cancel
Showing results for 
Search instead for 
Did you mean: 

Alter subscription

Former Member
3,224

Attempting to do a Alter Subscription statement to change the IP address. I get an error stating it can't recognize the subscription name Any suggestions? Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

regdomaratzki
Product and Topic Expert
Product and Topic Expert

In order to change the MobiLink address for this remote database, you will need to execute the following command :

ALTER SYNCHRONIZATION SUBSCRIPTION TO kokolink FOR "77"
  TYPE HTTPS
  ADDRESS 'host=[newIPAddress];
           port=443;
           trusted_certificates=[fullPath]\\mobilink_public_cert.cer';

Replace [newIPAddress] with the new ip address of the ML Server, and replace [fullPath] with the full path to your public certificate.

You will need to execute a different ALTER SYNCHRONIZATION SUBSCRIPTION command on each remote database, since you've defined a different synchronization user at each location.

Former Member
0 Kudos

Hello I made the change I now get syntax error near 77 on line 1 Also you are saying I will need to create 2000 separate packages to push out this change to each lap top ouch!

ALTER SYNCHRONIZATION SUBSCRIPTION TO kokolink FOR 77 TYPE HTTPS ADDRESS 'host=host=hg.nspirehealth.com; port=443; trusted_certificates=c:program fileskokolinkpdsApp3mobilink_public_cert.cer';

VolkerBarth
Contributor

AFAIK, userids starting with digits have to be put in double quotes, so try

... TO "77" ...

[Source: Identifies definition]

Former Member

That did it! I had done this before I started the blog and forgot the "77" thanks for your help.

regdomaratzki
Product and Topic Expert
Product and Topic Expert

Sorry, forgot numeric identifiers needed double quotes. Thanks Volker.

You could probably send a single package that creates, then executes and then drops a stored procedure that looks something like (syntax not checked, but you should get the general idea ) :

create procedure ChangeIP () 
begin
  declare @mluser varchar(128);
  declare @newaddr long varchar;
  declare @sql long varchar;
  select site_name into @mluser,
         REPLACE( server_connect,
                  '216.183.117.242', 
                  'new.tcp.ip.addr' ) into @newaddr
    from SYS.SYSSYNC 
   where site_name is not null 
     and publication_id = ( select publication_id 
                              from SYS.SYSPUBLICATION 
                             where publication_name = 'kokolink' );
  set @sql = 'ALTER SYNCHRONIZATION SUBSCRIPTION TO kokolink ';
  set @sql = @sql || 'FOR "' || @mluser || '" ';
  set @sql = @sql || 'TYPE HTTPS ';
  set @sql = @sql || 'ADDRESS ''' || @newaddr || '''';
  message 'EXECUTING : ' || @sql;
  execute immediate @sql;
end;

call ChangeIP();
drop procedure ChangeIP;

The general idea being that you dynamically figure out the name of the synchronization user that is subscribed to the publication in question, and also get the current address being used, replacing the old IP address with the new IP address.

Former Member
0 Kudos

Executing this procedure manually on the clients works, however when i send this using a passthrough script it generates the following error Passthrough script 'test3 failed with SQL code -767. Cannot find synchronization subscription with the name 'imobpub' Any idea why this only works manually?