oracle 10g 第二章

zhengbao_jun發表於2009-02-16

第2章
run
{
allocate channel c1 type disk;
backup database format 'db_%u_%d_%s' tag monthly_backup;
backup format 'log_t%t_s%s_p%p'
(archivelog all);
}

command>rman
rman>connect target
rman>run{
allocate channel c1 type disk;
backup database format 'db_%u_%d_%s';
backup format 'log_t%t_s%s_p%p'
(archivelog all);
}


rman>run
{
allocate channel ch1 tyep disk;
copy
datafile 1 to 'c:\oracle\staging\ora101t\system01.dbf',
current controlfile to 'c:\oracle\staging\ora101t\control01.ctl';}

 


command>rman
rman>connect target
rman>backup as copy tag "062504_backup" database;


rman>backup as compressed backupset database;

rman>configure device type disk backup type to compressed backupset;

dir *.bkp

rman>backup incremental level 0 database;
rman>backup incremental level 1 database;
rman>backup incremental level 1 cumulative database;


備份集得並行化
command>set ORACLE_SID=ora101rc
command>rman
rman>run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup
(datafile 1,2,3 channel c1)
(archivelog all channel c2);
}


rman>show all;
rman>configure device type disk parallelism 3;
rman>backup
(datafile 1,2)
(datafile 3,4)
(archivelog all);


rman>backup tablespace users format ='user_bs_%d%p%s';
rman>backup as copy tablespace users format='c:\oracle\backups\ora101c\users_%d%p%s';
rman>backup database tag weekly_backup;
rman>configure channel device type disk rate 5m;
rman>configure channel device type disk maxsetsize=10g;
rman>backup database maxsetsize=10g;
rman>configure channel device type disk maxpiecesize=2G;

啟動和關閉塊變化跟蹤
command>sqlplus /nolog
sql>connect / as sysdba
sql>alter database enable block change tracking using file 'c:\oracle\block_track\ora101rc_block_track.log';


sql>select filename,status,bytes from v$block_change_tracking;
sql>alter database disable block change tracking;

用EM管理備份
監視RMAN備份
sql>connect system/manager@ora101c
sql>select dbid from v$database;
sql>connect rman_user/rman_user@ora101rc
sql>select db_key from rc_database where dbid=1736563848;
sql>select bs_key,backup_type,completion_time
from rc_database_incarnation a,rc_backup_set b
where a.db_key = b.db_key
and a.current_incarnation = 'YES';


使用list命令。
rman>list backupset by backup summary;
rman>list backupset by file;

使用report命令
rman>REPORT OBSOLETE;
rman>REPORT SCHEMA;

使用RMAN作業示例
啟用ARCHIVELOG模式
sql>alter system set log_archive_start=true scope=spfile;

sql>connect / as sysdba
sql>startup mount
sql>alter database archivelog;
sql>alter database open;

使用RMAN備份歸檔重執行日誌
RUN
{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database;
backup (archivelog all);
}


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/235507/viewspace-553407/,如需轉載,請註明出處,否則將追究法律責任。

相關文章