WEB开发网
开发学院数据库Oracle oracle rman备份命令-备份恢复 阅读

oracle rman备份命令-备份恢复

 2008-11-10 12:59:55 来源:WEB开发网   
核心提示:RMAN简单使用目标机A:create tablespace RMAN datafile '$ORACLE_HOME/oradata/FILENAME.DBF' size 20M;RMAN简单使用目标机A:create tablespace RMAN datafile '$ORACLE_HOME

RMAN简单使用

目标机A:

create tablespace RMAN datafile '$ORACLE_HOME/oradata/FILENAME.DBF' size 20M;

RMAN简单使用

目标机A:

create tablespace RMAN datafile '$ORACLE_HOME/oradata/FILENAME.DBF' size 20M;
create username RMAN identified by RMAN default tablespace rman temporary tablespace temp quota unlimited on RMAN;
  
grant recovery_catalog_owner to rman ;
rman catalog rman/rman
create catalog tablespace 'RMAN';

Rman主机B:

rman target /

connect catalog rman/rman@$A_SID

注册数据库

register database;

注销数据库

sqlplus rman/rman
select * from db;
EXECUTE dbms_rcvcat.unregisterdatabase(db_key, db_id);

///////////非归档模式使用RMAN备份///////////////////////

备份目标数据库:

rman target /

connect catalog rman/rman@$A_SID

定义通道

allocate channel c1 type disk;

撤消通道

release channel c1;

备份整个数据库

run {
allocate channel c1 type disk;
backup full tag full_db_backup
format '/export/home/oracle/oradata/bak_db/db_%d' database
include current controlfile;
release channel c1;
}

备份表空间

run {
allocate channel d1 type disk;
backup tag tbs_users_read_only
format '/export/home/oracle/oradata/bak_tab/block_t%t_s%s' (tablespace "BLOCK");
release channel c1;
}
  
run {
allocate channel d1 type disk;
backup tablespace "BLOCK" filesperset 3 format '/export/home/oracle/oradata/bak_tab/aatst_%d%t%s.%p'
include current controlfile;
release channel c1;
}

1 2 3 4 5 6  下一页

Tags:oracle rman 备份

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接