您好,登錄后才能下訂單哦!
authorization sa
state=started
as tcp(listener_port=5022,listener_ip=all)
for database_mirroring(role=all,authentication=windows, ENCRYPTION = REQUIRED ALGORITHM RC4)
go
GRANT CONNECT ON ENDPOINT:: [Hadr_endpoint] TO [數據庫服務啟動賬號,這里設置為service01]
gocreate endpoint [Hadr_endpoint]
authorization sa
state=started
as tcp(listener_port=5022,listener_ip=all)
for database_mirroring(role=all,authentication=windows, ENCRYPTION = REQUIRED ALGORITHM RC4)
go
GRANT CONNECT ON ENDPOINT:: [Hadr_endpoint] TO [service01]
go
GO
BACKUP DATABASE [test] TO DISK = N'D:\dbbackup\test_full.bak' WITH COMPRESSION, NOFORMAT, NOINIT
GO
02:還原數據庫備份
go
restore database [test] from disk=N'D:\dbbackup\test_full.bak'
with
move 'test' to 'e:\SQL_Data\test.mdf'
,move 'test_log' to 'e:\SQL_Data\test_log.ldf'
,norecovery,replace,stats=5
go
01:主節點數據庫日志備份
BACKUP log [test] TO
DISK = N'D:\dbbackup\test_log.bak' WITH COMPRESSION, NOFORMAT, NOINIT
with norecovery,stats=5
go
01:主節點創建AG
WITH (AUTOMATED_BACKUP_PREFERENCE = SECONDARY)
FOR DATABASE [test]
REPLICA ON
N'test01' WITH (
ENDPOINT_URL = N'TCP://test01.pousheng.com:5022'
,FAILOVER_MODE = MANUAL
,AVAILABILITY_MODE = SYNCHRONOUS_COMMIT
,BACKUP_PRIORITY = 50
,SECONDARY_ROLE(ALLOW_CONNECTIONS = ALL))
,N'test02' WITH (
ENDPOINT_URL = N'TCP://test02.pousheng.com:5022'
,FAILOVER_MODE = MANUAL
,AVAILABILITY_MODE = SYNCHRONOUS_COMMIT
,BACKUP_PRIORITY = 50
,SECONDARY_ROLE(ALLOW_CONNECTIONS = ALL));
ALTER AVAILABILITY GROUP [test_AlwaysOn]
ADD REPLICA ON 'test01'
WITH (
ENDPOINT_URL = 'TCP://test01.pousheng.com:5022',
AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
FAILOVER_MODE = MANUAL,
BACKUP_PRIORITY = 50,
SECONDARY_ROLE(ALLOW_CONNECTIONS = ALL)
);免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。