Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9124727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:37:59+00:00 2026-06-17T06:37:59+00:00

I have 2 Oracle databases and I frequently copy data from prod DB to

  • 0

I have 2 Oracle databases and I frequently copy data from prod DB to test DB using TOAD, by generating insert scripts for Prod DB and running it on the test DB later.

I am trying to do it faster through a batch file.

I think that I can use this solution but the DB has an auto-increment column. If I use this solution, would that column be affected? Do I need to change the script in some way? I haven’t tried this so far as I have no access do the DB and would be able to test this only on Monday.

Is there a better way I can accomplish this? What I am essentially looking for is doing the whole copy procedure using a batch file, which would minimize the time I spend doing this using TOAD.

Also, it’s fine by me if I can be guided in the right direction, if solution is not simple.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:38:00+00:00Added an answer on June 17, 2026 at 6:38 am

    Make sure the two tables have the same structure.

    Connect to the target database.

    Create a public link to the source database. The user should have “CREATE PUBLIC DATABASE LINK” system privilege to do this.

    CREATE PUBLIC DATABASE LINK mylink
      CONNECT TO source_user IDENTIFIED BY source_password
      USING 'source_entry_in_tnsnames';
    

    Copy the data:

    INSERT INTO mytable SELECT * FROM mytable@mylink;
    

    If the primary key of the table comes from a sequence, set the sequence to – at least – the same value as in the source database:

    ALTER SEQUENCE mysequence increment by 100000;
    SELECT mysequence.nextval FROM DUAL;
    ALTER SEQUENCE mysequence increment by 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first some data: we are using Oracle 11g databases. A primary database running on
We have a huge Oracle database and I frequently fetch data using SQL Navigator
We have a problem using ODAC11 (client) and Oracle databases version 9.0 and 9.1.
I have a script that connects to multiple databases (Oracle, MySQL and MSSQL), each
I have 3 Oracle database instances with the same data and scheme that I
I have an Oracle account (schema) of a remote Oracle database. By using this
I have an Oracle 10g database of genomic data with several >100 million row
I am looking into using JBoss 5.1.0GA on Oracle, and have seen this ,
I have worked for 5 years mainly in java desktop applications accessing Oracle databases
I have a c# windows service which updates data in my database using PetaPoco

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.