Clean solution to use Database Links in OLEDB source

Hi,
I have a connection to server A and from there, I have access to a set of views that are behind a database link.
All the queries I can do follow have the following semantic:
SELECT CODE, DESCRIPTRION
FROM STUDENT@DBLINK_DEV
but then in production it will be
SELECT CODE, DESCRIPTRION
FROM STUDENT@DBLINK_PRD
Is there any clean solution to have the dblink in a parameter without having to use a SQL statement inside package variable?
Thank you

 I dislike the fact that I cannot simply copy paste thecode into the sql query of the oledb source.
Why do you have to even do that?
The variable takes care of the query by itself by means of expression so all that you do is set expression
and map the variable.
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • Database link form OLEDB source

    Hello
    Is there any possibility to create a Database link from oledb datasource in Oracle 11g? mayby you have any suggestion how can I access Oledb via Oracle, since the Generic Connectivity is not available in the Oracle 11g.
    Many thanks,
    Wojtek

    Hi Wojtek,
    To avoid any confusion I will clarify that Generic Connectivity is available in 11g as the product Database Gateway for ODBC (DG4ODBC). This a direct replacement for the 10g generic connectiivty products, such as HSODBC. However, what is no longer available in 11g is HSOLEDB and only ODBC connectiivty is available using the gateway products but not OLEDB.
    The Oracle OLEDB provider is still available and the following note may help -
    Master Note For The Oracle Provider for OLE DB (OLE DB) (Doc ID 1132946.1)
    Regards,
    Mike

  • TNS-12666 error occures when using database link

    When I am trying to use database link
    defined in my database the following error occures:
    TNS-12666 Dedicated server: outbound transport protocol different from inbound.
    In documentation is stated to resolve such an error to
    specify the same protocol in the SQL*Net connect string or alias for the outbound connection as that used for the inbound connection.
    I have in tnsnames.ora defined network service name
    by which I can connect to such a database by SQL*Plus
    without any problems, why can I not do such a thing
    via database link?
    Thanks a lot for advise, ...

    Could you change the following entry in your 'sqlnet.ora' file and try?
    SQLNET.AUTHENTICATION_SERVICES = (NONE)

  • How to Execute a Remote Procedure in Portal using Database Link

    Hi,
    I followed the instructions to create a Portal form for a remote procedure. But I am encountering the following error. Can someone advise what may be the cause?
    Failed to execute - Missing string(create_package_body) language(us) domain (wwv) sub_domain (wwv_builder) (WWV-04300)
    ORA-04020: deadlock detected while trying to lock object PUBLIC.PORTLET_SCHEMA (WWV-11230)
    Failed to parse as PORTAL - (WWV-08300)
    PURPOSE
    How to execute a remote procedure in Portal using Database Link.
    DESCRIPTION
    This procedure assumes that you have two databases, one of which is remote, and Portal is configured in the other.
    Remote Database A:
    ==================
    1) Create a procedure as follows: Create or Replace PROCEDURE SCOTT.ADD_TWO_VALUES ( v_one IN NUMBER, v_two IN NUMBER, v_result OUT NUMBER) as begin v_result :=v_one+v_two; end; 2) Grant execute privileges to PUBLIC on the procedure.
    Database B (where Portal is configured): ========================================
    1) Create a public database link and choose to connect as a specific user (say SYSTEM). By default, in an Oracle 8i database, the "global_names" parameter in initSID.ora (or init.ora) file is set to "true". This Global Naming parameter enforces that a dblink has the same name as the database it connects to. Therefore, if the remote global database (A) name is "ora8.acme.com" then the database link should also be named as "ora8.acme.com".
    2) Create a synonym for the procedure in Database A. Make sure you fully qualify the procedure name in the remote database (like SCOTT.ADD_TWO_VALUES).
    3) Create a dynamic page to execute the procedure. The ORACLE tags in the dynamic page will look similar to the following: <ORACLE> DECLARE v_total NUMBER; BEGIN ADD_TWO_VALUES(:v_one,:v_two, v_total); htp.p('The total is => '); htp.p('<input type="TEXT" VALUE='||v_total||'>'); htp.para; htp.anchor('http://<machine.domain:port#>/pls/portal30/SCOTT.DYN_ADD_TWO_VALUES.show_parms', 'Re-Execute Procedure'); END; </ORACLE>
    4) Portal does not have an option to create a form based on a synonym. Therefore, if you want to create a form instead of a dynamic page, create a wrapper procedure and then create a form based on this procedure. For example: Create or Replace PROCEDURE PORTAL30.ADD_TWO_VALUES_PR ( v_one IN NUMBER, v_two IN NUMBER, v_total OUT NUMBER) as begin add_two_values(v_one, v_two, v_total); end;
    5) Grant execute privileges to PUBLIC on the procedure.

    hello...
    any input will welcomed... Thanks..

  • Adding user to the oracle database using database link - is it possible?

    Hi, i wolud like to manage my databases using one client. I easilly operate on my distriubuted tables but i have problem with creating users in distribiuted database. Is it possible to create users in distributed database using database links? or it have to be done locally using some stored procedures or sth similar?

    The SQL syntax of the CREATE USER statement doesn't support DB links, the only way to do it would be with stored procedures. There might be an Oracle SP for that or for generic remote execution of SQL, but I'm not familiar with such.

  • How to use database link in from6i?

    I can use database link in sql plus,but i can't use it in forms6i,why? thanks

    Don't know why.
    What I always do is create a synonym on the local database which points (through the db link) to the object on the other database.
    Regards,
    Meine

  • SSIS 2012 ETL is failing only at one server (No BIDS) but running successfully from BIDS on different sever . In this ETL, I have used Stored Procedure in OLEDB Source.

    Hi Guys,
    SSIS 2012 ETL is failing only at one server (No BIDS) but running successfully from BIDS on different sever . In this ETL, I have used Stored Procedure in OLEDB Source.
    Note: I have couple of ETLs developed in 2005 using same logic and upgraded to 2012, working perfectly.
    I am getting Error Message:
    SSIS
    Error Code
    DTS_E_OLEDBERROR. 
    An OLE DB
    error has occurred.
    Error code: 0x80004005.
    An
    OLE DB
    record is available. 
    Source: "Microsoft OLE DB Provider for SQL Server" 
    Hresult: 0x80004005 
    Description: "Error converting data type varchar to datetime.".
    Unable
    to retrieve
    column information
    from the data
    source. Make
    sure your target
    table in
    the database is
    available.
    "OLE DB Source"
    failed validation
    and returned
    validation status
    "VS_ISBROKEN".
    I tried below word around and found It is working perfectly.
    I loaded data into a table (dbo.TEMP) using Stored procedure and then I used this dbo.TEMP table in OLEDB source and then found no issue.
    MY SP Details: (This SP I am calling in OLEDB source of ETL) and when I run it from one server IT is working fine and when I run from ETL dedicated Server getting error:   Guys Help me out.
    USE
    [TEST_DB]
    GO
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    ALTER
    PROCEDURE  [DBO].[SP_TEST]
    --EXEC [DBO].[SP_TEST] '2014-09-30','2014-10-01'
    @FROMDATETIME
    DATETIME,
    @TODATETIME
    DATETIME
    AS
    SET
    NOCOUNT ON
    BEGIN
    DECLARE
    @FROMDATEKEY INT,
    @TODATEKEY INT,
    SET
    @FROMDATEKEY=
    CONVERT(VARCHAR(10),@FROMDATETIME,112)
    SET
    @TODATEKEY=
    CONVERT(VARCHAR(10),@TODATETIME,112)
    IF 1 = 1
    BEGIN
    SELECT
    CAST(NULL
    AS DATETIME) 
    AS TXN_DATE
    , CAST(NULL
    AS DATETIME
    ) AS PROCESS_DATE     
    , CAST(NULL
    AS money)
    AS  S1_AMT
    , CAST(NULL
    AS money)
    AS  S2_AMOUNT
    , CAST(NULL
    AS money)
    AS  S2_INVALID_AMOUNT
    , CAST(NULL
    AS money)
    AS  INVALID_MOVED_IN_VALID_S2_AMOUNT
    , CAST(NULL
    AS VARCHAR(20))
    AS SYSTEM_ID
    , CAST(NULL
    AS money)
    AS  S3_AMT
    END
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_1
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    UNION
    ALL
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_2
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    UNION
    ALL
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_3
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    END
    Data Source Mode: SQL Command for Variable
    "EXEC [DBO].[SP_TEST]  '"+ (DT_WSTR, 24) @[User::V_EXTRACT_FROM_DT]  +"','"+ (DT_WSTR, 24) @[User::V_EXTRACT_TO_DT]  +"'"
    Where variable @[User::V_EXTRACT_FROM_DT] and @[User::V_EXTRACT_TO_DT] is defined as DATETIME 
    Thanks Shiven:) If Answer is Helpful, Please Vote

    Hi,
    Yes you are right. At one sever where I was getting error, DateTime was in USA format and Where It was running successfully was in AUS format.
    I changed from USA to AUS and I did another changes:
    Data Source Mode: SQL
    Command
    EXEC  [DBO].[SP_TEST] 
    @FROMDATETIME = ?,
    @TODATETIME = ?
    and It is working fine.
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • OWB 10g -- Can't Create Database Links for Data Source and Target

    We installed OWB 10g server components on a Unix box running Oracle 10g (R2) database. The Designer Repository is in one instance. The Runtime Repository and the Target are in another instance. The OWB client component was installed on Windows XP. We create a data source module and a target module in OWB. The data source is on another Unix box running Oracle 9i (R2) database. We try to create database links for data source module and target module, respective. But when we created and tested the DB links, the DB links were failed.
    For the database link of data source, we got the following error message:
    Testing...
    Failed.
    SQL Exception
    Repository Error:SQL Exception..
    Class Name: CacheMediator.
    Method Name: getDDEntryFromDB.
    Repository Error Message: ORA-12170: TNS:Connect timeout occurred
    For the database link of target , we got the following error message:
    Testing...
    Failed.
    API2215: Cannot create database link. Please contact Oracle Support with the stack trace and the details on how to reproduce it.
    Repository Error:SQL Exception..
    Class Name: oracle.wh.ui.integrator.common.RepositoryUtils.
    Method Name: createDBLink(String, String, String, String).
    Method Name: -1.
    Repository Error Message: java.sql.SQLException: ORA-00933: SQL command not properly ended.
    However, we could connect to the two databases (data source and target) using the OWB’s utility SQL Plus.
    Please help us to solve this problem. Thank you.

    As I said prior the database link creation should work from within the OWB client (also in 10).
    Regarding your issue when deploying, have you registered your target locations in the deployment manager and did you first deployed your target location's connector which points out to your source?
    I myself had some problems with database link creations in the past and I can't remember exactly what they were but it had something to do with
    - the use of abnormal characters in the database link name
    - long domain name used in as names.default_domain in my sqlnet.ora file
    What you can do is check the actual script created when deploying the database link so see if there's something strange and check if executing the created script manually works or not.

  • Error using database link

    Before creating the link, I went into my init.ora file and made sure the GLOBAL_NAMES entry was false.
    I then created a database link using the following:
    create public database link cindy_link
    connect to system identified by syspswd
    using 'PRECISEI';
    My link was created, but when I attempt to use it, I get the error:
    ORA-02085:database link CINDY_LINK.WORLD connects to PRECISEI.WORLD
    Here is the entry from my tnsnames.ora file:
    PRECISEI =
    (DESCRIPTION =
    (ADDRESS_LINK =
    (ADDRESS =(PROTOCOL = TCP)(HOST = taurus)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = precisei.world)
    Here is the entry from my listener.ora file:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = precisei.world)
    (ORACLE_HOME = E:|oracle\ora81)
    (SID_NAME = precisei)
    (I must admit to not having a full understanding of SID_NAME vs SERVICE_NAME.) I looked in dba_db_links, and my db_link is named CINDY_LINK.WORLD instead of CINDY_LINK.
    Do I have a problem in one of my files?
    I would really appreciate any help.
    Thanks.

    Well, I was facing the same problem but corrected it later on. Let me describe the solution is little detail.
    You need to check few things before creating db link.
    1) db_name and db_domain in init.ora file
    2) global_name in listener.ora file
    3) service name in tnsnames.ora file.
    It seems to me that you have not specified the db_domain in init.ora file. And in that case, you need to follow these steps.
    I am considering here that you have database A on server X and database B on server Y.
    Go to the first server (server X).
    set the global name in init.ora file by following
    Global_name=true
    db_domain=usa.com
    Start and open the database.
    connect as system user.
    (if your oracle sid is orcl then)
    svrmgr30>alter database rename global_name
    to orcl.usa.com;
    this will set the global_name as specified in init.ora file. Here, your SID is orcl and db_domain is usa.com so global_name will be orcl.usa.com.
    svrmgr30>Select * from global_name;
    You get the answer like this.
    Orcl.usa.com
    Now, go to Listener.ora file and change global_name to the new name (orcl.usa.com)
    restart the listener.
    WE WILL SEE ABOUT THE CHANGES OF TNSNAMES.ORA LITTLE LATER.
    Now, go to second server(server Y) and perform the same operation as defined above. i.e. Specify the db_name, db_domain in init.ora file, execute "alter database.." command for setting global_name and edit listener.ora file for new global name.
    Once you do all these you need to create service on server 1 to connect to server 2 and on server2 to connect to server1.
    Go to server X.
    Open tnsnames.ora file and create an entry like this.
    P =
    (DESCRIPTION =
    (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = IP address of B)(Port= 1521)))
    (CONNECT_DATA = (SID = P))
    Here, P is global name of P ( at both the places).
    Now, go to server Y.
    Open tnsnames.ora file and create an entry like this.
    Q =
    (DESCRIPTION =
    (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = IP address of A)(Port= 1521)))
    (CONNECT_DATA = (SID = Q))
    Here, Q is global name of Q ( at both the places).
    you are all set now.
    Create database link between 2 servers now.
    Say these are all your settings..
    Server X is having database A with global_name orcl.usa.com and server Y is having database B with global_name orcl2.us.com
    Now go to server X and create db link to server Y
    Create public database link orcl2.us.com using 'orcl2.us.com'
    (Note. don't miss to create a service 'orcl2.us.com' in server X's tnsnames.ora file)
    And go to server Y and create db link there.
    Create public database link orcl.usa.com using 'orcl.usa.com'
    (Note. don't miss to create a service 'orcl.usa.com' in server Y's tnsnames.ora file)
    hope this helps,
    If this doesn't work, feel free to contact me.
    Kalpen
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by cindy spearman ([email protected]):
    Before creating the link, I went into my init.ora file and made sure the GLOBAL_NAMES entry was false.
    I then created a database link using the following:
    create public database link cindy_link
    connect to system identified by syspswd
    using 'PRECISEI';
    My link was created, but when I attempt to use it, I get the error:
    ORA-02085:database link CINDY_LINK.WORLD connects to PRECISEI.WORLD
    Here is the entry from my tnsnames.ora file:
    PRECISEI =
    (DESCRIPTION =
    (ADDRESS_LINK =
    (ADDRESS =(PROTOCOL = TCP)(HOST = taurus)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = precisei.world)
    Here is the entry from my listener.ora file:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = precisei.world)
    (ORACLE_HOME = E:|oracle\ora81)
    (SID_NAME = precisei)
    (I must admit to not having a full understanding of SID_NAME vs SERVICE_NAME.) I looked in dba_db_links, and my db_link is named CINDY_LINK.WORLD instead of CINDY_LINK.
    Do I have a problem in one of my files?
    I would really appreciate any help.
    Thanks.<HR></BLOCKQUOTE>
    null

  • Using database-link in view to get around ORA-01031 error

    I have been granted select rights on a users table. I am therefore able to select from his table. If however I try create a view against his table I run into the ORA-01031 problem. I have worked around this problem by creating a database-link to myself and then adding that to the view creation and it works. What are the downsides of using the database-link in this way?

    The only down side I have been able to identify is that a extra session is created and that the CPU has a little extra work due to the LOOP BACK that takes place. I need to ensure the network is not unnessesarly used and therefore will need to ensure that 127.0.0.1 (local host) is used in the database connection discription. e.g.
    create database link my_db_link connect to scott identified by tiger using '(description=(address=(protocol=tcp)(host=127.0.0.1) (Port = 1521) ) (connect_data= (sid=ora10g)))';

  • 20 Index Restriction on Remote Tables (i.e. using Database Links)

    The Oracle Database Administrator's Guides for 10g and 11g document a performance restriction that "No more than 20 indexes are considered for a remote table." If I go back to the 8i documentation it says "In cost-based optimization, no more than 20 indexes per remote table are considered when generating query plans. The order of the indexes varies; if the 20-index limitation is exceeded, random variation in query plans may result."
    Does anyone have more details on this performance restriction? In particular I am trying to answer these questions:
    1) Are the 20 indexes which are considered by the CBO still random in 10g?
    2) Can I influence which indexes are considered with index hints or will my hints only be considered if they are for one of the "random" 20 indexes which are being considered by the CBO?
    3) Are there any other approaches or work-arounds to this restriction assuming you need to select from a large remote table with more than 20 indexes (and need to perform the selection using 1 of those indexes to get adequate performance) or do we need to abandon database links for this table?
    Thanks in advance for your input.

    So, here's my simple test.
    SQL>
    SQL> create table gurnish.indexes20plus ( n1 number, n2 number, n3 number, n4 number, n5 number, n6 number, n7 number,
    2 n8 number, n9 number, n10 number, n11 number, n12 number, n13 number, n14 number, n15 number, n16 number,
    3 n17 number, n18 number, n19 number, n20 number, n21 number, n22 number, n23 number, n24 number,
    4 n25 number, n26 number, n28 number);
    create index xin1 on indexes20plus (n1);
    Table created.
    SQL> SQL> create index xin2 on indexes20plus (n2);
    create index xin3 on indexes20plus (n3);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin4 on indexes20plus (n4);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin5 on indexes20plus (n5);
    create index xin6 on indexes20plus (n6);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin7 on indexes20plus (n7);
    Index created.
    SQL> SQL> create index xin8 on indexes20plus (n8);
    Index created.
    SQL> SQL> create index xin9 on indexes20plus (n9);
    Index created.
    SQL>
    SQL> create index xin10 on indexes20plus (n10);
    Index created.
    SQL> SQL> create index xin11 on indexes20plus (n11);
    create index xin12 on indexes20plus (n12);
    create index xin13 on indexes20plus (n13);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin14 on indexes20plus (n14);
    Index created.
    SQL> SQL> create index xin15 on indexes20plus (n15);
    Index created.
    SQL>
    SQL> create index xin16 on indexes20plus (n16);
    Index created.
    SQL>
    SQL> create index xin17 on indexes20plus (n17);
    Index created.
    SQL> SQL> create index xin18 on indexes20plus (n18);
    Index created.
    SQL> SQL> create index xin19 on indexes20plus (n19);
    Index created.
    SQL> SQL> create index xin20 on indexes20plus (n20);
    Index created.
    SQL> SQL> create index xin21 on indexes20plus (n21);
    Index created.
    declare
    i number;
    begin
    for i in 1..100
    loop
    dbms_random.seed(i+100);
    insert into indexes20plus values (dbms_random.value(1,5),dbms_random.value(1,21),dbms_random.RANDOM, dbms_random.RANDOM,dbms_random.value(1,20),
    dbms_random.value(1,4),dbms_random.value(1,6), dbms_random.value(1,7),dbms_random.value(1,9),dbms_random.value(1,10),
    dbms_random.value(1,11),dbms_random.value(1,12),dbms_random.value(1,13),dbms_random.value(1,14),dbms_random.value(1,1),
    dbms_random.value(1,1),dbms_random.value(1,19),dbms_random.value(1,122),dbms_random.value(1,20),dbms_random.value(1,20)
    ,dbms_random.value(4,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20)
    ,dbms_random.value(4,20),dbms_random.value(4,20));
    end loop;
    commit;
    end;
    SQL> set autotrace traceonly
    SQL> l
    1* select * from gurnish.indexes20plus@lvoprds where n1 = 4
    SQL> /
    no rows selected
    Execution Plan
    Plan hash value: 441368878
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU
    )| Time | Inst |
    | 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
    )| 00:00:01 | |
    | 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
    )| 00:00:01 | LVPRD |
    |* 2 | INDEX RANGE SCAN | XIN1 | 1 | | 1 (0
    )| 00:00:01 | LVPRD |
    Predicate Information (identified by operation id):
    2 - access("A1"."N1"=4)
    Note
    - fully remote statement
    - dynamic sampling used for this statement
    Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    1897 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL> select * from gurnish.indexes20plus@lvoprds where n21 = 4;
    no rows selected
    Execution Plan
    Plan hash value: 2929530649
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU
    )| Time | Inst |
    | 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
    )| 00:00:01 | |
    | 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
    )| 00:00:01 | LVPRD |
    |* 2 | INDEX RANGE SCAN | XIN21 | 1 | | 1 (0
    )| 00:00:01 | LVPRD |
    Predicate Information (identified by operation id):
    2 - access("A1"."N21"=4)
    Note
    - fully remote statement
    - dynamic sampling used for this statement
    Statistics
    1 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    1897 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL>

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How to fetch,update,insert the data using database link on diff. servers

    I am using two oracle server.
    1st) Oracle 9i ( Server1 )
    2nd) Oracle 10g ( Server2 )
    3) Forms 6i
    I have created a database link on Server 1 for connecting to Server 2.
    I written a piece of code which will be executed in Forms 6i and is connected to Server1.
    The piece of code brings the data from SErver2 via cursor and I try to insert / update the relevant records
    in my Server1 database users.
    The Insert/Update runs sucessfully but at the time of commit I get the following errors
    in Forms ORA-01041:internal error. hostdef does not exist.
    Then it forcefully rollback the data and come out of the application.
    contact :email-id : [email protected]

    Suggest you test your code from sqlplus before running from forms.
    Start by testing a simple "select sysdate from dual@<database link>;" then test select from application_table@<database link> then test the insert/update code. After it works from sqlplus, then try it from forms.

  • Unable to access remote database object using database link

    Hi all,
    I have created a database link to a remote server
    SQL> create database link remote_link connect to lax_dba identified by lax_dba using 'abc.corp.com';
    database link created
    when i am trying to access any table of lax_dba
    sql> select * from laxtab@remote_link;
    i am getting this Ora error
    ORA-12514: TNS:listener does not currently know of service requested in connect
    I need your help please to solve this issue
    Thanks n Regards
    Laxman

    The database server where you defined the link (not your PC) has resolved 'abc.corp.com' to a server/port/service combination using its tnsnames.ora, sqlnet.ora and possibly ldap.ora settings. You can try
    tnsping abc.corp.comon the server (as ReubenC suggested) to see what it's attempting to connect to. (It's important to do this on the database server and not on your PC as they will have different tns settings etc.)
    It has then found the server and found a listener running on it (so you're getting close), but that remote listener doesn't recognise the service you're asking for. It might be something like the '.com' suffix.

  • Insert using database link

    Now connected to database B :
    INSERT INTO abc_hesids
              (     abc_key,
                   hesid,
                   date_added,
                   date_updated,
                   dob,
                   sex,
                   newnhsno,
                   homeadd,
                   procode3,
                   lopatid
              SELECT     'X',
                        0,
                        sysdate,
                        sysdate,
                        HES_Common.f_string_field('X', 1),
                        HES_Common.f_string_field('X', 2),
                        HES_Common.f_string_field('X', 3),
                        HES_Common.f_string_field('X', 4),
                        HES_Common.f_string_field('X', 5),
                        HES_Common.f_string_field('X', 6)
              FROM dual
    The above INSERT has been reduced down to bare minimum with the following error occurring :
    HES_Common.f_string_field('X', 1),
    ERROR at line 18:
    ORA-02069: global_names parameter must be set to TRUE for this operation
    SQL>
    The abc_hesids table exists in database A and this insert is running in database B. A database link exists such that abc_hesids is a synonym for the table of the same name in database A.
    I want Oracle to insert into the table in database A but use the package HES_Common in database B. I think this is possible but have not done this sort of thing for a while. Note : the package HES_Common exists in both databases A and B
    Any ideas on how to get Oracle to use the local version of the package - do I have to get the DBA to change global_names to TRUE ??

    ORA-02069 global_names parameter must be set to TRUE for this operation
    Cause: A remote mapping of the statement is required but cannot be achieved because GLOBAL_NAMES should be set to TRUE for it to be achieved.
    Action: Issue ALTER SESSION SET GLOBAL_NAMES = TRUE if possible.

Maybe you are looking for