【DBLINK】不可使用 DBLINK在遠端資料庫上執行DDL類SQL

secooler發表於2010-04-11
很少使用dblink在遠端資料庫中建立表,今天偶爾嘗試,收穫的是“ORA-02021”錯誤。錯誤本身提示的資訊已經非常的明顯:在遠端資料庫不可以執行DDL型別的SQL語句。

簡單記錄一下,供參考。

1.嘗試使用dblink在遠端資料庫建立表
sec@ora10g> create table t@dblink_to_ora10 as select * from t;
create table t@dblink_to_ora10 as select * from t
              *
ERROR at line 1:
ORA-02021: DDL operations are not allowed on a remote database

此處的錯誤資訊已經非常的明顯。

2.使用oerr工具可以查詢到如下的解釋
ora10g@secDB/home/oracle$ oerr ora 2021
02021, 00000, "DDL operations are not allowed on a remote database"
// *Cause: An attempt was made to use a DDL operation on a remote database.
//         For example, "CREATE TABLE tablename@remotedbname ...".
// *Action: To alter the remote database structure, you must connect to the
//          remote database with the appropriate privileges.

3.MOS中的[ID 19304.1]文章也有同樣的描述
Error:  ORA 2021
Text:   DDL operations are not allowed on a remote database
-------------------------------------------------------------------------------
Cause:  An attempt was made to use a DDL operation on a remote database.
        For example, "CREATE TABLE tablename@remotedbname...".
Action: To alter the remote database structure, you must connect to the remote
        database with the appropriate privileges.

4.小結
嘗試--&gt 遇到問題 --&gt 根據提示資訊分析問題 --&gt 總結問題 --&gt 提高。

Good luck.

secooler
10.04.11

-- The End --

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-631838/,如需轉載,請註明出處,否則將追究法律責任。

相關文章