Change DBID and DBNAME of ORACLE RAC 19c Database We will be changing DBID and DB_NAME for Oracle RAC database as below Step1=> Get current status as below. [oracle@racsetn1 bkp]$ sqlplus "/as sysdba" Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> select dbid, name from v$database; DBID NAME ---------- --------- 1427195521 TNT SQL> alter user sys identified by Oracle_4U; User altered. SQL> exit Step2=> Stop database in all instance and start on any node with MOUNT mode as below. [oracle@racsetn1 admin]$ sqlplus "/as sysdba" SQL> show parameter cluster_Database NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ cluster_database boolean TRUE cluster_database_instances integer 2 SQL> alter system set cluster_database=FALSE; SQL> SHUTDOWN IMMEDIATE Database closed. Database dismounted. ORACLE instance shut down. SQL> STARTUP MOUNT; ORACLE instance started. Total System Global Area 2751463160 bytes Fixed Size 8900344 bytes Variable Size 704643072 bytes Database Buffers 2030043136 bytes Redo Buffers 7876608 bytes Database mounted. SQL> EXIT Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 Step3=> Execute NID as below to change DBID and DBNAME [oracle@racsetn1 admin]$ nid TARGET=sys/Oracle_4U DBNAME=new_TNT LOGFILE=change_dbname.log [oracle@racsetn1 admin]$ tail -100f change_dbname.log Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Connected to database TNT (DBID=1427195521) Connected to server version 19.3.0 Control Files in database: +DATA/TNT/CONTROLFILE/current.293.1123679973 +FRA/TNT/CONTROLFILE/current.734.1123679973 Changing database ID from 1427195521 to 3756383430 Changing database name from TNT to NEW_TNT Control File +DATA/TNT/CONTROLFILE/current.293.1123679973 - modified Control File +FRA/TNT/CONTROLFILE/current.734.1123679973 - modified Datafile +DATA/TNT/DATAFILE/system.348.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/ro_ts.352.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/sysaux.349.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/undotbs1.350.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/undotbs2.358.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/users.351.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/ts_nolog.353.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/ts_nolog.354.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/tnt_test.355.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/undotbs01.356.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/DATAFILE/undotbs02.357.112368198 - dbid changed, wrote new name Datafile +DATA/TNT/TEMPFILE/temp.363.112368209 - dbid changed, wrote new name Control File +DATA/TNT/CONTROLFILE/current.293.1123679973 - dbid changed, wrote new name Control File +FRA/TNT/CONTROLFILE/current.734.1123679973 - dbid changed, wrote new name Instance shut down Database name changed to NEW_TNT. Modify parameter file and generate a new password file before restarting. Database ID for database NEW_TNT changed to 3756383430. All previous backups and archived redo logs for this database are unusable. Database is not aware of previous backups and archived logs in Recovery Area. Database has been shutdown, open database with RESETLOGS option. Succesfully changed database name and ID. DBNEWID - Completed succesfully. Step 4=> Create DUMP directory ON BOTH Nodes as Mount database as below. [oracle@racsetn1 bkp]$ mkdir -p /ora_home/app/oracle/admin/NEW_TNT/adump [oracle@racsetn1 bkp]$ sqlplus "/as sysdba" Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount pfile='/ora_home/bkp/pfile1.ora'; ORACLE instance started. Total System Global Area 2751463160 bytes Fixed Size 8900344 bytes Variable Size 570425344 bytes Database Buffers 2164260864 bytes Redo Buffers 7876608 bytes Database mounted. SQL> exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 [oracle@racsetn1 bkp]$ Step5 => Now we need to recreate Passwordfile and SPfile as below. Create Passwordfile as below. Get current status -> [oracle@racsetn1 bkp]$ srvctl config database -d TNT Database unique name: TNT Database name: NEW_TNT Oracle home: /ora_home/app/19c/db Oracle user: oracle Spfile: +DATA/TNT/PARAMETERFILE/spfile.ora Password file: +DATA/TNT/PASSWORD/pwdtnt.281.1115902969 Domain: ace2oracle.lab Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: FRA,DATA Mount point paths: Services: Type: RAC Start concurrency: Stop concurrency: OSDBA group: oinstall OSOPER group: oper Database instances: TNT1,TNT2 Configured nodes: racsetn1,racsetn2 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed Make passwordfile as NULL [oracle@racsetn1 bkp]$ srvctl modify database -d TNT -pwfile [oracle@racsetn1 bkp]$ Verify again-> [oracle@racsetn1 bkp]$ srvctl config database -d TNT Database unique name: TNT Database name: NEW_TNT Oracle home: /ora_home/app/19c/db Oracle user: oracle Spfile: +DATA/TNT/PARAMETERFILE/spfile.ora Password file: Domain: ace2oracle.lab Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: FRA,DATA Mount point paths: Services: Type: RAC Start concurrency: Stop concurrency: OSDBA group: oinstall OSOPER group: oper Database instances: TNT1,TNT2 Configured nodes: racsetn1,racsetn2 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed [oracle@racsetn1 bkp]$ Recreate Passwordfile as below. [oracle@racsetn1 bkp]$ orapwd dbuniquename=TNT file='+DATA/TNT/PARAMETERFILE/passwdfile' Enter password for SYS: Verify Passwordfile as below. [oracle@racsetn1 bkp]$ srvctl config database -d TNT Database unique name: TNT Database name: NEW_TNT Oracle home: /ora_home/app/19c/db Oracle user: oracle Spfile: +DATA/TNT/PARAMETERFILE/spfile.ora Password file: +DATA/TNT/PARAMETERFILE/passwdfile Domain: ace2oracle.lab Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: FRA,DATA Mount point paths: Services: Type: RAC Start concurrency: Stop concurrency: OSDBA group: oinstall OSOPER group: oper Database instances: TNT1,TNT2 Configured nodes: racsetn1,racsetn2 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed Step6=> Modify new SPfile for new DB_NAME [oracle@racsetn1 bkp]$ sqlplus "/as sysdba" Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> create spfile='+DATA/TNT/PARAMETERFILE/spfile.ora' from memory; File created. SQL> exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 [oracle@racsetn1 bkp]$ srvctl modify database -d TNT -spfile '+DATA/TNT/PARAMETERFILE/spfile.ora' Step7=> Open database in RESTLOGS modes as below. [oracle@racsetn1 bkp]$ sqlplus "/as sysdba" Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> alter database open resetlogs; Database altered. SQL> Step8=> Modify CLUSTER_DATABASE to TRUE and start database in RAC mode. SQL> show parameter cluster_Database NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ cluster_database boolean TRUE cluster_database_instances integer 2 Step 10=> Now we will remove OLD DB_NAME from cluster and add new DB_NAME in cluster as below. [oracle@racsetn1 bkp]$ srvctl stop database -d TNT [oracle@racsetn1 bkp]$ srvctl remove database -d TNT Remove the database NEW_TNT? (y/[n]) Y [oracle@racsetn1 bkp]$ srvctl add database -d TNT -o /ora_home/app/19c/db -spfile '+DATA/TNT/PARAMETERFILE/spfile.ora' -pwfile '+DATA/TNT/PARAMETERFILE/passwdfile' [oracle@racsetn1 bkp]$ srvctl add instance -d TNT -i NEW_TNT1 -n racsetn1 [oracle@racsetn1 bkp]$ srvctl add instance -d TNT -i NEW_TNT2 -n racsetn2 [oracle@racsetn1 bkp]$ [oracle@racsetn1 bkp]$ srvctl start database -d TNT [oracle@racsetn1 bkp]$ Step11 => Check and verify details as below. [oracle@racsetn1 bkp]$ srvctl config database -d TNT Database unique name: TNT Database name: Oracle home: /ora_home/app/19c/db Oracle user: oracle Spfile: +DATA/TNT/PARAMETERFILE/spfile.ora Password file: +DATA/TNT/PARAMETERFILE/passwdfile Domain: ace2oracle.lab Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: Mount point paths: Services: Type: RAC Start concurrency: Stop concurrency: OSDBA group: oinstall OSOPER group: oper Database instances: NEW_TNT1,NEW_TNT2 Configured nodes: racsetn1,racsetn2 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed [oracle@racsetn1 bkp]$ Step 12=> Verofy details as below. SQL> SQL> show parameter db_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_name string NEW_TNT SQL> show parameter db_uniq NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_unique_name string NEW_TNT SQL> SQL>
© 2021 Ace2Oracle. All Rights Reserved | Developed By IBOX444