How to activate a database link?

How can one activate a database link w/in SQL*Plus or DBA Studio?
I'm trying to re-create my schema in a new instance and in order to execute my materialized view SQL I must first create a new database link. I'm using the same info as in our other instance so am sure the connection will work IF I can get the database link to be 'active'. I created the link in DBA Studio and attempted to test, but received the error "Database link is not active." Canned it and created through SQL*Plus with same result. I see no option to activate and cannot find any info in 8i DBA Handbook or 8i DBA Bible.
Only way to create an active dblink is to find another link that is already active and do a Create Like.
I figure there's an easy solution to this problem, but cannot figure out what it is. Any help is appreciated!
Thanks.

Nathan,
What is the exact sql your using to create the link? Sometimes I've seen OEM say the link is not active when its a private one (the pressing of the TEST button that is). Maybe it's a bug or something (I just tested it now again to make sure I was getting the db link test error). This is with OEM 1.6x though, I thought it would have been fixed by the current version. Maybe it never was a bug I don't know.
I norammly create and activate a db link like this ...
DROP DATABASE LINK DB_TEST;
CREATE PUBLIC DATABASE LINK DB_TEST CONNECT TO <user> IDENTIFIED BY <pass> USING '<tns name entry on the SERVER>;
SELECT NAME FROM V$DATABASE@DB_TEST;
Here's an actual run and gets the databsae name off the linked server ...
15:42:59 ORACLE [->] CREATE DATABASE LINK DB_TEST_PRIVATE CONNECT TO USER1 IDENTIFIED BY
USER1 USING 'TNS1';
Database link created.
15:42:59 ORACLE [->] CREATE PUBLIC DATABASE LINK DB_TEST_PUBLIC CONNECT TO USER1 IDENTIFI
ED BY USER1 USING 'TNS1';
Database link created.
15:42:59 ORACLE [->] SELECT NAME AS "LINK_PRIVATE" FROM V$DATABASE@DB_TEST_PRIVATE;
LINK_PRIV
DEVL
15:43:00 ORACLE [->] SELECT NAME AS "LINK_PUBLIC" FROM V$DATABASE@DB_TEST_PUBLIC;
LINK_PUBL
DEVL
The following link tells more about database links and some good examples ...
http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/server.901/a90117/ds_admin.htm#12904
The folowwing is from that page on checking on current open db links ...
--[START]
You may find it useful to determine which database link connections are currently open in your session. Note that if you connect as SYSDBA, you cannot query a
view to determine all the links open for all sessions; you can only access the link information in the session within which you are working.
The following views show the database link connections that are currently open in your current session:
V$DBLINK (view) : Lists all open database links in your session, that is, all database links with the IN_TRANSACTION column set to YES.
GV$DBLINK (view) : Lists all open database links in your session along with their corresponding instances. This view is useful in an Oracle Real Application Clusters
configuration.
--[END]
Sometimes the v$dblink doesn't show all the active ones (since it might have gotton opened under a different user name or something), but doing a simple select * from dual@DB_LINK, will most certainly open it if the connection is not yet open. Creating the databse link itself does not open the actuall connection.
Hope this helps ya,
Tyler D.

Similar Messages

  • How can i Create Database Link

    Dear Expert,
    I have two servers on that there are two databases then
    how can i create database link.

    CREATE [SHARED][PUBLIC] DATABASE LINK link_name
    [CONNECT TO user IDENTIFIED BY password]
    [AUTHENTICATED BY user IDENTIFIED BY password]
    [USING 'connect_string']

  • Owb92 demo: How to configure workflow database link?

    Hi,
    I follow the doc for owb92 demo, but got error while deploying the wh_proc_loc. The error is as follows. How do configure workflow database link on owb? Thanks.
    RPE-02085: Failed to test wb_rti_workflow_util.initialize through deployed Workflow Database Link ORCL.US.ORACLE.COM@WB_LK_LD_OLAP. Please check that "EXECUTE ANY PROCEDURE" privilege is set and that the OWB Runtime is available.
    - ORA-06550: line 1, column 7:
    PLS-00201: identifier '[email protected]@WB_LK_LD_OLAP' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    Have you checked whether none of the specified errors applies?
    - The user needs the "EXECUTE ANY PROCEDURE" privilege
    - OWB Runtime available, this could mean several things:
    ......* runtime repository unavailable (as in not installed?... unlikely)
    ......* runtime platform service unavailable --> try running service_doctor.sql in directory <your OWB home>\owb\rtp\sql\
    Good luck, Patrick

  • How to create a database link on an ms acces data source

    Hello every body
    Is it possible to create a database link on an MS access data source under
    oracle 10 g and Apex ?
    If yes how to do it ?
    Thanks in advace

    I don't know what Apex is!!! But try to follow these instructions.
    It works for Oracle 9i.
    As far as I know, you are supposed to have installed other than ORACLE Client to complete these instructions.
    1. Control Panel / Administrative Tools / Data Sources (ODBC)
    Folder: System DSN /
    click add
    Choose : Microsoft Access Driver
    Data Source Name : my_test
    Description : any_description_you_want
    click Database/Select... : full pathname for <your_file.mdb>
    click OK
    Click OK
    2. Goto OH\hs\admin:
    2.1) Create a copy of "inithsodbc.ora" file giving it this name:
    initmy_test.ora
    2.2) Edit "initmy_test.ora" and change as below.
    # HS init parameters
    HS_FDS_CONNECT_INFO = my_test
    HS_FDS_TRACE_LEVEL = OFF
    3. Add this entry to listener ( Don't forget to stop/start the listener )
    (SID_DESC =
    (SID_NAME = my_teste)
    (ORACLE_HOME = <Path to OH> ) ### Ex: D:\ORANT901
    (PROGRAM = hsolesql)
    4. Now you need to add entries to point to the HS in the tnsnames.ora :
    access =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=<your_host>)(PORT=1521))
    (CONNECT_DATA=(SID=my_test))
    (HS=my_test)
    5. Now you need to go into the database and create the database link:
    CREATE PUBLIC DATABASE LINK "ACCESS_DB" USING 'access';
    6. select * from your_table@ACCESS_DB;
    HTH
    RK
    Message was edited by:
    RKravcenko

  • Forgot how to call a database link in Apex... @linkname not working for me

    Don't have access to my old apps and I can't remember how to call fields from a database link now...
    when i try
    select "TABLE"."DATE" as "Date"
    from "TABLE" "TABLE" @LINKNAME
    I get ORA-00933: SQL command not properly ended
    Tried CHRISD which is the name of the link, then tried CHRISD.REGRESS.RDBMS.DEV.US.ORACLE.COM which is the entire name.
    Neither one looks right to me but I can't remember the correct syntax for the link name... I remember putting something about userlink in there somewhere but nothing I can think of works.
    anyone?

    select ename from emp@dblink
    ...lose the double quotes.
    Scott

  • How to create a database link between an 8i (apps) database and APEX

    Want to link my Oracle APPS databse on 8i with Oracle XE and APEX. Any idea how to achieve this ?

    I don't know what Apex is!!! But try to follow these instructions.
    It works for Oracle 9i.
    As far as I know, you are supposed to have installed other than ORACLE Client to complete these instructions.
    1. Control Panel / Administrative Tools / Data Sources (ODBC)
    Folder: System DSN /
    click add
    Choose : Microsoft Access Driver
    Data Source Name : my_test
    Description : any_description_you_want
    click Database/Select... : full pathname for <your_file.mdb>
    click OK
    Click OK
    2. Goto OH\hs\admin:
    2.1) Create a copy of "inithsodbc.ora" file giving it this name:
    initmy_test.ora
    2.2) Edit "initmy_test.ora" and change as below.
    # HS init parameters
    HS_FDS_CONNECT_INFO = my_test
    HS_FDS_TRACE_LEVEL = OFF
    3. Add this entry to listener ( Don't forget to stop/start the listener )
    (SID_DESC =
    (SID_NAME = my_teste)
    (ORACLE_HOME = <Path to OH> ) ### Ex: D:\ORANT901
    (PROGRAM = hsolesql)
    4. Now you need to add entries to point to the HS in the tnsnames.ora :
    access =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=<your_host>)(PORT=1521))
    (CONNECT_DATA=(SID=my_test))
    (HS=my_test)
    5. Now you need to go into the database and create the database link:
    CREATE PUBLIC DATABASE LINK "ACCESS_DB" USING 'access';
    6. select * from your_table@ACCESS_DB;
    HTH
    RK
    Message was edited by:
    RKravcenko

  • How Discoverer scheduler handles Database links ?

    I have 2 databases (both Oracle). created a view based on the another database view in the current database using the database link.
    I ran the workbook in discoverer Plus successfully.
    I scheduled the workbook without any problem
    when I tried to open a workbook, I am getting the following error..
    ORA 01017: INVALID USERNAME AND PASSWORD; LOGIN DENIED ORA02063:PRECEEDING LINE FROM
    INPTR (INPTR is the name of the datasource )
    Any ideas??
    Thanks

    See my reply to an earlier post today: "How to Connect to Discoverer Viewer " for more information. (How to Connect to Discoverer Viewer
    Since you have not installed an infrastructure and associated Discoverer with it, you will not see any button / link to create public connections in EM (App Server Control).
    You cannot use an existing database for your infrastructure. The Oracle Application Server infrastructure is installed in its own database.
    Thanks
    Abhinav
    Oracle Business Intelligence Product Management
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN : http://www.oracle.com/technology/products/bi/
    Discoverer : http://www.oracle.com/technology/products/discoverer/
    BI Software : http://www.oracle.com/technology/software/products/ias/devuse.html
    Documentation: http://www.oracle.com/technology/documentation/appserver1012.html
    BI Samples : http://www.oracle.com/technology/products/bi/samples/
    Blog : http://oraclebi.blogspot.com/

  • How to create & use database links

    i have 2 databases (oracle 8.1.6) and (oracle8.1.5)
    i want to call a function of one d/b from another
    i think this is possible via databse links.
    how do i go about creating and using them
    can someone guide me to a site or post an example .
    what all changes do i need to make in my configuration settings of the databases
    null

    Yes, you can do this with database links.
    Please see: http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a76960/ds_admin.htm#22393
    null

  • How to Create Public database link in oracle 9i?

    Friends,
    OS: RHEL AS 3
    DB: 9iR2
    database name 1 = nubul
    database name 2 = test
    in the 'nubul' database server using system user.
    i created a database link to connect the 'test' database
    sql> create public database link test using 'test';
    database link created.
    then i logged in as normal user....
    sql> select count(*) from employee@test
    Error at line 1:
    ORA-12154: TNS: could not resolve service name
    where i am making mistake?
    i gave the linkname as my remote database name.
    am i have to make any entry in the tnsnames.ora?
    thanks & regards

    You have to remember that when you access a dblink, the database where the link is defined is acting as a client to the database to which the link points ... exactly the same as if you you were using sqlplus on the machine hosting the db where the link is defined. In other words, given:
    Host 'Host-src', with database 'db-src', with a dblink 'lk_target'
    Host 'host-trgt', with database 'db-trgt'
    When you connect to db-src and access lk-target, db-src is now acting as a client to db-trgt. Exactly as if you had opened sqlplus on host-src and connected directly to db-trgt. So, given the above scenario
    host-src$> sqlplus scott/tiger@db-src
    sql> select * from emp@lk_target;when you execute that SELECT to the link, the same tns considerations are in effect as if you had
    host-src$> sqlplus scott/tiger@db-trgtThe same tnsnames.ora entry, on the source machine, is required for both.

  • How to create a database link ?

    i want to create a database link.please give mesteps

    There is a chapter in the DBA Administration manual for versions 8.1, 9.2, and 10g on this topic which provide all the information you need.
    You will need to choose the type of database link: global, current user, or imbedded user and if you need a public or private link.
    Basically all you do is create a tnsnames.ora entry for the remote db and then create a database link (See SQL manual entry CREATE DATABASE LINK) that references the tnsnames.ora entry.
    The manuals or the entire manual set can be downloaded from technet.
    HTH -- Mark D Powell --

  • How to create a database link in someone else's schema?

    I have access to Sys, but I don't have the passwords to all personal accounts. generally if you have a create any privilege you just do
    create <object> <schema>.object_name ....
    if i try this with a database link, the link gets created in my schema with the first part as part of its name.
    so
    create database link <user>.<db link> does not put the link in the other schema.
    what do I do?

    I assume Sybrand's suggestion works, but it is common not to know the schema passwords (who wants to remember them anyway?).
    We use the time tested "db_su.sql" script:
    -- db_su.sql: connect as another user
    set term off
    store set sqlplus_env rep
    set pages 0 feed off ver off echo off term off
    DEF user=&1
    spo temp.sql
    conn / as sysdba
    select 'alter user &user identified by values '''||password||''';'
      from dba_users where username = UPPER('&user')
    spo off
    alter user &user identified by temp;
    connect &user/temp
    START temp.sql
    @sqlplus_env
    set term on:p

  • How to activate the database

    after create the database using the database configuration asistant, what the next step that we should done to activate the database. i just know that we should create the listener. other than this what should we done..pls kindly help me.im just a new hire who working as a database administrator

    user12103692 wrote:
    after create the database using the database configuration asistant, what the next step that we should done to activate the database. i just know that we should create the listener. other than this what should we done..pls kindly help me.im just a new hire who working as a database administratorThen the best advice for you would be to visit http://tahiti.oracle.com/ and find answers there.
    Question you asked is very common and demands very common answer ,so don't get used to ask this kind of questions in forums as the best place to find the answer , when in a situation like you is , is reading the books, papers and posts on the net where discussion about this already hapened.

  • How to create a database link to connect to Progress

    I using 10g (10.2.0.4) and want to connect to progress 9.x using a databaselink.
    Which are the steps, examples to acomplish this?.

    You have to use the 11g Database Gateway for ODBC (DG4ODBC) to connect from Oracle 10.2.0.4 to Postgres.There's a note on My Oracle Support how to configure the gateway - please have a look at:
    How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install (Doc ID 561033.1)
    I would recommend you to use the latest gateway release (11.2.0.3) which can be downloaded from My Oracle Support portal as well. Just click on Patches and Updates and look for the 11.2.0.3 patch set:
    Patch 10404530: 11.2.0.3.0 PATCH SET FOR ORACLE DATABASE SERVER
    Although it is a patch set this software can also be used to install the gateway from scratch.
    Check out the readme as it lists which ZIP file contains the gateway software you have to download.
    The DG4ODBC gateway is for free and its license is included in the Oracle database license. You only need to make sure you have a suitable ODBC driver which is able to connect to your Postgres database.
    Best regards,
    Klaus

  • How to create a database link to SQL Server from a RAC environment

    We have a 4 node RAC running 11.2.0.3 binaries on 64-bit linux.
    Grid owns the listener named listener.
    Oracle owns the database.

    Thanks all! But I tried to configure and I am getting
    TNS-01201: Listener cannot find executable /u01/app/oracle/product/11.2.0.3/dbhome_1/bin/InfoEdb10 for SID InfoEdb10
    Listener failed to start. See the error message(s) above...
    So! What I did was
    1. Configure the odbc from the OS (only one node) and create the DSN and its odbc files.  connectivity works from Operating Systems.
    2. Create the listener entry (under GRID) user.
    3. Create the remotedb.ora file under $ORACLE_HOME/hs/admin
    --- Here is listener.ora file
    LISTENER_NODE1_TG =
       (DESCRIPTION_LIST =
        (DESCRIPTION =
           (ADDRESS = (PROTOCOL = TCP)(HOST = devrac-a-01-vip.cssd.pitt.edu)(PORT = 1549)(IP = FIRST))
           (ADDRESS = (PROTOCOL = TCP)(HOST = devrac-a-01.cssd.pitt.edu)(PORT = 1549)(IP = FIRST))
    SID_LIST_LISTENER_NODE1_TG =
       (SID_LIST =
           (SID_DESC =
             (SID_NAME = InfoEdb10)
             (ORACLE_HOME = /u01/app/oracle/product/11.2.0.3/dbhome_1)
             (ENVS = "LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0.3/dbhome_1/lib")
             (PROGRAM = InfoEdb10)
    any  help is appreciated

  • How to create Database link

    Hi all,
    While trying to create a database link i am getting the following error:
    Create Database Link Failed.
    ORA-01031: insufficient privileges
    Could you please tell me how to create a database link.
    Thanks
    Grishma

    Hi Grishma,
    Login as DBA (SYSTEM or SYS for ex.) in SQL*Plus and run this command:
    SELECT *
    FROM dba_sys_privs
    WHERE grantee = 'USERNAME'
    AND PRIVILEGE = 'CREATE DATABASE LINK'
    Change the USERNAME by the USER you're trying to create the database link from. (CAPITALS!)
    Dimitri

Maybe you are looking for