以下是windows下备份前一些RMAN操作 将数据库启动到归档模式下: C:\Documents and Settings\Administrator>sqlplus / as sysdba SQL>shutdown immediate SQL>startup mount SQL>alter database archivelog; SQL>alter database open; SQL>archive log list; 根据需要更改日志的存放路径(前提是使用了spfile方式启动) SQL>alter system set log_archive_dest_=location=e:\oralce\oradata\backup scope=spfile; 恢复目录的配置 创建恢复目录表空间 C:\Documents and Settings\Administrator>sqlplus / as sysdba SQL>create tablespace rman_ts datafile d:/oracle/oradata/rman_tsora size M; 创建恢复目录User及赋予权限: SQL>create user rmanuser identified by rmanuser default tablespace rman_ts temporary tablespace temp; SQL>grant connectresource recovery_catalog_owner to rmanuser; SQL>exit; 为恢复目录创建对象: C:\Documents and Settings\Administrator>rman catalog rmanuser/rmanuser RMAN>create catalog tablespace rman_ts; RMAN>exit; 注册目标数据库: C:\Documents and Settings\Administrator>rman catalog rmanuser/rmanuser target system/system@oradb RMAN> register database; RMAN>exit; 恢复目录支持如下的命令 {CREATE|UPGRADE|DROP} CATALOG {CREATE|DELETE|REPLACE|PRINT} SCRIPT LIST INCARNATION REGISTER DATABASE REPORT SCHEMA AT TIME RESET DATABASE RESYNC CATALOG Resync命令 Resync可以同步数据库与恢复目录之间的信息在实际情况下rman一般可以自动同步 在如下情况下需要同步 ?数据库物理结构的改变 ?数据文件增加或者是改变大小 ?表空间删除 ?回滚段的创建与删除 ?每产生个归档日志 Reset 命令 目标数据库resetlogs 之后需要重新设置恢复目录Reset命令就用来重新设置恢复目录 |