Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Oracle Database Connection

by Tux (Canon)
on Sep 03, 2014 at 09:30 UTC ( [id://1099378]=note: print w/replies, xml ) Need Help??


in reply to Oracle Database Connection

When using tnsnames.ora as proposed, just set the environment $TWO_TASK and be done with it.

$ echo $TWO_TASK dbo_foobar $ tnsping $TWO_TASK TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 03-SEP- +2014 11:25:08 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: /pro/oracle/v12.1/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact ( DESCRIPTION = ( ADDRESS_LIST = ( ADDRESS = ( H +OST = dbo)( PORT = 1521)( PROTOCOL = TCP))) ( CONNECT_DATA = ( SERVIC +E_NAME = foobar))) OK (150 msec) $ env DBI_TRACE=1 perl -MDBI -wE'DBI->connect ("dbi:Oracle:", split m{ +/} => $ENV{ORACLE_USERID})' DBI 1.631-ithread default trace level set to 0x0/1 (pid 9871 pi 1e +ba010) at DBI.pm line 288 via -e line 0 -> DBI->connect(dbi:Oracle:, USER, ****) -> DBI->install_driver(Oracle) for linux perl=5.020000 pid=9871 ru +id=203 euid=203 install_driver: DBD::Oracle version 1.74 loaded from /pro/lib/p +erl5/site_perl/5.20.0/x86_64-linux-thread-multi-ld/DBD/Oracle.pm <- STORE('ShowErrorStatement', 1)= ( 1 ) [1 items] at Oracle.pm li +ne 81 <- install_driver= DBI::dr=HASH(0x2045f30) <- connect('', 'USER', ...)= ( DBI::db=HASH(0x21ec3e8) ) [1 items] + at DBI.pm line 671 <- STORE('PrintError', 1)= ( 1 ) [1 items] at DBI.pm line 723 <- STORE('AutoCommit', 1)= ( 1 ) [1 items] at DBI.pm line 723 <- STORE('Username', 'USER')= ( 1 ) [1 items] at DBI.pm line 726 <- connected('dbi:Oracle:', 'USER', ...)= ( undef ) [1 items] at D +BI.pm line 733 <- connect= DBI::db=HASH(0x21ec3e8) <- STORE('dbi_connect_closure', CODE(0x21ebde8))= ( 1 ) [1 items] +at DBI.pm line 742 <- DESTROY(DBI::db=HASH(0x21ec310))= ( undef ) [1 items] at -e lin +e 1 <- disconnect_all= ( ) [0 items] (not implemented) at DBI.pm line +750 ! <- DESTROY(DBI::dr=HASH(0x2045f30))= ( undef ) [1 items] during gl +obal destruction

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1099378]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-26 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found