Connect to Oracle from Unix | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Connect to Oracle from Unix

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-09-2009
rajesh_tns rajesh_tns is offline
Registered User
 
Join Date: Feb 2009
Last Activity: 9 March 2011, 8:37 PM EST
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Connect to Oracle from Unix

HI all,

I have some doubts on unix and oracle...

1. Need some scenarios of why is there a need to connect to oracle db from unix?

2. how to connect to oracle db from unix?

Thanks and Regards
rajesh
Sponsored Links
    #2  
Old 02-09-2009
rmuledeer rmuledeer is offline
Registered User
 
Join Date: Feb 2009
Last Activity: 9 February 2009, 4:51 PM EST
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I script solutions that execute queries via the command line for batch type processing that can't be or is in no need of being handled through procedure calls.

Last edited by rmuledeer; 02-09-2009 at 02:11 PM..
Sponsored Links
    #3  
Old 02-09-2009
pludi's Avatar
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,522
Thanks: 38
Thanked 335 Times in 308 Posts
  1. To access configuration data for scripts that is maintained in a DB, because it's used on many hosts
  2. Look up the SQLplus command line utility (ships with Oracle)
    #4  
Old 02-09-2009
rajesh_tns rajesh_tns is offline
Registered User
 
Join Date: Feb 2009
Last Activity: 9 March 2011, 8:37 PM EST
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
hi

thank you ..
Sponsored Links
    #5  
Old 02-09-2009
ddreggors's Avatar
ddreggors ddreggors is offline
Registered User
 
Join Date: Aug 2008
Last Activity: 22 July 2013, 9:20 AM EDT
Location: Florida
Posts: 160
Thanks: 5
Thanked 12 Times in 11 Posts
We also use our Oracle Database for config management. As to how here is an example function...


Code:
#!/bin/sh

LOGIN="user/pass@host:1521"

CREATE_HOSTS_FILE () {
        sqlplus -s $LOGIN <<EOF > hosts.out
        SET HEAD OFF
        SET LINESIZE 120
        SET FEEDBACK OFF
        SELECT
                HOSTNAME, IP
        FROM
                HOSTS
        WHERE
                ACTIVE = 1
/
EOF
} 

CREATE_HOSTS_FILE

# Now we have a file named hosts.out that we can review and then pass to all servers as the "/etc/hosts" file

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Connect Oracle from NATted IP skbpk_in Solaris 0 09-18-2008 09:27 AM
How to connect oracle from unix ravi gongati Shell Programming and Scripting 2 03-24-2008 06:19 AM
How to connect ORACLE using PERL Vijayakumarpc Shell Programming and Scripting 1 02-27-2008 07:20 AM
How to connect to oracle ?? divyesh shah Shell Programming and Scripting 2 01-04-2007 03:40 AM
HOw to connect oracle using ksh and perl script chendra.putta Shell Programming and Scripting 3 10-16-2006 11:30 PM



All times are GMT -4. The time now is 05:29 PM.