ITPub博客

首页 > 数据库 > > 【DBLINK】不可使用 DBLINK在远程数据库上执行DDL类SQL

【DBLINK】不可使用 DBLINK在远程数据库上执行DDL类SQL

作者:secooler 时间:2020-01-29 14:07:29 0 删除 编辑
很少使用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.小结
尝试--> 遇到问题 --> 根据提示信息分析问题 --> 总结问题 --> 提高。

Good luck.

secooler
10.04.11

-- The End --

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

请登录后发表评论 登录
全部评论
Oracle ACE 总监,阿里云MVP,北京大学理学硕士,恩墨学院创始人,教育专家,中国区 Cloudera 首位官方授权大数据讲师,金牌培训专家,BDA大数据联盟创始人,OCM联盟创始人,ACCUG创始人、ACOUG核心专家,Blogger。

注册时间:2008-03-16

  • 博文量
    1601
  • 访问量
    8477144