How To Rename A Database - Version 9.2 Or Later
Table of Contents
BACKGROUND & OVERVIEW
This document provides a step-by-step guide to renaming a database. This is not valid for databases prior to version 9.2. Instead, for databases prior to 9.2. use the following guide.ASSUMPTIONS & PRE_REQUISITES
This document expects and assumes the following:- The instructions are carried out by a qualified DBA, fully conversant with Oracle.
- All necessary client software, e.g. Telnet and X-Server is available.
- There is a working Oracle database up and running;
- The Oracle user-id '/ AS SYSDBA' is user to stop and start your database;
- There is a full backup of your current database;
- If using this procedure for an Oracle RAC database, the database must be mounted inNOPARALLEL mode.
- The database must be opened with the RESETLOGS option after changing the DBID. This is not necessary if only changing the database name.
- Datafiles must not be in need of recovery
- All read-only tablespaces must be writable at the operating system level.
- The DBNEWID utility does not change global database names.
- The current database name will be OLDD
- The new database name will be NEWDB
- The database $ORACLE_HOME definitions location will be /var/opt/oracle/oratab
STEP-BY-STEP GUIDE
1. Ensure there is a complete full backup of OLDDB.2. Set the oracle environment to OLDDB.
3. Stop the OLDDB
- . oraenv
- ORACLE_SID = [oracle] ? OLDDB
4. Bring up the OLDDB to mount mode.
- sqlplus '/ as sysdba'
- SQL> shutdown immediate
5. Run the NEWDBID utility
- sqlplus '/ as sysdba'
- SQL> startup mount
6. Once NEWDBID has completed successfully, bring up the NEWDB to mount mode.
- nid TARGET=sys/enter_sys_password@OLDDB DBNAME=NEWDB
7. Open the NEWDB with a resetlogs
- SQL> startup mount
8. Change the global DB name.
- SQL> alter database open resetlogs;
9. Take a full backup of the database.
- alter database rename global_name to newname.domain;
No comments:
Post a Comment