Use nid in Oracle Database to modify Database Name

Source: Internet
Author: User

In some systems, the Oracle database name is not very standard. If you do not want to recreate the Oracle database, you can use the nid tool that comes with Oracle to modify the name of the Oracle database. During the entire modification process, the control file and data file are modified and the dbid is reset. We recommend that you back up the data before the modification.

In this example, the instance_name and db_name in the Oracle database are changed from "oratest" to "test", and the database version is 10.2.0.3.

View the database information.

 
 
  1. SQL> show parameter instance_name  
  2. NAME TYPE VALUE  
  3. stance_name string ORATEST  
  4. SQL> show parameter db_name  
  5. NAME TYPE VALUE  
  6. db_name string ORATEST  
  7. SQL>show parameter service_name  
  8. NAME TYPE VALUE  
  9. db_name string ORATEST  
  10. SQL>select dbid from v$database;  
  11. DBID   
  12. 3213300265  

Before modification, the Oracle database name is "oratest" and dbid = "3213300265 ". Next, modify the database name, stop the database, start it to the mount state, and use the nid tool to modify dbname.

 
 
  1. SQL> shutdown immediate  
  2. Database closed.  
  3. Database dismounted.  
  4. ORACLE instance shut down.  
  5. SQL> startup mount  
  6. Total System Global Area 268435456 bytes  
  7. Fixed Size 1261272 bytes  
  8. Variable Size 117440808 bytes  
  9. Database Buffers 146800640 bytes  
  10. Redo Buffers 2932736 bytes  
  11. Database mounted.  
  12. SQL> host;  
  13. $ nid target="sys/password" dbname=test 
  14. DBNEWID: Release 10.2.0.3.0 - Production on Wed Feb 4 11:12:36 2009  
  15. Copyright (c) 1982, 2005, Oracle. All rights reserved.  
  16. Connected to database ORATEST (DBID=3213300265)  
  17. Connected to server version 10.2.0  
  18. Control Files in database:  
  19. /u02/oradata/test/control01.ctl  
  20. /u02/oradata/test/control02.ctl  
  21. /u02/oradata/test/control03.ctl  
  22. Change database ID and database name ORATEST to TEST? (Y/[N]) => y  
  23. Proceeding with operation  
  24. Changing database ID from 3213300265 to 1976074532  
  25. Changing database name from ORATEST to TEST  
  26. Control File /u02/oradata/test/control01.ctl - modified  
  27. Control File /u02/oradata/test/control02.ctl - modified  
  28. Control File /u02/oradata/test/control03.ctl - modified  
  29. Datafile /u02/oradata/test/system01.dbf - dbid changed, wrote new name  
  30. Datafile /u02/oradata/test/undotbs01.dbf - dbid changed, wrote new name  
  31. Datafile /u02/oradata/test/sysaux01.dbf - dbid changed, wrote new name  
  32. Datafile /u02/oradata/test/users01.dbf - dbid changed, wrote new name  
  33. Datafile /u02/oradata/test/example01.dbf - dbid changed, wrote new name  
  34. Datafile /u02/oradata/test/temp01.dbf - dbid changed, wrote new name  
  35. Control File /u02/oradata/test/control01.ctl - dbid changed, wrote new name  
  36. Control File /u02/oradata/test/control02.ctl - dbid changed, wrote new name  
  37. Control File /u02/oradata/test/control03.ctl - dbid changed, wrote new name  
  38. NID-00600: Internal Error - [28] [12152] [0] [0]  
  39. Change of database name and ID failed during validation -database is intact.  
  40. DBNEWID - Completed with validation errors.   

The above content is an introduction to how to use nid to modify the database name in the Oracle database.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.