-- Subject
Use master;
-- Drop master key;
-- Unified master key
Create master key encryption by Password = 'jiubang _ ZB_2008@3g.cn ';
Go
-- Unified logon Password
Create login mir_m_login with Password = 'jiubang _ JB_2008@3g.cn ';
Go
-- Unified logon Username
Create user mir_m_user for login mir_m_login;
Go
---------------------------
Use master;
Create certificate cert_001
With subject = 'cert _ 001 certificate for database processing ing ',
Start_date = '2014/1/123', expiry_date = '2014/1/123 ';
Go
-- Create an outbound endpoint
Create endpoint emp_001
State = started
As TCP (listener_port = 5025, listener_ip = All)
For database_grouping ing (
Authentication = certificate cert_001
, Encryption = required algorithm RC4
, Role = all
);
Go
-- Configure the endpoint
Grant connect on endpoint: emp_001 to [mir_m_login];
Go
-- Activate the endpoint
Alter endpoint emp_001 state = started
Go
-- Save the export certificate and copy it to the master server.
Backup certificate cert_001 to file = 'C: \ share \ cert_001.cer ';
Go
---------------------
Use master;
Create certificate cert_002
Authorization mir_m_user
From file = 'C: \ share \ cert_002.cer'
Go
Create certificate cert_003
Authorization mir_m_user
From file = 'C: \ share \ cert_003.cer'
Go
---------------------
Use master;
Alter database Test
Set partner = 'tcp: // 192.168.1.170: 8080'
Go
Alter database Test
Set witness = 'tcp: // 192.168.1.171: 8080'
Go
/*
Use master;
Alter database Test
Set partner off
Go
*/
-- Check whether the operation is successful
Select * From SYS. database_indexing ing where database_id = (
Select database_id from SYS. databases where name = 'test ')
Select * From expense
Update expense limit set amount = 444566
Select * From expense
Bytes ---------------------------------------------------------------------------------------------------------------------
-- Image
Use master;
-- Drop master key;
-- Unified master key
Create master key encryption by Password = 'jiubang _ ZB_2008@3g.cn ';
Go
-- Unified logon Password
Create login mir_m_login with Password = 'jiubang _ JB_2008@3g.cn ';
Go
-- Unified logon Username
Create user mir_m_user for login mir_m_login;
Go
----------------------------------
Use master;
Create certificate cert_002
With subject = 'cert _ 002 certificate for database processing ing ',
Start_date = '2014/1/123', expiry_date = '2014/1/123 ';
Go
Create endpoint emp_002
State = started
As TCP (listener_port = 5025, listener_ip = All)
For database_grouping ing (
Authentication = certificate cert_002
, Encryption = required algorithm RC4
, Role = all
);
Go
-- Configure the endpoint
Grant connect on endpoint: emp_002 to [mir_m_login];
Go
-- Activate the endpoint
Alter endpoint emp_002 state = started
Go
-- Save the export certificate and copy it to the master server.
Backup certificate cert_002 to file = 'C: \ share \ cert_002.cer ';
Go
----------------------
-- Associate a specified certificate with a specified user
Use master;
Create certificate cert_001
Authorization mir_m_user
From file = 'C: \ share \ cert_001.cer'
Go
Create certificate cert_003
Authorization mir_m_user
From file = 'C: \ share \ cert_003.cer'
Go
--------------------------
Use master;
Alter database Test
Set partner = 'tcp: // 192.168.1.169: 8080'
Go
/*
Use master;
Alter database Test
Set partner off
Go
*/
Create Database test_ss_new on (
Name = test,
Filename = 'C: \ test_ss_new.ss ') as snapshot of test;
-- Query the modified record
Select * From test_ss_new.dbo. Expense Calculation
Bytes ----------------------------------------------------------------------------------------------------------------
-- Witness
Use master;
-- Drop master key;
-- Unified master key
Create master key encryption by Password = 'jiubang _ ZB_2008@3g.cn ';
Go
-- Unified logon Password
Create login mir_m_login with Password = 'jiubang _ JB_2008@3g.cn ';
Go
-- Unified logon Username
Create user mir_m_user for login mir_m_login;
Go
-----------
Use master;
Create certificate cert_003
With subject = 'cert _ 003 certificate for database processing ing ',
Start_date = '2014/1/123', expiry_date = '2014/1/123 ';
Go
Create endpoint emp_003
State = started
As TCP (listener_port = 5025, listener_ip = All)
For database_grouping ing (
Authentication = certificate cert_003
, Encryption = required algorithm RC4
, Role = all
);
Go
-- Configure the endpoint
Grant connect on endpoint: emp_003 to [mir_m_login];
Go
-- Activate the endpoint
Alter endpoint emp_003 state = started
Go
-- Save the export certificate and copy it to the master server.
Backup certificate cert_003 to file = 'C: \ share \ cert_003.cer ';
Go
--------------------------
Use master;
Create certificate cert_001
Authorization mir_m_user
From file = 'C: \ share \ cert_001.cer'
Go
Create certificate cert_002
Authorization mir_m_user
From file = 'C: \ share \ cert_002.cer'
Go