Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CREATE CONTROLFILE must not use REUSE to modify DB_NAME

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report