开发者

Copying production database setup to development database

I am using Oracle 9i, Please suggest how can I select data from one remote database and insert the data in the local database开发者_开发知识库?

Also suggest how the data can be copied from a remote to remote database.


You need to create a database link.

Please refer to this link: http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/ds_concepts.htm#12354

excerpts:

example:

CREATE DATABASE LINK sales.us.americas.acme_auto.com CONNECT TO scott IDENTIFIED BY tiger USING 'sales_us';

query:

For example, using a database link to database sales.division3.acme.com, a user or application can reference remote data as follows:

SELECT * FROM scott.emp@sales.division3.acme.com;  # emp table in scott's schema
SELECT loc FROM scott.dept@sales.division3.acme.com;


Based on the vagueness of the question. Make a backup of production and restore it in development.


If you are talking Microsoft SQL then you can create a Linked Server. Here is an article about doing this in SQL 2008, but you can do it in earlier versions as well. Then you can select from it using a four part name LinkedServer.database.schema.table

http://msdn.microsoft.com/en-us/library/ff772782.aspx


Define a link from the development server to the prooduction server. You can then use a select based insert to copy data into the development server.

Use the SAMPLE clause on the select to retrieve a percentage of the data. For child tables use a WHERE exists clause to copy child rows for which the parent was sampled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜