rman增量备份及恢复的例子

SQL> !
[oracle@oracle ~]$ cd /oracle
[oracle@oracle oracle]$ ls
admin app flash_recovery_area oradata oraInventory
[oracle@oracle oracle]$ mkdir chtrace.f
[oracle@oracle oracle]$ pwd
/oracle
[oracle@oracle oracle]$ mv chtrace.f changetrace
[oracle@oracle oracle]$ ls -l
total 24
drwxr-x--- 3 oracle oinstall 4096 Nov 7 13:37 admin
drwxrwxr-x 3 oracle oinstall 4096 Nov 7 12:31 app
drwxr-xr-x 2 oracle oinstall 4096 Nov 26 08:27 changetrace
drwxr-x--- 3 oracle oinstall 4096 Nov 7 13:39 flash_recovery_area
drwxr-x--- 3 oracle oinstall 4096 Nov 7 13:37 oradata
drwxrwx--- 6 oracle oinstall 4096 Nov 7 13:33 oraInventory
[oracle@oracle oracle]$ cd chantrace
bash: cd: chantrace: No such file or directory
[oracle@oracle oracle]$ cd changetrace
[oracle@oracle changetrace]$ pwd
/oracle/changetrace
[oracle@oracle changetrace]$ exit
exit

SQL> alter database enable block change tracking using file '/oracle/changetrace/rman_change_track.f';

Database altered.

SQL> desc V$BLOCK_CHANGE_TRACKING
Name Null? Type
----------------------------------------- -------- ----------------------------
STATUS VARCHAR2(10)
FILENAME VARCHAR2(513)
BYTES NUMBER

SQL> select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING;

M STATUS
---------- ----------
FILENAME
--------------------------------------------------------------------------------
11.0625 ENABLED
/oracle/changetrace/rman_change_track.f


SQL> alter database disable block change tracking;

Database altered.

SQL> select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING;

M STATUS
---------- ----------
FILENAME
--------------------------------------------------------------------------------
DISABLED

SQL> alter database enable block change tracking using file '/oracle/changetrace/rman_change_track.f' reuse;

Database altered.

SQL> select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING;

M STATUS
---------- ----------
FILENAME
--------------------------------------------------------------------------------
11.0625 ENABLED
/oracle/changetrace/rman_change_track.f


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 26 08:36:20 2009

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

connected to target database: ORCL (DBID=1230089073)

RMAN> run {
2> allocate channel t1 type disk;
3> allocate channel t2 type disk;
4> BACKUP INCREMENTAL LEVEL 0 FILESPERSET 10 FORMAT 'full_orcl_%T_%s_%p' DATABASE;
5> sql 'alter system archive log current';
6> BACKUP FILESPERSET 10 MAXSETSIZE 10G FORMAT 'full_orcl_%Y%M%D_%s_%p' SKIP INACCESSIBLE
7> ARCHIVELOG ALL DELETE INPUT;
8> backup format 'spfile_orcl_%T_%t' spfile;
9> backup format 'controlfile_orcl_%T_%t' current controlfile;
10> release channel t1;
11> release channel t2;
12> }

using target database control file instead of recovery catalog
allocated channel: t1
channel t1: sid=153 devtype=DISK

allocated channel: t2
channel t2: sid=140 devtype=DISK

Starting backup at 26-NOV-09
channel t1: starting incremental level 0 datafile backupset
channel t1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/orcl/system01.dbf
input datafile fno=00004 name=/oracle/oradata/orcl/users01.dbf
channel t1: starting piece 1 at 26-NOV-09
channel t2: starting incremental level 0 datafile backupset
channel t2: specifying datafile(s) in backupset
input datafile fno=00003 name=/oracle/oradata/orcl/sysaux01.dbf
input datafile fno=00005 name=/oracle/oradata/orcl/example01.dbf
input datafile fno=00002 name=/oracle/oradata/orcl/undotbs01.dbf
channel t2: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_1_1 tag=TAG20091126T083631 comment=NONE
channel t1: backup set complete, elapsed time: 00:01:27
channel t1: starting incremental level 0 datafile backupset
channel t1: specifying datafile(s) in backupset
including current control file in backupset
channel t1: starting piece 1 at 26-NOV-09
channel t2: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_2_1 tag=TAG20091126T083631 comment=NONE
channel t2: backup set complete, elapsed time: 00:01:28
channel t2: starting incremental level 0 datafile backupset
channel t2: specifying datafile(s) in backupset
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_3_1 tag=TAG20091126T083631 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:03
including current SPFILE in backupset
channel t2: starting piece 1 at 26-NOV-09
channel t2: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_4_1 tag=TAG20091126T083631 comment=NONE
channel t2: backup set complete, elapsed time: 00:00:02
Finished backup at 26-NOV-09

sql statement: alter system archive log current

Starting backup at 26-NOV-09
current log archived
channel t1: starting archive log backupset
channel t1: specifying archive log(s) in backup set
input archive log thread=1 sequence=4 recid=1 stamp=703931892
channel t1: starting piece 1 at 26-NOV-09
channel t2: starting archive log backupset
channel t2: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=2 stamp=703931893
channel t2: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_5_1 tag=TAG20091126T083814 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:04
channel t1: deleting archive log(s)
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_4_5jvmhkth_.arc recid=1 stamp=703931892
channel t2: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_6_1 tag=TAG20091126T083814 comment=NONE
channel t2: backup set complete, elapsed time: 00:00:04
channel t2: deleting archive log(s)
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_5_5jvmhop6_.arc recid=2 stamp=703931893
Finished backup at 26-NOV-09

Starting backup at 26-NOV-09
channel t1: starting full datafile backupset
channel t1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel t1: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/spfile_orcl_20091126_703931905 tag=TAG20091126T083825 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:02
Finished backup at 26-NOV-09

Starting backup at 26-NOV-09
channel t1: starting full datafile backupset
channel t1: specifying datafile(s) in backupset
including current control file in backupset
channel t1: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/controlfile_orcl_20091126_703931907 tag=TAG20091126T083827 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:04
Finished backup at 26-NOV-09

released channel: t1

released channel: t2

RMAN> exit


Recovery Manager complete.
[oracle@oracle ~]$ cd /oracle/app/10.1/dbs
[oracle@oracle dbs]$ ls -l
total 646380
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:38 controlfile_orcl_20091126_703931907
-rw-r----- 1 oracle oinstall 372195328 Nov 26 08:37 full_orcl_20091126_1_1
-rw-r----- 1 oracle oinstall 249143296 Nov 26 08:37 full_orcl_20091126_2_1
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:38 full_orcl_20091126_3_1
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:38 full_orcl_20091126_4_1
-rw-r----- 1 oracle oinstall 18337280 Nov 26 08:38 full_orcl_20091126_5_1
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:38 full_orcl_20091126_6_1
-rw-rw---- 1 oracle oinstall 1544 Nov 7 13:37 hc_orcl.dat
-rw-r----- 1 oracle oinstall 12920 May 3 2001 initdw.ora
-rw-r----- 1 oracle oinstall 8385 Sep 11 1998 init.ora
-rw-rw---- 1 oracle oinstall 24 Nov 7 13:38 lkORCL
-rw-r----- 1 oracle oinstall 1536 Nov 25 22:51 orapworcl
-rw-r----- 1 oracle oinstall 7061504 Nov 26 08:38 snapcf_orcl.f
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:38 spfile_orcl_20091126_703931905
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:20 spfileorcl.ora
[oracle@oracle dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 26 08:40:43 2009

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING;

M STATUS
---------- ----------
FILENAME
--------------------------------------------------------------------------------
11.0625 ENABLED
/oracle/changetrace/rman_change_track.f


SQL> conn scott/tiger
Connected.
SQL> create table test (col int);

Table created.

SQL> insert into test values(1);

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> commit;

Commit complete.

SQL> select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING;
select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING
*
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> conn / as sysdba
Connected.
SQL> select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING;

M STATUS
---------- ----------
FILENAME
--------------------------------------------------------------------------------
11.0625 ENABLED
/oracle/changetrace/rman_change_track.f


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle dbs]$ date
Thu Nov 26 08:42:32 CST 2009
[oracle@oracle dbs]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 26 08:42:54 2009

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

connected to target database: ORCL (DBID=1230089073)

RMAN> run {
2> allocate channel t1 type disk;
3> allocate channel t2 type disk;
4> BACKUP INCREMENTAL LEVEL 1 FILESPERSET 10 FORMAT 'inc_orcl_%T_%s_%p' DATABASE;
5> sql 'alter system archive log current';
6> BACKUP FILESPERSET 10 MAXSETSIZE 10G FORMAT 'inc_orcl_%Y%M%D_%s_%p' SKIP INACCESSIBLE
7> ARCHIVELOG ALL DELETE INPUT;
8> backup format 'inc_spfile_orcl_%T_%t' spfile;
9> backup format 'inc_controlfile_orcl_%T_%t' current controlfile;
10> release channel t1;
11> release channel t2;
12> }

using target database control file instead of recovery catalog
allocated channel: t1
channel t1: sid=144 devtype=DISK

allocated channel: t2
channel t2: sid=139 devtype=DISK

Starting backup at 26-NOV-09
channel t1: starting incremental level 1 datafile backupset
channel t1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/orcl/system01.dbf
input datafile fno=00004 name=/oracle/oradata/orcl/users01.dbf
channel t1: starting piece 1 at 26-NOV-09
channel t2: starting incremental level 1 datafile backupset
channel t2: specifying datafile(s) in backupset
input datafile fno=00003 name=/oracle/oradata/orcl/sysaux01.dbf
input datafile fno=00005 name=/oracle/oradata/orcl/example01.dbf
input datafile fno=00002 name=/oracle/oradata/orcl/undotbs01.dbf
channel t2: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_orcl_20091126_9_1 tag=TAG20091126T084310 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:03
channel t1: starting incremental level 1 datafile backupset
channel t1: specifying datafile(s) in backupset
including current control file in backupset
channel t1: starting piece 1 at 26-NOV-09
channel t2: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_orcl_20091126_10_1 tag=TAG20091126T084310 comment=NONE
channel t2: backup set complete, elapsed time: 00:00:03
channel t2: starting incremental level 1 datafile backupset
channel t2: specifying datafile(s) in backupset
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_orcl_20091126_11_1 tag=TAG20091126T084310 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:01
including current SPFILE in backupset
channel t2: starting piece 1 at 26-NOV-09
channel t2: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_orcl_20091126_12_1 tag=TAG20091126T084310 comment=NONE
channel t2: backup set complete, elapsed time: 00:00:02
Finished backup at 26-NOV-09

sql statement: alter system archive log current

Starting backup at 26-NOV-09
current log archived
channel t1: starting archive log backupset
channel t1: specifying archive log(s) in backup set
input archive log thread=1 sequence=6 recid=3 stamp=703932198
channel t1: starting piece 1 at 26-NOV-09
channel t2: starting archive log backupset
channel t2: specifying archive log(s) in backup set
input archive log thread=1 sequence=7 recid=4 stamp=703932198
channel t2: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_orcl_20091126_13_1 tag=TAG20091126T084318 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:03
channel t1: deleting archive log(s)
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_6_5jvms690_.arc recid=3 stamp=703932198
channel t2: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_orcl_20091126_14_1 tag=TAG20091126T084318 comment=NONE
channel t2: backup set complete, elapsed time: 00:00:02
channel t2: deleting archive log(s)
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_7_5jvms6kp_.arc recid=4 stamp=703932198
Finished backup at 26-NOV-09

Starting backup at 26-NOV-09
channel t1: starting full datafile backupset
channel t1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel t1: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_spfile_orcl_20091126_703932202 tag=TAG20091126T084322 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-NOV-09

Starting backup at 26-NOV-09
channel t1: starting full datafile backupset
channel t1: specifying datafile(s) in backupset
including current control file in backupset
channel t1: starting piece 1 at 26-NOV-09
channel t1: finished piece 1 at 26-NOV-09
piece handle=/oracle/app/10.1/dbs/inc_controlfile_orcl_20091126_703932203 tag=TAG20091126T084323 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:02
Finished backup at 26-NOV-09

released channel: t1

released channel: t2

RMAN> exit


Recovery Manager complete.
[oracle@oracle dbs]$ ls -l
total 661316
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:38 controlfile_orcl_20091126_703931907
-rw-r----- 1 oracle oinstall 372195328 Nov 26 08:37 full_orcl_20091126_1_1
-rw-r----- 1 oracle oinstall 249143296 Nov 26 08:37 full_orcl_20091126_2_1
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:38 full_orcl_20091126_3_1
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:38 full_orcl_20091126_4_1
-rw-r----- 1 oracle oinstall 18337280 Nov 26 08:38 full_orcl_20091126_5_1
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:38 full_orcl_20091126_6_1
-rw-rw---- 1 oracle oinstall 1544 Nov 7 13:37 hc_orcl.dat
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:43 inc_controlfile_orcl_20091126_703932203
-rw-r----- 1 oracle oinstall 466944 Nov 26 08:43 inc_orcl_20091126_10_1
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:43 inc_orcl_20091126_11_1
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:43 inc_orcl_20091126_12_1
-rw-r----- 1 oracle oinstall 88576 Nov 26 08:43 inc_orcl_20091126_13_1
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:43 inc_orcl_20091126_14_1
-rw-r----- 1 oracle oinstall 270336 Nov 26 08:43 inc_orcl_20091126_9_1
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:43 inc_spfile_orcl_20091126_703932202
-rw-r----- 1 oracle oinstall 12920 May 3 2001 initdw.ora
-rw-r----- 1 oracle oinstall 8385 Sep 11 1998 init.ora
-rw-rw---- 1 oracle oinstall 24 Nov 7 13:38 lkORCL
-rw-r----- 1 oracle oinstall 1536 Nov 25 22:51 orapworcl
-rw-r----- 1 oracle oinstall 7061504 Nov 26 08:43 snapcf_orcl.f
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:38 spfile_orcl_20091126_703931905
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:20 spfileorcl.ora
[oracle@oracle dbs]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 26 08:44:39 2009

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

connected to target database: ORCL (DBID=1230089073)

RMAN> list backup
2> ;

using target database control file instead of recovery catalog

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Incr 0 237.59M DISK 00:01:22 26-NOV-09
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_2_1
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 0 Incr 534268 26-NOV-09 /oracle/oradata/orcl/undotbs01.dbf
3 0 Incr 534268 26-NOV-09 /oracle/oradata/orcl/sysaux01.dbf
5 0 Incr 534268 26-NOV-09 /oracle/oradata/orcl/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Incr 0 354.95M DISK 00:01:25 26-NOV-09
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_1_1
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 534266 26-NOV-09 /oracle/oradata/orcl/system01.dbf
4 0 Incr 534266 26-NOV-09 /oracle/oradata/orcl/users01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Incr 0 6.77M DISK 00:00:02 26-NOV-09
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_3_1
Control File Included: Ckp SCN: 534300 Ckp time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Incr 0 80.00K DISK 00:00:01 26-NOV-09
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_4_1
SPFILE Included: Modification time: 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
5 2.00K DISK 00:00:02 26-NOV-09
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083814
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_6_1

List of Archived Logs in backup set 5
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 5 534312 26-NOV-09 534317 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6 17.49M DISK 00:00:03 26-NOV-09
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083814
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_5_1

List of Archived Logs in backup set 6
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 4 527435 25-NOV-09 534312 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7 Full 80.00K DISK 00:00:01 26-NOV-09
BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083825
Piece Name: /oracle/app/10.1/dbs/spfile_orcl_20091126_703931905
SPFILE Included: Modification time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8 Full 6.77M DISK 00:00:02 26-NOV-09
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083827
Piece Name: /oracle/app/10.1/dbs/controlfile_orcl_20091126_703931907
Control File Included: Ckp SCN: 534333 Ckp time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9 Incr 1 256.00K DISK 00:00:01 26-NOV-09
BP Key: 9 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_9_1
List of Datafiles in backup set 9
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 534508 26-NOV-09 /oracle/oradata/orcl/system01.dbf
4 1 Incr 534508 26-NOV-09 /oracle/oradata/orcl/users01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10 Incr 1 448.00K DISK 00:00:02 26-NOV-09
BP Key: 10 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_10_1
List of Datafiles in backup set 10
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 1 Incr 534509 26-NOV-09 /oracle/oradata/orcl/undotbs01.dbf
3 1 Incr 534509 26-NOV-09 /oracle/oradata/orcl/sysaux01.dbf
5 1 Incr 534509 26-NOV-09 /oracle/oradata/orcl/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
11 Incr 1 6.77M DISK 00:00:01 26-NOV-09
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_11_1
Control File Included: Ckp SCN: 534510 Ckp time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12 Incr 1 80.00K DISK 00:00:01 26-NOV-09
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_12_1
SPFILE Included: Modification time: 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
13 86.00K DISK 00:00:02 26-NOV-09
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084318
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_13_1

List of Archived Logs in backup set 13
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 6 534317 26-NOV-09 534523 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
14 2.00K DISK 00:00:01 26-NOV-09
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084318
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_14_1

List of Archived Logs in backup set 14
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 7 534523 26-NOV-09 534528 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15 Full 80.00K DISK 00:00:00 26-NOV-09
BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084322
Piece Name: /oracle/app/10.1/dbs/inc_spfile_orcl_20091126_703932202
SPFILE Included: Modification time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
16 Full 6.77M DISK 00:00:01 26-NOV-09
BP Key: 16 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084323
Piece Name: /oracle/app/10.1/dbs/inc_controlfile_orcl_20091126_703932203
Control File Included: Ckp SCN: 534543 Ckp time: 26-NOV-09

RMAN> list backuppiece;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "double-quoted-string, integer, single-quoted-string, tag"
RMAN-01007: at line 1 column 17 file: standard input

RMAN> list backupset;


List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Incr 0 237.59M DISK 00:01:22 26-NOV-09
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_2_1
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 0 Incr 534268 26-NOV-09 /oracle/oradata/orcl/undotbs01.dbf
3 0 Incr 534268 26-NOV-09 /oracle/oradata/orcl/sysaux01.dbf
5 0 Incr 534268 26-NOV-09 /oracle/oradata/orcl/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Incr 0 354.95M DISK 00:01:25 26-NOV-09
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_1_1
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 534266 26-NOV-09 /oracle/oradata/orcl/system01.dbf
4 0 Incr 534266 26-NOV-09 /oracle/oradata/orcl/users01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Incr 0 6.77M DISK 00:00:02 26-NOV-09
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_3_1
Control File Included: Ckp SCN: 534300 Ckp time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Incr 0 80.00K DISK 00:00:01 26-NOV-09
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083631
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_4_1
SPFILE Included: Modification time: 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
5 2.00K DISK 00:00:02 26-NOV-09
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083814
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_6_1

List of Archived Logs in backup set 5
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 5 534312 26-NOV-09 534317 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6 17.49M DISK 00:00:03 26-NOV-09
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083814
Piece Name: /oracle/app/10.1/dbs/full_orcl_20091126_5_1

List of Archived Logs in backup set 6
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 4 527435 25-NOV-09 534312 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
7 Full 80.00K DISK 00:00:01 26-NOV-09
BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083825
Piece Name: /oracle/app/10.1/dbs/spfile_orcl_20091126_703931905
SPFILE Included: Modification time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8 Full 6.77M DISK 00:00:02 26-NOV-09
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: TAG20091126T083827
Piece Name: /oracle/app/10.1/dbs/controlfile_orcl_20091126_703931907
Control File Included: Ckp SCN: 534333 Ckp time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9 Incr 1 256.00K DISK 00:00:01 26-NOV-09
BP Key: 9 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_9_1
List of Datafiles in backup set 9
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 1 Incr 534508 26-NOV-09 /oracle/oradata/orcl/system01.dbf
4 1 Incr 534508 26-NOV-09 /oracle/oradata/orcl/users01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10 Incr 1 448.00K DISK 00:00:02 26-NOV-09
BP Key: 10 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_10_1
List of Datafiles in backup set 10
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 1 Incr 534509 26-NOV-09 /oracle/oradata/orcl/undotbs01.dbf
3 1 Incr 534509 26-NOV-09 /oracle/oradata/orcl/sysaux01.dbf
5 1 Incr 534509 26-NOV-09 /oracle/oradata/orcl/example01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
11 Incr 1 6.77M DISK 00:00:01 26-NOV-09
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_11_1
Control File Included: Ckp SCN: 534510 Ckp time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12 Incr 1 80.00K DISK 00:00:01 26-NOV-09
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084310
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_12_1
SPFILE Included: Modification time: 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
13 86.00K DISK 00:00:02 26-NOV-09
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084318
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_13_1

List of Archived Logs in backup set 13
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 6 534317 26-NOV-09 534523 26-NOV-09

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
14 2.00K DISK 00:00:01 26-NOV-09
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084318
Piece Name: /oracle/app/10.1/dbs/inc_orcl_20091126_14_1

List of Archived Logs in backup set 14
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 7 534523 26-NOV-09 534528 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15 Full 80.00K DISK 00:00:00 26-NOV-09
BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084322
Piece Name: /oracle/app/10.1/dbs/inc_spfile_orcl_20091126_703932202
SPFILE Included: Modification time: 26-NOV-09

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
16 Full 6.77M DISK 00:00:01 26-NOV-09
BP Key: 16 Status: AVAILABLE Compressed: NO Tag: TAG20091126T084323
Piece Name: /oracle/app/10.1/dbs/inc_controlfile_orcl_20091126_703932203
Control File Included: Ckp SCN: 534543 Ckp time: 26-NOV-09

RMAN> exit


Recovery Manager complete.
[oracle@oracle dbs]$ sqlplus scott/tiger

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 26 08:49:14 2009

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select * from test;

COL
----------
1
1
1
1
1

SQL> delete from test;

5 rows deleted.

SQL> commit;

Commit complete.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle dbs]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 26 08:49:44 2009

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

connected to target database: ORCL (DBID=1230089073)

RMAN> run {
2> allocate channel t1 type disk;
3> allocate channel t2 type disk;
4> sql 'alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';
5> sql 'alter session set NLS_LANGUAGE=American';
6> set until time='2009-11-26 08:42:30';
7> restore database;
8> recover database;
9> sql 'alter database open resetlogs';
10> release channel t1;
11> release channel t2;
12> }

using target database control file instead of recovery catalog
allocated channel: t1
channel t1: sid=147 devtype=DISK

allocated channel: t2
channel t2: sid=144 devtype=DISK

sql statement: alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"

sql statement: alter session set NLS_LANGUAGE=American

executing command: SET until clause

Starting restore at 26-NOV-09

channel t1: starting datafile backupset restore
channel t1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /oracle/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /oracle/oradata/orcl/sysaux01.dbf
restoring datafile 00005 to /oracle/oradata/orcl/example01.dbf
channel t1: reading from backup piece /oracle/app/10.1/dbs/full_orcl_20091126_2_1
channel t2: starting datafile backupset restore
channel t2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oracle/oradata/orcl/system01.dbf
restoring datafile 00004 to /oracle/oradata/orcl/users01.dbf
channel t2: reading from backup piece /oracle/app/10.1/dbs/full_orcl_20091126_1_1
released channel: t1
released channel: t2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/26/2009 08:50:10
ORA-19870: error reading backup piece /oracle/app/10.1/dbs/full_orcl_20091126_2_1
ORA-19573: cannot obtain exclusive enqueue for datafile 3

RMAN> exit


Recovery Manager complete.
[oracle@oracle dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 26 08:50:32 2009

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218292 bytes
Variable Size 79694092 bytes
Database Buffers 79691776 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle dbs]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Nov 26 08:51:42 2009

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

connected to target database: ORCL (DBID=1230089073, not open)

RMAN> run {
2> allocate channel t1 type disk;
3> allocate channel t2 type disk;
4> sql 'alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';
5> sql 'alter session set NLS_LANGUAGE=American';
6> set until time='2009-11-26 08:42:30';
7> restore database;
8> recover database;
9> sql 'alter database open resetlogs';
10> release channel t1;
11> release channel t2;
12> }

using target database control file instead of recovery catalog
allocated channel: t1
channel t1: sid=156 devtype=DISK

allocated channel: t2
channel t2: sid=155 devtype=DISK

sql statement: alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"

sql statement: alter session set NLS_LANGUAGE=American

executing command: SET until clause

Starting restore at 26-NOV-09

channel t1: starting datafile backupset restore
channel t1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /oracle/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /oracle/oradata/orcl/sysaux01.dbf
restoring datafile 00005 to /oracle/oradata/orcl/example01.dbf
channel t1: reading from backup piece /oracle/app/10.1/dbs/full_orcl_20091126_2_1
channel t2: starting datafile backupset restore
channel t2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oracle/oradata/orcl/system01.dbf
restoring datafile 00004 to /oracle/oradata/orcl/users01.dbf
channel t2: reading from backup piece /oracle/app/10.1/dbs/full_orcl_20091126_1_1
channel t1: restored backup piece 1
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_2_1 tag=TAG20091126T083631
channel t1: restore complete, elapsed time: 00:01:15
channel t2: restored backup piece 1
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_1_1 tag=TAG20091126T083631
channel t2: restore complete, elapsed time: 00:01:16
Finished restore at 26-NOV-09

Starting recover at 26-NOV-09

starting media recovery

channel t2: starting archive log restore to default destination
channel t2: restoring archive log
archive log thread=1 sequence=4
channel t2: reading from backup piece /oracle/app/10.1/dbs/full_orcl_20091126_5_1
channel t1: starting archive log restore to default destination
channel t1: restoring archive log
archive log thread=1 sequence=5
channel t1: reading from backup piece /oracle/app/10.1/dbs/full_orcl_20091126_6_1
channel t1: restored backup piece 1
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_6_1 tag=TAG20091126T083814
channel t1: restore complete, elapsed time: 00:00:01
channel t2: restored backup piece 1
piece handle=/oracle/app/10.1/dbs/full_orcl_20091126_5_1 tag=TAG20091126T083814
channel t2: restore complete, elapsed time: 00:00:02
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_4_5jvncv2o_.arc thread=1 sequence=4
channel default: deleting archive log(s)
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_4_5jvncv2o_.arc recid=6 stamp=703932796
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_5_5jvncv0y_.arc thread=1 sequence=5
channel default: deleting archive log(s)
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_5_5jvncv0y_.arc recid=5 stamp=703932795
media recovery complete, elapsed time: 00:00:04
channel t1: starting archive log restore to default destination
channel t1: restoring archive log
archive log thread=1 sequence=6
channel t1: reading from backup piece /oracle/app/10.1/dbs/inc_orcl_20091126_13_1
channel t1: restored backup piece 1
piece handle=/oracle/app/10.1/dbs/inc_orcl_20091126_13_1 tag=TAG20091126T084318
channel t1: restore complete, elapsed time: 00:00:02
channel default: deleting archive log(s)
archive log filename=/oracle/flash_recovery_area/ORCL/archivelog/2009_11_26/o1_mf_1_6_5jvnd18v_.arc recid=7 stamp=703932801
Finished recover at 26-NOV-09

sql statement: alter database open resetlogs

released channel: t1

released channel: t2

RMAN> exit


Recovery Manager complete.
[oracle@oracle dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 26 08:54:30 2009

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> conn scott/tiger
Connected.
SQL> select * from test;

COL
----------
1
1
1
1
1

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle dbs]$ ls -l
total 661316
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:38 controlfile_orcl_20091126_703931907
-rw-r----- 1 oracle oinstall 372195328 Nov 26 08:37 full_orcl_20091126_1_1
-rw-r----- 1 oracle oinstall 249143296 Nov 26 08:37 full_orcl_20091126_2_1
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:38 full_orcl_20091126_3_1
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:38 full_orcl_20091126_4_1
-rw-r----- 1 oracle oinstall 18337280 Nov 26 08:38 full_orcl_20091126_5_1
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:38 full_orcl_20091126_6_1
-rw-rw---- 1 oracle oinstall 1544 Nov 7 13:37 hc_orcl.dat
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:43 inc_controlfile_orcl_20091126_703932203
-rw-r----- 1 oracle oinstall 466944 Nov 26 08:43 inc_orcl_20091126_10_1
-rw-r----- 1 oracle oinstall 7110656 Nov 26 08:43 inc_orcl_20091126_11_1
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:43 inc_orcl_20091126_12_1
-rw-r----- 1 oracle oinstall 88576 Nov 26 08:43 inc_orcl_20091126_13_1
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:43 inc_orcl_20091126_14_1
-rw-r----- 1 oracle oinstall 270336 Nov 26 08:43 inc_orcl_20091126_9_1
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:43 inc_spfile_orcl_20091126_703932202
-rw-r----- 1 oracle oinstall 12920 May 3 2001 initdw.ora
-rw-r----- 1 oracle oinstall 8385 Sep 11 1998 init.ora
-rw-rw---- 1 oracle oinstall 24 Nov 7 13:38 lkORCL
-rw-r----- 1 oracle oinstall 1536 Nov 25 22:51 orapworcl
-rw-r----- 1 oracle oinstall 7061504 Nov 26 08:43 snapcf_orcl.f
-rw-r----- 1 oracle oinstall 98304 Nov 26 08:38 spfile_orcl_20091126_703931905
-rw-r----- 1 oracle oinstall 2560 Nov 26 08:51 spfileorcl.ora
[oracle@oracle dbs]$ exit
logout
[root@oracle ~]# exit
logout

[@more@]

fullbackup的脚本

run {
allocate channel t1 type disk;
allocate channel t2 type disk;
BACKUP INCREMENTAL LEVEL 0 FILESPERSET 10 FORMAT 'full_orcl_%T_%s_%p' DATABASE;
sql 'alter system archive log current';
BACKUP FILESPERSET 10 MAXSETSIZE 10G FORMAT 'full_orcl_%Y%M%D_%s_%p' SKIP INACCESSIBLE
ARCHIVELOG ALL DELETE INPUT;
backup format 'full_spfile_orcl_%T_%t' spfile;
backup format 'full_controlfile_orcl_%T_%t' current controlfile;
release channel t1;
release channel t2;
}

××××××××××××××××××××××××××××××××××××××××××××××

增量备份的脚本

run {
allocate channel t1 type disk;
allocate channel t2 type disk;
BACKUP INCREMENTAL LEVEL 1 FILESPERSET 10 FORMAT 'inc_orcl_%T_%s_%p' DATABASE;
sql 'alter system archive log current';
BACKUP FILESPERSET 10 MAXSETSIZE 10G FORMAT 'inc_orcl_%Y%M%D_%s_%p' SKIP INACCESSIBLE
ARCHIVELOG ALL DELETE INPUT;
backup format 'inc_spfile_orcl_%T_%t' spfile;
backup format 'inc_controlfile_orcl_%T_%t' current controlfile;
release channel t1;
release channel t2;
}

×××××××××××××××××××××××××××××××××××××××××××××

时间点恢复的脚本

run {
allocate channel t1 type disk;
allocate channel t2 type disk;
sql 'alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';
sql 'alter session set NLS_LANGUAGE=American';
set until time='2009-11-26 08:42:30';
restore database;
recover database;
sql 'alter database open resetlogs';
release channel t1;
release channel t2;
}

××××××××××××××××××××××××××××××××××××××××

启用关闭block change tracking的相关命令

--启用block change trace
alter database enable block change tracking using file '/oracle/changetrace/rman_change_track.f';

--查看当前的数据库是否启用了change trace
select bytes/1024/1024 m,status,filename from V$BLOCK_CHANGE_TRACKING;

--禁用change trace
alter database disable block change tracking;

--重用已存在的change trace
alter database enable block change tracking using file '/oracle/changetrace/rman_change_track.f' reuse;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22049049/viewspace-1029099/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22049049/viewspace-1029099/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值