Backup and recovery of SQLServer database

xiaoxiao2021-03-06  40

SQLServer database backup and recovery measures 2004: 8: 19 · Source: Motto CiCi 1, Backup Database 1, Open SQL Enterprise Manager, in the root directory of the console, click Microsoft SQL Server2, SQL Server Group -> Double click Open your server -> Double-click Open Database Document 3, select your database name (such as the forum database forum) -> then click Tools in the Menu -> Select Backup Database 4, and Back Up Options Select full backup, destination Backup to if the original path and name are selected, then add some addition, if there is no path and name, select Add, then specify the path and file name, the specified point determination returns the backup window, then determine the backup Second, restore the database 1, open the SQL Enterprise Manager, click on the Microsoft SQL Server2, SQL Server Group in the root directory, SQL Server Group -> Double click New Database icon for opening your server-> point icon, new database Names yourself 3, click on the newly entered database name (such as the forum database forum) -> then click Tools in the Menu -> Select Restore Database 4, select from the Dependent option in the pop-up window - > Click to select the device -> Add -> and select your backup file name -> Add the point OK to return, at this time, the device bar should appear the name of the database backup file you just selected, the backup number is 1 (if You have made multiple backups for the same file, you can click on the view next to the backup number, select the latest backup after the check box) -> Then click on the option button next to the normal side of the normal, in the appearance Select in the Window to force restore on the existing database, and select options that allow the database to continue running but cannot restore other transaction logs in the recovery completion state.

Restoring the database file for the intermediate part of the window To set up the installation of your SQL installation (you can also specify your own directory), the logical file name does not need to be changed, move to the physical file name to do according to your recovery machine situation Change, such as your SQL database in D: / Program Files / Microsoft SQL Server / MSSQL / DATA, then follow the directory of your recovery machine to change, and the last file name is best to change your current database name (If it is bbs_data.mdf, now the database is forum, change to forum_data.mdf), log and data files must be related to the related changes in this way (the file name of the log is * _log.ldf), Here you can freely set, provided that this directory must exist (if you can specify D: /SQLDATA/BBS_DATA.MDF or D: /SQLDATA/BBS_LOG.LDF), otherwise recovery will report an error 6, after the modification is complete, click The following determination is restored, then a progress bar, prompting the progress of recovery, the system will automatically prompt after the recovery is completed, such as the intermediate prompt error, please record the relevant error content and ask the person familiar with SQL operation, General errors are nothing more than directory error or file name duplicate or file name error or space is not enough or the database is in use, and the database is using an error. You can try to close all the SQL windows and reopen the recovery operation, if you still prompt you Using an error can stop the SQL service and then restarted, as for other errors, it can be restored after the error content is changed accordingly. In general, the contraction of the SQL database is not largely contracted. Reduce the size of the database, the main role is to shrink the log size, should periodically do this to prevent the database log excessively 1, set the database mode as simple mode: Open SQL Enterprise Manager, in the control station root directory, click Microsoft SQL Server -> SQL Server Group -> Double click on your server -> Double click to open the Database directory -> Select your database name (such as the forum database forum) -> then click Right click Select Properties -> Select Options - > Select "Simple" in the mode of failure, then press OK 2, right-click on the current database, see the contraction database in all tasks, the default settings in all tasks are not adjusted, direct point determination 3, the shrink database is completed It is recommended to reset your database properties to standard mode, and the operation method is the first point, because the log is often an important basis for recovering the database in some abnormalities, setting a daily automatic backup database strongly recommended that conditional users This operation! 1. Open Enterprise Manager, click on the Microsoft SQL Server -> SQL Server Group -> Double click on your server 2 in the root directory of the Control Station -> Select the Database Maintenance Planner above the menu 3, Next Select data to be automatically backed up -> Next update data optimization information, here usually do not do the choice -> Next check data integrity, it is generally not selected 4, the next specified database maintenance plan, default One week backup once, click Change Select Once After you back up, you can determine 5. Next Specify the backup disk directory, select the specified directory, such as you can create a directory in D: DATABAK, then choose to use here This directory, if your database is better to choose to build a subdirectory for each database, then select Remove the backup of the pre-presumere, generally set 4-7 days, see your specific backup requirements,

转载请注明原文地址:https://www.9cbs.com/read-62043.html

New Post(0)