How to Rename a Database 9.2 Onwards
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.
- You have a working Oracle database up and running;
- You use the Oracle user-id '/ AS SYSDBA' to stop and start your database;
- You have a full backup of your current database
- If using this procedure for an Oracle RAC database, the database must be mounted in NOPARALLEL mode.
- You must open the database 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.
For the purpose of this document we will use the following names and values :
- 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
Useful Information
None Currently.
Known Issues
None Currently.
Step-By-Step Guide
1. Ensure there is a complete full backup of OLDDB.
2. Set the oracle environment to OLDDB.
- . oraenv
- ORACLE_SID = [oracle] ? OLDDB
3. Stop the OLDDB
- sqlplus '/ as sysdba'
- SQL> shutdown immediate
4. Bring up the OLDDB to mount mode.
- sqlplus '/ as sysdba'
- SQL> startup mount
5. Run the NEWDBID utility
- nid TARGET=sys/enter_sys_password@OLDDB DBNAME=NEWDB
6. Once NEWDBID has completed successfully, bring up the NEWDB to mount mode.
- SQL> startup mount
7. Open the NEWDB with a resetlogs
- SQL> alter database open resetlogs;
8. Change the global DB name.
- alter database rename global_name to newname.domain;
9. Take a full backup of the database.
Example Output
Appearing here soon