为了将导出的逻辑备份刻录到光盘,因一个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/