How to Use RMAN to restore some tablespaces

Source: Internet
Author: User
During the routine maintenance and use of the oracle database, data may be accidentally deleted (drop, delete, truncate). When we use conventional means (flashbackquery, flashbackdrop, we can use the latest logical backup and dmp on the same host to restore the corresponding table. However, if these logical backups are not available

During the routine maintenance and use of the oracle database, data may be accidentally deleted (drop, delete, truncate). When we use conventional means (flashback query, flashback drop, we can use the latest logical backup and dmp on the same host to restore the corresponding table. However, if these logical backups are not available

During the routine maintenance and use of the oracle database, data may be accidentally deleted (drop, delete, truncate). When we use conventional means (flashback query, flashback drop, we can use the latest logical backup and dmp on different machines to restore the corresponding tables. However, if these logical backups are not available, there is a recent rman full backup, then we can use this backup to restore the accidentally deleted tablespace to restore the data. Here I will take the NBU backup environment as an example to briefly describe how to restore some tablespaces;

------- Restore the control file in nomount status

run {allocate channel t1 type 'sbt_tape';send 'NB_ORA_SERV=netbackup,NB_ORA_CLIENT=http://blog.csdn.net/lixora';restore controlfile to '/oracle11/oradata1/control011.ctl' from '/c-2151157071-20141111-00';release channel t1 ;}

------- After restoring the control file, start the instance to the mount state and restore some tablespace data files:

Rman target/nocatalog msglog =/home/oracledb/rman. log <
 
  
set newname for datafile 1 to '/oracle11/oradata/datafile/system.262.762381347' ;set newname for datafile 3 to '/oracle11/oradata/datafile/undotbs1.264.762381401';set newname for datafile 4 to '/oracle11/oradata/datafile/undotbs2.266.762381455';set newname for datafile 227 to '/oracle11/oradata/datafile/system02.dbf';set newname for datafile 344 to '/oracle11/oradata/datafile/lixora.375.820259689';set newname for datafile 345 to '/oracle11/oradata/datafile/lixora.414.820949317';

restore tablespace system,undotbs1,undotbs2,lixora ;switch datafile all;release channel t1;release channel t2;}EOF

--------- [If the table is empty, you can generate the offline drop command for tablespace in batches] to restore the database.

rman target / msglog=recover.log << EOFRUN{ALLOCATE CHANNEL ch0 TYPE 'SBT_TAPE' ;ALLOCATE CHANNEL ch1 TYPE 'SBT_TAPE' ;send 'NB_ORA_SERV=netbackup,NB_ORA_CLIENT=http://blog.csdn.net/lixora';set until time "to_date('2014/11/11 14:00:00','yyyy/mm/dd hh24:mi:ss')";recover database skip forever tablespace SYSAUX,TEMP,USERS,INDEX_DATA;release channel ch0;release channel ch1;}EOF



--- Open the oracle database in resetlogs Mode
Alter database open resetlogs;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.