vicker313 tech blog

April 27, 2009

Change Oracle 10g DB name in Linux

Filed under: Linux, Oracle — Tags: — vicker313 @ 8:59 am
  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
    startup mount

  6. Use the DBNEWID command to change the DB ID, you need to login as user with privilege SYSDBA (Terminal).
  7. nid target=username/password@servicename dbname=newdbname

  8. Shutdown database again (SQLPLUS).
  9. shutdown immediate

  10. Change db_name initialization parameter in the initialization file, normally inside database folder/admin/pfile (Terminal).
  11. Create a new password file using ORAPWD utility, the file usually in Oracle folder/dbs (Terminal).
  12. orapwd file=orapwSID password=password entries=

  13. Start database in mount state (SQLPLUS).
  14. startup mount

  15. Open database with RESETLOGS option (SQLPLUS).
  16. alter database open resetlogs

  17. Verify the database id and name using following statement (SQLPLUS).
  18. select dbid, name from v$database

  19. Don’t forget to change ORACLE_SID parameter in .bash_profile and database name in /etc/oratab


  1. […] Rename the new database to mydb2 […]

    Pingback by Copy or Move Oracle Database « vicker313 tech blog — June 11, 2011 @ 12:18 pm

  2. nid target….. command is not working…m having oracle linux working on virtual machine…i need to change the name of database as users.dbf file is deleted before taking backup…

    Comment by amarjot — July 30, 2012 @ 4:35 am

    • what exactly is the error? is it command not found? if that’s the case, you probably didn’t issue the command under oracle user

      Comment by vicker313 — July 30, 2012 @ 11:20 am

  3. Thank you so much for applying free time in order to publish “Change Oracle 10g DB name in Linux vicker313 tech blog”.
    Thanks again ,Mariano

    Comment by — February 5, 2013 @ 1:44 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: