SQL скриптове

1. Mirroring

Forse:

ALTER DATABASE test123 SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS

 

Set online:

USE [master]

GO

ALTER DATABASE test123 SET ONLINE

GO


2.  Transactional Replication

Persons

CREATE TABLE Persons
 (
 P_Id int NOT NULL PRIMARY KEY,
 LastName varchar(255) NOT NULL,
 FirstName varchar(255),
 Address varchar(255),
 City varchar(255)
 )

Delete DB Distribution

use master
go
alter database distribution set offline;
drop database distribution;

 

3. Log shipping

Set db online

GO

RESTORE DATABASE Log
WITH RECOVERY

GO