SQL Server Database Complete Migration

xiaoxiao2021-03-06  52

Method 1: 1, stop the source database, copy two physical files (MDF, log) to be copied to the destination. 2. Open the Enterprise Manager of the Destination SQL Server Database, attach the database file as a local database. But the library name is to be modified to different names, such as XXBak, etc. 3. Create a new space with the source database, establish the default value. 4. In "Safety" - "Login" newly created the actual login name, enter the access password, "Database Access", select the corresponding database, and hook "DB_OWNER" option. Because the login name of the library cannot be modified only after only additional databases, the login name corresponding to the name is often empty, making the table in the database cannot be accessed. 5. Export data from the additional backup database to the newly built empty database: After selecting the source data source and destination data source, the next step is selected "copying objects and data between SQL Server database", this is very important, do not choose the default "From the source database replication table and view", the data will not be copied.

_________________________________________________________________________________________________________________________________________________________________________________ 按 按, select All Tasks -> Backup Database. Backup Selection Database - Full, Destination - Backup to - Press Add Button File Name - Enter a custom backup database file name under the SQL Server server hard disk (suffix is ​​typically BAK) to rewrite - There is a media to finally press the OK button. If the generated backup database file is greater than 1m, use a compression tool to compress it to the Internet.

2, the destination SQL Server database If you haven't yet this database, create a new database first; then select this newly created database, right-click, select all tasks -> Restore Database Restore -> From Device -> Select Devices -> Disk -> Add (find backup database file name you want to import) -> Determine Restore Backup Set -> Database - Finally press the OK button. A complete database is successful. (If you have a restore database on the already existing SQL Server database, you may have some other people who are using it and restore the action to fail, you can go to see -> Management -> Current Activity -> Lock / Object -> Find the Database Locked The process number -> to the Query Analyzer to kill these locks with the Kill process number, then do the restore)

3, this recovered database data should be complete, but username access may not normal

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

New Post(0)