码迷,mamicode.com
首页 > 数据库 > 详细

Linux oracle cool back scritp

时间:2014-05-27 03:43:10      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:linux oracle cool back scritp

oracle 冷备份是一致性备份,备份的内容有数据文件,redo文件,temp文件,控制文件等,

SQLBLANKLINES ON 是预防脚本中有空格,sqlplus误认为是结束,报

SP2-0734: unknown command beginning "where t.bg..." - rest of line ignored.

错误.


set feedback off heading off verify off trimspool off SQLBLANKLINES ON

set pagesize 0 linesize 200

define dir=‘/u01/backup‘

define script=‘/tmp/coolbak.sql‘

spool &script

select ‘! cp ‘ || name || ‘ &dir ‘ from v$datafile order by 1;

select ‘! cp ‘ || member || ‘ &dir ‘ from v$logfile order by 1;

select ‘! cp ‘ || name || ‘ &dir ‘ from v$controlfile order by 1;

select ‘! cp ‘ || name || ‘ &dir ‘ from v$tempfile order by 1;

create pfile = ’&dir/initDBID.ora’ from spfile;

ho cp /u01/app/oracle/product/11.2.0/db_1/dbs/orapwDBID  ‘ &dir ‘

spool off

shutdown immediate

@&script

startup




本文出自 “Permanent” 博客,谢绝转载!

Linux oracle cool back scritp,布布扣,bubuko.com

Linux oracle cool back scritp

标签:linux oracle cool back scritp

原文地址:http://ericklee.blog.51cto.com/6941516/1412763

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!