ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle冷备份(一致备份)脚本

Oracle冷备份(一致备份)脚本

原创 Linux操作系统 作者:mengzhaoliang 时间:2008-03-09 00:05:29 0 删除 编辑
'系统:linux redhat 3
closed_backup.sql脚本存放在/u01/backup/目录下

脚本内容:
      1 Remark set sql*plus variables to manipulate output
      2 set feedback off heading off verify off trimspool off
      3 set pagesize 0 linesize 200
      4 Remark set sql*plus user variables used in this script
      5 define dir ='/u01/backup'
      6 define fil='/u01/backup/closed_backup_commands.sql'
      7 prompt *** Spooling to &fil
      8 Remark create a command file with file backup commands
      9 spool &fil
     10 select 'host cp '|| name ||' &dir' from v$datafile order by 1;
     11 select 'host cp '|| member ||' &dir' from v$logfile order by 1;
     12 select 'host cp '|| name ||' &dir' from v$controlfile order by 1;
     13 select 'host cp '|| name ||' &dir' from v$tempfile order by 1;
     14 spool off;
     15 Remark Shutdown the database cleanly
     16 shutdown immediate;
     17 Remark Run the copy file commands from the operation system
     18 @&fil
     19 Remark start the database again
     20 startup;
     21


用oracle中的sys  or  system 用户在sqlplus中运行
>@/u01/backup/closed_backup.sql

即可.

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

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2008-01-30

  • 博文量
    336
  • 访问量
    3085321