我是靠谱客的博主 犹豫手机,最近开发中收集的这篇文章主要介绍Oracle 11g RMAN备份-一致备份,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

--调整为非归档模式

sys@TESTDB11>shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

--启动到mount状态

sys@TESTDB11>startup mount;

ORACLE instance started.

 

Total System Global Area  855982080 bytes

Fixed Size                  2230792 bytes

Variable Size             641730040 bytes

Database Buffers          209715200 bytes

Redo Buffers                2306048 bytes

Database mounted.

--如果开启了闪回日志,则要关闭闪回日志

sys@TESTDB11>alter database flashback off;

--改变为非归档模式

Database altered.

 

sys@TESTDB11>alter database noarchivelog;

 

Database altered.

--开库

sys@TESTDB11>alter database open;

 

Database altered.

--查看已经运行于非归档模式

sys@TESTDB11>archive log list;

Database log mode              No Archive Mode

Automatic archival             Disabled

Archive destination            /archive2

Oldest online log sequence     22

Current log sequence           24

 

--登录rman后关库

RMAN> shutdown immediate;

 

using target database control file instead of recovery catalog

database closed

database dismounted

Oracle instance shut down

 

--不能进行备份

RMAN> backup database;

 

Starting backup at 2013-08-14 05:42:26

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 08/14/2013 05:42:26

RMAN-06171: not connected to target database

 

--进入nomount状态,仍然不能进行备份

RMAN> startup nomount;

 

connected to target database (not started)

Oracle instance started

 

Total System Global Area     855982080 bytes

 

Fixed Size                     2230792 bytes

Variable Size                641730040 bytes

Database Buffers             209715200 bytes

Redo Buffers                   2306048 bytes

 

RMAN> backup database;

 

Starting backup at 2013-08-14 05:43:17

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=18 device type=DISK

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 08/14/2013 05:43:18

ORA-01507: database not mounted

 

--只有在mount状态下才可进行备份,原因是rman需要控制文件中的信息,同时需要向控制文件中存储信息

RMAN> mount database;

 

database mounted

released channel: ORA_DISK_1

 

--进行全库一致性备份

RMAN> backup database;

 

Starting backup at 2013-08-14 05:48:27

configuration for DISK channel 2 is ignored

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=18 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00001 name=/oradata/system01.dbf

input datafile file number=00002 name=/oradata/sysaux01.dbf

input datafile file number=00005 name=/oradata/example01.dbf

input datafile file number=00003 name=/oradata/undotbs01.dbf

input datafile file number=00007 name=/oradata/fbtbs01.dbf

input datafile file number=00008 name=/oradata/users02.dbf

input datafile file number=00006 name=/oradata/newts01.dbf

input datafile file number=00004 name=/oradata/users01.dbf

channel ORA_DISK_1: starting piece 1 at 2013-08-14 05:48:28

channel ORA_DISK_1: finished piece 1 at 2013-08-14 05:51:01

piece handle=/pooldisk02/backup03/20oh8i5c_1_1 tag=TAG20130814T054828 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:33

Finished backup at 2013-08-14 05:51:01

 

Starting Control File and SPFILE Autobackup at 2013-08-14 05:51:01

piece handle=/u01/app/oracle/fast_recovery_area/TESTDB11/autobackup/2013_08_14/o1_mf_s_823412526_90pr8psq_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 2013-08-14 05:51:04

 

--打开归档模式

sys@TESTDB11>shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

--启动到mount状态

sys@TESTDB11>startup mount;

ORACLE instance started.

 

Total System Global Area  855982080 bytes

Fixed Size                  2230792 bytes

Variable Size             641730040 bytes

Database Buffers          209715200 bytes

Redo Buffers                2306048 bytes

Database mounted.

--修改为归档模式

sys@TESTDB11>alter database archivelog;

 

Database altered.

--查看归档模式

sys@TESTDB11>archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            /archive2

Oldest online log sequence     22

Next log sequence to archive   24

Current log sequence           24

--开库

sys@TESTDB11>alter database open;

 

Database altered.

 

--将原来所有备份删除,包括刚做的一致性备份

RMAN> delete backup;

 

--开归档之后要做一个整库备份(非一致性的)

RMAN> backup database;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17013648/viewspace-1154713/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17013648/viewspace-1154713/

最后

以上就是犹豫手机为你收集整理的Oracle 11g RMAN备份-一致备份的全部内容,希望文章能够帮你解决Oracle 11g RMAN备份-一致备份所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(55)

评论列表共有 0 条评论

立即
投稿
返回
顶部