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

智能推荐

解决win10/win8/8.1 64位操作系统MT65xx preloader线刷驱动无法安装_mt65驱动-程序员宅基地

文章浏览阅读1.3w次。转载自 http://www.miui.com/thread-2003672-1-1.html 当手机在刷错包或者误修改删除系统文件后会出现无法开机或者是移动定制(联通合约机)版想刷标准版,这时就会用到线刷,首先就是安装线刷驱动。 在XP和win7上线刷是比较方便的,用那个驱动自动安装版,直接就可以安装好,完成线刷。不过现在也有好多机友换成了win8/8.1系统,再使用这个_mt65驱动

SonarQube简介及客户端集成_sonar的客户端区别-程序员宅基地

文章浏览阅读1k次。SonarQube是一个代码质量管理平台,可以扫描监测代码并给出质量评价及修改建议,通过插件机制支持25+中开发语言,可以很容易与gradle\maven\jenkins等工具进行集成,是非常流行的代码质量管控平台。通CheckStyle、findbugs等工具定位不同,SonarQube定位于平台,有完善的管理机制及强大的管理页面,并通过插件支持checkstyle及findbugs等既有的流..._sonar的客户端区别

元学习系列(六):神经图灵机详细分析_神经图灵机方法改进-程序员宅基地

文章浏览阅读3.4k次,点赞2次,收藏27次。神经图灵机是LSTM、GRU的改进版本,本质上依然包含一个外部记忆结构、可对记忆进行读写操作,主要针对读写操作进行了改进,或者说提出了一种新的读写操作思路。神经图灵机之所以叫这个名字是因为它通过深度学习模型模拟了图灵机,但是我觉得如果先去介绍图灵机的概念,就会搞得很混乱,所以这里主要从神经图灵机改进了LSTM的哪些方面入手进行讲解,同时,由于模型的结构比较复杂,为了让思路更清晰,这次也会分开几..._神经图灵机方法改进

【机器学习】机器学习模型迭代方法(Python)-程序员宅基地

文章浏览阅读2.8k次。一、模型迭代方法机器学习模型在实际应用的场景,通常要根据新增的数据下进行模型的迭代,常见的模型迭代方法有以下几种:1、全量数据重新训练一个模型,直接合并历史训练数据与新增的数据,模型直接离线学习全量数据,学习得到一个全新的模型。优缺点:这也是实际最为常见的模型迭代方式,通常模型效果也是最好的,但这样模型迭代比较耗时,资源耗费比较多,实时性较差,特别是在大数据场景更为困难;2、模型融合的方法,将旧模..._模型迭代

base64图片打成Zip包上传,以及服务端解压的简单实现_base64可以装换zip吗-程序员宅基地

文章浏览阅读2.3k次。1、前言上传图片一般采用异步上传的方式,但是异步上传带来不好的地方,就如果图片有改变或者删除,图片服务器端就会造成浪费。所以有时候就会和参数同步提交。笔者喜欢base64图片一起上传,但是图片过多时就会出现数据丢失等异常。因为tomcat的post请求默认是2M的长度限制。2、解决办法有两种:① 修改tomcat的servel.xml的配置文件,设置 maxPostSize=..._base64可以装换zip吗

Opencv自然场景文本识别系统(源码&教程)_opencv自然场景实时识别文字-程序员宅基地

文章浏览阅读1k次,点赞17次,收藏22次。Opencv自然场景文本识别系统(源码&教程)_opencv自然场景实时识别文字

随便推点

ESXi 快速复制虚拟机脚本_exsi6.7快速克隆centos-程序员宅基地

文章浏览阅读1.3k次。拷贝虚拟机文件时间比较长,因为虚拟机 flat 文件很大,所以要等。脚本完成后,以复制虚拟机文件夹。将以下脚本内容写入文件。_exsi6.7快速克隆centos

好友推荐—基于关系的java和spark代码实现_本关任务:使用 spark core 知识完成 " 好友推荐 " 的程序。-程序员宅基地

文章浏览阅读2k次。本文主要实现基于二度好友的推荐。数学公式参考于:http://blog.csdn.net/qq_14950717/article/details/52197565测试数据为自己随手画的关系图把图片整理成文本信息如下:a b c d e f yb c a f gc a b dd c a e h q re f h d af e a b gg h f bh e g i di j m n ..._本关任务:使用 spark core 知识完成 " 好友推荐 " 的程序。

南京大学-高级程序设计复习总结_南京大学高级程序设计-程序员宅基地

文章浏览阅读367次。南京大学高级程序设计期末复习总结,c++面向对象编程_南京大学高级程序设计

4.朴素贝叶斯分类器实现-matlab_朴素贝叶斯 matlab训练和测试输出-程序员宅基地

文章浏览阅读3.1k次,点赞2次,收藏12次。实现朴素贝叶斯分类器,并且根据李航《统计机器学习》第四章提供的数据训练与测试,结果与书中一致分别实现了朴素贝叶斯以及带有laplace平滑的朴素贝叶斯%书中例题实现朴素贝叶斯%特征1的取值集合A1=[1;2;3];%特征2的取值集合A2=[4;5;6];%S M LAValues={A1;A2};%Y的取值集合YValue=[-1;1];%数据集和T=[ 1,4,-1;..._朴素贝叶斯 matlab训练和测试输出

Markdown 文本换行_markdowntext 换行-程序员宅基地

文章浏览阅读1.6k次。Markdown 文本换行_markdowntext 换行

错误:0xC0000022 在运行 Microsoft Windows 非核心版本的计算机上,运行”slui.exe 0x2a 0xC0000022″以显示错误文本_错误: 0xc0000022 在运行 microsoft windows 非核心版本的计算机上,运行-程序员宅基地

文章浏览阅读6.7w次,点赞2次,收藏37次。win10 2016长期服务版激活错误解决方法:打开“注册表编辑器”;(Windows + R然后输入Regedit)修改SkipRearm的值为1:(在HKEY_LOCAL_MACHINE–》SOFTWARE–》Microsoft–》Windows NT–》CurrentVersion–》SoftwareProtectionPlatform里面,将SkipRearm的值修改为1)重..._错误: 0xc0000022 在运行 microsoft windows 非核心版本的计算机上,运行“slui.ex