Start the database with pfile
Take the backup of existing initialization Parameter file(pfile)
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 409194496 bytes
Fixed Size 2226992 bytes
Variable Size 268436688 bytes
Database Buffers 134217728 bytes
Redo Buffers 4313088 bytes
Database mounted.
SQL> sho parameter pfile;
NAME TYPE VALUE
———————————— ———– ——————————
spfile string
SQL> select dbid,name from v$database;
DBID NAME
———- ———
2076663514 TEST
SQL>!
[oracle@localhost ~]$ nid target=sys DBNAME=varun SETNAME=y
DBNEWID: Release 11.2.0.2.0 – Production on Thu Mar 22 17:56:48 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Password:
Connected to database TEST (DBID=2076663514)
Connected to server version 11.2.0
Control Files in database:
/varun/oraclehome/oraclebase/varun/control01.ctl
/varun/oraclehome/oraclebase/fast_recovery_area/varun/control02.ctl
Change database name of database TEST to VARUN? (Y/[N]) => Y
Proceeding with operation
Changing database name from TEST to VARUN
Control File /varun/oraclehome/oraclebase/varun/control01.ctl – modified
Control File /varun/oraclehome/oraclebase/fast_recovery_area/varun/control02.ctl – modified
Datafile /varun/oraclehome/oraclebase/varun/system01.db – wrote new name
Datafile /varun/oraclehome/oraclebase/varun/sysaux01.db – wrote new name
Datafile /varun/oraclehome/oraclebase/varun/undotbs01.db – wrote new name
Datafile /varun/oraclehome/oraclebase/varun/users01.db – wrote new name
Datafile /varun/oraclehome/oraclebase/varun/temp01.db – wrote new name
Control File /varun/oraclehome/oraclebase/varun/control01.ctl – wrote new name
Control File /varun/oraclehome/oraclebase/fast_recovery_area/varun/control02.ctl – wrote new name
Instance shut down
Database name changed to VARUN.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID – Completed succesfully.
- Set the
DB_NAME
initialization parameter in the initialization parameter file to the new database name
- Change the ORACLE_ SID which was set in environment variables
- change the old initialization parameter file to newly changed
SQL> startup
ORACLE instance started.
Total System Global Area 409194496 bytes
Fixed Size 2226992 bytes
Variable Size 281019600 bytes
Database Buffers 121634816 bytes
Redo Buffers 4313088 bytes
Database mounted.
Database opened.
SQL> select name,dbid from v$database;
NAME DBID
——— ———-
VARUN 2076663514