Saturday, July 20, 2024

Rename the Database

Why?

One of the common change for database for the Data Guard implementation is to match the DB name and have a different DB unique name, it is article I will list my own steps to keep achieve this along with other changes to avoid any issue post to this change. In my below steps I have match the oracle name and oracle SID to follow the same pattern of default installation values.

How?

With reference to the blog https://oracle-base.com/articles/9i/dbnewid , I did my below steps.

1- Check the current value for the SID and database name:

SQL> show parameter name ;

SQL> select instance from v$thread;

SQL> select name from v$database;

 

2- stop the DB and started on mount stat:

SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP MOUNT

 

3- rename the DB using “nid” utility, setname parameter to only change the name and keep the DB id, shutdown it and started on mount to change parameter file , error will appeared but ignore it.

$ nid TARGET=sys/sys@<current_service_name> DBNAME='<new_name>' SETNAME=YES

SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP MOUNT

SQL> ALTER SYSTEM SET DB_NAME='<new_name>' SCOPE=SPFILE;

SQL> SHUTDOWN IMMEDIATE

 

4- change the password file and spfile name to match the new name:

$ orapwd file=orapw$ORACLE_SID password=sys force=y

Export ORACLE_SID=<new_DBNAME>;

SQL> STARTUP MOUNT

--*Rename the SPFILE to match the new DBNAME

$ cd $ORACLE_HOME/dbs

$ cp spfile<old_dbname>.ora spfile$ORACLE_SID.ora

$ lsnrctl reload

SQL> STARTUP MOUNT ;

SQL> show parameter name ;

SQL> alter database open ;

 

Why and How to install Grid 19c on RHEL 8?

  Why ? Simply we will be requested to install Oracle Grid RAC DB on Redhat RHEL 8, below is my note for this installation . How ? 1-  OS in...