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

  • SEARCH
  • Home
  • 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 7086825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:35:53+00:00 2026-05-28T07:35:53+00:00

I have written the following query using the documentation at: Oracle Documentation to copy

  • 0

I have written the following query using the documentation at: Oracle Documentation to copy some data from a database/table on my production server to database/table on Sandbox server.

COPY FROM username1/passwd1@<production_IP> to username2/passwd2@<sandbox_IP> INSERT TABLE_C (*) USING
(SELECT * FROM TABLE_C WHERE COL_A = 4884);

However, I am constantly running into Connection failed error. Is there anything wrong with the query?

  • 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-05-28T07:35:53+00:00Added an answer on May 28, 2026 at 7:35 am

    In a typical Oracle environment, you have TNS names set up. That’s a service to lookup the connection parameters for Oracle instances given an SID or service name. In it’s simplest form, TNS names is a file called tnsnames.ora located by the environment variable TNS_ADMIN (which points to the directory where the file is).

    Given the SIDs PROD and SANDBOX, you can then copy the tables from the SQLPLUS command line utility:

    COPY FROM username1/passwd1@PROD to username2/passwd2@SANDBOX
        INSERT TABLE_C (*) USING (SELECT * FROM TABLE_C WHERE COL_A = 4884);
    

    Please note that this COPY command only supports a limited set of Oracle datatypes: char, date, long, varchar2, number.

    If you don’t have TNS names set up, you’ll need to know the host name or IP address, the port number and the service name. The syntax then becomes:

    COPY FROM username1/passwd1@//192.168.3.17:1521/PROD_SERVICE to username2/passwd2@//192.168.4.17:1521/SANDBOX_SERVICE
        INSERT TABLE_C (*) USING (SELECT * FROM TABLE_C WHERE COL_A = 4884);
    

    To determine the SID and/or service name, you best have a look into the TNSNAMES.ORA file on the database server itself. If you are able to login to the database, you can use the following queries to determine the SID and service name (but don’t ask me which is which):

    select name from v$database;
    
    select * from global_name;
    
    select instance_number, instance_name, host_name from v$instance;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a DB2 query to do the following: Create a temp table
I am using System.Data.Sqlite to access SQLite database in C#. I have a query
I have the following Query: SELECT * FROM tbl_Muffins WHERE OvenLoadId IN ( SELECT
I'm trying to execute a query in PostgreSQL using the following code. It's written
I made a blog database and created some tables in it. I have wriTten
I have written the following query: Private Sub Size_Sqft_BeforeUpdate(Cancel As Integer) Me!Size_Sqft = Nz(Me!Size_Sqft,
Following on from my last question : I've written some code to upgrade a
I have written a query, and from the date of birth field, and I
I have a SQL query which is written in string and then executed using
I have written the following simple test in trying to learn Castle Windsor's Fluent

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.