ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle 10g 第二章

oracle 10g 第二章

原创 Linux操作系统 作者:zhengbao_jun 时间:2009-02-16 11:01:23 0 删除 编辑

第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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-08-08

  • 博文量
    209
  • 访问量
    867062