Determine the database / DB Link Connectivity

I have 2 databases access, via a DB_LINK I created. Before I run a procedure in a work, I want to check this db_link database is running and I have connectivity to it.

I tried the following:

DECLARE

DUMB_NUMB NUMBER (1.0);
NUMBER OF VAL_CONN;

BEGIN
VAL_CONN: = 0;

BEGIN
SELECT COUNT (*)
IN DUMB_NUMB
OF TABLE@DB_LINK_TEST
WHERE COMPANY_ID = '002';

EXCEPTION
WHEN TIMEOUT_ON_RESOURCE THEN
VAL_CONN: = 1;
END;

IF VAL_CONN > 0 THEN
DBMS_OUTPUT. PUT_LINE ('NO NO CONNECTION!');
ON THE OTHER
DBMS_OUTPUT. PUT_LINE ("CONNECTION ESTABLISHED!'");
END IF;
END;

This annonymous block is just for proofing.

I was wondering if maybe I can throw something like a TNSPING in PL/SQL or if there is an Oracle Exception with no link established a database link!

You get this error at compile time? Or at run time?

I guess that's a compilation error, in which case a run time of the Manager of exceptions would not be called. If you can not solve the object at the time that the block is compiled, you cannot encode an exception for this handler.

Justin

Tags: Database

Similar Questions

  • Troubleshoot utility could not determine the speed of my connection. Error code 0 x 80070057

    Attempted to have the resolution of the problems of control of my connection speed because YouTube videos were playing and pausing a lot. Convenience store reported an error occurred during troubleshooting and gave the following casablenca: -.

    Package ID: diagnosis of IE security

    Path: unknown

    Error code: 0 x 8007057

    Source: catalog

    User: Hand-HP-ADMIN

    Context: restricted

    Hello

    -What Web browser are you using to play youtube videos?
    -Respect the limit with the specific Web site?
    -Have you contacted your ISP about slow connection?
    -You are aware of any changes made on the computer before this problem?
     
    Method 1: Run the FIXIT from Microsoft from the link below and check if the problem persists.
    Playing video files crashes or blocking Internet Explorer - Windows
    http://support.Microsoft.com/mats/video_freezes_or_crashes/

    Method 2:
    run the Microsoft FIXIT from the below mentioned link and check if it helps.
    Troubleshoot Internet Explorer to IE quick, safe and stable
    http://support.Microsoft.com/mats/ie_performance_and_safety/
     
    Method 3: If the issue is only with Internet Explorer, I wouldf suggest the steps from the link below and check if it hellps.
    The video problems when you use Internet Explorer
    http://support.Microsoft.com/kb/2532294
    For reference:
    Slow PC? Optimize your computer for peak performance
     
    Hope this information helps.
  • DBUA could not determine the database version. Upgrade from 10.2 to 11.2

    I am trying to improve my database of version 10.2 to 11R2. I have already installed the software in a new Oracle home directory, and now I use the upgrade database wizard according to the instructions. In the section select your database, when I hit the next button after selecting my database I get the error "DBUA could not determine database version. Make sure that the version of the database is supported for upgrade". I have already confirmed that the upgrade from 10.2 to 11R2 database is supported. Does anyone know how to fix this?

    Thank you

    Apply the 4547817 hotfix that upgrades your database to 10.2.0.2 and then you can directly go to 11.2.0.2

  • How to determine which database I am connected to?

    Hello world

    30%

    I'll drop a database via SQL more.

    I forgot the command that will show you what db I'm connected to. Do not want to delete the incorrect database!

    Thank you, John

    Personally I prefer to use: select name from v$ database

    to check what database, I am connected to if there is no doubt.

    With 10g, it is possible to put the name of your database sqlpromt and I held it, even if you issue a connect statement to a different database.

    HTH - Mark D Powell.

  • Determine the Type of network connection

    Hello!

    How can I determine bbos 10 current network connection (Wi - Fi or cell or etc) using 10 api bbos or Qt?

    Thank you.

    Would not get you what you want?

    https://developer.BlackBerry.com/native/reference/Cascades/qnetworkconfiguration.html#BearerType-ENU...

  • Determine the correct update link

    I have a single virtual machine host running 5.0. I want to update to 5.5 U1.

    My server is an HP Proliant. I had to download a custom ISO for HP for the initial installation.

    I need to download 5.5 U1 from the custom TAB ISO?

    New virtual machine. The heads up / advice welcomed.

    Thank you.

    That's what you're looking for:

    https://my.VMware.com/group/VMware/details?downloadGroup=HP-ESXi-5.5.0U1-GA&ProductID=353

    What about upgrade options, you have a few

    1.) wipe and install new

    -This requires you to vmotion off all vm and UN-fix your storage, install as a fresh new installation

    2.) upgrade on the spot out of the CD/DVD ISO from start and the update option

    (3.) If you have an environment with installed Update Manager vCenter, you can import the 5.5U1 HP ESXi ISO in vCenter, once you have updated with Update Manager 5.5 5.5 and create a database upgrade, then he address to each host at a time

    Hope this has helped

  • Why the name of the database link come like that?

    Hi all

    I created the link of database as follows

    create database BRANCH01 link
    connect to human resources identified by HR using 'hr ';

    everything is ok with me, but the oracle problem name suffix like this

    Select db_link
    of all_dba_links;

    Db_link
    --------
    BRANCH01. US. ORACLE.COM

    How can I remove this suffix, I want to rename the dblink to appear as I create

    no idea, how do to rename or how to remove this suffix
    Thanks for everyone viewing and helping

    Discover [Chapter 30 | http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/ds_admin.htm#i1007567] of the database administrator's Guide. It should answer most, if not all your questions.

    HTH!

  • Test the connection to the database failed: connection to the server could not

    I have one of my servers HPOV NNMi 9.23 restarted this morning and NNMi is loading is no longer.  I see the following errors in the newspapers said:

    /var/opt/OV/log/NNM/public/nmsdbmgr.log

    06/04/2015-09:28:05 connection to the database test failed: connection to the server could not: connection refused
    The server running on host "127.0.0.1" and accept
    TCP/IP connections on port 5432?

    /var/opt/OV/log/NNM/public/postgres.log

    2015-04-06 09:25:55.312 EDT: 8580:0LOG: could not translate the hostname "localhost", "5432" service at the address: name or service not known not

    2015-04-06 09:25:55.312 EDT: 8580:0WARNING: could not create listen to "localhost".

    2015-04-06 09:25:55.312 EDT: 8580:0FATAL: could not create TCP/IP sockets

    I have checked/etc/hosts and found the following entry:

    #; Local
    #;
    127.0.0.1 localhost

    The command line, I can ping localhost without problem.  Not sure why NNMi begins not at this point.

    Turns out be the permissions on the file/etc/hosts.

  • Connection to the database sysbda

    Hello
    If I come home with sqlplus "under /sysdba", how to connect to a database?

    Thank you.

    PD: I don't know that the name of the database, do not know is not the user and passwd

    Published by: JuanPablo on January 16, 2009 05:26

    Juan,
    To see the tables in the database,

    SQL>select owner , table_name from dba_tables where owner ='yourschemausername';
    

    I think that you are sourcing the variables env correctly, if you do not have to put it again. Usually when you have multiple instances running it is preferable to set the sid to the instance of the database right before connect you.

    Hope this helps
    Concerning

  • Disable the database on abandonment

    Hello community,

    Using 32-bit Teststand 2014

    In a previous post of mine, I asked how do I enable/disable by program the result of database processing. I got my answer and it dealt with altering the sequence file callback «DatabaseOptions» Is there a way to change the setting in my DatabaseOptions during my MainSequence? My reason for this is when the user runs the movie file and decides to abandon during the test based on a selection of message popup. I do want to teststand to process the results to the database when the user cancels the test and proceed to the cleaning. Is there a way to cause Teststand to not write to the database in this scenario?

    I'm not sure I follow what is happening here.

    Are you still trying to prevent the logging database in the case where you're finished running? What I have described above should do. See the file attached sequence (I tested this out with the sample shipment database).

    As to change the ConnectionString property in the callback of LogToDatabase, it is likely not to do that you are pregnant. A new connection is performed only if one does not already exist (even if you change the connection string during execution). If you're really moving from the database that you connect in the middle of a performance, there are ways to go about this, but I wouldn't recommend it if you try only to prevent logging in particular situations. The method I proposed above would be much cleaner to implement.

    Hope this helps,

    Trent

  • UCR-6002: the database specified does not have the minimum requirement to load the metadata repository.

    Hi all

    I want to install a test environment with the following software products:

    WebLogic Server 10.3.6

    WebCenter Capture 11.1.1.8.0

    WebCenter Imaging 11.1.1.8.0

    BPM 11.1.1.7.0

    SOA Suite 11.1.1.7.0

    Oracle Database Enterprise Edition Release 12.1.0.2.0 12 c

    I use the remote 11.1.1.8.0 to create the database schemas.

    When RCU checks the prerequisites, it comes up with a warning as follows:

    «The database you connect to, is one newer than the supported version.» See the matrix of certification for the supported DB versions".

    If I type 'ignore' on the message box, it stops the verification process will not continue. Also, if I type "Cancel" does the same thing.

    The error message displayed in the Message box is both below:

    UCR-6002: the database specified does not have the minimum requirement to load the metadata repository.

    UCR-6080: Global check prerequisites failed - requirement of verification for the specified database

    The database that you connect is a CDB that is not supported.

    Action taken:

    1. check again on the database character set and confirmed it is set up correctly for AL32UTF8

    2. the databases are supported for WebCenter 11.1.1.8.0 + 12.1.0.1, so the database version is supported.

    Hope someone knows what's going on.

    Thanks in advance.

    Try to create a plugable (PDB) database within the CBD and then rerun

    the UCR.

    May be restricted the RCU to install MDS and other schemas FMW the

    CBD, but rather in the PDB.

    More information on PDB and CBD you can find here

    http://docs.Oracle.com/database/121/CNCPT/cdbovrvw.htm#CNCPT89235

    Hope that helps,

    Anatoli

  • Setting up a test server. Getting the error "Could not connect to MySQL". Help!

    First of all, I am a rookie at this, so please excuse me for leaving out some details.  In any case, I followed David Powers "establishing an environment of PHP for Dreamweaver development" set up my test server.  I tested the timetest.php file and everything works great.  I saved my website in its entirety and extracted its contents in my folder xampp/htdocs/php_test/CIM.  'CIM' is a file that I created to hold the content of my entire site.  I get an error message when I try to access my index.php file.  When I click on 'Live View', I get 'database error: unable to connect to the database: could not connect to MySQL'.»»  My index., is a php file in xampp/htdocs/php_test/CIM/public_html/store.  I too, started with Apache and MySql running XAMPP.  What I am doing wrong?

    If your timetest.php is like this:

    This page was created at on the computer running PHP.

    So which proves that you have PHP work.  I want to talk in DW when you try to establish a database connection.  Based on your error page there is no connection to the database.  The screen I'm talking about is:

  • DATABASE_PROPERTIES view not present in the database

    I created a new database using the following SQL in Oracle 11 g 1 material (11.1.0.7.0):
    CREATE DATABASE WEBCENTR
    USER SYS IDENTIFIED BY ORACLE
    USER SYSTEM IDENTIFIED BY ORACLE
    DATAFILE 'D:\orattach\oradata\WEBCENTR\SYSTEM01.DBF' SIZE 325M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
    SYSAUX DATAFILE 'D:\orattach\oradata\WEBCENTR\SYSAUX01.DAT' SIZE 120M REUSE AUTOEXTEND ON NEXT 5M MAXSIZE 2048M
    DEFAULT TABLESPACE USERS DATAFILE 'D:\orattach\oradata\WEBCENTR\USERS01.DBF' SIZE 50M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
    DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'D:\orattach\oradata\WEBCENTR\TEMP01.DBF' SIZE 40M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
    UNDO TABLESPACE "UNDOTBS1" DATAFILE 'D:\orattach\oradata\WEBCENTR\UNDOTBS01.DBF'
    SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
    CHARACTER SET WE8MSWIN1252
    NATIONAL CHARACTER SET AL16UTF16
    LOGFILE 'D:\orattach\oradata\WEBCENTR\REDO01.LOG' SIZE 100M REUSE,
    'D:\orattach\oradata\WEBCENTR\REDO02.LOG' SIZE 100M REUSE,
    'D:\orattach\oradata\WEBCENTR\REDO03.LOG' SIZE 100M REUSE
    EXTENT MANAGEMENT LOCAL
    MAXLOGFILES 32 
    MAXLOGMEMBERS 4
    MAXLOGHISTORY 100
    MAXDATAFILES 254
    MAXINSTANCES 1;
    And here is my init.ora file
    DB_FILES = 256 
    OPEN_CURSORS = 1000
    db_block_size = 8192
    undo_tablespace=UNDOTBS1
    NLS_LENGTH_SEMANTICS=CHAR
    
    ###########################################
    # Cache and I/O
    ###########################################
    #db_block_size=
    db_file_multiblock_read_count=16
     
     
    ###########################################
    # Database Identification
    ###########################################
    # db_domain=corp.peoplesoft.com
    # db_name=
     
    ###########################################
    # Diagnostics and Statistics
    ###########################################
    #background_dump_dest=
    #core_dump_dest=
    #user_dump_dest=
     
     
    ###########################################
    # Job Queues
    ###########################################
    job_queue_processes=10
     
    ###########################################
    # Miscellaneous
    ###########################################
    compatible=11.1.0.7.0
     
    ###########################################
    # Processes and Sessions
    ###########################################
    processes=500
     
    ###########################################
    # SGA Memory
    ###########################################
    sga_target=287309824
     
    ###########################################
    # Security and Auditing
    ###########################################
    #audit_file_dest=
    remote_login_passwordfile=EXCLUSIVE
     
    ###########################################
    # Shared Server
    ###########################################
    dispatchers="(PROTOCOL=TCP) (SERVICE=XDB)"
     
    ###########################################
    # Sort, Hash Joins, Bitmap Indexes
    ###########################################
    pga_aggregate_target=95420416
     
    ###########################################
    # System Managed Undo and Rollback Segments
    ###########################################
    undo_management=AUTO
    #undo_tablespace=
    DB_NAME=WEBCENTR 
    control_files=("D:\orattach\oradata\WEBCENTR\control01.ctl") 
    audit_file_dest=D:\orattach\admin\WEBCENTR\adump 
    background_dump_dest=D:\orattach\admin\WEBCENTR\bdump 
    core_dump_dest=D:\orattach\admin\WEBCENTR\cdump 
    user_dump_dest=D:\orattach\admin\WEBCENTR\udump 
    Now after creating the database, when I connect as sys/ORACLE and when issuing suite SQL:
    Select * from database_properties;
    It gives following error
    Select * from database_properties
                  *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Can someone tell what is the problem?

    user9928161 wrote:
    Thanks, I will run this script and let you know.

    If there are no errors during execution of the script, you will have the created view.

  • Using the database link to connect to two databases

    Hi guys,.
    Here's my question. I need to give to a Select rights contractor on the tables located in two schemas located on two different servers. A dev server and a prod. Let's say we have a user schema: EMPLOYEE on the dev and user schema: DEPARTMENT on prod. The outside contractor needs certain rights on all the tables in the schema DEPARTMENT but just select on a few (4 to be exact) tables from a diagram of the EMPLOYEE.

    My first train of thougth is: CREATE a named user: TEST (of course, only used for an example of random name) for contractor on prod. Give some rights to TEST user on all the tables in the schema of DEPARTMENT.
    Create the link of database to the dev server so user TEST can access the EMPLOYEE schema.

    How can I go to limit the user TEST link database to display only 4 tables to EMPLOYEE instead of all the tables?

    Should I also do this scenario backwards? Creating user TEST on dev, giving rights TEST for 4 tables in the FRAMEWORK, and then creating the database for you link connect to schema Department on production database?

    Any help will be appreciated. Thanks in advance.

    Just set up a new DEV scheme to be used by the link of database connection string.

    -create synonyms in this schema@DEV for these four tables.
    -grant select access on these four tables to this schema@DEV.

  • Import the database link

    I try to import tables from one database to another via a database link. But faced with a weird error. Help, please.

    Operating system:  Server Linux Oracle release 6.4

    Database of the source: Oracle 12.1.0.2

    Target databases: Oracle 12.1.0.2


    Measures

    1. Created a TNS entry for the source on the target server database.
    2. Create a link from public database to the schema of the source by using the tns name.
    3. Created a database in the target database directory and the permissions granted to the user target.

    Run the command below

    Impdp directory with name of user and password = dirname tables = network_link = linkname schema.tablename

    Get the below output

    Import: Release 12.1.0.2.0 - Production on Fri 9 Oct 14:51:32 2015

    Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

    Connected to: Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production database

    With the options of partitioning, OLAP, advanced analytics and Real Application Testing

    ORA-39004: invalid state

    ORA-39091: unable to determine the State of standby and logical flow

    ORA-06550: line 1, column 47:

    PLS-00103: encountered the symbol "IN" when the expected in the following way:

    < an ID > < a between double quote delimited identifiers of >


    Hello

    Run the command below

    Impdp directory with name of user and password = dirname tables = network_link = linkname schema.tablename

    can you show real impdp statement executed...

    I guss here is the problem network_link 'name '.

    Rajesh

Maybe you are looking for

  • HP ENVT 17-n152sa: System Recovery dowloanding

    I bought a few days ago in the United Kingdom, London, a laptop HP marine and just after the establishment began face to problems, blue screen, frozen screen and lost finmaly comprehensive system. I only have access to the boot using CTRL + F1 or con

  • Equium A100: How to increase WiFi range

    Hello I have an Equium A100 and wondering if I can increase the wi - fi range with any form of add the accessories?I have to balance my laptop on the windowsill of my apartment to pick up my more close to 'hot spot '. Any ideas?Thank you.Gus

  • How can I get rid of jollywallet

    How can I get rid of the Jollywallet, there is something in youtube video, but it's hard to follow. I get all these ads popping up all the time. I tried to find the program to remove from my control panel and have deleted the software but nothing see

  • Quick charge in Z3 Compact

    Dear team, How to check the fast charge z3 compact xperia Thank you Abdul Rahman

  • Connectivity with linksys WRT160N

    Hello- I recently had my computer reimagee and now unable to connect to my home wireless network.  I can connect to other wireless networks, and other computers can connect to my home network. I tried to restart my computer, reset the connection, res