rman 全库备份脚本

run {

allocate channel d1 type disk;

allocate channel d2 type disk;

backup full database format '$back_path/`date +%Y%m%d`_full_%d_%s_%p_%u.bak'

tag='full' include current controlfile;

sql 'alter system archive log current';

backup archivelog all format '$back_path/`date +%Y%m%d`_archivelog_%d_%s_%p_%u.bak' delete all input;

release channel d2;

release channel d1;

}

[root@localhost ~]# su - oracle
[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jan 7 10:47:18 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1299576258)

RMAN> run {
2> 
3> allocate channel d1 type disk;
4> 
5> allocate channel d2 type disk;
6> 
7> backup full database format '$back_path/`date +%Y%m%d`_full_%d_%s_%p_%u.bak'
8> 
9> tag='full' include current controlfile;
10> 
11> sql 'alter system archive log current';
12> 
13> backup archivelog all format '$back_path/`date +%Y%m%d`_archivelog_%d_%s_%p_%u.bak' delete all input;
14> 
15> release channel d2;
16> 
17> release channel d1;
18> 
19> }

using target database control file instead of recovery catalog
allocated channel: d1
channel d1: SID=41 device type=DISK

allocated channel: d2
channel d2: SID=46 device type=DISK

Starting backup at 07-JAN-12
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel d1: starting piece 1 at 07-JAN-12
channel d2: starting full datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
channel d2: starting piece 1 at 07-JAN-12
channel d2: finished piece 1 at 07-JAN-12
piece handle=/u02/oradata/`date +2012%mORCL`_full_ORCL_8_1_08n05k5t.bak tag=FULL comment=NONE
channel d2: backup set complete, elapsed time: 00:01:17
channel d2: starting full datafile backup set
channel d2: specifying datafile(s) in backup set
channel d1: finished piece 1 at 07-JAN-12
piece handle=/u02/oradata/`date +2012%mORCL`_full_ORCL_7_1_07n05k5t.bak tag=FULL comment=NONE
channel d1: backup set complete, elapsed time: 00:01:20
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel d1: starting piece 1 at 07-JAN-12
including current control file in backup set
channel d2: starting piece 1 at 07-JAN-12
channel d1: finished piece 1 at 07-JAN-12
piece handle=/u02/oradata/`date +2012%mORCL`_full_ORCL_10_1_0an05k8e.bak tag=FULL comment=NONE
channel d1: backup set complete, elapsed time: 00:00:02
channel d2: finished piece 1 at 07-JAN-12
piece handle=/u02/oradata/`date +2012%mORCL`_full_ORCL_9_1_09n05k8c.bak tag=FULL comment=NONE
channel d2: backup set complete, elapsed time: 00:00:02
Finished backup at 07-JAN-12

sql statement: alter system archive log current

Starting backup at 07-JAN-12
current log archived
channel d1: starting archived log backup set
channel d1: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=2 STAMP=771935241
channel d1: starting piece 1 at 07-JAN-12
channel d2: starting archived log backup set
channel d2: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=3 STAMP=771936534
input archived log thread=1 sequence=6 RECID=4 STAMP=771936534
channel d2: starting piece 1 at 07-JAN-12
channel d1: finished piece 1 at 07-JAN-12
piece handle=/u02/oradata/`date +2012%mORCL`_archivelog_ORCL_11_1_0bn05k8o.bak tag=TAG20120107T104855 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:04
channel d1: deleting archived log(s)
archived log file name=/u02/oradata/1_4_771795526.dbf RECID=2 STAMP=771935241
channel d2: finished piece 1 at 07-JAN-12
piece handle=/u02/oradata/`date +2012%mORCL`_archivelog_ORCL_12_1_0cn05k8p.bak tag=TAG20120107T104855 comment=NONE
channel d2: backup set complete, elapsed time: 00:00:05
channel d2: deleting archived log(s)
archived log file name=/u02/oradata/1_5_771795526.dbf RECID=3 STAMP=771936534
archived log file name=/u02/oradata/1_6_771795526.dbf RECID=4 STAMP=771936534
Finished backup at 07-JAN-12

released channel: d2

released channel: d1

最新文章

  1. nodejs+edatagrid读取本地excel表格
  2. 【转】Handler学习笔记(一)
  3. java web 学习 --第十天(Java三级考试)
  4. 调皮的MySQL服务 请你不要再躲猫猫
  5. UVa10025-The ? 1 ? 2 ? ... ? n = k problem
  6. Qt mac QMYSQL(动态加载插件QPluginLoader的用法)
  7. c# 如何判断字符串中相同字符串的个数 (相同字符在字符串中出现的次数)
  8. MongDB .Net工具库MongoRepository的简单使用
  9. 更改EBS服务器域名/IP
  10. RNN(Recurrent Neural Network)的几个难点
  11. “数学口袋精灵”App的第三个Sprint计划----开发日记
  12. 【BZOJ】4542: [Hnoi2016]大数
  13. Star Schema and Snowflake Schema
  14. linux:根据名称杀死进程
  15. springboot redis多数据源设置
  16. CentOS 7 修改网卡名
  17. Dialog插件artDialog
  18. BFS+优先队列+状态压缩DP+TSP
  19. POJ 3167 Cow Pattern ★(KMP好题)
  20. centos7 杂记

热门文章

  1. Nosql的实际应用场景
  2. python 3.x 学习笔记17(协程以及I/O模式)
  3. <Android Framework 之路>Android5.1 Camera Framework(一)
  4. CF 949C Data Center Maintenance_强联通分量_思维题
  5. 电子邮件的三个协议: SMTP、IMAP、POP3
  6. 小程序全局状态管理,在页面中获取globalData和使用globalSetData
  7. BZOJ 2329/2209 [HNOI2011]括号修复 (splay)
  8. mycql 基本mysql语句(增删改查)
  9. 小学生都能学会的python(<lamda匿名函数,sorted(),filter(),map(),递归函数>)
  10. 2015 Multi-University Training Contest 8 hdu 5384 Danganronpa