oracle9i中Rman的备份使用点滴
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle9i中Rman的备份使用点滴相关的知识,希望对你有一定的参考价值。
参考技术A rman的简单使用: catalog的建立 全备份 保留备份策略 删除过期备份 查看当前数据库的数据文件 SQL> select name from V$datafile; NAME /oracle/oracle i/oradata/testmysiteok/system dbf /oracle/oracle i/oradata/testmysiteok/undotbs dbf /oracle/oracle i/oradata/testmysiteok/cwmlite dbf /oracle/oracle i/oradata/testmysiteok/drsys dbf /oracle/oracle i/oradata/testmysiteok/example dbf /oracle/oracle i/oradata/testmysiteok/indx dbf /oracle/oracle i/oradata/testmysiteok/odm dbf /oracle/oracle i/oradata/testmysiteok/tools dbf /oracle/oracle i/oradata/testmysiteok/users dbf /oracle/oracle i/oradata/testmysiteok/xdb dbf /oracle/oradata/webdb_file dbf NAME /oracle/oradata/webdb_file dbf /oracle/oradata/webdb_file dbf /oracle/oradata/webdb_file dbf rows selected 建立catalog表空间为back_up SQL> create tablespace back_up datafile /oracle/oradata/catalog dbf size m; Tablespace created 建立rman用户密码为rman rman默认的表空间为back_up 使用临时表空间temp SQL> create user rman identified by rman default tablespace back_up temmporary tablespace temp; create user rman identified by rman default tablespace back_up temmporary tablespace temp * ERROR at line : ORA : missing or invalid option SQL> create user rman identified by rman default tablespace back_up temporary tablespace temp; User created 给rman用户授权 SQL> grant connect resource recovery_catalog_owner to rman; Grant succeeded SQL> quit Disconnected from Oracle i Enterprise Edition Release bit Production With the Partitioning OLAP and Oracle Data Mining options JServer Release Production 连接或者创建catalog到表空间 back_up bash $ rman Recovery Manager: Release bit Production Copyright (c) Oracle Corporation All rights reserved RMAN> connect catalog rman/rman; connected to recovery catalog database recovery catalog is not installed RMAN> create catalog tablespace backup; RMAN : =========================================================== RMAN : =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN : =========================================================== RMAN : error encountered while parsing input mands RMAN : syntax error: found backup : expecting one of: double quoted string identifier single quoted string RMAN : at line column file: standard input RMAN : =========================================================== RMAN : =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN : =========================================================== RMAN : error encountered while parsing input mands RMAN : syntax error: found ; : expecting one of: allocate alter backup beginline blockrecover catalog change connect copy create crosscheck configure duplicate debug delete drop exit endinline host library list mount open print quit recover register release replace report renormalize reset restore resync rman run rpctest set setlimit sql spool startup shutdown send show test upgrade validate RMAN : at line column file: standard input RMAN> create catalog tablespace back_up; recovery catalog created RMAN> quit Recovery Manager plete 连接到sid 为testmysiteok的 catalog上 并注册testmysiteok数据库 bash $ rman target testmysiteok catalog rman/rman Recovery Manager: Release bit Production Copyright (c) Oracle Corporation All rights reserved target database Password: connected to target database: testmysiteOK (DBID= ) connected to recovery catalog database RMAN> register database; database registered in recovery catalog starting full resync of recovery catalog full resync plete 全备份testmysiteok数据库 RMAN> backup full tag testmysiteok format /data/ora_backup/testmysiteok_%u_%s_%p database; Starting backup at AUG allocated channel: ORA_DISK_ channel ORA_DISK_ : sid= devtype=DISK channel ORA_DISK_ : starting full datafile backupset channel ORA_DISK_ : specifying datafile(s) in backupset including current SPFILE in backupset including current controlfile in backupset input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/system dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/undotbs dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/example dbf input datafile fno= name=/oracle/oradata/webdb_file dbf input datafile fno= name=/oracle/oradata/webdb_file dbf input datafile fno= name=/oracle/oradata/webdb_file dbf input datafile fno= name=/oracle/oradata/webdb_file dbf input datafile fno= name=/oracle/oradata/catalog dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/xdb dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/indx dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/users dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/cwmlite dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/drsys dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/odm dbf input datafile fno= name=/oracle/oracle i/oradata/testmysiteok/tools dbf channel ORA_DISK_ : starting piece at AUG channel ORA_DISK_ : finished piece at AUG piece handle=/data/ora_backup/testmysiteok_ grgroc_ _ ment=NONE channel ORA_DISK_ : backup set plete elapsed time: : : Finished backup at AUG 设置保留最近的 次备份 RMAN> configure retention policy to redundancy ; old RMAN configuration parameters: CONFIGURE RETENTION POLICY TO REDUNDANCY ; new RMAN configuration parameters: CONFIGURE RETENTION POLICY TO REDUNDANCY ; new RMAN configuration parameters are successfully stored starting full resync of recovery catalog full resync plete 查看过期的备份 RMAN> report obsolete; RMAN retention policy will be applied to the mand RMAN retention policy is set to redundancy Report of obsolete backups and copies Type Key Completion Time Filename/Handle Backup Set OCT Backup Piece OCT /oracle/testmysiteok dbf Archive Log SEP /oracle/OraHome/dbs/arch _ dbf 查看所有备份 RMAN> list backup; 删除过期备份 RMAN> delete obsolete; RMAN retention policy will be applied to the mand RMAN retention policy is set to redundancy using channel ORA_DISK_ Deleting the following obsolete backups and copies: Type Key Completion Time Filename/Handle Backup Set OCT Backup Piece OCT /oracle/testmysiteok dbf Archive Log SEP /oracle/OraHome/dbs/arch _ dbf Do you really want to delete the above objects (enter YES or NO)? y deleted backup piece backup piece handle=/oracle/testmysiteok dbf recid= stamp= Deleted objects lishixinzhi/Article/program/Oracle/201311/18428
RMAN备份,catalog注册rman带库备份信息
客户需求:测试恢复的过程中,控制文件是全备时期的,recover database无法恢复到指定日期,控制文件中缺失后续新的归档备份信息。
方法:1.控制文件rman注册后续带库中的归档备份;
2.使用更新的控制文件进行恢复操作,其中自动包含归档日志信息,无需注册。
如果需要注册,Rman如何注册带库归档备份信息?
HOW TO CATALOG TAPE BACKUP PIECES (Doc ID 550082.1) RMAN>CONFIGURE CHANNEL DEVICE TYPE ‘SBT_TAPE‘ PARMS ‘ENV=(NB_ORA_CLASS=oraclebkup, SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so)‘; RMAN> CATALOG DEVICE TYPE ‘SBT_TAPE‘ BACKUPPIECE ‘lij1qaa3_1_1‘;
以上是关于oracle9i中Rman的备份使用点滴的主要内容,如果未能解决你的问题,请参考以下文章
oracle rac rman 备份 怎么恢复到另外的rac