![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connecting to oracle database from shell script | satyakiran | Shell Programming and Scripting | 8 | 07-03-2009 03:22 PM |
| sybase connection through shell-script | Amitabh | UNIX for Dummies Questions & Answers | 9 | 04-10-2009 10:34 PM |
| Logging into oracle or SQL from shell script | manirsendhil | Shell Programming and Scripting | 2 | 04-09-2007 11:46 PM |
| run shell script from oracle store procedure | arnabb4u | Shell Programming and Scripting | 8 | 08-16-2006 12:16 PM |
| shell script- oracle connection problem | nattynatty | Shell Programming and Scripting | 4 | 08-14-2002 09:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
oracle connection from shell script
Hi,
For connecting to oracle my script is using the command sqlplus username/password@db_instance_name.For this to work i am setting ORACLE_HOME,TNS_ADMIN and ORACLE_SID in a seperate script.My question is,could we make a connection to oracle just by the command sqlplus username/password ie,without appending the instance name?.If yes,what all are the configurations i have to make before doing this?Your help is appreciated. With Regards Dileep |
|
||||
|
If you define ORACLE_SID, sqlplus user/password will connect you to $ORACLE_SID,
$ORACLE_HOME has to point to a locally mounted directory. There is another variable, TWO_TASK which needs to be set when the instance is on a remote box. It needs to be set to the full name of the remote instance as defined in tnsnames.ora. Code:
sample tnsnames.ora --
VCSPROD.corp=
(DESCRIPTION =
(ADDRESS =
(COMMUNITY = TCP.corp)
(PROTOCOL = TCP)
(Host = somename)
(Port = 1521)
)
(CONNECT_DATA =
(SID = PROD)
(GLOBAL_NAME = VCSPROD.corp)
)
find GLOBAL_NAME GLOBAL_NAME=VCSPROD.corp. VCSPROD (no suffix) goes in TWO_TASK. TWO_TASK-VCSPROD |
|
||||
|
why hesitate to start new thread for your own topic?
since this is your first post, I advice you to read the forum rules carefully. please visit here for information about beginners. unix beginners for connection to oracle, you can try Code:
$ORACLE_HOME/bin/sqlplus $uname/$passwd@$sid << END <<your sql queries goes here>> <<...>> exit END Last edited by anchal_khare; 07-01-2009 at 04:00 AM.. Reason: added sql connection part. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|