rman 随便看看备份-程序员宅基地

技术标签: 操作系统  数据库  

SQL> conn / as sysdba
Connected.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 21
Next log sequence to archive 23
Current log sequence 23
SQL> startup mount force
ORACLE instance started.

Total System Global Area 184549376 bytes
Fixed Size 1218412 bytes
Variable Size 79693972 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL>
--怎么监控 备份的速率呢???
RMAN> backup as compressed backupset database;

Starting backup at 21-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnndf_TAG20111021T190507_7b2nh4s7_.bkp tag=TAG20111021T190507 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:06
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsnf_TAG20111021T190507_7b2nm5bm_.bkp tag=TAG20111021T190507 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
Finished backup at 21-OCT-11

RMAN> alter database open;
database opened
RMAN>
---------------------- 特定路径
RMAN> run{
2> allocate channel c1 device type disk format '/export/home/oracle/db_%U';
3> backup as compressed backupset database;
4> backup current controlfile;
5> }
allocated channel: c1
channel c1: sid=157 devtype=DISK
Starting backup at 21-OCT-11
channel c1: starting compressed full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel c1: starting piece 1 at 21-OCT-11
channel c1: finished piece 1 at 21-OCT-11
piece handle=/export/home/oracle/db_09mpm9go_1_1 tag=TAG20111021T193552 comment=NONE
channel c1: backup set complete, elapsed time: 00:03:46
channel c1: starting compressed full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 21-OCT-11
channel c1: finished piece 1 at 21-OCT-11
piece handle=/export/home/oracle/db_0ampm9nq_1_1 tag=TAG20111021T193552 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:07
Finished backup at 21-OCT-11

Starting backup at 21-OCT-11
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 21-OCT-11
channel c1: finished piece 1 at 21-OCT-11
piece handle=/export/home/oracle/db_0bmpm9o3_1_1 tag=TAG20111021T193947 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 21-OCT-11
released channel: c1

RMAN>
---这个备份 并没备份到D盘 搞错了 是lINUX
---标记tag 时间 duration 备份大小 maxsetsize 保存策略
backup tag='test' duration 00:02 maxsetsize 700M database
RMAN> backup tag='test' duration 00:02 maxsetsize 700M database;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/21/2011 19:50:23
ORA-19591: backup aborted because job time exceeded duration time

RMAN>
--10g 有这个参数 以前的 要注意
backup database keep until time ='sysdate+10'
RMAN> backup database keep until time ='sysdate+10' logs;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
backup will be obsolete on date 31-OCT-11
archived logs required to recover from this backup will expire when this backup expires
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/21/2011 20:09:49
ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 10/21/2011 20:09:51
ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes
--本实验失败
-- keep forever; keep until time ='sysdate+10'
-- validate
RMAN> backup validate database ;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 21-OCT-11

RMAN> list backup;
RMAN>
--没有真正的备份数据库

-- skip readonly skip offline skipp inaccessible
-- backup database force
backup validate database keep until time='sysdate+10';
--只备份新加的
backup database not backed up;
RMAN> backup database not backed up;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnndf_TAG20111021T201651_7b2ronbf_.bkp tag=TAG20111021T201651 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05

channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsnf_TAG20111021T201651_7b2rqsdj_.bkp tag=TAG20111021T201651 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 21-OCT-11
--备份特定时间内美哟备份的文件
backup database not backed up since time='sysdate-2';
RMAN> backup database not backed up since time='sysdate-2';

Starting backup at 21-OCT-11
using channel ORA_DISK_1
skipping datafile 1; already backed up on 21-OCT-11
skipping datafile 2; already backed up on 21-OCT-11
skipping datafile 3; already backed up on 21-OCT-11
skipping datafile 4; already backed up on 21-OCT-11
Finished backup at 21-OCT-11
---------------------以上都是脱机备份
----------------------下面联机备份
backup archivelog all delete input;
backup archivelog from sequence 11 delete input;
backup archivelog all delete input until time 'sysdate-1';
RMAN> backup archivelog all delete input;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=13 recid=1 stamp=764429562
input archive log thread=1 sequence=14 recid=2 stamp=764429563
input archive log thread=1 sequence=15 recid=3 stamp=764429567
input archive log thread=1 sequence=16 recid=4 stamp=764429738
input archive log thread=1 sequence=17 recid=5 stamp=764445613
input archive log thread=1 sequence=18 recid=6 stamp=764447490
input archive log thread=1 sequence=19 recid=7 stamp=764719188
input archive log thread=1 sequence=20 recid=8 stamp=764719928
input archive log thread=1 sequence=21 recid=9 stamp=764795225
input archive log thread=1 sequence=22 recid=10 stamp=764809621
input archive log thread=1 sequence=23 recid=11 stamp=765140867
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_annnn_TAG20111021T202441_7b2s4cq4_.bkp tag=TAG20111021T202441 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_13/o1_mf_1_13_79dxzt8m_.arc recid=1 stamp=764429562
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_13/o1_mf_1_14_79dxzv25_.arc recid=2 stamp=764429563
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_13/o1_mf_1_15_79dxzzos_.arc recid=3 stamp=764429567
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_13/o1_mf_1_16_79dy57v8_.arc recid=4 stamp=764429738
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_13/o1_mf_1_17_79ffo4r0_.arc recid=5 stamp=764445613
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_13/o1_mf_1_18_79fhj1th_.arc recid=6 stamp=764447490
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_16/o1_mf_1_19_79ortm16_.arc recid=7 stamp=764719188
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_16/o1_mf_1_20_79oskrto_.arc recid=8 stamp=764719928
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_17/o1_mf_1_21_79r32rbc_.arc recid=9 stamp=764795225
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_17/o1_mf_1_22_79rk4nl3_.arc recid=10 stamp=764809621
archive log filename=/u01/app/oracle/flash_recovery_area/TEST/archivelog/2011_10_21/o1_mf_1_23_7b2nn2x3_.arc recid=11 stamp=765140867
Finished backup at 21-OCT-11
---备份级备份


RMAN> backup backupset all;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
input backupset count=17 stamp=765145012 creation_time=21-OCT-11
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: backup piece /u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnndf_TAG20111021T201651_7b2ronbf_.bkp
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnndf_TAG20111021T201651_7b2skstl_.bkp comment=NONE
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
input backupset count=18 stamp=765145077 creation_time=21-OCT-11
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: backup piece /u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsnf_TAG20111021T201651_7b2rqsdj_.bkp
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsnf_TAG20111021T201651_7b2smkqd_.bkp comment=NONE
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
input backupset count=19 stamp=765145482 creation_time=21-OCT-11
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: backup piece /u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_annnn_TAG20111021T202441_7b2s4cq4_.bkp
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_annnn_TAG20111021T202441_7b2smnkt_.bkp comment=NONE
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 21-OCT-11
-- 差异备份...
backup incremental level=1 database;
RMAN> backup incremental level=1 database;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnnd1_TAG20111021T203537_7b2srt76_.bkp tag=TAG20111021T203537 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsn1_TAG20111021T203537_7b2stych_.bkp tag=TAG20111021T203537 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 21-OCT-11

--
backup incremental level=2 cumulative database;
RMAN> backup incremental level=2 cumulative database;

Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 2 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
skipping datafile 00001 because it has not changed
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
skipping datafile 00004 because it has not changed
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
skipping datafile 00003 because it has not changed
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
skipping datafile 00002 because it has not changed
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting incremental level 2 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsn2_TAG20111021T204022_7b2t1rnr_.bkp tag=TAG20111021T204022 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 21-OCT-11

--增量的更新备份, script
run{
recover copy of database with tag 'test_incr';
backup incremental level 1 for recover of copy with tag 'test_incr' database;
}
-------------------------------------------------------------------------------------------
RMAN> run{
2> recover copy of database with tag 'test_incr';
3> backup incremental level 1 for recover of copy with tag 'test_incr' database;
4> }
Starting recover at 21-OCT-11
using channel ORA_DISK_1
no copy of datafile 1 found to recover
no copy of datafile 2 found to recover
no copy of datafile 3 found to recover
no copy of datafile 4 found to recover
Finished recover at 21-OCT-11
Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
skipping datafile 00001 because it has not changed
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
skipping datafile 00004 because it has not changed
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
skipping datafile 00003 because it has not changed
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
skipping datafile 00002 because it has not changed
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsn1_TAG20111021T205024_7b2tnl94_.bkp tag=TAG20111021T205024 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 21-OCT-11
--以上什么备份 都木有的时候
backup database;
RMAN> backup database;
Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnndf_TAG20111021T205108_7b2toxfy_.bkp tag=TAG20111021T205108 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsnf_TAG20111021T205108_7b2tqqg4_.bkp tag=TAG20111021T205108 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
Finished backup at 21-OCT-11
RMAN> backup copy of database;
Stating backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: including datafile copy of datafile 00001 in backupset
input filename=/u01/app/oracle/flash_recovery_area/TEST/datafile/o1_mf_system_7b2t9tx8_.dbf
channel ORA_DISK_1: including datafile copy of datafile 00004 in backupset
input filename=/u01/app/oracle/flash_recovery_area/TEST/datafile/o1_mf_users_7b2tc04r_.dbf
channel ORA_DISK_1: including datafile copy of datafile 00003 in backupset
input filename=/u01/app/oracle/flash_recovery_area/TEST/datafile/o1_mf_sysaux_7b2td1lz_.dbf
channel ORA_DISK_1: including datafile copy of datafile 00002 in backupset
input filename=/u01/app/oracle/flash_recovery_area/TEST/datafile/o1_mf_undotbs1_7b2tdjvn_.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnndf__7b2tt832_.bkp comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:06
Finished backup at 21-OCT-11
RMAN> run{
2> recover copy of database with tag 'test_incr';
3> backup incremental level 1 for recover of copy with tag 'test_incr' database;
4> }
Starting recover at 21-OCT-11
using channel ORA_DISK_1
no copy of datafile 1 found to recover
no copy of datafile 2 found to recover
no copy of datafile 3 found to recover
no copy of datafile 4 found to recover
Finished recover at 21-OCT-11
Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
skipping datafile 00001 because it has not changed
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
skipping datafile 00004 because it has not changed
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
skipping datafile 00003 because it has not changed
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
skipping datafile 00002 because it has not changed
channel ORA_DISK_1: backup cancelled because all files were skipped
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsn1_TAG20111021T205508_7b2txjk0_.bkp tag=TAG20111021T205508 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
Finished backup at 21-OCT-11
RMAN>
--增量备份
---------------------------------------------------------------------------------------------
--基本备份
--backup incremental level=0 database;
RMAN> backup incremental level=0 database;
Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_nnnd0_TAG20111021T205624_7b2tzsgh_.bkp tag=TAG20111021T205624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 21-OCT-11
channel ORA_DISK_1: finished piece 1 at 21-OCT-11
piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2011_10_21/o1_mf_ncsn0_TAG20111021T205624_7b2v1moh_.bkp tag=TAG20111021T205624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
Finished backup at 21-OCT-11
-----------------------文件跟踪---------------------------------------------------------------
alter database enable block change tracking using file '/u01/app/oracle/test.fill'
SQL> alter database enable block change tracking using file '/u01/app/oracle/test.fill'
2 ;
Database altered.
SQL>
select status from v$block_change_tracking
SQL> select status from v$block_change_tracking;
STATUS
-------
ENABLED
--backup validate check logical database;
RMAN> backup validate check logical database;
Starting backup at 21-OCT-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 21-OCT-11
--backup database not backed up since time='sysdate-2';
RMAN> backup database not backed up since time='sysdate-2';
Starting backup at 21-OCT-11
using channel ORA_DISK_1
skipping datafile 1; already backed up on 21-OCT-11
skipping datafile 2; already backed up on 21-OCT-11
skipping datafile 3; already backed up on 21-OCT-11
skipping datafile 4; already backed up on 21-OCT-11
Finished backup at 21-OCT-11
RMAN>
--===============================================================
Oracle backup常用命令总结备忘-----------------------------------

1.设置备份标记
backup database tag='full_bak1';
注:每个标记必须唯一,相同的标记可以用于多个备份只还原最新的备份。

2.设置备份集大小(一次备份的所有结果为一个备份集,要注意备份集大小)
backup database maxsetsize=100m tag='datafile1';
注:maxsetsize限定备份集的大小。所以必须大于数据库总数据文件的大小,否则会报错。

RMAN-06183: datafile or datafile copy larger than MAXSETSIZE: file# 1 /data/oradata/system01.dbf

3.设置备份片大小(磁带或文件系统限制)
run {
allocate channel c1 type disk maxpicecsize 100m format '/data/backup/full_0_%U_%T';
backup database tag='full_0'; release channel c1;
}

Oracle backup常用命令总结备忘可以在allocate子句中设定每个备份片的大小,以达到磁带或系统限制。
也可以在configure中设置备份片大小。

Configure channel device type disk maxpiecesize 100 m;
configure channel device type disk clear;

4.备份集的保存策略

backup database keep forever; --永久保留备份文件
backup database keep until time='sysdate+30'; --保存备份30天 --这个始终不成功

5.重写configure exclude命令
backup databas noexclude keep forever tag='test backup'; --这个始终不成功

6.检查数据库错误
backup validate database;

使用RMAN来扫描数据库的物理/逻辑错误,并不执行实际备份。

7.跳过脱机,不可存取或只读文件
backup database skip readonly; --可以
backup database skip offline;
backup database skip inaccessible;
backup database ship readonly skip offline ship inaccessible;

8.强制备份
backup database force; 9.基于上次备份时间备份数据文件

1>只备份添加的新数据文件
backup database not backed up;
2>备份"在限定时间周期内"没有被备份的数据文件
backup database not backed up since time='sysdate-2';

10.Oracle backup常用命令总结备忘中备份操作期间检查逻辑错误
backup check logical database;
backup validate check logical database;

11.生成备份副本
backup database copies=2;

12.备份控制文件
backup database device type disk includ current controlfile;

[@more@]

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

转载于:http://blog.itpub.net/9879835/viewspace-1055865/

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/cntkcn4698/article/details/100301301

智能推荐

js-选项卡原理_选项卡js原理-程序员宅基地

文章浏览阅读90次。【代码】js-选项卡原理。_选项卡js原理

设计模式-原型模式(Prototype)-程序员宅基地

文章浏览阅读67次。原型模式是一种对象创建型模式,它采用复制原型对象的方法来创建对象的实例。它创建的实例,具有与原型一样的数据结构和值分为深度克隆和浅度克隆。浅度克隆:克隆对象的值类型(基本数据类型),克隆引用类型的地址;深度克隆:克隆对象的值类型,引用类型的对象也复制一份副本。UML图:具体代码:浅度复制:import java.util.List;/*..._prototype 设计模式

个性化政府云的探索-程序员宅基地

文章浏览阅读59次。入选国内首批云计算服务创新发展试点城市的北京、上海、深圳、杭州和无锡起到了很好的示范作用,不仅促进了当地产业的升级换代,而且为国内其他城市发展云计算产业提供了很好的借鉴。据了解,目前国内至少有20个城市确定将云计算作为重点发展的产业。这势必会形成新一轮的云计算基础设施建设的**。由于云计算基础设施建设具有投资规模大,运维成本高,投资回收周期长,地域辐射性强等诸多特点,各地在建...

STM32问题集之BOOT0和BOOT1的作用_stm32boot0和boot1作用-程序员宅基地

文章浏览阅读9.4k次,点赞2次,收藏20次。一、功能及目的 在每个STM32的芯片上都有两个管脚BOOT0和BOOT1,这两个管脚在芯片复位时的电平状态决定了芯片复位后从哪个区域开始执行程序。BOOT1=x BOOT0=0 // 从用户闪存启动,这是正常的工作模式。BOOT1=0 BOOT0=1 // 从系统存储器启动,这种模式启动的程序_stm32boot0和boot1作用

C语言函数递归调用-程序员宅基地

文章浏览阅读3.4k次,点赞2次,收藏22次。C语言函数递归调用_c语言函数递归调用

明日方舟抽卡模拟器wiki_明日方舟bilibili服-明日方舟bilibili服下载-程序员宅基地

文章浏览阅读410次。明日方舟bilibili服是一款天灾驾到战斗热血的创新二次元废土风塔防手游,精妙的二次元纸片人设计,为宅友们源源不断更新超多的纸片人老婆老公们,玩家将扮演废土正义一方“罗德岛”中的指挥官,与你身边的感染者们并肩作战。与同类塔防手游与众不同的几点,首先你可以在这抽卡轻松获得稀有,同时也可以在战斗体系和敌军走位机制看到不同。明日方舟bilibili服设定:1、起因不明并四处肆虐的天灾,席卷过的土地上出..._明日方舟抽卡模拟器

随便推点

Maven上传Jar到私服报错:ReasonPhrase: Repository version policy: SNAPSHOT does not allow version: xxx_repository version policy snapshot does not all-程序员宅基地

文章浏览阅读437次。Maven上传Jar到私服报错:ReasonPhrase: Repository version policy: SNAPSHOT does not allow version: xxx_repository version policy snapshot does not all

斐波那契数列、素数、质数和猴子吃桃问题_斐波那契日-程序员宅基地

文章浏览阅读1.2k次。斐波那契数列(Fibonacci Sequence)是由如下形式的一系列数字组成的:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …上述数字序列中反映出来的规律,就是下一个数字是该数字前面两个紧邻数字的和,具体如下所示:示例:比如上述斐波那契数列中的最后两个数,可以推导出34后面的数为21+34=55下面是一个更长一些的斐波那契数列:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584,_斐波那契日

PHP必会面试题_//该层循环用来控制每轮 冒出一个数 需要比较的次数-程序员宅基地

文章浏览阅读363次。PHP必会面试题1. 基础篇1. 用 PHP 打印出前一天的时间格式是 2017-12-28 22:21:21? //>>1.当前时间减去一天的时间,然后再格式化echo date('Y-m-d H:i:s',time()-3600*24);//>>2.使用strtotime,可以将任何字符串时间转换成时间戳,仅针对英文echo date('Y-m-d H:i:s',str..._//该层循环用来控制每轮 冒出一个数 需要比较的次数

windows用mingw(g++)编译opencv,opencv_contrib,并install安装_opencv mingw contrib-程序员宅基地

文章浏览阅读1.3k次,点赞26次,收藏26次。windows下用mingw编译opencv貌似不支持cuda,选cuda会报错,我无法解决,所以没选cuda,下面两种编译方式支持。打开cmake gui程序,在下面两个框中分别输入opencv的源文件和编译目录,build-mingw为你创建的目录,可自定义命名。1、如果已经安装Qt,则Qt自带mingw编译器,从Qt安装目录找到编译器所在目录即可。1、如果已经安装Qt,则Qt自带cmake,从Qt安装目录找到cmake所在目录即可。2、若未安装Qt,则安装Mingw即可,参考我的另外一篇文章。_opencv mingw contrib

5个高质量简历模板网站,免费、免费、免费_hoso模板官网-程序员宅基地

文章浏览阅读10w+次,点赞42次,收藏309次。今天给大家推荐5个好用且免费的简历模板网站,简洁美观,非常值得收藏!1、菜鸟图库https://www.sucai999.com/search/word/0_242_0.html?v=NTYxMjky网站主要以设计类素材为主,办公类素材也很多,简历模板大部个偏简约风,各种版式都有,而且经常会更新。最重要的是全部都能免费下载。2、个人简历网https://www.gerenjianli.com/moban/这是一个专门提供简历模板的网站,里面有超多模板个类,找起来非常方便,风格也很多样,无须注册就能免费下载,_hoso模板官网

通过 TikTok 联盟提高销售额的 6 个步骤_tiktok联盟-程序员宅基地

文章浏览阅读142次。你听说过吗?该计划可让您以推广您的产品并在成功销售时支付佣金。它提供了新的营销渠道,使您的产品呈现在更广泛的受众面前并提高品牌知名度。此外,TikTok Shop联盟可以是一种经济高效的产品或服务营销方式。您只需在有人购买时付费,因此不存在在无效广告上浪费金钱的风险。这些诱人的好处是否足以让您想要开始您的TikTok Shop联盟活动?如果是这样,本指南适合您。_tiktok联盟