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

智能推荐

240320俄罗斯方块java,JAVA游戏编程之三----j2me 手机游戏入门开发--俄罗斯方块_2-程序员宅基地

文章浏览阅读202次。packagecode;//importjava.awt.*;//importjava.awt.Canvas;//importjava.awt.event.*;//importjavax.swing.*;importjava.util.Random;importjavax.microedition.lcdui.*;//写界面所需要的包/***//***俄罗斯方块*高雷*2007年1..._240×320java游戏

在线电影院售票平台(源码+开题报告)-程序员宅基地

文章浏览阅读779次,点赞14次,收藏19次。然后,实现系统的数据管理和服务功能,包括用户的注册与登录、电影的分类与展示、电影信息的查询与推荐、座位的选择与预订、在线支付与电子票生成等。此外,随着在线视频平台的兴起,越来越多的人选择在线观看电影,这对传统电影院产生了巨大的冲击。研究意义: 开发在线电影院售票平台对于提升用户的观影体验、优化电影院的运营效率、促进电影产业的发展具有重要的意义。该系统旨在通过技术手段解决传统电影院售票中的问题,提供一个集成化的电影信息展示、座位选择、在线支付和用户评价平台,同时也为电影院和电影制作方提供有效的工具。

程序员熬夜写代码,用C/C++打造一个安全的即时聊天系统!_基于c++的即时聊天系统设计-程序员宅基地

文章浏览阅读509次。保护我们剩下的人的通话信息安全,使用TOX可以让你在和家人,朋友,爱人交流时保护你的隐私不受政府无孔不入的的偷窥.关于TOX:其他牛逼的软件因为一些细化服务问你要钱的时候, TOX分文不取 . 你用了TOX, 想干嘛就干嘛.网友评论:项目源码展示:源码测试效果:最后,如果你学C/C++编程有什么不懂的,可以来问问我哦,或许我能够..._基于c++的即时聊天系统设计

linux Java服务swap分区被占用内存泄露问题故障及解决方法_linux swap占用很高-程序员宅基地

文章浏览阅读584次。鱼弦:CSDN内容合伙人、CSDN新星导师、全栈领域创作新星创作者 、51CTO(Top红人+专家博主) 、github开源爱好者(go-zero源码二次开发、游戏后端架构 https://github.com/Peakchen)当Java服务在Linux系统中运行时,可能会出现swap分区被占用的内存泄露问题,导致系统性能下降或者崩溃。下面是该问题的故障及解决方法、底层结构、架构图、工作原理、使用场景详解和实际应用方式、原理详细描述、相关命令使用示例以及文献材料链接。_linux swap占用很高

word中利用宏替换标点标点全角与半角-程序员宅基地

文章浏览阅读662次。Alt+F11,然后插入-模块:复制下面代码到编辑窗口:Sub 半角标点符号转换为全角标点符号()'中英互译文档中将中文段落中的英文标点符号替换为中文标点符号 Dim i As Paragraph, ChineseInterpunction() As Variant, EnglishInterpunction() As Variant Dim MyRange..._替换半角宏

Android WebView使用总结_android webview真正加载完成-程序员宅基地

文章浏览阅读2.8k次。#.简介: WebView是Android提供的用来展示展示web页面的View,内部使用webkit浏览器引擎(一个轻量级的浏览器引擎),除了展示Web页面外,还可与Web页面内的JS脚本交互调用。WebView内部的WebSetting对象负责管理WebView的参数配置; WebViewClient负责处理WebView的各种请求和通知事件,在对应事件发生时会执行WebViewClient的对应回调; ChromeWebviewClient辅助Webview处理与JS一些交互......_android webview真正加载完成

随便推点

bitcoin 调试环境搭建-程序员宅基地

文章浏览阅读1.6k次。_bitcoin 调试环境搭建

曲线生成 | 图解B样条曲线生成原理(基本概念与节点生成算法)-程序员宅基地

文章浏览阅读4.3k次,点赞93次,收藏94次。为了解决贝塞尔曲线无法局部修正、控制性减弱、曲线次数过高、不易拼接的缺陷,引入B样条曲线(B-Spline)。本文介绍B样条曲线的基本概念:节点向量、支撑性、次数阶数、加权性质、节点生成算法等,为后续曲线计算打下基础。_样条曲线生成

CDH安装宝典之ClouderaManager_/opt/cloudera/cm-agent/service/mgmt/mgmt.sh: line -程序员宅基地

文章浏览阅读902次。配置本地repo库下载我的阿里云盘文件文件放置#创建目录mkdir -p /opt/cloudera/parcel-repo/mkdir -p /opt/cloudera/cm/yum install createrepoCDH 6.2.0 的三个文件放到/opt/cloudera/parcel-repo/中,并且注意把sha256后缀的文件名修改为sha#执行createrepo命令生成rpm元数据 最终/opt/cloudera/parcel-repo/会多一个repodata目录_/opt/cloudera/cm-agent/service/mgmt/mgmt.sh: line 76: /usr/java/jdk1.8.0_181

uni.canvasToTempFilePath在app正常,微信小程序报错: fail canvas is empty-程序员宅基地

文章浏览阅读943次,点赞2次,收藏2次。uni.canvasToTempFilePath_uni.canvastotempfilepath

SDRAM笔记_sdram 干扰-程序员宅基地

文章浏览阅读3.1k次。SRAM :静态RAM,不用刷新,速度可以非常快,像CPU内部的cache,都是静态RAM,缺点是一个内存单元需要的晶体管数量多,因而价格昂贵,容量不大。DRAM:动态RAM,需要刷新,容量大。SDRAM:同步动态RAM,需要刷新,速度较快,容量大。DDR SDRAM:双通道同步动态RAM,需要刷新,速度快,容量大。........................_sdram 干扰

Excel转SQL语句_excel数据怎么生成sql语句-程序员宅基地

文章浏览阅读7.3k次。假设表格有A、B、C、D四列数据,希望导入到你的数据库中表格table,对应的字段分别是col1、col2、col3、col4。_excel数据怎么生成sql语句

推荐文章

热门文章

相关标签