简体   繁体   中英

How to move table data from one environment to another environment in Oracle

I am a novice Oracle User. I want to move a table records from QA to Test environment. The table already exists in Test. Would it be something like this ?

insert into wKTest01.MyTableIWantToMove select * from wkQA01.MyTableIWantToMove ; 

Any help is greatly appreciated. Both the tables in both environments have same number of columns with same data types.

You can use database links in Oracle to do this.Create a database link in your test database called myQADBLink which points to your QA DB.

The code would look something like this

CREATE DATABASE LINK myQADBLink CONNECT TO <username> identified by
<password> USING
'<QA DBconnect string>';

SELECT 1 FROM dual@myQADBLink; -- This is to test if your dblink is created properly.

Now you can copy from QA to test by saying

INSERT INTO wKTest01.MyTableIWantToMove select * from wkQA01.MyTableIWantToMove@myQADBLink;

Yes, it actually exists, right like you put it.

Here is the full syntax guide for this: http://docs.oracle.com/cd/E17952_01/refman-5.1-en/insert-select.html .

Later, when you might place your tables at the different Oracle instances, google 'Orace DBLink' for the good ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM