您好,登錄后才能下訂單哦!
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 [數(shù)據(jù)庫服務(wù)啟動賬號,這里設(shè)置為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:還原數(shù)據(jù)庫備份
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:主節(jié)點數(shù)據(jù)庫日志備份
BACKUP log [test] TO
DISK = N'D:\dbbackup\test_log.bak' WITH COMPRESSION, NOFORMAT, NOINIT
with norecovery,stats=5
go
01:主節(jié)點創(chuàng)建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)
);免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。