CREATE CONTROLFILE must not use REUSE to modify DB_NAME
Summary: the original db_name is orcl, rebuild the control file, want to change db_name to orclK, if the reconstruction control file uses REUSE, it will prompt ORA-01503: CREATE CONTROLFILE failed
ORA-01161: database name ORCL in file header does not match given name of ORCLK
ORA-01110: data file 1:'/ u01 *
The original name of the database was orcl
Sqlplus / as sysdba
SQL > show parameter db_name
NAME TYPE VALUE
-
Db_name string orcl
SQL > alter database backup controlfile to trace as'/ home/oracle/control'
/ etc/oratab has added the configuration of database orclK, as follows
Orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y
OrclK:/u01/app/oracle/product/11.2.0/dbhome_1:Y
Cp initorcl.ora initorclK.ora
Change the * .db _ name='orcl' in initorclK.ora to * .db _ name='orclK'
Lab 1, using REUSE
Modify / home/oracle/control content, use the default REUSE, and change ORCL to ORCLK
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCLK" RESETLOGS NOARCHIVELOG XXX
.oraenv
OrclK
Sqlplus / as sysdba
SQL > @ / home/oracle/control
ORACLE instance started.
Total System Global Area 1272213504 bytes
Fixed Size 1344680 bytes
Variable Size 352324440 bytes
Database Buffers 905969664 bytes
Redo Buffers 12574720 bytes
CREATE CONTROLFILE REUSE DATABASE "ORCLK" RESETLOGS NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01161: database name ORCL in file header does not match given name of ORCLK
ORA-01110: data file 1:'/ u01 *
Lab 2, using SET
Modify / home/oracle/control content, change REUSE to SET, change ORCL to ORCLK
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "ORCLK" RESETLOGS NOARCHIVELOG XXX
.oraenv
OrclK
Sqlplus / as sysdba
SQL > @ / home/oracle/control.sql
ORACLE instance started.
Total System Global Area 1272213504 bytes
Fixed Size 1344680 bytes
Variable Size 352324440 bytes
Database Buffers 905969664 bytes
Redo Buffers 12574720 bytes
Control file created.
SQL > alter database open resetlogs
Database altered.
SQL > show parameter db_name
NAME TYPE VALUE
-
Db_name string orclK
The experiment also found that the content in / home/oracle/control is case-sensitive, and the case result is the same. For example, ORCLK is all uppercase, but the actual db_name is orclK.