CREATE CONTROLFILE修改DB_NAME一定不能使用REUSE
短信预约 -IT技能 免费直播动态提醒
总结:最初的db_name是orcl,重建控制文件,想把db_name修改为orclK,如果重建控制文件使用REUSE,会提示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/app/oracle/oradata/orcl/system01.dbf'
最初数据库的名字是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新增了数据库orclK的配置,具体配置如下
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
把initorclK.ora里面的*.db_name='orcl'修改为*.db_name='orclK'
实验1,使用REUSE
修改/home/oracle/control内容,使用默认的REUSE,把ORCL修改为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/app/oracle/oradata/orcl/system01.dbf'
实验2,使用SET
修改/home/oracle/control内容,把REUSE修改为SET,把ORCL修改为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
实验也发现/home/oracle/control里面的内容大小写敏感,大小写结果一样,比如ORCLK都是大写,但是实际db_name是orclK
ORA-01161: database name ORCL in file header does not match given name of ORCLK
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
最初数据库的名字是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新增了数据库orclK的配置,具体配置如下
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
把initorclK.ora里面的*.db_name='orcl'修改为*.db_name='orclK'
实验1,使用REUSE
修改/home/oracle/control内容,使用默认的REUSE,把ORCL修改为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/app/oracle/oradata/orcl/system01.dbf'
实验2,使用SET
修改/home/oracle/control内容,把REUSE修改为SET,把ORCL修改为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
实验也发现/home/oracle/control里面的内容大小写敏感,大小写结果一样,比如ORCLK都是大写,但是实际db_name是orclK
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341