|
此文章由 huaxianz 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 huaxianz 所有!转贴必须注明作者、出处和本声明,并保持内容完整
If you have log shipping in place, and if the restore interval is longer enough during which you can notice and respond to a catastrophic action on the primary, then you can roll back your accidental deletion. HOWEVER, log shipping is not supposed to be used for this purpose. It's just a possible workaround.
All in all, nothing is better than having a good habit. E.g. always write where clause before anything else, or embed DML statement within a transaction and do not commit it before double checking the result, or even write out those affected rows into an auxiliary table before applying the changes to production. If too many rows are qualified by the serach condition and leads to lock escalation, then let it block. Blocking is not always a bad thing, it's acceptable if under a threshold. After all it's what a pessimistic concurrency model is supposed to be. Blocking is at least 100 times better than losing production data. |
|