Rman:热备份 必须是归档模式下
1)Backup压缩
2)copy
rman登陆方式:
1)C:\Documents and Settings\Administrator>rman nocatalog target sys log='e:\oracle\my backup\rmanlog.log' append
target database Password:
RMAN>--保存跟踪信息
2)C:\Documents and Settings\Administrator>rman target / --本地才可以登录的
3)C:\Documents and Settings\Administrator>rman nocatalog target sys
--nocatalog 登录没有恢复目录的方式登录到本机数据库上
4)C:\Documents and Settings\Administrator>rman nocatalog targetsys/pwd@oracle_sid
创建catalog
--1.sys用户登录
C:\Documents and Settings\Administrator>sqlplus
Enter user-name: sys as sysdba
Enter password:
--2.创建catalog所需的rmants表空间
SQL> create tablespace rmants datafile 'e:\oracle\rman\rmants01.dbf' size 50m;
Tablespace created.
--3.创建rman用户
--创建用户rman/rman123 默认表空间味rmants允许自由使用
SQL> create user rman identified by rman123 default tablespace rmants quota unlimited on rmants;
User created.
--4.用户授权
//grant connect to rman
SQL> grant recovery_catalog_owner to rman;
Grant succeeded.
--5.查看角色权限
SQL> select * from dba_sys_privs where grantee='RECOVERY_CATALOG_OWNER';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
RECOVERY_CATALOG_OWNER CREATE TYPE NO
RECOVERY_CATALOG_OWNER CREATE VIEW NO
RECOVERY_CATALOG_OWNER CREATE TABLE NO
RECOVERY_CATALOG_OWNER ALTER SESSION NO
RECOVERY_CATALOG_OWNER CREATE CLUSTER NO
RECOVERY_CATALOG_OWNER CREATE SESSION NO
RECOVERY_CATALOG_OWNER CREATE SYNONYM NO
RECOVERY_CATALOG_OWNER CREATE TRIGGER NO
RECOVERY_CATALOG_OWNER CREATE SEQUENCE NO
RECOVERY_CATALOG_OWNER CREATE PROCEDURE NO
RECOVERY_CATALOG_OWNER CREATE DATABASE LINK NO
11 rows selected.
--查看rman用户信息
SQL> select * from dba_users where username='RMAN';
--6.创建恢复目录
C:\Documents and Settings\Administrator>rman catalog rman/rman123
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to recovery catalog database
recovery catalog is not installed
RMAN> create catalog tablespace rmants;
recovery catalog created
--7.连接数据库
--连接到目标数据库
************
>rman target sys/target_pwd@target_str catalogrman/cat_pwd@cat_str
或者
RMAN> connect target sys/target_pwd@target_str
RMAN> connect catalogrman/cat_pwd@cat_str
*************
RMAN> connect target sys
target database Password:
connected to target database: ORCL (DBID=1286688152)
--还需连接到目标xxx数据库上,我还没有装载别的实例,所以先不连接
RMAN> connect targetrman/rman123@xxx
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN>
--8.连接两个数据库
C:\Documents and Settings\Administrator>rman target / catalog rman/rman123
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1286688152)
connected to recovery catalog database
RMAN>
--9.可以使用rman工具进行备份和恢复操作了。