Sunday, July 8, 2018

Changing database name using NID


1. Shutdown your database.
2. Start it in mount stage.
3. Run nid to apply changes.
4. After successful completion start database with resetlogs.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 3206836224 bytes
Fixed Size                  2257520 bytes
Variable Size            1778388368 bytes
Database Buffers         1409286144 bytes
Redo Buffers               16904192 bytes
Database mounted.
SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
bash-3.2$
bash-3.2$ nid TARGET=SYS/xxxxxxx DBNAME=UAT

DBNEWID: Release 11.2.0.4.0 - Production on

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to database PROD (DBID=337679511)

Connected to server version 11.2.0

Control Files in database:
    /DB/app/oracle/oradata/UAT/control01.ctl
    /DB/app/oracle/oradata/UAT/control02.ctl

Changing database ID from 337679511 to 3686432641
Changing database name from PROD to UAT
    Control File /DB/app/oracle/oradata/UAT/control01.ctl - modified
    Control File /DB/app/oracle/oradata/UAT/control02.ctl - modified
    Datafile /DB/app/oracle/oradata/UAT/system.294.87146925 - dbid changed, wrote new name
    Datafile /DB/app/oracle/oradata/UAT/sysaux.267.87146925 - dbid changed, wrote new name
    Datafile /DB/app/oracle/oradata/UAT/undotbs1.270.87146925 - dbid changed, wrote new name
    Datafile /DB/app/oracle/oradata/UAT/users.269.87146925 - dbid changed, wrote new name
    Datafile /DB/app/oracle/oradata/UAT/undotbs2.272.87146940 - dbid changed, wrote new name
    Datafile /DB/app/oracle/oradata/UAT/temp.295.87146934 - dbid changed, wrote new name
    Control File /DB/app/oracle/oradata/UAT/control01.ctl - dbid changed, wrote new name
    Control File /DB/app/oracle/oradata/UAT/control02.ctl - dbid changed, wrote new name
    Instance shut down

Database name changed to UAT.
Modify parameter file and generate a new password file before restarting.
Database ID for database UAT changed to 3686432641.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.


1 comment:

  1. The Casino at Rosedale, WA Casino
    Find casinos 김제 출장안마 in 거제 출장샵 the Rosedale, WA area 강원도 출장안마 and other. We 거제 출장마사지 have 1,100 slot 광양 출장안마 machines, the largest selection of table games & live poker games!

    ReplyDelete