如何將Oracle11g備份匯入到10g
11g 匯出語句:EXPDP USERID='facial/facial@orcl as sysdba' schemas=facial directory=DATA_PUMP_DIRdumpfile=aa.dmp logfile=aa.log version=10.2.0.1.0
其中,紅色文字部分是根據需要改寫的地方。例如我的使用者facial密碼是facial,資料庫sid是orcl,schemas要到出的使用者名稱是facial,要匯入到10.2.0.1.0版本的Oracle資料庫中去。aa.dmp和aa.log將會在11g的dpdump目錄中產生,例如我的11g裝在了E盤下面,於是aa.dmp將會在E:\app\Administrator\admin\orcl\dpdump目錄下被產生。
二、在10g伺服器上,使用impdp命令恢複資料
準備工作:1.建庫2.建資料表空間3.建使用者並授權4.將aa.dmp拷貝到10g的dpdump目錄下
--建立資料表空間
createtablespace TS_Facial datafile'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\Facial.DBF' size 500M autoextend on next50M;
--建立使用者
create user Facial identified by Facial default tablespace TS_Facial;
--授權給使用者
grantconnect,resource,dba to Facial;
aa.dmp和 aa.log 放在E:\oracle\product\10.2.0\admin\orcl\dpdump目錄下
10g 匯入語句:IMPDP USERID='facial/facial@orcl as sysdba' schemas=facial directory=DATA_PUMP_DIR dumpfile=aa.dmp logfile=aa.logversion=10.2.0.1.0
其中紅色部分是根據需要改寫的地方。例如我的使用者facial密碼是facial,資料庫sid是orcl,schemas要匯入使用者名為facial,要匯入到10.2.0.1.0版本的Oracle資料庫中去。aa.log將會在10g的dpdump目錄中產生。
在用expdp的時候可能會報錯,在metink上和蓋總哪兒都找到瞭解決方法
ORA-39213 Metadata processing not available
今天在執行EXPDP時遇到了這個錯誤:
Connectedto: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
Withthe Partitioning, OLAP and Data Mining options
ORA-39006:internal error
ORA-39213:Metadata processing is not available
Metalink確認是一個又來已經的已知問題,可以嘗試執行如下步驟解決:
connect/ as sysdba
executesys.dbms_metadata_util.load_stylesheets;
我的系統中,以上處理過程有效:
OracleDatabase 10g Enterprise Edition Release 10.2.0.2.0 - Production
Withthe Partitioning, OLAP and Data Mining options
SQL>exec dbms_metadata_util.load_stylesheets
PL/SQLprocedure successfully completed.
SQL>exit
此後匯出可以順利執行。