2008年1月8日星期二

Oracle学习笔记20080107

链接RMAN的种类
Target database
Recovery catalog database
Auxiliary database(后备数据库)
- Standby database
- Duplicate database
- TSPITR instance

进入本地rman
UNIX: $ ORACLE_SID=DB01; export ORACLE_SID
$ rman target / as sysdba
Windows NT:C:\> set ORACLE_SID=DB01
C:\> rman target / as sysdba

远程控制
rman target sys/target_pwd@DB01

写到RMAN输出到某个log file
$ rman target sys/oracle log $HOME/ORADATA/u03/rman.log append

Executing a command file when RMAN is invoked:执行一段命令文件当rman被请求
$ rman target sys/oracle log $HOME/ORADATA/u03/rman.log append
@'$HOME/STUDENT/LABS/my_rman_script.rcv'

恢复管理模式
Interactive mode(作用模式)
-Use it when doing analysis
-Minimize regular usage
-Avoid using with log optionBatch mode(组模式)
-Meant for automated jobs-Minimize operator errors
-Set the log file to obtain information

RMAN命令
RMAN命令有几种:独立(不用run),事件(必须用run),独立或事件.

RMAN管理文件设置
rman在安装好后用默认的修改设置
用configure命令可以:
-Configure automatic channels
-Specify the backup retention policy
-Specify the number of backup copies to be created
-Limit the size of backup sets
-Exempt a tablespace from backup
-Enable and disable backup optimization

设置自动通道:
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/db01/BACKUP/%U';恢复什么的天数。。
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 days;过多的天数RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;

没有评论: