Sachin
Sachin

Reputation: 21901

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.

Upvotes: 0

Views: 363

Answers (4)

clyc
clyc

Reputation: 2450

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 [email protected];  # emp table in scott's schema
SELECT loc FROM [email protected];

Upvotes: 1

BillThor
BillThor

Reputation: 7576

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.

Upvotes: 0

theChrisKent
theChrisKent

Reputation: 15099

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

Upvotes: 0

Kuberchaun
Kuberchaun

Reputation: 30324

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

Upvotes: 0

Related Questions