Rename Database 11gR2


RENAME DATABASE 11gR2

Shutdown the database
Start in Mount and see all the steps

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup mount
ORACLE instance started.

Total System Global Area 1.2831E+10 bytes
Fixed Size 2170304 bytes
Variable Size 2248147520 bytes
Database Buffers 1.0536E+10 bytes
Redo Buffers 44793856 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@can0sudb01a:mtandb01:/opt/oracle02/product/11.2.0/dbs]
[oracle@can0sudb01a:mtandb01:/opt/oracle02/product/11.2.0/dbs] nid TARGET=system/XXXXX DBNAME=MTANDONTEST1 SETNAME=Y

DBNEWID: Release 11.2.0.2.0 - Production on Thu Sep 29 13:27:29 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to database MTANDON01 (DBID=3591888462)

Connected to server version 11.2.0

Control Files in database:
/d1/oradata/mtandb01/control01.ctl
/d1/oradata/mtandb01/control02.ctl
/d1/oradata/mtandb01/control03.ctl

Change database name of database MTANDON01 to MTANDONTEST1? (Y/[N]) => Y

Proceeding with operation
Changing database name from MTANDON01 to MTANDONTEST1
Control File /d1/oradata/mtandb01/control01.ctl - modified
Control File /d1/oradata/mtandb01/control02.ctl - modified
Control File /d1/oradata/mtandb01/control03.ctl - modified
Datafile /d1/oradata/mtandb01/system01.db - wrote new name
Datafile /d1/oradata/mtandb01/undotbs1.db - wrote new name
Datafile /d1/oradata/mtandb01/sysaux01.db - wrote new name
Control File /d1/oradata/mtandb01/control01.ctl - wrote new name
Control File /d1/oradata/mtandb01/control02.ctl - wrote new name
Control File /d1/oradata/mtandb01/control03.ctl - wrote new name
Instance shut down

Database name changed to MTANDONTEST1.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.


[oracle@can0sudb01a:mtandb01:/opt/oracle02/product/11.2.0/dbs] vi initmtandb01.ora
"initmtandb01.ora" 49 lines, 2038 characters
'
*.db_name='MTANDONTEST1'

[oracle@can0sudb01a:mtandb01:/opt/oracle02/product/11.2.0/dbs] ls -lrt

-rw-r--r-- 1 oracle oinstall 2038 Sep 29 13:29 initmtandb01.ora

[oracle@can0sudb01a:mtandb01:/opt/oracle02/product/11.2.0/dbs] sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.2.0 Production on Thu Sep 29 13:30:11 2011

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1.2831E+10 bytes
Fixed Size 2170304 bytes
Variable Size 2248147520 bytes
Database Buffers 1.0536E+10 bytes
Redo Buffers 44793856 bytes
Database mounted.
Database opened.
SQL>
SQL> SELECT name FROM v$database;

NAME
---------
MTANDONTEST1

SQL> SHOW parameter db_name

NAME TYPE
------------------------------------ --------------------------------
VALUE
------------------------------
db_name string
MTANDONTEST1

No comments:

Post a Comment