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

The use of RMAN (8)

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

XVI. Full recovery in archive mode

In the archive mode, with RMAN backup and archive redo logs and the current redo log files, the database can be fully restored, and it can be recovered online.

1. Recovery of non-system tablespace damage

Make a full backup of database

RMAN > backup as compressed backupset database plus archivelog delete all input

Create a test table

SQL > create table test123 tablespace users as select * from dba_segments

Delete the tablespace data file of the test table

SQL >! Rm-rf / u01/app/oradata/orcl/users01.dbf

Restart the database

SQL > shutdown immediate

SQL > startup

In order to open the database first, take the database file offline.

SQL > alter database datafile 4 offline

SQL > alter database open;-you can also open the database after the recovery of the mounted state

Restore data files

RMAN > restore datafile 4

Restore data files

RMAN > recover datafile 4

Change the database file online

SQL > alter database datafile 4 online

You can also put the above commands in the rman script.

Run {

Sql 'alter database datafile 4 offline'

Restore tablespace users

Recover tablespace users

Sql 'alter database datafile 4 online'

}

two。 Recovery of system tablespace damage

The system tablespace is damaged and must be restored before the database can be opened.

Delete the data file system01.dbf

[oracle@oracle11g ~] $rm-rf / u01/app/oradata/orcl/system01.dbf

Note: you may not be able to reconnect to the database at this time:

Login using RMAN also failed, using shutdown abort to stop the database:

Start the database to mount state

SQL > shutdown immediate

SQL > startup

Use the RMAN script to restore the data file.

RMAN > run {

Sql 'alter database datafile 1 offline'

Restore datafile 1

Recover datafile 1

Sql 'alter database datafile 1 online'

}

Start the database

SQL > alter database open

3. Recovery of all missing data files

Delete all data files.

[oracle@oracle11g orcl] $rm-f / u01/app/oradata/orcl/*.dbf

Use the RMAN script to restore the data file.

SQL > shutdown abort

SQL > startup

RMAN > run {

Restore database

Recover database

Sql 'alter database open'

}

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