finance_teacher
asked on
Oracle -- copy table from one db to another db ?
I have two databases (test & dev) on the same machine (server1) and tried running the below in Oracle SQL Developer, but get errors.
How can i easily copy the test database accounting_structure_tab table into dev ?
truncate DEV.ACCOUNTING_STRUCTURE_T AB
INSERT INTO DEV.ACCOUNTING_STRUCTURE_T AB
SELECT *
from TEST.ACCOUNTING_STRUCTURE_ TAB
How can i easily copy the test database accounting_structure_tab table into dev ?
truncate DEV.ACCOUNTING_STRUCTURE_T
INSERT INTO DEV.ACCOUNTING_STRUCTURE_T
SELECT *
from TEST.ACCOUNTING_STRUCTURE_
Do you have a DBLInk? if you do not create one.
INSERT INTO DEV.ACCOUNTING_STRUCTURE_T AB
SELECT *
from TEST.ACCOUNTING_STRUCTURE_ TAB@dblink
INSERT INTO DEV.ACCOUNTING_STRUCTURE_T
SELECT *
from TEST.ACCOUNTING_STRUCTURE_
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is also a sql COPY command.
The docs have the syntax.
The docs have the syntax.
then.... (you need "truncate table" not "truncate")
truncate table ACCOUNTING_STRUCTURE_TAB;
INSERT INTO ACCOUNTING_STRUCTURE_TAB
SELECT *
from ACCOUNTING_STRUCTURE_TAB@y
I assume the table structure is the same in both dev and test?