Get the App
SLTechnology News&Howtos  ›  Database  › 

How to recover data files by rman

Shulou Source: shulou.com Published: 2022-05-31 14:19:35 10月02日 Update

Rman how to restore data files, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Recovery can be done when the database is in open or mount state, with only 4 steps

1. Place the data file in the shape of offline

two。 Restore data file (specify data file number)

3. Restore data files

4. Online the data file

-View the status of the data file

SYS@ogg > select file_id,file_name,ONLINE_STATUS from dba_data_files

FILE_ID FILE_NAME ONLINE_

-

4 / u01/app/oracle/oradata/ogg/users01.dbf ONLINE

3 / u01/app/oracle/oradata/ogg/undotbs01.dbf ONLINE

2 / u01/app/oracle/oradata/ogg/sysaux01.dbf ONLINE

1/ u01/app/oracle/oradata/ogg/system01.dbf SYSTEM

5 / u01/app/oracle/oradata/ogg/example01.dbf ONLINE

6 / u01/app/oracle/oradata/ogg/ogg_01.dbf ONLINE

7 / u01/app/oracle/oradata/ogg/receiver_01.dbf ONLINE

-simulated destruction of data file No. 5

[oracle@ogg-80 ogg] $mv example01.dbf example01.dbf.bak

1 offline data file

RMAN > sql 'alter database datafile 5 offline'

-check the offline status, where the status becomes recover.

SYS@ogg > select file_id,file_name,ONLINE_STATUS from dba_data_files

FILE_ID FILE_NAME ONLINE_

-

4 / u01/app/oracle/oradata/ogg/users01.dbf ONLINE

3 / u01/app/oracle/oradata/ogg/undotbs01.dbf ONLINE

2 / u01/app/oracle/oradata/ogg/sysaux01.dbf ONLINE

1/ u01/app/oracle/oradata/ogg/system01.dbf SYSTEM

5 / u01/app/oracle/oradata/ogg/example01.dbf RECOVER

6 / u01/app/oracle/oradata/ogg/ogg_01.dbf ONLINE

7 / u01/app/oracle/oradata/ogg/receiver_01.dbf ONLINE

two。 Restore data files

RMAN > restore datafile 5

3. Restore data files

RMAN > recover datafile 5;-here is the application log

-the recovery is completed in the viewing status, and the status here becomes offline

SYS@ogg > select file_id,file_name,ONLINE_STATUS from dba_data_files

FILE_ID FILE_NAME ONLINE_

-

4 / u01/app/oracle/oradata/ogg/users01.dbf ONLINE

3 / u01/app/oracle/oradata/ogg/undotbs01.dbf ONLINE

2 / u01/app/oracle/oradata/ogg/sysaux01.dbf ONLINE

1/ u01/app/oracle/oradata/ogg/system01.dbf SYSTEM

5 / u01/app/oracle/oradata/ogg/example01.dbf OFFLINE

6 / u01/app/oracle/oradata/ogg/ogg_01.dbf ONLINE

7 / u01/app/oracle/oradata/ogg/receiver_01.dbf ONLINE

4. Online the data file

RMAN > sql 'alter database datafile 5 online'

-check the status again after online

SYS@ogg > select file_id,file_name,ONLINE_STATUS from dba_data_files

FILE_ID FILE_NAME ONLINE_

-

4 / u01/app/oracle/oradata/ogg/users01.dbf ONLINE

3 / u01/app/oracle/oradata/ogg/undotbs01.dbf ONLINE

2 / u01/app/oracle/oradata/ogg/sysaux01.dbf ONLINE

1/ u01/app/oracle/oradata/ogg/system01.dbf SYSTEM

5 / u01/app/oracle/oradata/ogg/example01.dbf ONLINE

6 / u01/app/oracle/oradata/ogg/ogg_01.dbf ONLINE

7 / u01/app/oracle/oradata/ogg/receiver_01.dbf ONLINE

After reading the above, have you mastered the method of how rman recovers the data files? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Data files status content methods more problems nothing you can do for this again reasons just for this skills databases logs steps articles experience industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi Apple MySQL MariaDB