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

Recovery of database data files and control files

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Recovery of database data files and control files

One time database data files and control files are missing or no recovery database startup method is created

This document applies to data recovery:

Loss of control files and data files during database installation

Or the data or control files of the database failure are missing.

Or if the original data or control files of the database are lost, if there are backup files, restore them with backup files.

Environmental variables in this paper

ORACLE_BASE=/oo/oracle

ORACLE_HOME=/oo/oracle/11g

1. Database startup error

Database startup Times error:

Error 1:SQL > startupORA-01261: Parameter db_recovery_file_dest destination string cannot be translatedORA-01262: Stat failed ona file destination directoryLinux-x86_64 Error: 2: No such file or directory error 2: manually establish the startup database init.ora file SQL > startup mount pfile='/oo/oracle/11g/dbs/init.ora'ORA-09925: Unable to create audit trail fileLinux-x86_64 Error: 2: No such file or directoryAdditional information: 9925

Create a directory based on the information in the init.ora file and give permissions

Change the ORACLE_BASE in the init.ora file to the absolute path in the environment variable

Path: / oo/oracle/11g/dbs

Solution:

Create all directories in init.ora and add permissions

Mkdir-p / oo/oracle/flash_recovery_area

Mkdir-p / oo/oracle/admin/orcl/adump

Chmod 755 / oo/oracle/flash_recovery_area

Chmod 755 / oo/oracle/admin/orcl/adump

Chown oracle:oinstall / oo/oracle/admin/orcl/adump

Chown oracle:oinstall / oo/oracle/flash_recovery_area/

Note: both error messages are that the directory file does not exist.

two。 Start the database manually

After creating the directory and giving permissions, start the database init.ora file manually.

SQL > startup mount pfile='/oo/oracle/11g/dbs/init.ora'

ORACLE instance started.

Total System Global Area 1068937216 bytes

Fixed Size 2220200 bytes

Variable Size 616566616 bytes

Database Buffers 444596224 bytes

Redo Buffers 5554176 bytes

ORA-00205: error in identifying control file, check alert log for more info

/ oo/oracle/11g/dbs

SQL > create pfile='/oo/oracle/11g/dbs/initorcl.ora' from spfile;File created.SQL > create spfile from pfile='/oo/oracle/11g/dbs/initorcl.ora';File created.

The spfile file is created using the method above, but the startup still reports an error because there are no errors caused by the following files in this directory, and none of these files is an empty directory.

If the database is not backed up, you can find two control files in other normal oracle databases

The specific location of the control file can be viewed in the system log file alert_orcl.log

Path: / oo/oracle/diag/rdbms/orcl/orcl/trace

Find two control files and put them in this directory / oo/oracle/11g/dbs

Then create and restart the database again

Create spfile from pfile='/oo/oracle/11g/dbs/init.ora'

Startup mount pfile='/oo/oracle/11g/dbs/initorcl.ora'

Note: after each startup in SQL, stop shutdown before starting again.

3. After the control file is restored

Start the database again after you have the control file. The error message changes to the system data file system01.db can not find.

Error 3:

SQL > startup

ORACLE instance started.

Total System Global Area 1068937216 bytes

Fixed Size 2220200 bytes

Variable Size 616566616 bytes

Database Buffers 444596224 bytes

Redo Buffers 5554176 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 1-see DBWR trace file

ORA-01110: data file 1:'/ oracle/oracle/oradata/orcl/system01.dbf'

It is true that there is no system01.dbf when you go to the directory and none of these files is an empty directory

If there are no log files and database files, the following error must be reported when using recover to recover.

The above files are copied from other oracle database servers

Error 4:

SQL > startup

ORACLE instance started.

Total System Global Area 1068937216 bytes

Fixed Size 2220200 bytes

Variable Size 616566616 bytes

Database Buffers 444596224 bytes

Redo Buffers 5554176 bytes

Database mounted.

ORA-01113: file 1 needs media recovery

ORA-01110: data file 1:'/ oracle/oracle/oradata/orcl/system01.dbf'

Alter database datafile'/ oracle/oracle/oradata/orcl/system01.dbf' offline drop

Error 5:

ORA-01147: SYSTEM tablespace file 1 is offline

ORA-01110: data file 1:'/ oracle/oracle/oradata/orcl/system01.dbf'

Live: the error message is caused by the above command. Just re-online it.

Alter database datafile'/ oracle/oracle/oradata/orcl/system01.dbf' online

Then use the recover command to restore

Recover datafile'/ oracle/oracle/oradata/orcl/system01.dbf';-restore database files

Recover tablespace system;-restore tablespace

Recover database;-restore the database

Action:

SQL > recover datafile'/ oracle/oracle/oradata/orcl/system01.dbf'

SQL > ALTER DATABASE OPEN

ALTER DATABASE OPEN

*

ERROR at line 1:

ORA-01157: cannot identify/lock data file 5-see DBWR trace file

ORA-01110: data file 5:'/ oracle/oracle/oradata/orcl/test_data01.dbf'

Because the dbf data files and redo logs copied from other machines were not completely copied, the database started after copying the file that reported an error and using the command again.

The reason for reporting an error is that the files of other databases are not completely copied, so the data files in the replicated database server need to be copied. It is recommended to copy the files in the initialized database server.

SQL > ALTER DATABASE OPEN

Database altered.

SQL > select STATUS from v$instance

STATUS

-

OPEN

SQL > select from all_tables

Select from all_tables

*

ERROR at line 1:

ORA-01775: looping chain of synonyms

But using the simple query Times is wrong.

Just restart the database. After shutdown startup starts again, it will be normal.

Oracle imports sql file SQL > @ / oo/PC_CORE01.sqlbr/ > SQL > @ / oo/PC_CORE01.sql

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

Servers

Wechat

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

12
Report