Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

To change the database name after database creation

$
0
0
Method 1:

1) Using NID utility

a) alter database close;
b) nid target=sys as sysdba dbname=CLONE(this will change the control files and headers of the datafiles with the correction of new name)

c)cd $ORACLE_HOME/dbs

d) cp initprod.ora initclone.ora

e)vi initclone.ora

find db_name parameter and change it to clone
f)vi /etc/oratab
change the name prod to clone

g) . oraenv
set the variable ORACLE_SID=clone

f) startup the database
SQL> startup (but the database open will error out since the datbase should open with resetlogs)

h) alter database open resetlogs;


Method 2:

By changing the control file

a)alter database backup control file to trace;

b)go to trace directory and edit the control file trace

c)In control file trace update database name prod to clone

d)shut down the database

e)remove the control file

f)vi init file and change the dbname prod to clone

g)startup nomount

h)execute the control file trace which we modified earlier(this will create a new control file in the location with the  new dbname )

i) alter database open resetlogs;

Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>