Google it ....

Showing posts with label instance. Show all posts
Showing posts with label instance. Show all posts

Monday, November 25, 2013

How To Change Instance name in Oracle

Hello,
Here I show you how to change instance name in oracle database, let's check instance name:
SQL> show parameter instance_name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
instance_name                        string      orcl

In Linux:
We want to change instance name which is orcl to test.
if we are using spfile we need to do
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DISKS/orcl/spfileorcl.ora

SQL> alter system set instance_name=test scope=spfile;
System altered.
SQL> shutdown immediate;
........
SQL> startup;
........
SQL> show parameter instance_name
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
instance_name                        string      TEST

If we are using pfile, then change instance_name parameter in that and restart database, if there is not instane_name parameter then add.
Note: It's strongly recommended that using spfile
In Windows:
We need to create service with ORADIM
set ORACLE_SID=TEST
c:\app\oracle\product\11.2.0\db_1\bin\oradim -new -sid TEST -SRVC OracleServiceTEST 
-STARTMODE auto -SRVCSTART system -PFILE
c:\app\oracle\product\11.2.0\db_1\database\INITTEST.ORA

after that delete old instance
c:\app\oracle\product\11.2.0\db_1\bin\oradim -DELETE -SID orcl

Until you did not delete your old instance you always got error so first delete your old instance and then check your instance name.
good by :)