SQL Server Database Mirroring essay

Source: Internet
Author: User

2. Establish database mirroring.

A ensure that the environment is stable: before backing up the primary database, you need to ensure that the primary database does not have a large number of read and write operations, so that the primary database is as stable as possible. If conditions permit, it is best to close all services that read and write to the database before mirroring is established. The following assumes that the name of the primary database is "brandwisdom_v9".

< Span style= "Font-size:14px;font-family:calibri, Sans-serif;color:rgb (31,73,125);" >        B full for the primary library, assuming the file name of the backup is " bw_v9_20130813.bak "in order to reduce the time to copy backup files, you can set the backup compression to" Compress the backup.

C transaction log backup: A database backup with a backup type of transaction log is established for the primary library, and the file name of the backup must be selected as the same file that was used in the previous step full backup , " Bw_v9_20130813.bak ".

D Copy the backup file: Copy the backup file to the hard disk on which the mirror will be created.

E To Restore the image: Create a database in the backup database with exactly the same name as the primary library " brandwisdom_v9 , select the database to restore. Select Restore from "Source device" and select Copy backup file "bw_v9_20130813.bak", select the database and transaction log to restore in "Select backup set for Restore" and tick. In the Restore option , select Overwrite existing database and do not perform any operations on the database without rolling back uncommitted transactions. OK to start the restore.

FConfigure the primary and standby security: After the restore image is complete, in the options for the properties of the main library, select mirroring to begin configuring security. If only2server to create a mirror, select Do not include the witness server instance. The principal server instance selects the main library, and the listener port remains the same (5022), the endpoint name can be filled in with a random, for example, "BWendpoint ". Select the mirror server instance as the host name for the mirrored database, and the listener port and endpoint names are exactly the same as the main library. The service account for the instance can be left blank, or it can be filled in as a two database in the first stepWindowsAccount "Bw_db_mirror_user"(but need to be followed in two databases,Bw_db_mirror_userThis account adds the access endpoint "BWendpoint "ofConnectpermissions). When you are sure that you are finished, confirm the listener port ( 5022) is open in both servers ' firewallsafter that, you can "start mirroring".

G Complete Mirroring setup: If "Start mirroring" succeeds in the previous step, you can refresh the status of the primary and standby database to see if it is in the "Recovering" or "synchronizing" state. If the master and standby synchronizations are completed in a while, the status should be synchronized and in recovery. In most cases, without a witness, you can modify the image's "Run Mode" to "high performance (asynchronous)" To improve the write performance of the main library.

H Failure Detection: If the "Start mirror" in the previous step is unsuccessful, follow the error message and reconfigure it carefully against the above steps. If you are prompted not to be able to access the mirror server or the mirrored database, you may have a firewall or hosts file problem, check that each port and hostname resolution is correct. If you are prompted for a problem with the database, check whether the two database is running with the same Windows account and password, if the database name is the same, whether the mirror database is restored with "do not perform any operations on the database, do not roll back uncommitted transactions" (if not, You need to remove the image to restore it again). If you are prompted with a problem with the mirroring endpoint, remove and reconfigure the endpoint on the master standby to configure the primary and standby security.


SQL Server Database Mirroring essay

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.