在备库上进行热备份--10G之前

25 篇文章 1 订阅
14 篇文章 1 订阅

切换主库日志的脚本 logswitch.sh:

sqlplus -s "sys/<passwd>@<primary_db> as sysdba" <<EOF
alter system archive log current;
exit
EOF

先备份数据库,再运行脚本切换主库的日志,再备份归档日志,具体步骤:

[oracle@dg121-2 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Sep 8 19:19:07 2020

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

connected to target database: ORCL (DBID=1461820645, not open)

RMAN> 
run{
allocate channel c1 type 'sbt_tape' parms='
SBT_LIBRARY=/opt/scutech/dbackup3/lib/libobk.so,
ENV=(URL=http://192.168.87.155:50306/d2/data/0d36020eecec11ea8000b49691622ac4/c7873e9aed0811ea8000b49691622ac4,
EXTRA=X-Access-Key:ea5350ac00fa61d08533a729da808de0)' trace=0;
backup database plus archivelog delete input;
}
RMAN> 2> 3> 4> 5> 6> 7> 

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=363 device type=SBT_TAPE
channel c1: DBackup3 Oracle MMS Library


Starting backup at Sep 08 2020 19:19:14
RMAN-06820: WARNING: failed to archive current log at primary database
ORACLE error from target database: 
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist
......
RMAN>  host '/home/oracle/logswitch.sh';
System altered.
host command complete


RMAN> 
run{
allocate channel c1 type 'sbt_tape' parms='
SBT_LIBRARY=/opt/scutech/dbackup3/lib/libobk.so,
ENV=(URL=http://192.168.87.155:50306/d2/data/0d36020eecec11ea8000b49691622ac4/c7873e9aed0811ea8000b49691622ac4,
EXTRA=X-Access-Key:ea5350ac00fa61d08533a729da808de0)' trace=0;
backup archivelog all delete input;
}

RMAN> 2> 3> 4> 5> 6> 7> 
released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=363 device type=SBT_TAPE
channel c1: DBackup3 Oracle MMS Library

Starting backup at Sep 08 2020 19:21:41
RMAN-06820: WARNING: failed to archive current log at primary database
ORACLE error from target database: 
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist

channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=273 RECID=166 STAMP=1050607241
channel c1: starting piece 1 at Sep 08 2020 19:21:41
channel c1: finished piece 1 at Sep 08 2020 19:21:42
piece handle=4uv9tvm5_1_1 tag=TAG20200908T192141 comment=API Version 2.0,MMS Version 8.2.64.76
channel c1: backup set complete, elapsed time: 00:00:01
channel c1: deleting archived log(s)
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/oradata/cdr1/arc/ORCL1BY/archivelog/2020_09_08/o1_mf_1_273_hogt892p_.arc thread=1 sequence=273
Finished backup at Sep 08 2020 19:21:42
released channel: c1

RMAN> 

文章下方是我的微信,欢迎加我。👇

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姚远Oracle ACE

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值