Changing the DBID and Database Name
Database : 10gr1OS PLATFORM : WindowsArchive Log : EnableNon Distributed Database System.SQL> select DBID,NAME from v$database;DBID NAME---------- ---------13875087 ORA10G1.Ensure that you have a recoverable whole database backup.2.shutdown database and startup in mount stage.
SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startup mount;ORACLE instance started.Total System Global Area 171966464 bytesFixed Size 787988 bytesVariable Size 145488364 bytesDatabase Buffers 25165824 bytesRedo Buffers 524288 bytesDatabase mounted.
3.Invoke the DBNEWID utility on the command line, specifying a valid user with the SYSDBA privilege.
C:\>nid TARGET=SYS/oracle DBNAME=ORA101DBNEWID: Release 10.1.0.2.0 - ProductionCopyright (c) 2001, 2004, Oracle. All rights reserved.Connected to database ORA10G (DBID=13875087)Connected to server version 10.1.0Control Files in database:C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL01.CTLC:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL02.CTLC:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL03.CTLChange database ID and database name ORA10G to ORA101? (Y/[N]) => YProceeding with operationChanging database ID from 13875087 to 13925003Changing database name from ORA10G to ORA101Control File C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL01.CTL - modifiedControl File C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL02.CTL - modifiedControl File C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL03.CTL - modifiedDatafile C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\SYSTEM01.DBF - dbid changed, wrote new nameDatafile C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\UNDOTBS01.DBF - dbid changed, wrote new nameDatafile C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\SYSAUX01.DBF - dbid changed, wrote new nameDatafile C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\USERS01.DBF - dbid changed,wrote new nameDatafile C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\EXAMPLE01.DBF - dbid changed, wrote new nameDatafile C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\TEMP01.DBF - dbid changed,wrote new nameControl File C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL01.CTL - dbid changed, wrote new nameControl File C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL02.CTL - dbid changed, wrote new nameControl File C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\CONTROL03.CTL - dbid changed, wrote new nameInstance shut downDatabase name changed to ORA101.Modify parameter file and generate a new password file before restarting.Database ID for database ORA101 changed to 13925003.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.
4.Open PFILE and edit DB_NAME parameter and create new SPFILE.and Create New Password file.
C:\>orapwd file=c:\oracle\product\10.1.0\db_1\database\PWDora101.ora PASSWORD=oracle entries=5 force=yC:\>sqlplus sys as sysdbaSQL*Plus: Release 10.1.0.2.0 - Production on Mon Apr 2 18:54:20 2007Copyright (c) 1982, 2004, Oracle. All rights reserved.Enter password:Connected to an idle instance.SQL> -- Edit DB_NAME parameter in PFILE and CREATE NEW SPFILE.SQL> create SPFILE from PFILE;File created.
Note:password file name like "PWD.ORA" and sid is equal to INSTANCE_NAME not DATABASE_NAME.5.Startup Database in MOUNT MODE and open with RESETLOGS.
SQL> startup mount;ORACLE instance started.Total System Global Area 171966464 bytesFixed Size 787988 bytesVariable Size 145488364 bytesDatabase Buffers 25165824 bytesRedo Buffers 524288 bytesDatabase mounted.SQL> alter database open resetlogs;Database altered.
SQL> select DBID,NAME from v$database;DBID NAME---------- ---------13925003 ORA101Note : Take complete database backup. previous backup no longer usable.
No comments:
Post a Comment