Results 1 to 4 of 4

Thread: Check connectivity for an oracle server from with in a SQL Server Stored procedure.

  1. #1

    Thread Starter
    Addicted Member samkud's Avatar
    Join Date
    Oct 2001
    Location
    India
    Posts
    171

    Check connectivity for an oracle server from with in a SQL Server Stored procedure.

    Hi Folks,

    For one of my requirements I need to connect to the oracle server from within a sql server stored procedure and then proceed to do some operations.
    How do I check whether the oracle server is up and running? If it is running then only do the remaining operations.

    Actually I am importing some data from oracle to sql server database (Both the servers are on different machines). For that I have created one DTS package. And I am running that DTS package though a stored procedure. Before executing the DTS I truncate the tables , in the sql server database, for which the data is to be imported. But if for some reasons the DTS is not run the tables remain empty. So before truncating the data I wanna check if the oracle connectivity is there.

    Let me know.

    Thanx in advance.

    Regards,

    Samir Kudav.

  2. #2
    Addicted Member
    Join Date
    Jan 2001
    Location
    MPLS
    Posts
    187

    Re: Check connectivity for an oracle server from with in a SQL Server Stored procedure.

    You could create a "Linked Server" in your SQL Server database that establishes a connection to your Oracle server. Then in your stored procedure do a query against the linked server connection, and if no errors assume the Oracle DB is ready, otherwise remedy accordingly to the error provided. The test query could be something simple like a select count(*) from linkedserver..sys.dual which should always return 1 if the connection to oracle is made.

  3. #3
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Check connectivity for an oracle server from with in a SQL Server Stored procedure.

    As long as the Oracle Conectivity software is installed.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  4. #4

    Thread Starter
    Addicted Member samkud's Avatar
    Join Date
    Oct 2001
    Location
    India
    Posts
    171

    Re: Check connectivity for an oracle server from with in a SQL Server Stored procedure.

    Hi Guys,

    Thanx for ur replies.

    ducky,

    I had that thing in my mind, but was checking if there was any other better way. But none-the-less your comment has confirmed my thinking and I will go with that. Thanx for ur reply.

    Regards,

    Samir.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width