Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I created a database link using database link.

create public database link REMOTEDB connect to REMOTEUSER identified by REMOTEPWD using 'REMOTEDB';

then i create a table in remote db like,

create table MYTABLE@REMOTEDB (name varchar2(20)));

It says, ORA-02021 DDL operations are not allowed on| a remote database..

Will this Not work on any cost, or am i just missing some permissions to create ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Creating a table through a database link looks like a very bad idea. I cannot see any reason for doing so, therefor i don't think that this can work.

share|improve this answer
    
its not for the usual purpose.. i had to export some data to another datbase (without using usual export/import .dmp) .. anyway, i worked around a little, created tables manually, and inserted datas remotely! –  raj Apr 8 '10 at 9:30

You can call DBMS_SQL remotely to create a table

declare
 v_cursor  NUMBER;
 v_ind      number;
begin
 v_cursor := dbms_sql.open_cursor@dblink;
 dbms_sql.parse@dblink(v_cursor, 'create table t_gm_x (id number)', dbms_sql.native);
 v_ind := dbms_sql.execute@dblink( v_cursor );
end;
/
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.