Forgot your password?    
+ Reply to Thread
Results 1 to 5 of 5

Thread: Changing the DBID - DBNEWID utility

  1. #1
    Oracle DBA
    Join Date
    Oct 2011
    Location
    Noida
    Posts
    4

    Changing the DBID - DBNEWID utility

    Prior to the introduction of the DBNEWID utility alteration of the internal DBID of an instance was impossible and alteration of the DBNAME required the creation of a new controlfile.

    The DBNEWID utility allows the DBID to be altered for the first time and makes changing the DBNAME simpler. Changing the DBID is necessary when you want to use an RMAN catalog to backup a cloned instance.

    RMAN identifies instances using the DBID, preventing the original and cloned instance being managed by the same catalog. Alteration of the BID in the cloned instance removes this restriction.

    Procedure :

    - Backup the database.
    - Mount the database after a clean shutdown
    SHUTDOWN IMMEDIATE
    STARTUP MOUNT

    - Invoke the DBNEWID utility (nid) from the command line using a user with SYSDBA privilege.

    nid TARGET=sys/password@TSH3

    - Shutdown and open the database with RESETLOGS:

    SHUTDOWN IMMEDIATE
    STARTUP MOUNT
    ALTER DATABASE OPEN RESETLOGS;

    - Backup the database.

  2. #2
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427
    Nice Post Sandeep. Thanks!

  3. #3
    Oracle DBA
    Join Date
    Oct 2011
    Posts
    17
    Good Work..

  4. #4
    Note:- Interview Question of Oracle DBA in Oracle Corp.

    Q:- How to rename the database name?


    A new method for A Database Rename:--

    For Oracle9i and beyond, this procedure to rename an Oracle database using the new dbnewid (also called nid, for new ID) utility:

    STEP 1: Backup the database.

    STEP 2: Mount the database after a clean shutdown:

    SHUTDOWN IMMEDIATE;

    STARTUP MOUNT;

    STEP 3: Invoke the DBNEWID utility (nid) specifying the new DBNAME from the command line using a user with SYSDBA privilege:
    nid TARGET=sys/password@<sevice_nm> DBNAME=VKT
    Assuming the validation is successful the utility prompts for confirmation before performing the actions. Typical output may look something like:
    C:\oracle\920\bin>nid TARGET=sys/password@<service_nm> DBNAME=VKT
    DBNEWID: Release 9.2.0.3.0 - Production
    Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

    Connected to database TYAGI1 (DBID=1024166118)

    Control Files in database:
    C:\ORACLE\ORADATA\TSH1\CONTROL01.CTL
    C:\ORACLE\ORADATA\TSH1\CONTROL02.CTL
    C:\ORACLE\ORADATA\TSH1\CONTROL03.CTL

    Change database ID and database name TYAGI1 to VKT? (Y/[N]) => Y

    Proceeding with operation
    Changing database ID from 1024166118 to 1317278975
    Changing database name from TYAGI1 to VKT
    Control File C:\ORACLE\ORADATA\TSH1\CONTROL01.CTL - modified
    Control File C:\ORACLE\ORADATA\TSH1\CONTROL02.CTL - modified
    Control File C:\ORACLE\ORADATA\TSH1\CONTROL03.CTL - modified
    Datafile C:\ORACLE\ORADATA\TSH1\SYSTEM01.DBF - dbid changed, wrote new name
    Datafile C:\ORACLE\ORADATA\TSH1\UNDOTBS01.DBF - dbid changed, wrote new name
    Datafile C:\ORACLE\ORADATA\TSH1\CWMLITE01.DBF - dbid changed, wrote new name
    Control File C:\ORACLE\ORADATA\TSH1\CONTROL01.CTL - dbid changed, wrote new name
    Control File C:\ORACLE\ORADATA\TSH1\CONTROL02.CTL - dbid changed, wrote new name
    Control File C:\ORACLE\ORADATA\TSH1\CONTROL03.CTL - dbid changed, wrote new name

    Database name changed to VKT.
    Modify parameter file and generate a new password file before restarting.
    Database ID for database VKT changed to 1317278975.
    All previous backups and archived redo logs for this database are unusable.
    Shut down database and open with RESETLOGS option.
    Succesfully changed database name and ID.
    DBNEWID - Completed succesfully.


    STEP 4: Shutdown the database:

    SHUTDOWN IMMEDIATE;


    STEP 5: Modify the DB_NAME parameter in the initialization parameter file. The startup will result in an error but proceed anyway.

    STARTUP MOUNT;

    ALTER SYSTEM SET DB_NAME=VKT SCOPE=SPFILE;

    SHUTDOWN IMMEDIATE

    STEP 6: Create a new password file:
    orapwd file=c:\oracle\920\database\pwdTSH2.ora password=password entries=10

    STEP 7: Rename the SPFILE to match the new DBNAME.


    STEP *: At UNIX/Linux simply reset the ORACLE_SID environment variable:

    export ORACLE_SID=VKT
    $ORACLE_SID
    VKT

    STEP 9: Alter the listener.ora and tnsnames.ora setting to match the new database name and restart the listener:

    lsnrctl reload

    STEP 10: Open the database with RESETLOGS:

    STARTUP MOUNT

    ALTER DATABASE OPEN RESETLOGS;

    STEP 11: Backup the database.

    Qu:- What does DBNEWID(nid):

    Ans:- DBNEWID performs validations in the headers of the control files (not the data files) before attempting I/O to the files. If validation is successful, then DBNEWID changes the database name in the control files, shuts down the database and exits.


    The DBNEWID utility solves this problem by allowing you to change any of the following:

    1) Only the DBID of a database.

    2) Only the DBNAME of a database.

    3) Both the DBNAME and DBID of a database.

    For Option 1:-
    nid TARGET=sys/password@<service_nm>

    For Option 2:-
    nid TARGET=sys/password@<service_nm> DBNAME=VKT SETNAME=YES

    And for option 3:-
    nid TARGET=sys/password@<service_nm> DBNAME=VKT



    Considerations for Global Database Names:--

    If you are dealing with a database in a distributed database system, then each database should have a unique global database name. The DBNEWID utility does not change global database names. This can only be done with the SQL ALTER DATABASE statement, for which the syntax is as follows:

    ALTER DATABASE RENAME GLOBAL_NAME TO <newname>.<domain>;

    The global database name is made up of a database name and a domain, which are determined by the DB_NAME and DB_DOMAIN initialization parameters when the database is first created.

    The following example changes the database name to sales in the domain us.oracle.com:

    ALTER DATABASE RENAME GLOBAL_NAME TO sales.us.oracle.com

    You would do this after you finished using DBNEWID to change the database name.
    Last edited by vineettyagi; 02-17-2012 at 12:49 PM.

  5. #5
    .........................
    Last edited by Hemant; 06-06-2012 at 04:07 PM.

+ Reply to Thread

Similar Threads

  1. Different ways to get the DBID of Database.
    By ajaychandi in forum Core Database Administration and Monitoring
    Replies: 0
    Last Post: 02-26-2013, 06:51 PM
  2. Changing the Archivelog Mode on 9i and earlier
    By Sandeep Sharma in forum Core Database Administration and Monitoring
    Replies: 3
    Last Post: 12-22-2011, 09:29 PM
  3. Changing Oracle Database from Noarchivelog to Archivelog mode
    By Pradeep in forum Core Database Administration and Monitoring
    Replies: 0
    Last Post: 12-14-2011, 05:10 AM
  4. Changing Look and feel of Oracle Application
    By harsh in forum Concepts,Service Management,Apache,OC4J,OPMN,JServ,Forms, Issues,Troubleshooting,
    Replies: 0
    Last Post: 12-08-2011, 04:28 PM
  5. Oracle Applications R12 Changing Forms from Servlet to Socket and vice versa
    By Hemant in forum Concepts,Service Management,Apache,OC4J,OPMN,JServ,Forms, Issues,Troubleshooting,
    Replies: 0
    Last Post: 10-29-2011, 10:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics