dbTalk Databases Forums  

Renaming a sybase instance

comp.databases.sybase comp.databases.sybase


Discuss Renaming a sybase instance in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
harki.rehal (AT) gmail (DOT) com
 
Posts: n/a

Default Renaming a sybase instance - 05-25-2006 , 03:49 PM







Hi,
I have several production servers where I have to rename the
sybase instance(long story). Some on windows and some on unix.

What would be the cleanest way to rename the servers?

I'm thinking that I could bcp out the syslogins, sysloginroles,
syssrvroles, sysusages, sysdevices, syssegments.

For windows then I could use sybatch with a resource file to rename the
server and then bcp data back in.

For unix i could use srvbuildres and then bcp in the data.

I haven't done anything like this before so any advise is welcome.

Thanks,
H


Reply With Quote
  #2  
Old   
Mark A. Parsons
 
Posts: n/a

Default Re: Renaming a sybase instance - 05-25-2006 , 04:09 PM






If you're referring to changing the dataserver names, it's a bit easier
than what you've proposed.

For sake of discussion we'll we want to rename OLD_DS (current dataserver
name) to NEW_DS (new dataserver name).

0 - shutdown dataserver

1 - edit the RUNserver file to change all instances of OLD_DS to NEW_DS,
this includes the references to the name of the dataserver, the name of the
RUNserver file, the name of the errorlog and the name of the config file;
alternatively, copy the old RUNserver file and edit it (ie, keep the old
copy around, just in case)

2 - edit the interfaces/sql.ini file by changing OLD_DS to NEW_DS;
alternatively, create a new entry called NEW_DS and leave OLD_DS in place,
again, just in case you want to go back

3 - rename the dataserver's config file from OLD_DS.cfg to NEW_DS.cfg;
alternatively keep a copy of OLD_DS.cfg, just in case you want to go back

4 - startup NEW_DS; check errorlog for any issues

5 - log into NEW_DS and rename the local server name; 'sp_dropserver
local', 'sp_addserver NEW_DS,local'; bounce NEW_DS and now @@servername
should equal NEW_DS

If you happen to have MDA tables installed and have the 'loopback' server
defined to point at OLD_DS ... you'll want to drop and recreate the
'loopback' definition to point at NEW_DS.

I think that covers all (?) of the required bases ... a few other items to
consider ...

---------------

If you happen to have your database devices defined with OLD_DS in the name
(directory or file name), it's up to you if you want to change these
references.

This will require a) possibly changing the master device reference in the
RUNserver file and b) updating master..sysdevices to refer to the new
device names.

This step is a little trickier ... doable, but requires some knowledge on
how to properly update system tables; probably best to change device names
in master..sysdevices, shutdown dataserver, rename devices, bring up
dataserver.

---------------

As for other server types (backupserver, monserver, histserver, xpserver,
etc.), if they have OLD_DS in their names ... shutdown said server(s),
modify the RUNserver files and interfaces entries, and start back up.

monserver - make sure RUNserver file references the NEW_DS dataserver (and
not the OLD_DS dataserver)

backupserver - will have to log into NEW_DS, 'sp_dropserver SYB_BACKUP',
'sp_addserver SYB_BACKUP,null,<new_backupservername>'

---------------

If OLD_DS (now NEW_DS) is part of a replication system you have a couple
options ... drop and recreate the various connections for databases that
reside in NEW_DS ... or do some research on what config files and RSSD
tables need to be patched (ie, change references to OLD_DS to now reference
NEW_DS).

---------------

If you have any proxies references in other databases (that reference
OLD_DS), you'll have to either a) drop/recreate said proxies, or b) update
the appropriate system tables.

Same goes for external logins that currently point at OLD_DS ... need to
change them (drop/recreate?) to point at NEW_DS.

---------------

Last (?) but not least, if you have OLD_DS hardcoded in any database
objects (view names, stored procs, etc.), you need to manually change
these, too ... most likely via drop/recreate.

NOTE: Name changes aren't important ... what will be important is any
reference to OLD_DS that actually affects connectivity (eg, remote
procedure calls, etc.).

---------------

Obviously (?) try this process on a development dataserver first; make sure
you (I?) didn't forget anything.

harki.rehal (AT) gmail (DOT) com wrote:

Quote:
Hi,
I have several production servers where I have to rename the
sybase instance(long story). Some on windows and some on unix.

What would be the cleanest way to rename the servers?

I'm thinking that I could bcp out the syslogins, sysloginroles,
syssrvroles, sysusages, sysdevices, syssegments.

For windows then I could use sybatch with a resource file to rename the
server and then bcp data back in.

For unix i could use srvbuildres and then bcp in the data.

I haven't done anything like this before so any advise is welcome.

Thanks,
H


Reply With Quote
  #3  
Old   
Mark A. Parsons
 
Posts: n/a

Default Re: Renaming a sybase instance - 05-25-2006 , 04:47 PM



Corrected a boo-boo with regards to redefining @@servername ...

Mark A. Parsons wrote:

Quote:
If you're referring to changing the dataserver names, it's a bit easier
than what you've proposed.

For sake of discussion we'll assume we want to rename OLD_DS (current
dataserver name) to NEW_DS (new dataserver name).

0 - shutdown OLD_DS

1 - edit the RUNserver file to change all instances of OLD_DS to NEW_DS,
this includes the references to the name of the dataserver, the name of
the RUNserver file, the name of the errorlog and the name of the config
file; alternatively, copy the old RUNserver file and edit it (ie, keep
the old copy around, just in case)

2 - edit the interfaces/sql.ini file by changing OLD_DS to NEW_DS;
alternatively, create a new entry called NEW_DS and leave OLD_DS in
place, again, just in case you want to go back

3 - rename the dataserver's config file from OLD_DS.cfg to NEW_DS.cfg;
alternatively keep a copy of OLD_DS.cfg, just in case you want to go back

4 - startup NEW_DS; check errorlog for any issues

5 - log into NEW_DS and rename the local server name; 'sp_dropserver
OLD_DS', 'sp_addserver NEW_DS,local'; bounce NEW_DS and now @@servername
should equal NEW_DS

If you happen to have MDA tables installed and have the 'loopback'
server defined to point at OLD_DS ... you'll want to drop and recreate
the 'loopback' definition to point at NEW_DS.

I think that covers all (?) of the required bases ... a few other items
to consider ...

---------------

If you happen to have your database devices defined with OLD_DS in the
name (directory or file name), it's up to you if you want to change
these references.

This will require a) possibly changing the master device reference in
the RUNserver file and b) updating master..sysdevices to refer to the
new device names.

This step is a little trickier ... doable, but requires some knowledge
on how to properly update system tables; probably best to change device
names in master..sysdevices, shutdown dataserver, rename devices, bring
up dataserver.

---------------

As for other server types (backupserver, monserver, histserver,
xpserver, etc.), if they have OLD_DS in their names ... shutdown said
server(s), modify the RUNserver files and interfaces entries, and start
back up.

monserver - make sure RUNserver file references the NEW_DS dataserver
(and not the OLD_DS dataserver)

backupserver - will have to log into NEW_DS, 'sp_dropserver SYB_BACKUP',
'sp_addserver SYB_BACKUP,null,<new_backupservername>'

---------------

If OLD_DS (now NEW_DS) is part of a replication system you have a couple
options ... drop and recreate the various connections for databases that
reside in NEW_DS ... or do some research on what config files and RSSD
tables need to be patched (ie, change references to OLD_DS to now
reference NEW_DS).

---------------

If you have any proxies references in other databases (that reference
OLD_DS), you'll have to either a) drop/recreate said proxies, or b)
update the appropriate system tables.

Same goes for external logins that currently point at OLD_DS ... need to
change them (drop/recreate?) to point at NEW_DS.

---------------

Last (?) but not least, if you have OLD_DS hardcoded in any database
objects (view names, stored procs, etc.), you need to manually change
these, too ... most likely via drop/recreate.

NOTE: Name changes aren't important ... what will be important is any
reference to OLD_DS that actually affects connectivity (eg, remote
procedure calls, etc.).

---------------

Obviously (?) try this process on a development dataserver first; make
sure you (I?) didn't forget anything.

harki.rehal (AT) gmail (DOT) com wrote:

Hi,
I have several production servers where I have to rename the
sybase instance(long story). Some on windows and some on unix.

What would be the cleanest way to rename the servers?

I'm thinking that I could bcp out the syslogins, sysloginroles,
syssrvroles, sysusages, sysdevices, syssegments.

For windows then I could use sybatch with a resource file to rename the
server and then bcp data back in.

For unix i could use srvbuildres and then bcp in the data.

I haven't done anything like this before so any advise is welcome.

Thanks,
H


Reply With Quote
  #4  
Old   
harki.rehal (AT) gmail (DOT) com
 
Posts: n/a

Default Re: Renaming a sybase instance - 05-26-2006 , 09:00 PM



Mark,
Every thing you said makes sense. But on windows how would
the registry entries get cleaned out?

Thanks,
Harki


Reply With Quote
  #5  
Old   
Mark A. Parsons
 
Posts: n/a

Default Re: Renaming a sybase instance - 05-26-2006 , 09:57 PM



Ahhhh, you're running in a Windoze environment, eh ...

Best bet would be to pull up regedit and do a search for OLD_DS ... and
replace all occurrences with NEW_DS.

At that point you will probably have to log out (or reboot the machine) so
that the registry entries 'take'.

Otherwise the rest should be the same ... sql.ini change,
sp_dropserver/sp_addserver to change @@servername, etc.

You definitely do *NOT* have to do any bcp out/in of any tables.

harki.rehal (AT) gmail (DOT) com wrote:
Quote:
Mark,
Every thing you said makes sense. But on windows how would
the registry entries get cleaned out?

Thanks,
Harki


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.