Oracle9i Release 2: Using the DBNEWID Utility
Only the DBID of a database
Only the DBNAME of a database
1. Make a whole database backup.
2. Invoke SQL*Plus and connect as a user with SYSDBA privileges.
3. Issue the following query to determine the current DBID:
SELECT dbid, name FROM v$database;
4. Shut down the instance using the NORMAL, IMMEDIATE, or TRANSACTIONAL options:
SHUTDOWN IMMEDIATE OR NORMAL
5. Start the instance and mount the database, specifying the parameter file if you are not using a server parameter file or the text initialization parameter file is not in the default location:
STARTUP MOUNT
6. Invoke the DBNEWID utility on the command line, specifying a valid user with the SYSDBA privilege. The DBNEWID utility performs validations of the headers of the data files and control files before attempting I/O to the files. If validation is successful, then DBNEWID prompts you to confirm the operation unless you specify a log file, changes the DBID for each data file (including offline normal and read-only data files), and then exits. The database is left mounted but is not yet usable.
nid TARGET=SYS/secure@
i.e: nid TARGET=SYS/PASSWORD@TEST
7. After DBNEWID successfully changes the DBID, shut down the instance:
SHUTDOWN IMMEDIATE OR NORMAL
8. Create a new password file using the ORAPWD utility:
orapwd file=orapw
9. Start the instance and mount the database:
STARTUP MOUNT;
10. Open the database with the RESETLOGS option:
ALTER DATABASE OPEN RESETLOGS;
11. Verify the change to the DBID by issuing the following query:
SELECT dbid, name FROM v$database;
Changing Your Database Name (DBNAME)
1. Make a whole database backup.
2. Invoke SQL*Plus and connect as a user with SYSDBA privileges.
3. Issue the following query to determine the current DBID:
SELECT dbid, name FROM v$database;
4. Shut down the instance using the NORMAL, IMMEDIATE, or TRANSACTIONAL options:
SHUTDOWN IMMEDIATE OR NORMAL
5. Start the instance and mount the database, specifying the parameter file if you are not using a server parameter file or the text initialization parameter file is not in the default location:
STARTUP MOUNT
6. Invoke the DBNEWID utility on the command line, specifying a valid user with the SYSDBA privilege. You must specify the DBNAME parameter and supply your new database name. You must also specify the YES value for the SETNAME parameter to indicate that only the DBNAME is to be changed. DBNEWID performs validations of the headers of the control files, but not the data files, before attempting I/O to the files. If validation is successful, then DBNEWID prompts for confirmation, changes the database name in the control files, and exits. After DBNEWID completes successfully, the database is left mounted but is not yet usable.
nid TARGET=
i.e: nid TARGET=SYS/PASSWORD@TEST DBNAME=DEVEL SETNAME=YES
7. After DBNEWID successfully changes the DBID, shut down the instance:
SHUTDOWN IMMEDIATE OR NORMAL
8. Create a new password file using the ORAPWD utility:
orapwd file=orapw
9. Change the DB_NAME initialization parameter to your new database name
10. Start the instance and mount the database:
STARTUP
11. Verify the change to the DBID by issuing the following query:
SELECT dbid, name FROM v$database;
No comments:
Post a Comment