Wednesday, 17 August 2011

NID(change the Database name using NID utility)

To change the Database name using NID utility

1)Make a whole database backup.
2)Login as a sys user..
sql>conn sys as sysdba
3)Check your database name
sql>SELECT nameFROM v$database;
NAME
———
ORCL
4)Make a proper shutdown of the database
here you can user immediate or transactional or normal
sql>SHUTDOWN IMMEDIATE
5) Invoke the newid utility
C:\mohd.dba>nid TARGET=system/manager@orcl DBNAME=newdb SETNAME=Y
DBNEWID: Release 10.2.0.1.0 – Production on Sat Jan 31 12:45:03 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database ORCL (DBID=1203749959)
Connected to server version 10.2.0
Control Files in database:
G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL
G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL02.CTL
G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL03.CTL
Changing database name from ORCL to NEWDB
Control File G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL – modified
Control File G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL02.CTL – modified
Control File G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL03.CTL – modified
Datafile G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF – wrote new name
Datafile G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF – wrote new name
Datafile G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF – wrote new name
Datafile G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF – wrote new name
Datafile G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF – wrote new name
Datafile G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEMP01.DBF – wrote new name
Control File G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL – wrote new name
Control File G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL02.CTL – wrote new name
Control File G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL03.CTL – wrote new name
Instance shut down
Database name changed to NEWDB.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID – Completed succesfully.
6)Edit the pfile to change the db_name:
change the db_name parameter in the pfile to the new database name
db_name=newdb
7)Create a new password file using the ORAPWD utility
C:\mohd.dba>orapwd file=orapw001 password=confidential entries=10
8)Start the database using pfile:
sql>conn sys as sysdba
sql>startup pfile =G:\oracle\product\10.2.0\admin\orcl\pfile\init.ora.0122009171812
9)Recreate the spfile from the pfile
sql> create spfile from pfile=’G:\oracle\product\10.2.0\admin\orcl\pfile\init.ora.0122009171812′;
10) start the database using spfile:
SQL> startup force;
ORACLE instance started.
Total System Global Area 289406976 bytes
Fixed Size 1248600 bytes
Variable Size 92275368 bytes
Database Buffers 192937984 bytes
Redo Buffers 2945024 bytes
Database mounted.
Database opened.

No comments:

Post a Comment