oracle备份有哪些技术,oracle技术之oracle一致性备份(冷备份)

1、编写生成备份脚本的脚本

#cold backcup

remark set sql*plus variable to manipulate output         //注释

set feedback off heading off verify  off trimspool off  echo off time off

set pagesize 0  linesize 200

remark set sql*plus user variable used  in this script                //注释

define bakdir='/disk1/backup/anny/cold_bak'                             //备份文件的存放位置

define bakscp='/disk1/backup/anny/cold_bak/cold_cmd.sql'               //执行备份的脚本,自动生成

prompt *** Spooling to &bakscp                        //输出提示语

remark  create a command file with  file backup commands

spool &bakscp

select 'host cp '|| name ||' &bakdir ' from v$datafile order by 1;

select 'host cp '|| name ||' &bakdir ' from v$controlfile order by 1;

spool off;

remark   shutdown the database cleanly

shutdown immediate; ――冷备份需要关库执行

remark run the copy file commands form the operating system

@&bakscp

remark start the database again

startup;

2、执行该脚本生成了一个脚本cold_cmd.sql,并执行该脚本进行冷备份

SQL> conn /as sysdba

Connected.

SQL> @/export/home/oracle/sqlplus/anny_cold_bak

SP2-0734: unknown command beginning "cold backc..." - rest of line ignored.

*** Spooling to /disk1/backup/anny/cold_bak/cold_cmd.sql        ――一下是脚本内容

host cp /u01/app/oracle/oradata/anny/index01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx02.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx03.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx04.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/sysaux01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/system01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/text01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/undotbs01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/user01.dbf /disk1/backup/anny/cold_bak

host cp /disk1/oradata/anny/control02.ctl /disk1/backup/anny/cold_bak

host cp /disk2/oradata/anny/control03.ctl /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/control01.ctl /disk1/backup/anny/cold_bak

Database closed.

Database dismounted.

ORACLE instance shut down.

ORACLE instance started.

Total System Global Area  314572800 bytes

Fixed Size                  1279964 bytes

Variable Size              58722340 bytes

Database Buffers          251658240 bytes

Redo Buffers                2912256 bytes

Database mounted.

Database opened.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值