The database backup strategy plays an important role in maintaining the security of the system data, and the good backup strategy should consider the security of the data, and the operation is more convenient. The basic process is simple, as follows:
1. Backup to local hard drive:
Dump TRANSACTION WITH TRUNCATE_ONLY
Dump Database ... to ...
DUMP Transaction
。。。
2. When loading databases and transaction logs, the database must be set to dbo use only to prevent other users from manipulating the database.
The order in which they are loaded is:
Dump TRANSACTION with No_truncate
Load Database database_name from ...
Load transaction database_name from ...
。。。
Online database
You can also use until to specify a time to recover
Using Threshold management
You can use threshold management to schedule the transaction log to be automatically dumped when a threshold value is exceeded in the threshold management. When the threshold is exceeded, SQL serve interrupts or suspends the user transaction attempting to write this log. Sends a message to errorlog for each pending transaction; then executes the sp_thresholdaction
Sp_thresholdaction users to write their own
CREATE PROCEDURE Sp_thresholdaction
@dbname varchar (30),
@segmentname varchar (30),
As
Dump transaction @dbname to "DEVICE"
Print "LOG DUMP:%1! For%2! Dumped ", @segmentname, @dbname
Where parameters:
@dbname the name of the database to reach the threshold;
@segmentname is the name of the segment to reach the valve value;
Handling of corrupted user databases
If the database is in a suspect state and cannot be deleted with the drop database:
DBCC DBREPAIR (db_name, dropdb)
Create DATABASE db_name on Dev_name for load
Load Database db_name from Dump_device
Master Library corrupted Processing
Use Buildmaster-m to reconstruct a new master database;
Buildmaster builds master and builds master, model, and tempdb libraries on this device.
The-m option simply writes back to the master library without modifying the configuration block or initializing the master device.
Restart the server in Single-user mode and increase the dump device if necessary;
Load master database from backup;
Restart SQL Server with StartServer;
Check consistency: Run DBCC CHECKALLOC for each database and check for important tables;
However, when we asked whether Sybase's technical support recommended the use of threshold, they did not actively recommend it, citing the often unpredictable results of automated operations. Of course, if there is a responsible DBA, daily manual backup, of course, is the best.
The basic backup operation is simple, but when we actually implement the strategy, we tend to consider such problems, and there are some unexpected problems, such as:
1, is the whole library backup or incremental backup
2, every day when the backup, backup time how to arrange
3, in case of need to restore the database, the current backup can be restored to a degree
4. What are the possible emergencies when the database is restored?
Wait a minute...
You are welcome to discuss this topic to stimulate some good ideas and experience to enhance the security of the system data together!