Создаём пользователей и папку для репликации
set password=MyP@$$w0rd
set sg=sql_repl_users
set rs=repl_snapshot
set rl=repl_logreader
set rd=repl_distribution
set rm=repl_merge
net user %rs% %password% /add /active:yes /comment:"User for MS SQL snapshot replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net user %rl% %password% /add /active:yes /comment:"User for MS SQL logreader replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net user %rd% %password% /add /active:yes /comment:"User for MS SQL distribution replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net user %rm% %password% /add /active:yes /comment:"User for MS SQL merge replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net localgroup %sg% /add
net localgroup %sg% %rs% /add
net localgroup %sg% %rl% /add
net localgroup %sg% %rd% /add
net localgroup %sg% %rm% /add
set shareName=repldata
set repl_sql_folder="%programfiles%\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Data\%shareName%"
mkdir %repl_sql_folder%
net share %shareName%=%repl_sql_folder% /grant:%rd%,READ /grant:%rm%,READ /grant:%rs%,FULL
icacls %repl_sql_folder% /grant %rd%:(OI)(CI)(R) /grant %rm%:(OI)(CI)(R) /grant %rs%:(OI)(CI)(F)
Пользователи создались далее по картинкам
set password=MyP@$$w0rd
set sg=sql_repl_users
set rs=repl_snapshot
set rl=repl_logreader
set rd=repl_distribution
set rm=repl_merge
net user %rs% %password% /add /active:yes /comment:"User for MS SQL snapshot replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net user %rl% %password% /add /active:yes /comment:"User for MS SQL logreader replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net user %rd% %password% /add /active:yes /comment:"User for MS SQL distribution replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net user %rm% %password% /add /active:yes /comment:"User for MS SQL merge replication" /EXPIRES:NEVER /PASSWORDCHG:NO
net localgroup %sg% /add
net localgroup %sg% %rs% /add
net localgroup %sg% %rl% /add
net localgroup %sg% %rd% /add
net localgroup %sg% %rm% /add
set shareName=repldata
set repl_sql_folder="%programfiles%\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Data\%shareName%"
mkdir %repl_sql_folder%
net share %shareName%=%repl_sql_folder% /grant:%rd%,READ /grant:%rm%,READ /grant:%rs%,FULL
icacls %repl_sql_folder% /grant %rd%:(OI)(CI)(R) /grant %rm%:(OI)(CI)(R) /grant %rs%:(OI)(CI)(F)
Пользователи создались далее по картинкам
Комментариев нет:
Отправить комментарий