1. Anar Godjaev
Change DB name.
Step by Step:
SQL> startup mount
ORACLE instance started.
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted.
SQL>
595591168
1220748
209719156
377487360
7163904
bytes
bytes
bytes
bytes
bytes
[oracle@anar ~]$nid
DBNEWID: Release 10.2.0.1.0 - Production on Thu Jul 21 11:52:54 2011
Copyright (c) 1982, 2005, Oracle.
All rights reserved.
Keyword
Description
(Default)
---------------------------------------------------TARGET
Username/Password
(NONE)
DBNAME
New database name
(NONE)
LOGFILE
Output Log
(NONE)
REVERT
Revert failed change
NO
SETNAME
Set a new database name only
NO
APPEND
Append to output log
NO
HELP
Displays these messages
NO
[oracle@anar ~]$ nid target=sys/oracle@anar_f as sysdbadbname=anar_f1
DBNEWID: Release 10.2.0.1.0 - Production on Thu Jul 21 12:19:19 2011
Copyright (c) 1982, 2005, Oracle.
All rights reserved.
Password:
Connected to database ANAR_F (DBID=604182317)
Connected to server version 10.2.0
Control Files in database:
/u01/app/oracle/anar_f/controlfile/control01.ctl
2. Anar Godjaev
/u01/app/oracle/anar_f/controlfile/control02.ctl
/u01/app/oracle/anar_f/controlfile/control03.ctl
Change database ID and database name ANAR_F to ANAR_F1? (Y/[N]) => y
Proceeding with operation
Changing database ID from 604182317 to 3902868108
Changing database name from ANAR_F to ANAR_F1
Control File /u01/app/oracle/anar_f/controlfile/control01.ctl modified
Control File /u01/app/oracle/anar_f/controlfile/control02.ctl modified
Control File /u01/app/oracle/anar_f/controlfile/control03.ctl modified
Datafile /u01/app/oracle/anar_f/system100.dbf - dbid changed, wrote
new name
Datafile /u01/app/oracle/anar_f/myundo.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/sysaux100.dbf - dbid changed, wrote
new name
Datafile /u01/app/oracle/anar_f/tsanar01.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/tsanar02.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/users01.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/users02.dbf - dbid changed, wrote new
name
Datafile /u01/ivants.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/pri_rman.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/rman_moni.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/anar_f/temp01.dbf - dbid changed, wrote new
name
Control File /u01/app/oracle/anar_f/controlfile/control01.ctl - dbid
changed, wrote new name
Control File /u01/app/oracle/anar_f/controlfile/control02.ctl - dbid
changed, wrote new name
Control File /u01/app/oracle/anar_f/controlfile/control03.ctl - dbid
changed, wrote new name
Instance shut down
Database name changed to ANAR_F1.
Modify parameter file and generate a new password file before restarting.
Database ID for database ANAR_F1 changed to 3902868108.
All previous backups and archived redo logs for this database are
3. Anar Godjaev
unusable.
Database is not aware of previous backups and archived logs in Recovery
Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
Now we need to change our parameter file:
[oracle@anar ~]$ cd $ORACLE_HOME/dbs
[oracle@anardbs]$ mv initanar_f.ora initanar_f1.ora
[oracle@anardbs]$ vi initanar_f1.ora
Alter the parameter DB_NAME=<newdbname>
[oracle@anardbs]$ export ORACLE_SID=anar_f1
[oracle@anardbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 21 12:24:15 2011
Copyright (c) 1982, 2005, Oracle.
All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 595591168 bytes
Fixed Size
1220748 bytes
Variable Size
163581812 bytes
Database Buffers
423624704 bytes
Redo Buffers
7163904 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> create spfile from pfile;
File created.
Just to check if is everything ok in the initialization: