You are on page 1of 3

Disk Quota = Size of a copy of database

+ Size of an incremental backup


+ Size of (n+1) days of archived redo logs
+ Size of (y+1) days of foreign archived redo logs (for logical
standby)
+ Size of control file + Size of an online redo log member * number
of log groups
+ Size of flashback logs (based on DB_FLASHBACK_RETENTION_TARGET
value)

shutdown immediate
startup mount;
alter database arhivelog;
alter database open;

create tablespace ts_catalog datafile


'/u01/app/oracle/oradata/ORA19C/catalog001.dbs' size 20M;

create user c##rman identified by tiger default tablespace ts_catalog;


grant recovery_catalog_owner,resource,dba to c##rman;

RMAN 备份默认路径

1、FRA 未开启,默认路径==》$ORACLE_HOME/dbs/
2、FRA 已开启,默认路径==》FRA

rman target /
backup database;

rman target / catalog c##rman/tiger


run{
recync catalog;
alter system checkpoint;
alter system switch logfile;
backup database plus archivelog;
alter system switch logfile;
backup archivelog all;
}

. /oravl01/orauser/.profile
export ORACLE_SID=orcl
target='target /'
catalogt=' catalog rman_orcl/Tsmbak2@rman'
# Get the current time for constructing a fairly unique filename in /tmp:
time=`date '+%Y%m%d%H%M'`

# Construct filenames using $time for uniqueness:


cmdfile=/oravl01/rmanscripts/full.rcv
msglog=/oravl01/rmanscripts/log/full_$time.log

rman $target $catalogt cmdfile $cmdfile msglog $msglog

run{
allocate channel m1t1 type 'SBT_TAPE' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_orcldb1.opt)';
allocate channel m1t2 type 'SBT_TAPE' parms
'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo_orclb1.opt)';
crosscheck backup;
crosscheck archivelog all;
crosscheck backup of archivelog all;
resync catalog;
backup
full
filesperset 40
tag 'full_backup'
format 'fullorcl_%u_%p_%c'
database;

backup
format 'cforcl_%s_%p'
(current controlfile);

sql 'alter system archive log current' ;

backup
filesperset 50
format 'archorcl_%t_%s_%r'
(archivelog until time 'sysdate-3' delete input channel m1t1);
delete noprompt archivelog all backed up 1 times TO DEVICE TYPE 'SBT_TAPE';

release channel m1t1;


release channel m1t2;
}

run{
allocate channel m1 device type disk;
allocate channel m2 device type disk;
allocate channel m3 device type disk;
allocate channel m4 device type disk;
allocate channel m5 device type disk;
allocate channel m6 device type disk;
allocate channel m7 device type disk;
backup section size 100M database plus archivelog;
release channel m1;
release channel m2;
release channel m3;
release channel m4;
release channel m5;
release channel m6;
release channel m7;
}

select * from t1 where id in


(select id from t2 where name = 'j');

_unnest_subquery=TRUE

等价查询改写

You might also like