Hendry's "Oracle and SQL Server DBA Stuff"

Oracle and SQL Server Database Solutions for DBA's please visit http://hendrydba.com for the latest posts. Thanks

change dbid for fixtest database

Posted by Hendry chinnapparaj on August 3, 2010

SQL> show parameter db_name

NAME                                 TYPE        VALUE

———————————— ———– ——————————

db_name                              string      fixtest

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

/u01/oracle/.kshrc[19]: hostname:  not found

ORACLE instance started.

Total System Global Area  536870912 bytes

Fixed Size                  2085392 bytes

Variable Size             171970032 bytes

Database Buffers          356515840 bytes

Redo Buffers                6299648 bytes

Database mounted.

SQL> !

oracle@uatu009 oracle>nid target=sys/fixtest@fixtest

DBNEWID: Release 10.2.0.4.0 – Production on Tue Aug 3 09:18:19 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to database fixtest (DBID=803403107)

Connected to server version 10.2.0

Control Files in database:

/u02/oradata/fixtest/control01.ctl

/u02/oradata/fixtest/control02.ctl

/u02/oradata/fixtest/control03.ctl

Change database ID of database fixtest? (Y/[N]) => Y

Datafile /u02/oradata/fixtest/bw_audit01.dbf – dbid changed

Datafile /u02/oradata/fixtest/soe.dbf – dbid changed

Datafile /u02/oradata/fixtest/soeindex.dbf – dbid changed

Datafile /u02/oradata/fixtest/temp01.dbf – dbid changed

Control File /u02/oradata/fixtest/control01.ctl – dbid changed

Control File /u02/oradata/fixtest/control02.ctl – dbid changed

Control File /u02/oradata/fixtest/control03.ctl – dbid changed

Instance shut down

Database ID for database fixtest changed to 258344671.

All previous backups and archived redo logs for this database are unusable.

Database is not aware of previous backups and archived logs in Recovery Area.

Database has been shutdown, open database with RESETLOGS option.

Succesfully changed database ID.

DBNEWID – Completed succesfully.

oracle@uatu009 oracle>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 – Production on Tue Aug 3 09:20:52 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount

/u01/oracle/.kshrc[19]: hostname:  not found

ORACLE instance started.

Total System Global Area  536870912 bytes

Fixed Size                  2085392 bytes

Variable Size             171970032 bytes

Database Buffers          356515840 bytes

Redo Buffers                6299648 bytes

Database mounted.

SQL> alter database open resetlogs;

Database altered.

SQL> select dbid from v$database;

DBID

———-

258344671

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: