【原创】rman 全库备份脚本
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
【原创】rman 全库备份脚本的更多相关文章
- 从Oracle9i RMAN全库备份迁移到 Oracle10g
1. 创建以下目录: mkdir -pv $ORACLE_BASE/admin/$ORACLE_SID/{{a,b,c,dp,u}dump,pfile} mkdir -pv $ORACLE_BASE/ ...
- MySQL生产库全库备份脚本
创建一个单独的备份用户backup,不要用root 创建备份目录 :mkdir -p /databackup/fullbackup mysql> grant SELECT,RELOAD,SHOW ...
- rman全库恢复到不同主机,不同实例名,不同目录下
一.配置目标主机的ip.hostname及与源端主机的连通性 1.配置目标主机IP 使用图形界面配置IP: administration----network---修改IP(指定静态IP) deact ...
- LINUX学习笔记——LINUX下EXP命令全库备份数据库文件
LINUX下EXP命令全库备份数据库文件 1)建立备份目录,目录操作权限授权给Oracle用户 mkdir /backup --创建backup文件夹 cd / --进入cd语句 ls -l ...
- MySQL 採用Xtrabackup对数据库进行全库备份
1,xtrabackup简单介绍 关于数据库备份以及备份工具.參考:http://blog.itpub.net/26230597/viewspace-1460065/,这里来介绍xtrabackup已 ...
- 从MySQL全库备份中恢复某个库和某张表【转】
从MySQL全库备份中恢复某个库和某张表 一.全库备份-A [root@mha2 backup]#mysqldump -uroot -p123456 --default-character-set=u ...
- 通过Xtrabackup实现MySQL实例的全库备份与按需单库恢复
在实际的生产环境中,为了管理方便,我们一般是通过 Xtrabackup实现实例的全库备份,即将实例上的所有数据库备份. 但是,考虑到快速恢复 我们常常面临的需求是快速还原单个数据库.针对初学者来说,网 ...
- 从MySQL全库备份中恢复某个库和某张表
在Mysqldump官方工具中,如何只恢复某个库呢? 全库备份 [root@HE1 ~]# mysqldump -uroot -p --single-transaction -A --master-d ...
- MySQL用全库备份数据恢复单表数据
备份数据库时,采用了全库备份,但是因为某些原因需要回滚一个表的数据到备份数据库上,如果回滚整个库就比较费时间,因为可能这个表只有几十M,但是其它表可能有十几上百G,这时候就需要将需要恢复的表提取出来了 ...
随机推荐
- vue中采用axios发送请求及拦截器
这几天在使用vue中axios发送get请求的时候很顺手,但是在发送post请求的时候老是在成功的回调函数里边返回参数不存在,当时就纳闷了,经过查阅资料,终于得到了解决方案,在此做一总结: 首先我们在 ...
- function——函数声明头的提升和预解析
函数: 即function语句的集合,就是将多个语句封装到一起: 函数的执行要会自己遍历,遇见函数 a():执行语句,就要移交控制权,函数执行完毕之后,控制权又移交回来了! 函数的参数要罗列在func ...
- localStorage、sessionStorage、cookie、session
localStorage 和 sessionStorage HTML5 提供了两种在客户端存储数据的新方法:localStorage 和 sessionStorage: 两者都是仅在客户端(即浏览器) ...
- IntelliJ Idea使用代码折叠
VS风格: //region xxxxxxxxxxxxxx ............. //endregion 快捷键: Ctrl+Shift+”+/-”,全部展开.折叠
- UVa 11729 Commando War 【贪心】
题意:有n个部下,交待每个部下完成他相应的任务需要bi的时间,然后完成这项任务需要ji的时间, 选择交待任务的顺序,使得总的花费的时间最少 因为不管怎么样,交待所需要的n*bi的时间都是要花费的, 然 ...
- Qwiklab'实验-API Gateway, AWS Lambda'
title: AWS之Qwiklab subtitle: 2. Qwiklab'实验-API Gateway, AWS Lambda' date: 2018-09-20 17:29:20 --- In ...
- Linux 环境中从源代码编译安装 ReText 问题与解决
从源代码编译安装 ReText 问题与解决 1. 如何安装 Python Markups 1.1 从 https://launchpad.net/python-markups 下载 Python Ma ...
- laravel报错:Unable to detect application namespace.
使用报错:Unable to detect application namespace. 是conposer.json格式不对
- Vue系列(一):简介、起步、常用指令、事件和属性、模板、过滤器
一. Vue.js简介 1. Vue.js是什么 Vue.js也称为Vue,读音/vju:/,类似view,错误读音v-u-e 是一个轻量级MVVM(Model-View-ViewModel)框架,和 ...
- vue项目中,如何对static文件夹下的静态文件添加时间戳,以达到清除缓存
例如config.js文件是存放在static文件夹下,里面存放的是websocket信息,需要经常改动.改动了以后由于缓存信息,使其不生效,因此需要对引入的文件添加时间戳. 最新方法: 注意转义符的 ...