How to use bbed to skip lost archives in Oracle

Source: Internet
Author: User
Tags commit log oracle database backup

If the required archive is lost during recover datafile, the recover cannot be made, and the bbed tool can skip the lost archive for recover datafile.

The experimental process is as follows:

Sys@orcl>select * from V$version;

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-prod

Pl/sql Release 10.2.0.1.0-production

CORE 10.2.0.1.0 Production

TNS for Linux:version 10.2.0.1.0-production

Nlsrtl Version 10.2.0.1.0-production

Sys@orcl>create tablespace Bbed_test_tbs

2 datafile '/u01/app/oracle/oradata/orcl/bbed_test_tbs01.dbf ' size 20M;

Tablespace created.

Sys@orcl>create table Bbed_test1 tablespace Bbed_test_tbs as SELECT * from Dba_objects;

Table created.

Sys@orcl>create table Bbed_test2 tablespace Bbed_test_tbs as SELECT * from Dba_objects;

Table created.

Sys@orcl>archive Log List

Database Log Mode Archive mode

Automatic Archival Enabled

Archive Destination Use_db_recovery_file_dest

Oldest online log sequence 2

Next Log sequence to archive 4

Current Log Sequence 4

Sys@orcl>select file#| | ' '|| name| | ' '|| bytes from V$datafile;

file#| | ' | | name| | ' | | BYTES

--------------------------------------------------------------------------------

1/U01/APP/ORACLE/ORADATA/ORCL/SYSTEM01.DBF 503316480

2/U01/APP/ORACLE/ORADATA/ORCL/UNDOTBS01.DBF 36700160

3/U01/APP/ORACLE/ORADATA/ORCL/SYSAUX01.DBF 262144000

4/U01/APP/ORACLE/ORADATA/ORCL/USERS01.DBF 5242880

5/U01/APP/ORACLE/ORADATA/ORCL/EXAMPLE01.DBF 104857600

6/U01/APP/ORACLE/ORADATA/ORCL/BBED_TEST_TBS01.DBF 20971520

6 rows selected.

Use Rman backup DataFile 6

[ORACLE@JP bbed]$ Rman Target/

Recovery manager:release 10.2.0.1.0-production on Thu June 19 21:33:16 2014

Copyright (c) 1982, +, Oracle. All rights reserved.

Connected to target DATABASE:ORCL (dbid=1356549586)

rman> backup datafile 6;

Starting backup at 19-jun-14

Using target database control file instead of recovery catalog

Allocated Channel:ora_disk_1

Channel ora_disk_1:sid=143 Devtype=disk

Channel ora_disk_1:starting full datafile backupset

Channel ora_disk_1:specifying DataFile (s) in Backupset

Input datafile fno=00006 name=/u01/app/oracle/oradata/orcl/bbed_test_tbs01.dbf

Channel ora_disk_1:starting piece 1 at 19-jun-14

Channel ora_disk_1:finished piece 1 at 19-jun-14

Piece handle=/u01/app/oracle/flash_recovery_area/orcl/backupset/2014_06_19/o1_mf_nnndf_tag20140619t213426_ 9T73X2S8_.BKP tag=tag20140619t213426 Comment=none

Channel Ora_disk_1:backup set complete, elapsed time:00:00:03

Finished backup at 19-jun-14

And then modify the data stored in DataFile 6 in the library.

Sys@orcl>delete from Bbed_test1;

50316 rows deleted.

sys@orcl>commit;

Commit complete.

Sys@orcl>alter system switch logfile;

System altered.

Sys@orcl>alter system switch logfile;

System altered.

Sys@orcl>alter system switch logfile;

System altered.

Then close the database delete datafile 6

Sys@orcl>shutdown Immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

[ORACLE@JP orcl]$ ls

BBED_TEST_TBS01.DBF control03.ctl redo02.log system01.dbf users01.dbf

Control01.ctl example01.dbf Redo03.log temp01.dbf

Control02.ctl Redo01.log sysaux01.dbf undotbs01.dbf

[ORACLE@JP orcl]$ MV bbed_test_tbs01.dbf Bbed_test_tbs01.dbf.bak

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.