win7怎么备份当前系统 RMAN备份前的操作(Windows)
RMAN备份前的操作(Windows)
以下是windows下 备份前一些RMAN操作
将数据库启动到归档模式下:
C:Documents and SettingsAdministrator>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:oralceoradatabackup scope=spfile;
恢复目录的配置
创建恢复目录表空间
C:Documents and SettingsAdministrator>sqlplus / as sysdba
SQL>create tablespace rman_ts datafile d:/oracle/oradata/rman_ts ora size M;
创建恢复目录User 及赋予权限:
SQL>create user rmanuser identified by rmanuser default tablespace rman_ts temporary
tablespace temp;
SQL>grant connect resource recovery_catalog_owner to rmanuser ;
SQL>exit;
为恢复目录创建对象:
C:Documents and SettingsAdministrator>rman catalog rmanuser /rmanuser
RMAN>create catalog tablespace rman_ts ;
RMAN>exit;
注册目标数据库:
C:Documents and SettingsAdministrator>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 命令
lishixinzhi/Article/program/Oracle/201311/17755