Thursday 6 June 2013

How to change oracle 10g DB name in linux


How to change oracle 10g DB name in linux

  1. First of all backup the database.
  2. 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.
  3. select dbid, name from v$database
  4. Shutdown the database and startup it in mount state (SQLPLUS).
  5. shutdown immediate
  1. startup mount
  2. Use the DBNEWID command to change the DB ID, you need to login as user with privilege SYSDBA (Terminal).
  3. nid target=username/password@servicename dbname=newdbname
  4. Shutdown database again (SQLPLUS).
  5. shutdown immediate
  6. Change db_name initialization parameter in the initialization file, normally inside database folder/admin/pfile (Terminal).
  7. Create a new password file using ORAPWD utility, the file usually in Oracle folder/dbs (Terminal).
  8. orapwd file=orapwSID password=password entries= 
  9. Start database in mount state (SQLPLUS).
  10. startup mount
  11. Open database with RESETLOGS option (SQLPLUS).
  12. alter database open resetlogs
  13. Verify the database id and name using following statement (SQLPLUS).
  14. select dbid, name from v$database
  15. Don’t forget to change ORACLE_SID parameter in .bash_profile and database name in /etc/oratab
  16. (Terminal).

No comments:

Post a Comment