Hi,
We have 2 databases DB A and DB B. we have created db link between 2 dbs as a2b;
in DB A, we have below table_A and data,
create table table_a (emp_id number, emp_name varchar2(30))
/
insert into table_a values (1,'Test1')
/
insert into table_a values (2,'Test2')
/
insert into table_a values (3,'Test3')
/
insert into table_a values (4,'Test4')
/
insert into table_a values (5,'Test5')
/
commit
/
in DB B, we have below table_B,
create table table_B (emp_id number, emp_name varchar2(30))
/
Now we want to add data from table_A to table_B using a2b db link,
we have tried by below DML statement but it's giving error as "ORA-01031 insufficient privilages" "ORA-02063 preceding line from a2b"
DML: insert into table_b@a2b(emp_id,emp_name) select * from table_a; but it's giving above error
please suggest.
Thanks
ORA-01031 => you're lacking privileges to run the statement. Probably insert on table_b.
Presumably this is because the database link connects to DB B as a user that
- Doesn't own table_B
- Has no insert privileges on table_B
So check which user you connect as and whether this has the right privileges:
select username
from dba_db_links
where db_link = 'A2B';