- First of all backup the database.
- Then login as SYSDBA to check out the DB ID and DB Name by using the following statement, using SQLPLUS or your favourite SQL Client.
- Shutdown the database and startup it in mount state (SQLPLUS).
- Use the DBNEWID command to change the DB ID, you need to login as user with privilege SYSDBA (Terminal).
- Shutdown database again (SQLPLUS).
- Change db_name initialization parameter in the initialization file, normally inside database folder/admin/pfile (Terminal).
- Create a new password file using ORAPWD utility, the file usually in Oracle folder/dbs (Terminal).
- Start database in mount state (SQLPLUS).
- Open database with RESETLOGS option (SQLPLUS).
- Verify the database id and name using following statement (SQLPLUS).
- Don’t forget to change ORACLE_SID parameter in .bash_profile and database name in
/etc/oratab
(Terminal).
select dbid, name from v$database
shutdown immediate
startup mount
nid target=username/password@servicename dbname=newdbname
shutdown immediate
orapwd file=orapwSID password=password entries=
startup mount
alter database open resetlogs
select dbid, name from v$database