Configures and manages alternate replication paths between a primary database and Replication Server.
sp_replication_path "dbname", { 'add' "physical_path", "repserver_name", "rs_username", "rs_password" | 'add', 'logical', 'logical_path', "physical_path" | 'drop', "physical_path" | 'drop', 'logical', 'logical_path', [,"physical_path"] | 'bind', "object_type", "[table_owner].object_name", "path_name" | 'unbind', "object_type", "object_name", {"path_name" | all} | 'config', "path_name", "config_parameter", "config_value" | 'list', ['object_type'], ['object_name']
sp_replication_path "pdb", 'add', "pdb_1", "RS2", "RS2_user", "RS2_password"
sp_replication_path "pdb", 'add', "pdb_2", "RS1", "RS1_user", "RS1_password"
There are now three physical replication paths from pdb: pdb_1, pdb_2, and the existing default path replication path that you must create to either RS1 or RS2 before you create the alternate physical replication paths.
sp_replication_path 'pdb', 'add', 'logical', 'logical_1', 'pdb_1'
sp_replication_path 'pdb, 'add', 'logical', 'logical_1', 'pdb_2'
sp_replication_path pdb, 'drop', "RS1"
sp_replication_path 'pdb', 'drop', 'logical', 'logical_1', 'pdb_1'
sp_replication_path 'pdb', 'drop', 'logical', 'logical_1', 'pdb_2'
sp_replication_path 'pdb', 'drop', 'logical', 'logical_1'
sp_replication_path pdb, 'bind', "table", "t1", "pdb_2"
sp_replication_path pdb, 'bind', "table", "owner1.t2", "pdb_2"
sp_replication_path pdb, 'bind', "sproc", "sproc1", "pdb_2"
sp_replication_path pdb, 'bind', "table", "dt1", "everywhere"
sp_replication_path pdb, 'bind', 'table', 'a*', "pdb_2"
sp_replication_path pdb, 'bind', 'table', 'au%rs', "pdb_2"
sp_replication_path pdb, 'bind', 'table', 'a*th%s', "pdb_2"
sp_replication_path pdb, 'bind', 'table', 'authors%', "pdb_2"
sp_replication_path pdb, 'unbind', 'table', "t1", "pdb_2"
sp_replication_path pdb, 'unbind', 'table', "t1", "all"
sp_replication_path pdb, 'unbind', 'path', 'pdb_2', "all"
To change the:
sp_replication_path pdb, 'config', "pdb_1", "rs_username", “RS1_user”
sp_replication_path pdb, 'config', "pdb_1", "rs password", “january”
sp_replication_path 'pdb','list' go
Binding Type Path -------------------- -------- -------------------- dbo.dt1 T everywhere dbo.sproc1 P pdb_1 dbo.sproc1 P pdb_2 dbo.t1 T pdb_2 dbo.t2 T pdb_1 (5 rows affected) Logical Path Physical Path ---------------------------- --------------------- everywhere pdb_1 everywhere pdb_2 (2 rows affected) Physical Path Destination ------------------------------ ------------------- pdb_1 RS2 pdb_2 RS1 (2 rows affected) (return status = 0)
sp_replication_path 'pdb','list','table' go
Binding Type Path -------------------- -------- -------------------- dbo.dt1 T everywhere dbo.t1 T pdb_2 dbo.t2 T pdb_1 (3 rows affected) (return status = 0)
sp_replication_path 'pdb','list','sproc' go
Binding Type Path -------------------- -------- -------------------- dbo.sproc1 P pdb_2 dbo.sproc1 P pdb_1 dbo.sproc2 P pdb_1 (3 rows affected) (return status = 0)
sp_replication_path 'pdb','list','sproc','sproc1' go
Binding Type Path -------------------- -------- -------------------- dbo.sproc1 P pdb_2 dbo.sproc1 P pdb_1 (2 rows affected) (return status = 0)
sp_replication_path 'pdb','list','path' go
Path Type Binding -------------------- -------- ---------------------- everywhere T dbo.dt1 pdb_1 P dbo.sproc1 pdb_1 T dbo.t2 pdb_2 P dbo.sproc1 pdb_2 T dbo.t1 (5 rows affected) Logical Path Physical Path ----------------------------- ------------------------ everywhere pdb_1 everywhere pdb_2 (2 rows affected) Physical Path Destination ----------------------------- ---------------------- pdb_1 RS2 pdb_2 RS1 (2 rows affected) (return status = 0)
sp_replication_path 'pdb','list','path','pdb_1' go
Path Type Binding -------------------- -------- -------------------- pdb_1 P dbo.sproc1 pdb_1 T dbo.t2 (2 rows affected) Physical Path Destination ------------------------------ ------------------- pdb_1 RS2 (1 rows affected) (return status = 0)
sp_replication_path 'pdb','list','path','logical_1' go
Path Type Binding -------------------- -------- ------------------------- logical_1 T dbo.dt1 (1 rows affected) Logical Path Physical Path ----------------------------- -------------------------- logical_1 pdb_1 logical_1 pdb_2 (2 rows affected) Physical Path Destination ----------------------------- ------------------------- pdb_1 RS2 pdb_2 RS1 (2 rows affected) (return status = 0)
Any object that you bind to a path always follows the same path during replication.