实战班RMAN备份恢复实习指导

更新时间:2023-06-18 09:55:51 阅读: 评论:0

CUUG数据库实战班
Rman备份与恢复实习指导
Rman与目标数据库的连接
1)没有目录服务器的连接
rman target / nocatalog 
RMAN>alter databa mount;
2)连接到远程目标数据库
% rman NOCATALOG
RMAN> CONNECT TARGET sys/change_on_install@prod1;
3)连接到目标数据库并连接到目录数据库
% rman
RMAN> CONNECT TARGET /
RMAN> CONNECT CATALOG rman/rman@rcat
4)连接到目标数据库、目录数据库、辅助数据库
% rman
RMAN> CONNECT TARGET SYS/sysdba@prod1
RMAN> CONNECT CATALOG rman/rman@rcat
pjm是什么意思RMAN> CONNECT AUXILIARY SYS/sysdba@dupdb
5)连接到远程目标数据库与目录数据库
#rman target sys/change_on_install@db160 catalog rman/rman@db01
Rman配置:
1)Configure automatic channels:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/db01/BACKUP/%U';
2)Implement retention policy by specifying a recovery window:
CONFIGURE RETENTION POLICY TO RECOVERY  WINDOW OF 7 days;
3)Implement retention policy by specifying redundancy:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
4)Check what backup t was obsolete:单词
爱你单词REPORT OBSOLETE;
5) DELETE backup t about OBSOLETE:
DELETE OBSOLETE;
5)Configure duplexed backup ts:
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE disk TO 2;
6)Configure backup optimization:
CONFIGURE BACKUP OPTIMIZATION ON;
7)U the CLEAR option to return to the default value:
CONFIGURE RETENTION POLICY CLEAR;
CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR;
8)Automatic channel configuration ttings
SHOW CHANNEL;
SHOW DEVICE TYPE;
SHOW DEFAULT DEVICE TYPE;
9)RMAN retention policy configuration ttings
SHOW RETENTION POLICY;
10)Number of backup copies
SHOW DATAFILE BACKUP COPIES;
11)Maximum size for backup ts
SHOW MAXSETSIZE;
12)Tablespaces excluded from whole databa backups
SHOW EXCLUDE;
13)Status of backup optimization
SHOW BACKUP OPTIMIZATION;
14)show all configure
show all;
15)List backups of all files in the databa:
LIST BACKUP OF DATABASE;
16)List all backup ts containing the urs01.dbf datafile:
LIST BACKUP OF DATAFILE  "/db01/ORADATA/u03/urs01.dbf";
greatbarrierreef17)List all copies of datafiles in the SYSTEM
LIST COPY OF TABLESPACE "SYSTEM";
18)What is the structure of the databa?
REPORT SCHEMA;
19)Which files need to be backed up?
REPORT NEED BACKUP ...;
20)Which backups can be deleted (that is, are obsolete)?
REPORT OBSOLETE;
21)Which files are not recoverable becau of unrecoverable operations(may be after open retlogs)?
wideopen REPORT UNRECOVERABLE ...;
22)Files needing three or more incremental backups for recovery:
REPORT NEED BACKUP incremental 3;
23)Files have not been backed up for three days:
REPORT NEED BACKUP days 3;
24)Backup needed if there are not two or more:
REPORT NEED BACKUP redundancy 2;
25)Backup needed to recover 3 days past:
REPORT NEED BACKUP  recovery window of 3 days;
Rman数据文件的备份:
1)级别为0的备份
RMAN> run {
moon walk
allocate channel t1 type disk;
backup incremental level = 0
format '/backup/rman/weekendfull_0_%d_%s_%p'
(databa include current controlfile);
}
2)级别为2的备份
RMAN> run {
allocate channel t1 type disk;
backup incremental level = 2
format '/backup/rman/incremental_2_%d_%s_%p'
(databa include current controlfile);
}
3)级别为1的备份
RMAN> run {
allocate channel t1 type disk;
backup incremental level = 1
format '/backup/rman/cumulative_%d_%s_%p'
(databa include current controlfile);
韦沃教育}banzhu
4)表空间备份
RMAN> run {
2> allocate channel t1 type disk format '/backup/rman/tbs_%d_%s_%p';
3> backup incremental level = 2
4> (tablespace system,urs);
6> }
5)并行备份并存放在不同的目录下。
RMAN>  run {
2>  allocate channel t1 type disk format ‘/backup/rman/blib_%d_%s_%p';
3>  allocate channel t2 type disk format '/backup/rman/blib_%d_%s_%p';
4>  backup
5> (datafile 1,2,3,4,5)
6> (datafile 6,7,8,9,10);
7> }
6)oracle 10g rman 支持压缩备份出来的文件,恢复时会自动解压,无须人工干预,且压缩率高。可以通过LIST BACKUPSET来看压缩的结果。
rman target sys/change_on_install nocatalog
run {
allocate channel t1 type disk format '/backup/rman/blib_%d_%s_%p';
backup as compresd backupt incremental level = 2
(databa include current controlfile);
}
7)定制每个备份集的piece的大小。
RUN {
    ALLOCATE CHANNEL t1 TYPE disk
    MAXPIECESIZE = 30m;
    BACKUP
        FORMAT '/oracle/backup/df_%t_%s_%p' FILESPERSET 2
        (databa);
sarah paulson  }
归档日志的备份
1)backup from time sysdate-2 archived log and delete;
RMAN> run {
2> allocate channel t1 type disk;
3> sql
大胆的爱小心的偷
4> 'alter system archive log current';
5> backup archivelog
6> from time 'sysdate-2'
7> format '/backup/rman/ar_%d_%s_%p_%t'

本文发布于:2023-06-18 09:55:51,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/149229.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:备份   数据库   目录   连接   恢复
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图