Oracle physical standby中的邏輯備份(exp命令)

kuqlan發表於2011-07-15

為了將匯出的邏輯備份燒錄到光碟,因一個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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章