How to change the name of the database?

1) This topic will show you how change name and ID of the database.
    This feature is available from Oracle10g R2 and later versions of Oracle


Note: Changing the DBID of a database is a serious procedure. When the DBID of a database is changed, all previous backups and archived logs of the database become unusable.


You all may know my database names are VIDYA and SAGAR. Those who already watched my previous concepts. Now I will change my one of database named VIDYA to VEERA


Steps to change name of the database:


a) Check whether you are connected to right database or not? I am changing database name to VIDYA to VEERA. So i need to connect to database VIDYA



b) Now shutdown database and startup on mount state. If we start database at mount stage. It will read control files, You all may know control files have all key information of database, It contains name of the database. so we have to start database at mount stage.


c) Now logout of sql. And issue NID (new database ID) command as shown in picture
     $ nid target=VIDYA dbname=VEERA
       password= (sys password)
      NID tool will ask your confirmation. Press Y and ENTER


Database ID changed

d) Now wee need to change name of database, for that we need to change init parameter file and password file

i) changing init parameter file... You need to worry if you have init.ora.. If you have spfile, we need to convert spfile into pfile..
Because we need to change dbaname from VIDYA to VEERA in init.ora file. we cant open spfile because it is binary file. We can edit init.ora using Vi editor. because it is a text file. 
ii) Check below picture for converting spfile to pfile.
   I) go to ORACLE_HOME/dbs folder
   II) Make a copy of spfileVIDYA.ora to spfileVEERA.ora. Using 'cp' command
   

e) Now connect SQLPLUS and convert spfile to pfile. Check below picture for better Idea


f) Logout of SQLplus and delete spfiles spfileVEERA.ora and spfileVIDYA.ora then edit initVEERA.ora using Vi editor as shown in figure


g) change dbname as VIDYA to VEERA 
    and save it


f) We are done with parameter file modifications, now password file
   1) goto $ORACLE_HOME/dbs
   2) rm orapwVIDYA
   3) create new password file as shown in figure


g)  Now connect to database and start database on mount stage
     Then Open the database with Resetlogs option



You can check the name of the database using following command

SQL> select name from v$database;
SQL> select instance_name from v$instance;

You are changed your database name to VIDYA to VEERA successfully 

Thanks
Sagar

Get back to you with another topic



    













     










1 comment: