Steps:
1. backup database TestMirror on Pricipal server
2. backup database log of TestMirror on Pricipal server
3. copy db and log backup files to Mirror server
4. restore db with norecovery
5. restore log with norecovery
6. create endpoints on both Pricipal serverand Mirror server
Issue:
If you use SQL command or Mirror wizard to set mirror machine.
It will show error: "The remote copy of database" db1_test "has not been rolled forward to a point in time that is encompassed in the local copy of the database log ."
Or
1. ALTERDATABASETestBackup01SETPARTNER = 'tcp: // isrv04.xxx: 8080 ';
2. Tasks-> Mirror-> processing ing-> Config Security
Solutions:
RESTORE DATABASE @dbname FROM DISK = @backupfile WITH FILE = 1, NORECOVERY, NOUNLOAD;RESTORE LOG @dbname FROM DISK = @backupfile WITH FILE = 2, NORECOVERY, NOUNLOAD;
These did the trick for me. I generated the commands through the "Script"-menu within the "Restore Database"-dialog of the Management Studio, because enabling indexing ing was no problem when I restored through the "Restore Database"-dialog. my manually written SQL-commands were missing the "NOUNLOAD" part.