Oracle cancel-based Incomplete recovery

Source: Internet
Author: User
Experiment: Oracle cancel-based Incomplete recovery experiment environment viewing lsnrctlstatusselectopen_modefromv $ database; -- listener and database status show

Experiment: Oracle cancel-based Incomplete recovery experiment environment viewing lsnrctl statusselect open_mode from v $ database; -- listener and database status show

Experiment: Oracle cancel-based Incomplete recovery

View lab environment

Lsnrctl status
Select open_mode from v $ database;
-- Monitoring and database status

Show parameter recovery;
Select flashback_on from v $ database;
Archive log list;
-- Configuration of flash back and archive

1) Prepare the environment: RMAN full-Database Backup
RMAN> backup as compressed backupset full database;
-- Compression backup
-- Backup full database; backup set

Starting backup at 20-MAR-13
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 45 device type = DISK
Channel ORA_DISK_1: starting compressed full datafile backup set
Channel ORA_DISK_1: specifying datafile (s) in backup set
Input datafile file number = 00001 name =/u01/app/oracle/oradata/ORA11GR2/system01.dbf
Input datafile file number = 00002 name =/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf
Input datafile file number = 00003 name =/u01/app/oracle/oradata/ORA11GR2/undotbs01.dbf
Input datafile file number = 00005 name =/u01/app/oracle/oradata/ORA11GR2/example01.dbf
Input datafile file number = 00004 name =/u01/app/oracle/oradata/ORA11GR2/users01.dbf
Channel ORA_DISK_1: starting piece 1 at 20-MAR-13
Channel ORA_DISK_1: finished piece 1 at 20-MAR-13
Piece handle =/u01/app/FRA/ORA11GR2/backupset/2013_03_20/empty _. bkp tag = TAG20130320T151949 comment = NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:02:17
Channel ORA_DISK_1: starting compressed full datafile backup set
Channel ORA_DISK_1: specifying datafile (s) in backup set
Including current control file in backup set
Including current SPFILE in backup set
Channel ORA_DISK_1: starting piece 1 at 20-MAR-13
Channel ORA_DISK_1: finished piece 1 at 20-MAR-13
Piece handle =/u01/app/FRA/ORA11GR2/backupset/2013_03_20/o1_mf_ncsnf_TAG20130320T151949_8nlrx2qs _. bkp tag = TAG20130320T151949 comment
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20-MAR-13

2) create Test Data
SYS @ ORA11GR2> create table scott. t1 as select 1 as id from dual;

Table created.

SYS @ ORA11GR2> alter system archive log current;

System altered.

SYS @ ORA11GR2> create table scott. t2 as select 2 as id from dual;

Table created.

SYS @ ORA11GR2> alter system archive log current;

System altered.

SYS @ ORA11GR2> create table scott. t3 as select 3 as id from dual;

Table created.

SYS @ ORA11GR2> alter system archive log current;

System altered.

SYS @ ORA11GR2>
SYS @ ORA11GR2> select table_name, tablespace_name from dba_tables where owner = 'Scott 'AND table_name LIKE't _';

TABLE_NAME TABLESPACE_NAME
-------------------------------------------------------
T3 USERS
T2 USERS
T1 USERS

After constructing the test data, view the generated archive logs.
Ls/u01/app/oracle/fast_recovery_area/PROD/archivelog/2014_10_08
Ls-lrt


3) delete all data files and online data files

Delete in sqlplus:
SYS @ PROD> select name from v $ datafile;

NAME
--------------------
/U01/app/oracle/oradata/PROD/datafile/o1_mf_system_b2251bs1 _. dbf

/U01/app/oracle/oradata/PROD/datafile/o1_mf_sysaux_b2251bvo _. dbf

/U01/app/oracle/oradata/PROD/datafile/o1_mf_undotbs1_b2251bw5 _. dbf

/U01/app/oracle/oradata/PROD/datafile/o1_mf_users_b2251byw _. dbf

/U01/app/oracle/oradata/PROD/datafile/o1_mf_example_b2257d0c _. dbf

/U01/app/oracle/oradata/PROD/datafile/tbs_move_01.dbf

SYS @ PROD> select member from v $ logfile;

MEMBER
Certificate ----------------------------------------------------------------------------------------------------------------------------------
/U01/app/oracle/oradata/PROD/onlinelog/o1_mf_3_b22567o2 _. log
/U01/app/oracle/fast_recovery_area/PROD/onlinelog/o1_mf_3_b2256827 _. log
/U01/app/oracle/oradata/PROD/onlinelog/o1_mf_2_b2255zsg _. log
/U01/app/oracle/fast_recovery_area/PROD/onlinelog/o1_mf_2_b22560gb _. log
/U01/app/oracle/oradata/PROD/onlinelog/o1_mf_1_b2255npg _. log
/U01/app/oracle/fast_recovery_area/PROD/onlinelog/ow.mf_1_b2255nxl _. log


SYS @ PROD>! Rm/u01/app/oracle/oradata/PROD/datafile/*. dbf;

SYS @ PROD>! Rm/u01/app/oracle/oradata/PROD/onlinelog/*. log;

SYS @ PROD>! Rm/u01/app/oracle/fast_recovery_area/PROD/onlinelog/*. log;


Delete in OS:
[Oracle @ ocmu ORA11GR2] $ pwd
/U01/app/oracle/oradata/ORA11GR2
[Oracle @ ocmu ORA11GR2] $ ls
Control01.ctl example01.dbf redo02.log sysaux01.dbf temp01.dbf users01.dbf
Control02.ctl redo01.log redo03.log system01.dbf undotbs01.dbf
[Oracle @ ocmu ORA11GR2] $ rm *. log
[Oracle @ ocmu ORA11GR2] $ ls
Control01.ctl example01.dbf system01.dbf undotbs01.dbf
Control02.ctl sysaux01.dbf temp01.dbf users01.dbf
[Oracle @ ocmu ORA11GR2] $


4) Start the database to mount Mode
SYS @ ORA11GR2> shutdown abort;
ORACLE instance shut down.
SYS @ ORA11GR2> startup mount;
ORACLE instance started.

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.