ORA-12154 when using Database Link

We're running 11r2 on our servers. I have a primary db and a standby db, using Data Guard. The standby is open for read-only querying. We are not using ASM.
The primary (and thus the standby) have a PUBLIC database link to a third db server.
When I run a query against the database link on the primary: select * from test@MyDBlink; Everything works fine.
When I run the same query against the database link on the standby: select * from test@MyDBlink; I get ORA-12154: TNS:could not resolve the connect identifier.
I check that the db link exists on the standby. It does.
I go to command prompt on the standby and run "tnsping MyDBlink". It executes fine. It says "Used TNSNAMES adapater to resolve the alias" and sure enough, MyDBlink is referenced in the TNSNAMES.ORA.
I also run "tnsping IP-of-MyDBlink" to doublecheck. No issues.
What is going on that is blocking the db link on the standby? Many reports utilize that standby and I'd hate to deny them the functionality of a db link.
Thanks

893968 wrote:
We're running 11r2 on our servers. I have a primary db and a standby db, using Data Guard. The standby is open for read-only querying. We are not using ASM.
The primary (and thus the standby) have a PUBLIC database link to a third db server.
When I run a query against the database link on the primary: select * from test@MyDBlink; Everything works fine.
When I run the same query against the database link on the standby: select * from test@MyDBlink; I get ORA-12154: TNS:could not resolve the connect identifier.
I check that the db link exists on the standby. It does.
I go to command prompt on the standby and run "tnsping MyDBlink". It executes fine. It says "Used TNSNAMES adapater to resolve the alias" and sure enough, MyDBlink is referenced in the TNSNAMES.ORA.
I also run "tnsping IP-of-MyDBlink" to doublecheck. No issues.
What is going on that is blocking the db link on the standby? Many reports utilize that standby and I'd hate to deny them the functionality of a db link.
ThanksMost people with this problem don't understand that the dblink is just another client, no different than sqplus running on the same machine - and therefore the link uses the tnsames in the ORACLE_HOME of the database containing the link. But it seems from the steps you've described that you've grasped that. The only thing I can think of off the top of my head is when you try sqlplus from the standby server you are hitting a different tnsnames than the one the database is using.

Similar Messages

  • 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)

  • ORA-01406 error encountered when using database link

    I am moving data between two different databases using a database link on Oracle 8.1.5. The database statement looks like:
    insert into TABLE@DATABASELINK
    (COLUMNS)
    select (COLUMNS) from TABLE
    One of the database columns is defined as varchar2(4000) on both the source and target database tables. When the data in this column on the source database is greater than 2000 characters, the database query generates the message:
    ORA-01406: fetched column value was truncated
    I have verified that the target column is defined as varchar2(4000), and have also verified that it is this varchar2(4000) column that is causing the problem. I have also tested out that this error only occurs when the varchar field is more than 2000 characters; if I remove characters so that the source field is less than or equal to 2000 characters, this error is no longer generated and the data is inserted to the target database table.
    Is this a limit with database links or some other database parameter that is not set up correctly?
    Thanks...Theresa Tucci

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

  • Ora-12154  problem with database link and transparent gateway

    Hello,
    I’m trying to make a communication between oracle and SQL server 2005.
    I use oracle 10g E.E Release 10.2.0.3.0 and the transparent gateway for SQL server 10201_gatway_win32.zip.
    Install:
    The oracle database is installed into a server named ss-serv. This server has two partition disk C and E. Oracle database is installed in E and the gateway in C. There is already a database (instance) running in the oracle home (in E).
    I configured the gateway as described into: http://download.oracle.com/docs/cd/B...3/conf_sql.htm.
    In sql server 2005, there is a database running named ClientTricks.
    I created a user named Avogadro with a login.
    In the partition C where the gateway is installed, the file inittg4msql.ora is like this:
    HS_FDS_CONNECT_INFO= ss-serv. ClientTricks
    The file sqlnet.ora where the gateway is installed is configured like this:
    SQLNET.AUTHENTIFICATION_SERVICES=(NTS)
    NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
    I configured the listener that is in the C partition where the gateway is installed, and the tnsnames that is in the oracle database in E partition disk like this:
    Listener :
    LISTENER=
    (ADDRESS=
    (PROTOCOL=TCP)
    (HOST=ss-serv)
    (PORT=1521))
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=tg4msql)
    (ORACLE_HOME=C:\oracle\product\10.2.0\tg_1)
    (PROGRAM=tg4msql)
    tnsnames:
    mytg4msql=
    (DESCRIPTION=
    (ADDRESS=
    (PROTOCOL=TCP)
    (HOST=ss-serv)
    (PORT=1521)
    (CONNECT_DATA=
    (SID=tg4msql))
    (HS=OK))
    After edited the listener, I stop and start the listener for the transparent gateway from administrative tools in the services.
    Then, connected in oracle (in a database named fakeclient) I created a database link in sqlplus.The the dblink were created, but when I tried to querry some data from ClientTricks by executing the following instructions:
    select * from s_client@dblink
    i got this fatal and terrible error :
    ora-12154 TNS:could not resolve the connect identifier specified
    I verified all my procedure and stapes, all seems to be good. I did a tnsping of mytg4msql
    I got this error in the command prompt:TNS-03505 fail to resolve name
    Could someone help me ?
    Sorry for my English ,I’m French
    best regards

    Hi Mkirtley,
    i clarify you what i've done:
    Pease have a look in the link in my first post. Then, i said that in oracle database home the listener is in port 1521
    here is this listener:
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=PLSExtproc)
    (ORACLE_HOME=E:\oracle\production\10.2.0\db_1)
    (PROGRAM=extproc)
    LISTENER=
    (DESCRIPTION_LIST=
    (DESCRIPTION=
    (ADDRESS= (PROTOCOL=TCP)(HOST=ss-serv)(PORT=1521))
    (ADDRESS= (PROTOCOL=IPC)(KEY=EXTPROC0))
    Here is the tnsnames.ora in oracle database home:
    N.B in this ora file, there's already some descriptions for the database running, so i just add these lines under the description in ora file.Here is:
    Jest=
    (DESCRIPTION=
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(HOST=ss-serv)(PORT=2000))
    (CONNECT_DATA=
    (SID=tg4msql)
    (HS=OK)
    for the listener of the gateway (installed in C partition):
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=tg4msql)
    (ORACLE_HOME=C:\oracle\production\10.2.0\tg_1)
    (PROGRAM=tg4msql)
    LISTENER=
    (DESCRIPTION_LIST=
    (DESCRIPTION=
    (ADDRESS= (PROTOCOL=TCP)(HOST=ss-serv)(PORT=2000))
    (ADDRESS= (PROTOCOL=IPC)(KEY=EXTPROC1))
    here are all i did.
    Best regards

  • Timeout when using database link connecting to a remote database

    Hi,
    I have another strange problem. I have two computers A and B. Both have an Oracle database server instance. I manage the one in B (which is my local computer) but not the one in A (which is a computer where I have a user account and an Oracle account but I don't own or manage).
    I tried to establish a database link on the database in B pointing to the one in A. This works.
    When I try the opposite, that is, establish a database link on the database in A pointing to the one in B I cannot get it work. I can create the database link but then when I try to use it (e.g., by submitting a "SELECT") it blocks for a long time and finally returns "ORA-12535: TNS:operation timed out". I tried to execute telnet from A to B using the port of the Oracle database server in B and it seems that the connection is established. I tried something similar with tnsping but this does not work, as I get again the timeout. I tried deactivating the firewall on my computer B, but it does not work either (besides, the telnet passes through even if I have the firewall activated).
    Any idea?
    My TNSPING looks like this:
    tnsping '(DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <the-target-ip>)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = XE)
    I also tried with:
    tnsping '(ADDRESS = (PROTOCOL = TCP)(HOST = <the-target-ip>)(PORT = 1521))';
    I'm lost... Any ideas are very much appreciated.
    Thanks!

    From A to B and from B to A can you ping ... post the output surrounded by tags for formatting.
    Do the same thing for TNSPING.
    What do these computers have in the way of firewalls and antivirus products installed and how are they configured?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Broken Pipe Error when using database link

    We are using WebLogic 6.1 sp2 / oracle database 8.1.6. / thin drivers.
    The connection works fine, unit I try to access a view that has a union and db links
    in it.
    We have used one or the other (view or a dblink) and it works, but when used together,
    we get broken pipe error.
    I haven't proven that this is the cause, I will try to setup a test, but I was wondering
    if this is a known issue or what ??
    thanks
    Rich

    You need to create the catalog views that support distributed SQL in your remote database (the database you connect to via db_link).
    To create these views, connect "/ as sysdba" and run:
    $ORACLE_HOME/rdbms/admin/catproc.sql
    which will in turn call several other scripts including: $ORACLE_HOME/rdbms/admin/catrpc.sql (which creates your missing view)
    It is best to run the whole catproc.sql script (and not just the catrpc script).
    You can run and rerun catproc.sql several times quite safely.
    Cheers

  • Error When Using DataBase LINK in pl/sql

    I have cursor fetching some values from remote db and i m trying to store values in local table (see code below) I can run the select query alone succefully but when i use it inside plsql it fails with error.
    DECLARE
    TYPE MY_CURSOR
    IS
         REF
         CURSOR;
              THE_CURSOR MY_CURSOR;
              V_CT          NUMBER(18);
              V_PSN_ID      VARCHAR2(30);
              V_INTERNET_ID VARCHAR2(75);
         BEGIN
              V_CT                                                                           :=0;
              OPEN THE_CURSOR FOR SELECT PSN_ID, 'TEST' FROM TABLE_A@PRO1 WHERE TABLE_A.SEQ_A<=1000;
              LOOP
                   FETCH THE_CURSOR INTO V_PSN_ID, V_INTERNET_ID;
              EXIT
         WHEN THE_CURSOR%NOTFOUND;
               INSERT INTO PSN_EMAIL_SENT_TO@local
                        (PSN_ID, LAST_UPDT_DT
                        ) VALUES
                        (V_PSN_ID, SYSDATE
              V_CT:=V_CT+1;
         END LOOP;
         CLOSE THE_CURSOR;
         DBMS_OUTPUT.PUT_LINE
              TO_CHAR(V_CT)
    END;
    Error report:
    ORA-04052: error occurred when looking up remote object  TABLE_A@PRO1
    ORA-00604: error occurred at recursive SQL level 1
    ORA-04029: error ORA-1775 occurred when querying ORA_KGLR7_DEPENDENCIES
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01775: looping chain of synonyms
    ORA-02063: preceding 3 lines from PRO1
    04052. 00000 -  "error occurred when looking up remote object %s%s%s%s%s"
    *Cause:    An error has occurred when trying to look up a remote object.
    *Action:   Fix the error.  Make sure the remote database system has run
               KGLR.SQL to create necessary views used for querying/looking up
               objects stored in the database.

    You need to create the catalog views that support distributed SQL in your remote database (the database you connect to via db_link).
    To create these views, connect "/ as sysdba" and run:
    $ORACLE_HOME/rdbms/admin/catproc.sql
    which will in turn call several other scripts including: $ORACLE_HOME/rdbms/admin/catrpc.sql (which creates your missing view)
    It is best to run the whole catproc.sql script (and not just the catrpc script).
    You can run and rerun catproc.sql several times quite safely.
    Cheers

  • ORA-02020: too many database links in use ; but OK with where clause...

    Hello all,
    I have a view called V_MEDGEN_LISTRADIO but I can't run
    SELECT * FROM V_MEDGEN_LISTRADIO
    ORA-02020: too many database links in useThe cause is that we call in the view 5 tables over dblink and the open_links parameter is set to 4.
    What is strange is that when I run this select by adding a where clause then it works!
    SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;Can someone explain me ? (use of index so all tables are not called ???)
    Thanks

    Explain plan for SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;
    | Id  | Operation                              | Name            | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                       |                 |     1 |   244 |    19   (6)| 00:00:01 |       |       |        |      |
    |   1 |  SORT ORDER BY                         |                 |     1 |   244 |    19   (6)| 00:00:01 |       |       |        |      |
    |   2 |   NESTED LOOPS                         |                 |     1 |   244 |    18   (0)| 00:00:01 |       |       |        |      |
    |   3 |    NESTED LOOPS                        |                 |     1 |   218 |    17   (0)| 00:00:01 |       |       |        |      |
    |   4 |     NESTED LOOPS                       |                 |     1 |   188 |    15   (0)| 00:00:01 |       |       |        |      |
    |   5 |      NESTED LOOPS                      |                 |     3 |   384 |    10   (0)| 00:00:01 |       |       |        |      |
    |   6 |       NESTED LOOPS                     |                 |     3 |   186 |     4   (0)| 00:00:01 |       |       |        |      |
    |   7 |        REMOTE                          | SPRR            |     1 |    20 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |   8 |        REMOTE                          | MPAT_MF         |     3 |   126 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |   9 |       REMOTE                           | SPER_P          |     1 |    66 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |* 10 |      TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL |     1 |    60 |     3   (0)| 00:00:01 | ROWID | ROWID |        |      |
    |* 11 |       INDEX RANGE SCAN                 | DOSMED_MPR_IDX2 |     2 |       |     1   (0)| 00:00:01 |       |       |        |      |
    |  12 |     REMOTE                             | MEP             |     1 |    30 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  13 |    REMOTE                              | SSV             |     1 |    26 |     1   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    Predicate Information (identified by operation id):
      10 - filter("DM"."EXAM_TYPE"='TELEM')
      11 - access("DM"."MPR"="P"."SPER")
    Remote SQL Information (identified by operation id):
       7 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE "SPRR"=3645 (accessing 'DEV10_DBLK' )
       8 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE "SPRR_MF"=3645 AND NVL("AU",:1+1)>=:2 AND
           "RMPB"='PRINC' AND "DU"<=:3 (accessing 'DEV10_DBLK' )
       9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE "SPER"=:1 (accessing 'ORAP_DBLK' )
      12 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
      13 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )Explain plan for SELECT * FROM V_MEDGEN_LISTRADIO
    Plan hash value: 3820716840
    | Id  | Operation                                | Name                  | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                         |                       |     7 |  1708 |   771   (1)| 00:00:10 |       |       |        |      |
    |   1 |  SORT ORDER BY                           |                       |     7 |  1708 |   771   (1)| 00:00:10 |       |       |        |      |
    |   2 |   NESTED LOOPS                           |                       |     7 |  1708 |   770   (1)| 00:00:10 |       |       |        |      |
    |   3 |    NESTED LOOPS                          |                       |     7 |  1568 |   763   (1)| 00:00:10 |       |       |        |      |
    |   4 |     NESTED LOOPS                         |                       |     7 |  1386 |   756   (1)| 00:00:10 |       |       |        |      |
    |   5 |      NESTED LOOPS                        |                       |     7 |  1176 |   742   (1)| 00:00:09 |       |       |        |      |
    |   6 |       NESTED LOOPS                       |                       |   194 | 24444 |   414   (1)| 00:00:05 |       |       |        |      |
    |   7 |        TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL       |   194 | 11640 |    23   (0)| 00:00:01 | ROWID | ROWID |        |      |
    |*  8 |         INDEX RANGE SCAN                 | DOSMED_EXAM_TYPE_IDX2 |   194 |       |     1   (0)| 00:00:01 |       |       |        |      |
    |   9 |        REMOTE                            | SPER_P                |     1 |    66 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  10 |       REMOTE                             | MPAT_MF               |     1 |    42 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |  11 |      REMOTE                              | MEP                   |     1 |    30 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  12 |     REMOTE                               | SSV                   |     1 |    26 |     1   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  13 |    REMOTE                                | SPRR                  |     1 |    20 |     1   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    Predicate Information (identified by operation id):
       8 - access("DM"."EXAM_TYPE"='TELEM')
    Remote SQL Information (identified by operation id):
       9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE :1="SPER" (accessing 'ORAP_DBLK' )
      10 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE NVL("AU",:1+1)>=:2 AND "RMPB"='PRINC' AND "DU"<=:3 AND
            :4="SPAT" (accessing 'DEV10_DBLK' )
      11 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
      12 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )
      13 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE :1="SPRR" (accessing 'DEV10_DBLK' )

  • Ora-12154 when trying to connect to database from fortran application

    I am trying to connect to database and run an simple select query to a table(without any where clause) using pro*fortran code.
    the connect strng is like
    exec sql connect :uidpwd
    where uidpwd = username/password@SID
    SID and tnsnames connect string are the same.
    The fortran (profortran) code is placed in the database server and there are no errors when make is run.
    Tnsping is working fine, also i am able to conect using sql*plus and run the same query.
    Please help
    Thanks and Regards
    Nitin

    Hi Nitin
    Thanks for the helpful! With your point I'm now Pro! Great thanks.
    By the way have your seen that?
    Files such as LISTENER.ORA, TNSNAMES.ORA, SQLNET.ORA, if configured manually, or copied and edited from earlier releases of Oracle Database may have record attributes that are incompatible with Oracle Database 10g release 2. The software cannot read such files. The required record format is stream_lf and the record attributes are carriage_control and carriage_return.
    This may result in:
    Inability to start the listener
    Services not registered with the listener
    Inability to connect to other databases
    ORA-12154: TNS:could not resolve service name
    Run the following command on each file affected:
    $ DIR/FULL filename
    An output similar to the following may be displayed:
    Record format: Variable length, maximum 255 bytes
    Record attributes: Carriage return carriage control
    If the output includes the preceding entries, then run the following command:
    $ CONVERT/FDL=SYS$INPUT filename filename
    RECORD
    CARRIAGE_CONTROL CARRIAGE_RETURN
    FORMAT STREAM_LF
    ^Z
    Otherwise herewith an interesting metalink note. Doc ID:      Note:437597.1
    Subject:      Ora-12154 When Executing Pro*Fortran Code Compiled With Oracle 10g.
    Hope this will also help you...
    Cheers
    Hubert

  • ORA-12154 when connect to Ora10 using an odbc from visual C++

    Hello
    I have the follong problem , I have a machine that must access to an oracle database , I have made an Odbc Conection and if I make atest there is no one problem and the test is sucessfully . My problem is when I 'm trying to access using my visual c++ program in this case I get an ORA -12154 error , using the same odbc connection that I have probe, also I have probe this program over others machines and there is no problem to access to the database . Can anyone tell me something ??
    The machine is an windows XP and the programa is a Visual C++.net .

    Well we have find the problem , was the path of the application . this has 84 characters we have put our program in a shortest path and now works!!!!

  • Adding REDO_Collector and Error:ORA-02082: a loopback database link...

    Hi, when I tried to add REDO Collector by command
    avorcldb add_collector -srcname av_db -agentname avagent -colltype REDO -av hostname:port:service name
    I got following:
    Collector added successfully
    Collector name (collname): REDO_Collector
    ERROR: ORA-02082: a loopback database link must have a connection qualifier.
    Any idea...? Please..

    i tried using -srcuser and i am getting the following error message
    avorcldb add_collector -srcname ORCLDB -agentname ORADB_AGENT -colltype REDO -srcuser av_user -av oraods.domain.com:1532:ORCL.WORLD
    unrecognized argument -srcuser was ignored
    unrecognized argument av_user was ignored
    collector REDO_Collector for source ORCLDB already exists
    initializing REDO Collector
    ERROR: could not get AV source user connection using jdbc:oracle:oci:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oraods.domain.com)(PORT=1532))(CONNECT_DATA=(SERVICE_NAME=ORCL.WORLD)))
    ERROR: java.sql.SQLException: ORA-01017: invalid username/password; logon denied

  • 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..

  • ORA-02020 too many database links

    Hello,
    I'm getting the ORA-02020 too many database links error in my Apex application. This error occurs when I run an interactive report in a page. There are 21 pages and 7 database links in the application. Each page has one interactive report that references one database link in the region source.
    The database links are referenced in each page as follows: database link1 (page 1); database link2 (pages 2 and 3); database link3 (pages 4-7), database link4 (pages 8-15); database link5 (pages 16-18); database link6 (pages 19); and database link7 (pages 20-21). Each database link is referenced to separate schemas in one remote Oracle database.
    I tried to eliminate the error by setting the open_links and open_links_per_instance parameters in the init.ora file of the remote and XE databases to 100 then restarted the both databases. This solution did not work. I created separate Application Processes from the Shared Components to close each database link by implementing the following:
    Click on Shared Components&gt; Logic &gt; Application Processes &gt; Create &gt;
    Name: CLOSE_LINK1
    Sequence: 1
    Point: On Load: Before Header (page template header)
    Type: PL/SQL Anonymous Block
    Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    Error Message: Database Link Error
    When I run the application now, the ORA-02081: database link is not open error appears.
    Please help anyone! I know someone has experienced these same errors.
    Thanks,
    Ms. H

    Joel,
    Thank you for your quick response. For clarification purposes, could you provide samples for 1) issuing the CLOSE DATABASE LINK and catching the exception; and 2) querying from V$DBLINK prior to issuing the CLOSE DATABASE LINK from the Shared Components &gt; Logic &gt; Application Processes?
    Lets assume the following query with a database link in the region source is referenced for Page 1.
    Page 1 - Employee Listing
    Region Source:
    select ename, job, hiredate
    from scott.emp@link1
    Lets assume the following Application Processes from the Shared Components is referenced to close the database link:
    Click on Shared Components&gt; Logic &gt; Application Processes &gt; Create &gt;
    Name: CLOSE_LINK1
    Sequence: 1
    Point: On Load: Before Header (page template header)
    Type: PL/SQL Anonymous Block
    Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    Error Message: Database Link Error
    My thoughts are to do the following:
    1. Log in SQL*Plus as SYS
    SQL&gt; grant select to v_$dblink to scott;
    2. In Apex, goto Shared Components&gt; Logic &gt; Application Processes and add the following queries in the Process Text:
    Name: CLOSE_LINK1
    Sequence: 1
    Process Text:
    select db_link from v$dblink;
    execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    3. Catch the exception???
    Your assistance is greatly appreciated. :8}
    Ms. H

  • 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.

  • URGENT : ORA 302000 when using TEXT_IO.fopen

    Hi,
    I get this error ORA 302000 when using TEXT_IO package, the code I use is
    new_file:=text_io.fopen('c:\text.txt','r')
    i don't have the description of this ORA 302000 , pls does anyone have it?

    Hi,
    I know it's been 2 years but it's still up to date for me.
    I tried the suggested piece of code to trace the error but it did not bring anything more
    EXCEPTION
    When Others then
    srw.Message( 2, 'EXCEPTION ' || SQLCODE || ' in common package. Can not open the file ');
    IF SQLCODE = -302000 then
    LOOP
    EXIT WHEN TOOL_ERR.NERRORS = 0;
    SRW.MESSAGE( 667, TO_CHAR(TOOL_ERR.CODE) || ': ' || TOOL_ERR.MESSAGE);
    TOOL_ERR.POP;
    END LOOP;
    END IF;
    srw.Message( 3, 'EXCEPTION ' || SQLCODE || ' in com package. Can not open the file ' || I_Desname || ' : ' || SQLERRM );
    Only Message 2 and 3 are displayed in the trace file
    Any other suggestion?
    Manu

Maybe you are looking for

  • White lines generated in a txt File when using variable substitution

    Hello, I have a problem with a File generated by XI, my File Adapter is using variable substitution with reference to a field of my message type. I use content conversion as well and the generated file has a white line in top of file. How could I avo

  • Kext causing kernel panic? Need help troubleshooting, please.

    Hello all, I'm a new face here and have been fortunate enough to never really need support, however at this point, I'm completely lost. First of all I want to apologize if my English is bad, Swedish is my native language. My specs: MBP 5,1 (late 2008

  • FireWire on MacPro - some disks mounting, some don't

    Hello I seem to have a FireWire problem on my Mac Pro. I have a removable hard disk case from WiebeTech (FW 800 and USB 2.0) that has refused to let me mount disks since I got the Mac Pro. USB works, but not FW. I thought it must be a problem with th

  • Cancel M/t Doc with Quality Stock

    Dear All,         I am facing the problem in cancellation of material document with Quality Stock. I am explaining my scenario, when GR is posted the stock directly comes to Quality stock because, QM is activated.After that QM users release the quali

  • Is it a BUG?, or this can be solved?

    The Issue: Basically I developed this particular site with Muse and I am using Business Catalyst for CRM and E-Commerce, I am using many custom javascripts and CSS to do many of the functions missing in Bc, most of these styles and scripts run in the