Oracle physical standby中的逻辑备份(exp命令)

为了将导出的逻辑备份刻录到光盘,因一个DVD普通光盘最多能刻录8.5G,因此需要分段导出并压缩后进行刻录,今天在物理灾备库上执行逻辑备份,OS环境为Solaris 10 具体步骤如下:

[@more@]

1、将physical standby库的改为只读模式打开:

-bash-3.00$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Jun 8 11:32:01 2011

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open read only;

Database altered.

SQL> exit

2、执行预先写好的导出脚本expdb_monthly.sh

bash-3.00$ ./expdb_monthly.sh

Export: Release 10.2.0.5.0 - Production on Wed Jun 8 11:34:40 2011

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified users ...

. exporting pre-schema procedural objects and actions

. exporting foreign function library names for user REP

. exporting foreign function library names for user WF

…..

expdb_monthly.sh脚本内容如下:

-bash-3.00$ more expdb_monthly.sh

. /export/home/oracle/.bash_profile

exp system/onewave owner=REP,WF file=/backup20110210_1.dmp,/backup20110210_2.dmp,/ba

ckup20110210_3.dmp log=/backup/monthlybak.log direct=y filesize=33000M statistics=none

cd /backup

compress -f backup20110210_1.dmp

compress -f backup20110210_2.dmp

compress -f backup20110210_3.dmp

将数据库恢复为mount模式:

-bash-3.00$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Jun 8 13:42:25 2011

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL> exit

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

转载于:http://blog.itpub.net/18841027/viewspace-1052529/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值