miercuri, 19 martie 2014

How to rename the database, instance and the XDB service

When needed, don't change only the name of the database or only the name of the instance.
I prefer to change all of the above three names, in order to have a naming rule consistency and for the sake of an easy administration.

Steps:

sql> shutdown immediate
sql> startup mount
sql> exit

$ nid target=sys dbname=somename setname=yes

Answer Y when prompted!


sql> shutdown immediate
sql> startup nomount
sql> alter system set db_name=somename scope=spfile;
sql> alter system set instance_name=somename scope=spfile;
sql> alter system set dispatchers='(protocol=tcp)(service=somenameXDB)' scope=both;
sql> shutdown immediate
sql> exit

Change the ORACLE_SID in your environment script and run it or change on the fly the value of ORACLE_SID with export ORACLE_SID=somename !

sql> startup
sql> exit

lsnrctl reload

Now you have all the important names in your database changed.


Niciun comentariu:

Trimiteți un comentariu