- 浏览: 486005 次
- 性别:
- 来自: 南阳
文章分类
最新评论
-
yuanhongb:
这么说来,感觉CGI和现在的JSP或ASP技术有点像啊
cgi -
draem0507:
放假了还这么勤啊
JXL操作Excel -
chenjun1634:
学习中!!
PHP/Java Bridge -
Jelen_123:
好文章,给了我好大帮助!多谢!
hadoop安装配置 ubuntu9.10 hadoop0.20.2 -
lancezhcj:
一直用job
Oracle存储过程定时执行2种方法(转)
RMAN 命令
连接到目标数据库(不用恢复目录数据库)
rman target / nocatalog
显示rman配置
RMAN> show all;
====================
报告目标数据库的物理结构
RMAN> report schema;
报告陈旧备份
RMAN> report obsolete;
报告不可恢复的数据文件
RMAN> report unrecoverable;
列出备份信息
RMAN> list backup;
RMAN> list backup of database;
RMAN> list backup of tablespace table_name;
RMAN> list backup of controlfile;
RMAN> list backup of spfile;
RMAN> list backupset id;
========================
校验备份信息:
RMAN> crosscheck backup;
RMAN> crosscheck backup of database;
RMAN> crosscheck backup of tablespace system;
RMAN> crosscheck backup of controlfile;
RMAN> crosscheck backup of spfile;
========================
删除备份
Use the ALLOCATE CHANNEL FOR MAINTENANCE command to manually allocate a channel in preparation for issuing a CHANGE, DELETE, or CROSSCHECK command. You can use the RELEASE CHANNEL command to unallocate the channel.
ALLOCATE CHANNEL FOR MAINTENANCE device type (disk,sbt ...)
RMAN> delete obsolete; -- 删除陈旧备份
RMAN> delete expired backup;
RMAN> delete backupset id;
RMAN> delete backup; -- 删除所有备份
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
1 列出对应物 RMAN>list incarnation;
2 列出备份
2.1概述可用的备份 RMAN>list backup summary;
B 表示 backup
F 表示 FULL
A 表示 archive log
0 1 表示 incremental backup
S 说明备份状态 (A AVAILABLE X EXPIRED )
2.2按备份类型列出备份 RMAN>list backup by file;
按照 数据文件备份,归档日志备份,控制文件备份,服务器参数文件备份 列出
2.3列出详细备份 RMAN>list backup;
2.4列出过期备份 RMAN>list expired backup;
2.5列出表空间和数据文件备份
list backup of tablespace 和list backup of datafile 输出和list backup 相似
如:list backup of tablespace user_tbs;
list backup of datafile 3;
2.6列出归档日志备份 RMAN>list archivelog all; 简要信息
RMAN>list backup of archivelog all; 详细信息
2.7列出控制文件和服务器参数文件
RMAN>list backup of controfile;
RMAN>list backup of spfile;
=====================================================
=====================================================
RMAN 的 report命令
1. 报告最近没有被备份的数据文件
RMAN>report need backup days=3;
2. 报告备份冗余或恢复窗口
RMAN>report need backup redundancy=2;
RMAN>report need backup recovery window of 2 days;
3. 报告数据文件的不可恢复操作
RMAN>report unrecoverable;
4. 报告数据库模式
RMAN>report schema;
5. 报告丢弃的备份
如果使用了保存策略,备份会标记为丢弃状态 RMAN>report obsolete; 删除丢弃状态备份RMAN>delete obsolete;
=====================================================
=====================================================
RMAN的crosscheck 命令
1 备份集有两种状态A(Available,RMAN认为该项存在于备份介质上)X(Expired,备份存在于控制文件或恢复目录中,但是并没有物理存在于备份介质上)
2 crosscheck 的目的是检查RMAN 的目录以及物理文件,如果物理文件不存在于介质上,将标记为Expired。如果物理文件存在,将维持Available。如果原先标记为Expired的备份集再次存在于备份介质上(如恢复了损坏的磁盘驱动器后),crosscheck将把状态重新从Expired标记回Available。
3 crosscheck 输出分两部分。第一部分列出确定存在于备份介质上的所有备份集片,第二部分列出不存在于备份介质上的备份集片,并将其标记为Expired。当设置备份保 存策略后,一个备份过期,crosscheck之后标记为丢弃的备份状态依旧为availabel,要删除丢弃备份delete obsolete。
4 示例:
crosscheck backup
crosscheck backup of datafile 1;
crosscheck backup of tablespace users;
crosscheck backup of controfile;
crosscheck backup of controlfile;
crosscheck backup tag='SAT_BACKUP';
crosscheck backup completed after 'sysdate - 2'
crosscheck backup completed between 'sysdate - 5' and 'sysdate -2 '
crosscheck backup device type sbt;
crosscheck archivelog all;
crosscheck archivelog like '%ARC00012.001'
crosscheck archivelog from sequence 12;
crosscheck archivelog until sequence 522;
=====================================================
=====================================================
RMAN 的validate 命令
1 validate 命令验证备份集片是否能够被还原
2 list backup summary; 得到了备份集得主键ID如40,然后validate backupset 40;
=====================================================
=====================================================
RMAN 的备份保存策略以及change ,delete命令
0.带delete参数的change 命令删除备份集,从备份介质,并且从控制文件和恢复目录中删除。
change backupset 117,118 delete;
change backuppiece 1304 delete;
change archivelog until logseq =544 delete;
1.两类策略:恢复窗口备份保存策略(recovery windows backup retension policy) 基于时间
备份冗余备份保存策略(backup redundancy backup retension policy) 基于备份的数量
两类策略互相排斥
2.即使使用了备份保存策略,备份到期并不删除,只是在RMAN目录中标记为丢弃,看到的状态依旧为available;
要查看标记为丢弃的备份 report obsolete,只有使用delete obsolete才真正物理删除。
3.configure retension policy to recovery window of 7 days;
configure retension policy to redundancy 3;
显示结果 show all;
4.查看到期丢弃的备份时,可能需要手工保存一些备份 ,可以使用change 命令带keep 参数,使用这个命令后,那些被修改的备份将被认为是个long-term backup,不在受保存策略影响也就是说delete obsolete 也不删除。
5.要使备份时候不受保存策略影响 ,使用带keep参数的backup 命令
backup database keep forever;
backup database keep 5 days;
6.change 命令功能
可以修改备份为永久保存并将以及该备份的相关的日志保存下来,保证总能将备份恢复到当前时间点
change backupset 31 keep forever logs;
可以设置备份丢弃的新日期 ,将备份在多保存7 天,7 天后将删除
change backupset 32 keep until time 'sysdata + 7' logs;
7.change 可以将备份集设置为unavailable
change backupset 33 unavailable;
标记为unavailable状态的备份集并不参与crosscheck;
=====================================================
=====================================================
恢复目录的记录删除
1. $ORACLE_HOME/rdbms/admin/prgrmanc.sql 脚本定期删除恢复目录中具有DELETED状态的记录
2. 要删除旧的对应物记录incarnation.必须从DBINC 表中删除这些对应物,使用RC_DATABASE_INCARNATION 视图来确定要删除的对应物。记录要删除的每个对应物的DBINC_KEY
随后启动SQL*Plus,执行delete from dbinc where dbinc_key=2;
=====================================================
=====================================================
手工同步恢复目录
resync catalog;
Oracle同步恢复目录的时候,首先创建快照控制文件,然后比较这个文件和恢复目录,完成后,Oracle 更新恢复目录,使恢复目录和控制文件同步
=====================================================
=====================================================
在RMAN 中存储脚本
1,连接到目标数据库和恢复目录
rman target / catalog rman/rman@rman9i
2,创建脚本
RMAN>create script my_bk_script
2>{backup database plus archivelog;}
create script my_bk_script
3,打印脚本
RMAN>print script my_bk_script;
printing stored scipt:my_bk_script
{backup database plus archivelog;}
4,运行这个脚本,备份目标数据库
RMAN>run {execute scipt my_bk_script;}
5 删除脚本
RMAN>delete script my_bk_script;
=====================================================
=====================================================
archivelog模式下的完全恢复
step1:set oracle_sid=recover
rman target rman_backup/password
configure controlfile autobackup on;
step2:backup database plus archivelog delete input;
step3:shutdown immediate;
step4:重命名所有的数据文件和控制文件,不重命名联机重做日志。
step5: startup nomount;
set DBID=****
restore controlfile from autobackup;
alter database mount;
step6: restore database;
recover database;
alter database open resetlogs;
表空间恢复
sql"alter tablespace users offline";
sql"alter tablespace tools offline";
restore tablespace users,tools;
recover tablespace users,tools;
sql"alter tablespace users online";
sql"alter tablespace tools online";
数据文件恢复
sql"alter database datafile 3 offline";
sql"alter database datafile 'd:oracleoradatausers01.dbf' offline";
restore datafile 3
restore datafile 'd:oracleoradatausers01.dbf';
recover datafile 3
recover datafile 'd:oracleoradatausers01.dbf';
sql"alter database datafile 3 online";
sql"alter database datafile 'd:oracleoradatausers01.dbf'online";
=====================================================
=====================================================
切换当前的incarnation 回到resetlogs 前RESET DATABASE TO INCARNATION inc_key
=====================================================
=====================================================
RMAN 高级恢复
1 基于时间点的恢复
run
{
set until time "to_date('07/01/02 15:00:00','mm/dd/yy hh24:mi:ss')"'
restore database;
recover database;
alter database open resetlogs;
}
2 基于SCN 的恢复
startup mount;
restore database UNTIL SCN 10000;
recover database UNTIL SCN 10000;
alter database open resetlogs;
3 基于日志序列的恢复
startup mount;
restore database UNTIL SEQUENCE 100 thread 1;
recover database UNTIL SEQUENCE 100 thread 1;
alter database open resetlogs;
==================================
c:/> rman cmdfile='' log=''
在run{}脚本里面,format后面的参数含义:%t代表当前时间,s%代表备份集,%p代表备份片
使用恢复目录数据库执行RMAN步骤
我想建立一个RMAN备份机制,本机为目标数据库,sid为orcl10的数据库为恢复目录来做备份,但总不成功,以下是我的执行步骤:
SQL> conn sys/e2000jl@orcl10 as sysdba
Connected.
SQL> create user rman
2 identified by rman123;
User created.
SQL> grant dba to rman;
Grant succeeded.
C:\Documents and Settings\zouyang>rman target sys/system catalog rman/rman123@orcl10
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1227672490)
connected to recovery catalog database
recovery catalog is not installed
RMAN> show channel for device type disk;
recovery catalog is not installed
recovery catalog is not installed
RMAN-00571: ===============================================
RMAN-00569: =========ERROR MESSAGE STACK FOLLOWS ========
RMAN-00571: ===============================================
RMAN-03002: failure of show command at 10/14/2009 09:30:02
RMAN-06429: RCVCAT database is not compatible with this version of RMAN
RMAN>
可以连接上恢复目录数据库,但是无法使用这个恢复目录,Oracle报错“recovery catalog is not installed”。
在网上搜了下,重新建立步骤如下:
第一步:Create Recovery Catalog
First create a user to hold the recovery catalog:
-- Create tablepsace to hold repository
SQL> create tablespace rman_tools
2 datafile
3 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL10\rman01.dbf'
4 size 100m;
Tablespace created
-- Create rman schema owner
SQL> create user rman
2 identified by rman123
3 default tablespace rman_tools
4 quota unlimited on rman_tools;
User created
C:\Documents and Settings\zouyang>rman catalog rman/rman123@orcl10
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
RMAN-00571: ===============================================
RMAN-00569: ====== ERROR MESSAGE STACK FOLLOWS ==========
RMAN-00571: ===============================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04004: error from recovery catalog database: ORA-01045: user RMAN lacks CREATE SESSION privilege; logon denied
-- 报错!要给rman用户分配一定的权限!
SQL> grant connect,resource,create session,recovery_catalog_owner
2 to rman;
Grant succeeded
C:\Documents and Settings\zouyang>rman catalog rman/rman123@orcl10
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 rman_tools;
recovery catalog created ——很好!!建立了!!
可是,当我重新连接,显示RMAN设置信息时又报错了!!
C:\Documents and Settings\zouyang>rman target sys/system catalog rman/rman123@orcl10
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1227672490)
connected to recovery catalog database
RMAN> show channel for device type disk;
RMAN configuration parameters are:
RMAN-00571: ===============================================
RMAN-00569: ========= ERROR MESSAGE STACK FOLLOWS =======
RMAN-00571: ===============================================
RMAN-03002: failure of show command at 10/14/2009 10:32:36
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
RMAN>
又在网上查找原因,原来还需要注册数据库!!
第二步:Register Database
Each database to be backed up by RMAN must be registered!
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> show channel for device type disk;
RMAN configuration parameters are:CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\BACKUP\RMAN\%d_%s.bak';
RMAN>
成功啦!!!
http://407882.blog.51cto.com/397882/212142
=========================================================
oracle10g用rman全备及控制文件在别的机器还原实验
利用rman全备文件(控制文件、归档日志、数据文件)在别处一台oracle10g上还原
要求两台服务器的oracle版本一致并且数据文件、控制文件、归档日志文件目录结构一样
rman全备是用nocatalog方式备份的,所以备份集信息保存在控制文件里。在这里证明一点,就是利用全备方式所备份出来的控制文件含的备份集信息是不全的,如果原来的控制文件丢失会给恢复带来一定麻烦,只有通过
DBMS_BACKUP_RESTORE包来恢复。但如果打开自动备份控制文件功能就不一样了。
rman全备脚本:
#!/bin/bash
rman target sys/sysdba nocatalog configure controlfile autobackup on ;
全备后的文件如下:
cd /u01/rman
[oracle@test rman]$ ll
总计 754936
-rw-r----- 1 oracle oinstall 375029760 12-20 22:48 full_wapdb_01k2ot0u_1_1
-rw-r----- 1 oracle oinstall 339255296 12-20 22:48 full_wapdb_02k2ot0u_1_1
-rw-r----- 1 oracle oinstall 7110656 12-20 22:45 full_wapdb_03k2ot0u_1_1
-rw-r----- 1 oracle oinstall 50874880 12-20 22:49 redolog_wapdb_04k2ot6v_1_1
--------------------------------------------------------------------------------
由于备份是nocatalog所以备份集信息是写到控制文件里的,用全备出来的控制文件信息是不全的。
来验证一下:(把日志文件 控制文件 数据文件删除)
1.从全备文件恢复
[oracle@test ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on 星期六 12月 20 23:28:31 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: oradb (not mounted)
RMAN> restore controlfile from '/u01/rman/full_wapdb_03k2ot0u_1_1';
Starting restore at 20-12月-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/u01/app/oracle/oradata/oradb/control01.ctl
output filename=/u01/app/oracle/oradata/oradb/control02.ctl
output filename=/u01/app/oracle/oradata/oradb/control03.ctl
Finished restore at 20-12月-08
这样三个控制文件就恢复了
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> list backup;
using target database control file instead of recovery catalog
在恢复出来的控制文件里找不到备份的信息
2.用自动备份控制文件来恢复(把刚才的三个控制文件删除)
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 167772160 bytes
Fixed Size 1266392 bytes
Variable Size 83889448 bytes
Database Buffers 79691776 bytes
Redo Buffers 2924544 bytes
RMAN> exit
--------------------------------------------------------------------------------
2.再来看看用自动备份恢复的实验
Recovery Manager complete.
[oracle@test ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on 星期六 12月 20 23:34:45 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: oradb (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/flash_recovery_area/ORADB/autobackup/2008_12_20/o1_mf_s_674002170_4nt1hx4z_.bkp';
Starting restore at 20-12月-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
output filename=/u01/app/oracle/oradata/oradb/control01.ctl
output filename=/u01/app/oracle/oradata/oradb/control02.ctl
output filename=/u01/app/oracle/oradata/oradb/control03.ctl
Finished restore at 20-12月-08
重新从autobackup里还原三个控制文件
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> list backup;
using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 6.77M DISK 00:00:06 20-12月-08
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224548
Piece Name: /u01/rman/full_wapdb_03k2ot0u_1_1
Control File Included: Ckp SCN: 339825 Ckp time: 20-12月-08
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 357.65M DISK 00:02:44 20-12月-08
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224548
Piece Name: /u01/rman/full_wapdb_01k2ot0u_1_1
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 Full 339824 20-12月-08 /u01/app/oracle/oradata/oradb/system01.dbf
4 Full 339824 20-12月-08 /u01/app/oracle/oradata/oradb/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 323.53M DISK 00:02:45 20-12月-08
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224548
Piece Name: /u01/rman/full_wapdb_02k2ot0u_1_1
List of Datafiles in backup set 3
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
2 Full 339825 20-12月-08 /u01/app/oracle/oradata/oradb/undotbs01.dbf
3 Full 339825 20-12月-08 /u01/app/oracle/oradata/oradb/sysaux01.dbf
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4 48.52M DISK 00:00:21 20-12月-08
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224901
Piece Name: /u01/rman/redolog_wapdb_04k2ot6v_1_1
List of Archived Logs in backup set 4
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 29 327057 20-12月-08 340013 20-12月-08
这次rman找回了备份集的信息
3.开始恢复
RMAN> restore database;
Starting restore at 20-12月-08
Starting implicit crosscheck backup at 20-12月-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 20-12月-08
Starting implicit crosscheck copy at 20-12月-08
using channel ORA_DISK_1
Finished implicit crosscheck copy at 20-12月-08
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/ORADB/autobackup/2008_12_20/o1_mf_s_674002170_4nt1hx4z_.bkp
File Name: /u01/app/oracle/flash_recovery_area/ORADB/archivelog/2008_12_20/o1_mf_1_30_4nt1jdhs_.arc
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/oradb/system01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/oradb/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/rman/full_wapdb_01k2ot0u_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/rman/full_wapdb_01k2ot0u_1_1 tag=TAG20081220T224548
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u01/app/oracle/oradata/oradb/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/oradb/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u01/rman/full_wapdb_02k2ot0u_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/rman/full_wapdb_02k2ot0u_1_1 tag=TAG20081220T224548
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 20-12月-08
RMAN> recover database noredo;
Starting recover at 20-12月-08
using channel ORA_DISK_1
Finished recover at 20-12月-08
RMAN> alter database open resetlogs;(注意在线日志不能恢复,用resetlogs打开)
database opened
RMAN> exit
恢复结束。
结论:
如果用rman选择nocatalog方式备份,因为备份信息放到控制文件里,所以控制文件非常重要,即使是全备,其里的备份信息也不全,必需打开自动备份控制文件configure controlfile autobackup on ;
一定要保存好自动备份文件。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40226/showart_1730431.html
连接到目标数据库(不用恢复目录数据库)
rman target / nocatalog
显示rman配置
RMAN> show all;
====================
报告目标数据库的物理结构
RMAN> report schema;
报告陈旧备份
RMAN> report obsolete;
报告不可恢复的数据文件
RMAN> report unrecoverable;
列出备份信息
RMAN> list backup;
RMAN> list backup of database;
RMAN> list backup of tablespace table_name;
RMAN> list backup of controlfile;
RMAN> list backup of spfile;
RMAN> list backupset id;
========================
校验备份信息:
RMAN> crosscheck backup;
RMAN> crosscheck backup of database;
RMAN> crosscheck backup of tablespace system;
RMAN> crosscheck backup of controlfile;
RMAN> crosscheck backup of spfile;
========================
删除备份
Use the ALLOCATE CHANNEL FOR MAINTENANCE command to manually allocate a channel in preparation for issuing a CHANGE, DELETE, or CROSSCHECK command. You can use the RELEASE CHANNEL command to unallocate the channel.
ALLOCATE CHANNEL FOR MAINTENANCE device type (disk,sbt ...)
RMAN> delete obsolete; -- 删除陈旧备份
RMAN> delete expired backup;
RMAN> delete backupset id;
RMAN> delete backup; -- 删除所有备份
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
1 列出对应物 RMAN>list incarnation;
2 列出备份
2.1概述可用的备份 RMAN>list backup summary;
B 表示 backup
F 表示 FULL
A 表示 archive log
0 1 表示 incremental backup
S 说明备份状态 (A AVAILABLE X EXPIRED )
2.2按备份类型列出备份 RMAN>list backup by file;
按照 数据文件备份,归档日志备份,控制文件备份,服务器参数文件备份 列出
2.3列出详细备份 RMAN>list backup;
2.4列出过期备份 RMAN>list expired backup;
2.5列出表空间和数据文件备份
list backup of tablespace 和list backup of datafile 输出和list backup 相似
如:list backup of tablespace user_tbs;
list backup of datafile 3;
2.6列出归档日志备份 RMAN>list archivelog all; 简要信息
RMAN>list backup of archivelog all; 详细信息
2.7列出控制文件和服务器参数文件
RMAN>list backup of controfile;
RMAN>list backup of spfile;
=====================================================
=====================================================
RMAN 的 report命令
1. 报告最近没有被备份的数据文件
RMAN>report need backup days=3;
2. 报告备份冗余或恢复窗口
RMAN>report need backup redundancy=2;
RMAN>report need backup recovery window of 2 days;
3. 报告数据文件的不可恢复操作
RMAN>report unrecoverable;
4. 报告数据库模式
RMAN>report schema;
5. 报告丢弃的备份
如果使用了保存策略,备份会标记为丢弃状态 RMAN>report obsolete; 删除丢弃状态备份RMAN>delete obsolete;
=====================================================
=====================================================
RMAN的crosscheck 命令
1 备份集有两种状态A(Available,RMAN认为该项存在于备份介质上)X(Expired,备份存在于控制文件或恢复目录中,但是并没有物理存在于备份介质上)
2 crosscheck 的目的是检查RMAN 的目录以及物理文件,如果物理文件不存在于介质上,将标记为Expired。如果物理文件存在,将维持Available。如果原先标记为Expired的备份集再次存在于备份介质上(如恢复了损坏的磁盘驱动器后),crosscheck将把状态重新从Expired标记回Available。
3 crosscheck 输出分两部分。第一部分列出确定存在于备份介质上的所有备份集片,第二部分列出不存在于备份介质上的备份集片,并将其标记为Expired。当设置备份保 存策略后,一个备份过期,crosscheck之后标记为丢弃的备份状态依旧为availabel,要删除丢弃备份delete obsolete。
4 示例:
crosscheck backup
crosscheck backup of datafile 1;
crosscheck backup of tablespace users;
crosscheck backup of controfile;
crosscheck backup of controlfile;
crosscheck backup tag='SAT_BACKUP';
crosscheck backup completed after 'sysdate - 2'
crosscheck backup completed between 'sysdate - 5' and 'sysdate -2 '
crosscheck backup device type sbt;
crosscheck archivelog all;
crosscheck archivelog like '%ARC00012.001'
crosscheck archivelog from sequence 12;
crosscheck archivelog until sequence 522;
=====================================================
=====================================================
RMAN 的validate 命令
1 validate 命令验证备份集片是否能够被还原
2 list backup summary; 得到了备份集得主键ID如40,然后validate backupset 40;
=====================================================
=====================================================
RMAN 的备份保存策略以及change ,delete命令
0.带delete参数的change 命令删除备份集,从备份介质,并且从控制文件和恢复目录中删除。
change backupset 117,118 delete;
change backuppiece 1304 delete;
change archivelog until logseq =544 delete;
1.两类策略:恢复窗口备份保存策略(recovery windows backup retension policy) 基于时间
备份冗余备份保存策略(backup redundancy backup retension policy) 基于备份的数量
两类策略互相排斥
2.即使使用了备份保存策略,备份到期并不删除,只是在RMAN目录中标记为丢弃,看到的状态依旧为available;
要查看标记为丢弃的备份 report obsolete,只有使用delete obsolete才真正物理删除。
3.configure retension policy to recovery window of 7 days;
configure retension policy to redundancy 3;
显示结果 show all;
4.查看到期丢弃的备份时,可能需要手工保存一些备份 ,可以使用change 命令带keep 参数,使用这个命令后,那些被修改的备份将被认为是个long-term backup,不在受保存策略影响也就是说delete obsolete 也不删除。
5.要使备份时候不受保存策略影响 ,使用带keep参数的backup 命令
backup database keep forever;
backup database keep 5 days;
6.change 命令功能
可以修改备份为永久保存并将以及该备份的相关的日志保存下来,保证总能将备份恢复到当前时间点
change backupset 31 keep forever logs;
可以设置备份丢弃的新日期 ,将备份在多保存7 天,7 天后将删除
change backupset 32 keep until time 'sysdata + 7' logs;
7.change 可以将备份集设置为unavailable
change backupset 33 unavailable;
标记为unavailable状态的备份集并不参与crosscheck;
=====================================================
=====================================================
恢复目录的记录删除
1. $ORACLE_HOME/rdbms/admin/prgrmanc.sql 脚本定期删除恢复目录中具有DELETED状态的记录
2. 要删除旧的对应物记录incarnation.必须从DBINC 表中删除这些对应物,使用RC_DATABASE_INCARNATION 视图来确定要删除的对应物。记录要删除的每个对应物的DBINC_KEY
随后启动SQL*Plus,执行delete from dbinc where dbinc_key=2;
=====================================================
=====================================================
手工同步恢复目录
resync catalog;
Oracle同步恢复目录的时候,首先创建快照控制文件,然后比较这个文件和恢复目录,完成后,Oracle 更新恢复目录,使恢复目录和控制文件同步
=====================================================
=====================================================
在RMAN 中存储脚本
1,连接到目标数据库和恢复目录
rman target / catalog rman/rman@rman9i
2,创建脚本
RMAN>create script my_bk_script
2>{backup database plus archivelog;}
create script my_bk_script
3,打印脚本
RMAN>print script my_bk_script;
printing stored scipt:my_bk_script
{backup database plus archivelog;}
4,运行这个脚本,备份目标数据库
RMAN>run {execute scipt my_bk_script;}
5 删除脚本
RMAN>delete script my_bk_script;
=====================================================
=====================================================
archivelog模式下的完全恢复
step1:set oracle_sid=recover
rman target rman_backup/password
configure controlfile autobackup on;
step2:backup database plus archivelog delete input;
step3:shutdown immediate;
step4:重命名所有的数据文件和控制文件,不重命名联机重做日志。
step5: startup nomount;
set DBID=****
restore controlfile from autobackup;
alter database mount;
step6: restore database;
recover database;
alter database open resetlogs;
表空间恢复
sql"alter tablespace users offline";
sql"alter tablespace tools offline";
restore tablespace users,tools;
recover tablespace users,tools;
sql"alter tablespace users online";
sql"alter tablespace tools online";
数据文件恢复
sql"alter database datafile 3 offline";
sql"alter database datafile 'd:oracleoradatausers01.dbf' offline";
restore datafile 3
restore datafile 'd:oracleoradatausers01.dbf';
recover datafile 3
recover datafile 'd:oracleoradatausers01.dbf';
sql"alter database datafile 3 online";
sql"alter database datafile 'd:oracleoradatausers01.dbf'online";
=====================================================
=====================================================
切换当前的incarnation 回到resetlogs 前RESET DATABASE TO INCARNATION inc_key
=====================================================
=====================================================
RMAN 高级恢复
1 基于时间点的恢复
run
{
set until time "to_date('07/01/02 15:00:00','mm/dd/yy hh24:mi:ss')"'
restore database;
recover database;
alter database open resetlogs;
}
2 基于SCN 的恢复
startup mount;
restore database UNTIL SCN 10000;
recover database UNTIL SCN 10000;
alter database open resetlogs;
3 基于日志序列的恢复
startup mount;
restore database UNTIL SEQUENCE 100 thread 1;
recover database UNTIL SEQUENCE 100 thread 1;
alter database open resetlogs;
==================================
c:/> rman cmdfile='' log=''
在run{}脚本里面,format后面的参数含义:%t代表当前时间,s%代表备份集,%p代表备份片
使用恢复目录数据库执行RMAN步骤
我想建立一个RMAN备份机制,本机为目标数据库,sid为orcl10的数据库为恢复目录来做备份,但总不成功,以下是我的执行步骤:
SQL> conn sys/e2000jl@orcl10 as sysdba
Connected.
SQL> create user rman
2 identified by rman123;
User created.
SQL> grant dba to rman;
Grant succeeded.
C:\Documents and Settings\zouyang>rman target sys/system catalog rman/rman123@orcl10
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1227672490)
connected to recovery catalog database
recovery catalog is not installed
RMAN> show channel for device type disk;
recovery catalog is not installed
recovery catalog is not installed
RMAN-00571: ===============================================
RMAN-00569: =========ERROR MESSAGE STACK FOLLOWS ========
RMAN-00571: ===============================================
RMAN-03002: failure of show command at 10/14/2009 09:30:02
RMAN-06429: RCVCAT database is not compatible with this version of RMAN
RMAN>
可以连接上恢复目录数据库,但是无法使用这个恢复目录,Oracle报错“recovery catalog is not installed”。
在网上搜了下,重新建立步骤如下:
第一步:Create Recovery Catalog
First create a user to hold the recovery catalog:
-- Create tablepsace to hold repository
SQL> create tablespace rman_tools
2 datafile
3 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL10\rman01.dbf'
4 size 100m;
Tablespace created
-- Create rman schema owner
SQL> create user rman
2 identified by rman123
3 default tablespace rman_tools
4 quota unlimited on rman_tools;
User created
C:\Documents and Settings\zouyang>rman catalog rman/rman123@orcl10
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
RMAN-00571: ===============================================
RMAN-00569: ====== ERROR MESSAGE STACK FOLLOWS ==========
RMAN-00571: ===============================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04004: error from recovery catalog database: ORA-01045: user RMAN lacks CREATE SESSION privilege; logon denied
-- 报错!要给rman用户分配一定的权限!
SQL> grant connect,resource,create session,recovery_catalog_owner
2 to rman;
Grant succeeded
C:\Documents and Settings\zouyang>rman catalog rman/rman123@orcl10
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 rman_tools;
recovery catalog created ——很好!!建立了!!
可是,当我重新连接,显示RMAN设置信息时又报错了!!
C:\Documents and Settings\zouyang>rman target sys/system catalog rman/rman123@orcl10
Recovery Manager: Release 10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1227672490)
connected to recovery catalog database
RMAN> show channel for device type disk;
RMAN configuration parameters are:
RMAN-00571: ===============================================
RMAN-00569: ========= ERROR MESSAGE STACK FOLLOWS =======
RMAN-00571: ===============================================
RMAN-03002: failure of show command at 10/14/2009 10:32:36
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
RMAN>
又在网上查找原因,原来还需要注册数据库!!
第二步:Register Database
Each database to be backed up by RMAN must be registered!
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> show channel for device type disk;
RMAN configuration parameters are:CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\BACKUP\RMAN\%d_%s.bak';
RMAN>
成功啦!!!
http://407882.blog.51cto.com/397882/212142
=========================================================
oracle10g用rman全备及控制文件在别的机器还原实验
利用rman全备文件(控制文件、归档日志、数据文件)在别处一台oracle10g上还原
要求两台服务器的oracle版本一致并且数据文件、控制文件、归档日志文件目录结构一样
rman全备是用nocatalog方式备份的,所以备份集信息保存在控制文件里。在这里证明一点,就是利用全备方式所备份出来的控制文件含的备份集信息是不全的,如果原来的控制文件丢失会给恢复带来一定麻烦,只有通过
DBMS_BACKUP_RESTORE包来恢复。但如果打开自动备份控制文件功能就不一样了。
rman全备脚本:
#!/bin/bash
rman target sys/sysdba nocatalog configure controlfile autobackup on ;
全备后的文件如下:
cd /u01/rman
[oracle@test rman]$ ll
总计 754936
-rw-r----- 1 oracle oinstall 375029760 12-20 22:48 full_wapdb_01k2ot0u_1_1
-rw-r----- 1 oracle oinstall 339255296 12-20 22:48 full_wapdb_02k2ot0u_1_1
-rw-r----- 1 oracle oinstall 7110656 12-20 22:45 full_wapdb_03k2ot0u_1_1
-rw-r----- 1 oracle oinstall 50874880 12-20 22:49 redolog_wapdb_04k2ot6v_1_1
--------------------------------------------------------------------------------
由于备份是nocatalog所以备份集信息是写到控制文件里的,用全备出来的控制文件信息是不全的。
来验证一下:(把日志文件 控制文件 数据文件删除)
1.从全备文件恢复
[oracle@test ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on 星期六 12月 20 23:28:31 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: oradb (not mounted)
RMAN> restore controlfile from '/u01/rman/full_wapdb_03k2ot0u_1_1';
Starting restore at 20-12月-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/u01/app/oracle/oradata/oradb/control01.ctl
output filename=/u01/app/oracle/oradata/oradb/control02.ctl
output filename=/u01/app/oracle/oradata/oradb/control03.ctl
Finished restore at 20-12月-08
这样三个控制文件就恢复了
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> list backup;
using target database control file instead of recovery catalog
在恢复出来的控制文件里找不到备份的信息
2.用自动备份控制文件来恢复(把刚才的三个控制文件删除)
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 167772160 bytes
Fixed Size 1266392 bytes
Variable Size 83889448 bytes
Database Buffers 79691776 bytes
Redo Buffers 2924544 bytes
RMAN> exit
--------------------------------------------------------------------------------
2.再来看看用自动备份恢复的实验
Recovery Manager complete.
[oracle@test ~]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on 星期六 12月 20 23:34:45 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: oradb (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/flash_recovery_area/ORADB/autobackup/2008_12_20/o1_mf_s_674002170_4nt1hx4z_.bkp';
Starting restore at 20-12月-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
output filename=/u01/app/oracle/oradata/oradb/control01.ctl
output filename=/u01/app/oracle/oradata/oradb/control02.ctl
output filename=/u01/app/oracle/oradata/oradb/control03.ctl
Finished restore at 20-12月-08
重新从autobackup里还原三个控制文件
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> list backup;
using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 6.77M DISK 00:00:06 20-12月-08
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224548
Piece Name: /u01/rman/full_wapdb_03k2ot0u_1_1
Control File Included: Ckp SCN: 339825 Ckp time: 20-12月-08
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 357.65M DISK 00:02:44 20-12月-08
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224548
Piece Name: /u01/rman/full_wapdb_01k2ot0u_1_1
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 Full 339824 20-12月-08 /u01/app/oracle/oradata/oradb/system01.dbf
4 Full 339824 20-12月-08 /u01/app/oracle/oradata/oradb/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 323.53M DISK 00:02:45 20-12月-08
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224548
Piece Name: /u01/rman/full_wapdb_02k2ot0u_1_1
List of Datafiles in backup set 3
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
2 Full 339825 20-12月-08 /u01/app/oracle/oradata/oradb/undotbs01.dbf
3 Full 339825 20-12月-08 /u01/app/oracle/oradata/oradb/sysaux01.dbf
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
4 48.52M DISK 00:00:21 20-12月-08
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20081220T224901
Piece Name: /u01/rman/redolog_wapdb_04k2ot6v_1_1
List of Archived Logs in backup set 4
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ---------- ---------- ---------
1 29 327057 20-12月-08 340013 20-12月-08
这次rman找回了备份集的信息
3.开始恢复
RMAN> restore database;
Starting restore at 20-12月-08
Starting implicit crosscheck backup at 20-12月-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 20-12月-08
Starting implicit crosscheck copy at 20-12月-08
using channel ORA_DISK_1
Finished implicit crosscheck copy at 20-12月-08
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/ORADB/autobackup/2008_12_20/o1_mf_s_674002170_4nt1hx4z_.bkp
File Name: /u01/app/oracle/flash_recovery_area/ORADB/archivelog/2008_12_20/o1_mf_1_30_4nt1jdhs_.arc
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/oradb/system01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/oradb/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/rman/full_wapdb_01k2ot0u_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/rman/full_wapdb_01k2ot0u_1_1 tag=TAG20081220T224548
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u01/app/oracle/oradata/oradb/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/oradb/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u01/rman/full_wapdb_02k2ot0u_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/rman/full_wapdb_02k2ot0u_1_1 tag=TAG20081220T224548
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 20-12月-08
RMAN> recover database noredo;
Starting recover at 20-12月-08
using channel ORA_DISK_1
Finished recover at 20-12月-08
RMAN> alter database open resetlogs;(注意在线日志不能恢复,用resetlogs打开)
database opened
RMAN> exit
恢复结束。
结论:
如果用rman选择nocatalog方式备份,因为备份信息放到控制文件里,所以控制文件非常重要,即使是全备,其里的备份信息也不全,必需打开自动备份控制文件configure controlfile autobackup on ;
一定要保存好自动备份文件。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40226/showart_1730431.html
发表评论
-
mysql 定时任务
2015-11-03 09:57 785定时任务 查看event是否开启: show variabl ... -
tomcat服务器大数量数据提交Post too large解决办法
2015-10-29 11:05 741tomcat默认设置能接收HTTP POST请求的大小最大 ... -
Tomcat启动内存设置
2015-10-20 15:40 702Tomcat的启动分为startupo.bat启动和注册为w ... -
Java串口包Javax.comm的安装
2015-10-12 16:32 702安装个java的串口包安装了半天,一直找不到串口,现在终于搞 ... -
在 Java 应用程序中访问 USB 设备
2015-10-10 17:49 969介绍 USB、jUSB 和 JSR- ... -
自动生成Myeclipse7.5注册码
2015-08-11 16:46 491package com.rbt.action; impor ... -
mysql定时器
2015-08-04 14:01 6105.1以后可以使用 ALTER EVENT `tes ... -
oracle安装成功后,更改字符集
2015-07-23 11:53 646看了网上的文章,乱码有以下几种可能 1. 操作系统的字符集 ... -
运用navicat for mysql实现定时备份
2015-06-05 15:02 1092使用navicat for mysql实现定时备份 首 ... -
利用html5调用本地摄像头拍照上传图片
2015-05-18 09:36 2614测试只有PC上可以,手机上不行 <!DOCTYPE ... -
必须Mark!最佳HTML5应用开发工具推荐
2015-05-15 22:50 971摘要:HTML5自诞生以来,作为新一代的Web标准,越来 ... -
Mobl试用二
2015-05-13 14:28 652最近有空又看了一下Mobl的一些说语法,备忘一下: 1 ... -
Nginx配置文件详细说明
2015-05-08 19:58 620在此记录下Nginx服务器nginx.conf的配置文件说明 ... -
axis调用cxf
2015-04-23 13:51 5611、写address时不用加?wsdl Service s ... -
Oracle10g数据文件太大,导致C盘空间不够用的解决方法
2015-03-19 15:22 944由于在安装的时候将Oracle安装到了C盘,表空间也创建到了C ... -
mysql 获取第一个汉字首字母
2015-03-18 17:48 656select dmlb, dmz, dmsm1, CHAR ... -
failed to install Tomcat6 service解决办法
2015-02-12 09:20 542最近我重装了一下tomcat 6.0,可不知为什么,总是安装 ... -
tomcat 分配java内存
2015-02-11 10:37 607//首先检查程序有没有限入死循环 这个问题主要还是由这个问 ... -
[Android算法] Android蓝牙开发浅谈
2014-12-15 15:27 675对于一般的软件开发人 ... -
Android 内存溢出解决方案(OOM) 整理总结
2014-11-21 10:12 756原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出 ...
相关推荐
本指南将为初学者详细解析如何在Oracle 10g中使用RMAN进行备份,确保数据库的安全运行。 一、RMAN简介 RMAN是Oracle数据库的内置组件,可以直接与数据库实例和控制文件通信。它提供了命令行接口和图形用户界面,...
Oracle 10g的RMAN(Recovery Manager)是Oracle数据库管理系统中用于数据备份和恢复的强大工具。在本文中,我们将深入探讨RMAN的工作原理、关键特性以及如何使用它进行有效的备份与恢复操作。 首先,RMAN是Oracle...
10. **数据泵导出导入**:RMAN可以与Oracle Data Pump协同工作,用于数据库的迁移和克隆,以及进行数据的导入和导出。 理解并熟练掌握RMAN是每个Oracle DBA必备的技能。通过阅读《Oracle Database 11g RMAN备份与...
- Oracle服务器有2个节点,oracle的asm(自动存储管理)存储空间为5.5T,剩余1.9T,每天占用约10G左右空间。 - **建议:**不要将备份存储放在asm中,以免asm出现故障导致数据丢失。建议申请额外的磁盘空间并挂载到...
- **`export PATH=$PATH:$ORACLE_HOME/bin`**: 更新了系统路径变量,确保RMAN命令能够被识别。 - **`export ORACLE_BASE=/u01/app/oracle`** - **`export ORACLE_HOME=/u01/app/oracle/product/11.2/db_1`** - **`...
Oracle 11g 的 Recovery Manager (RMAN) 是一个强大的工具,专为数据库备份和恢复设计。本手册详细阐述了 RMAN 的语法和用法,是数据库管理员进行数据保护和故障恢复的重要参考资料。以下是 RMAN 的核心知识点: 一...
### Oracle 10g RMAN备份与恢复 在Oracle数据库管理中,RMAN(Recovery Manager)是一个重要的工具,用于数据库备份、恢复以及灾难恢复。本文将基于提供的标题、描述和部分上下文内容来深入探讨Oracle 10g环境下...
本话题主要探讨如何在Oracle 10g环境中使用RMAN对Oracle 9i的完整备份进行恢复操作。 在Oracle 9i中执行RMAN全备时,通常会包括数据库的所有数据文件、控制文件、重做日志文件以及相关的参数文件。RMAN全备份的基本...
RMAN是向后兼容的,意味着从Oracle Database 10g升级到11g时,原有的备份和恢复策略无需做出调整。 高可用性(HA)是另外一个重要的概念,它涉及到如何防止系统部分或全部故障,保证用户无法察觉系统故障。HA解决...
Oracle 11g 中的RMAN(Recovery Manager)是Oracle数据库系统中一个重要的备份和恢复工具,它允许管理员执行数据库级别的备份,以及对数据文件、控制文件、重做日志文件等进行备份操作。RMAN是操作系统无关的,这...
在Oracle 10G版本中,RMAN提供了多种功能,包括表空间级别的恢复,这在数据丢失或系统故障时尤为重要。下面将详细介绍如何在Oracle 10G中使用RMAN进行表空间恢复。 首先,了解RMAN的基本结构。RMAN是通过PL/SQL接口...
Windows Oracle11g 备份与还原 Oracle11g 数据库备份与还原是数据库管理中非常重要的一部分,掌握备份与还原技术可以帮助数据库管理员快速恢复数据库,减少数据丢失的风险。本文将详细介绍 Oracle11g 数据库备份与...
以下是对Oracle 11g基于RMAN的备份与恢复的详细说明: 1. 备份整个数据库: 要备份整个数据库,可以通过RMAN命令行工具进行操作。在命令行输入`rman target/`来启动RMAN,然后执行`backup database;`命令,这将备份...
Oracle 数据库 RMAN 环境配置详解 Oracle 数据库 RMAN 环境配置是指在 Oracle 数据库中使用 ...RMAN> configure snapshot controlfile name to '/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife_test.f';
以上步骤是Oracle 10g RAC数据库通过RMAN恢复到异地单机的基本流程。在实际操作中,还应根据具体环境和需求调整某些步骤,如处理redo log、控制文件、Undo表空间等。在整个过程中,确保数据的安全性,遵循最佳实践,...
在 Oracle 10g 中,虽然 `LOG_ARCHIVE_START` 参数不再需要显式设置,但其他配置方式基本保持不变。 RMAN 命令的使用也十分灵活,可以通过指定 `target`、`catalog`、`nocatalog` 等参数来连接目标数据库和恢复目录...
Oracle 11g 的 RMAN (Recovery Manager) 是一种强大的数据库备份和恢复工具,它提供了灵活、自动化的备份方案。在 Windows 和 Linux 环境中部署 RMAN 定时备份是确保数据安全和业务连续性的重要步骤。以下是部署 ...
在Oracle11g中,可以使用RMAN的`RESTORE DATABASE`或`RESTORE DATAFILE`命令来恢复数据文件。 4. **应用重做日志**:恢复数据文件后,必须应用从故障时间点到当前的重做记录,以使数据达到一致状态。`RECOVER ...