Accessing Oracle DB via Shell possible ?


 
Thread Tools Search this Thread
Operating Systems AIX Accessing Oracle DB via Shell possible ?
# 1  
Old 11-03-2008
Accessing Oracle DB via Shell possible ?

At work we are using AIX 4.2 for the client. On this system, there is Oracle and kron, Bash and C shell.

Is it possible to access Oracle via the shell to create/update tables ?

There is this hourly data that we accumulate on the AIX and we manually copy the infos to Excel for stats. I thought it would be easier just to use Oracle on AIX.
# 2  
Old 11-04-2008
AIX 4.2 ... that's old. You got 2 things? You want
a) create/update tables
b) accumulate data and copy it to an Excel sheet


For a)
You did not say what Oracle version you use, but 8 has sqlplus. Not sure if former versions had this tool too. You should look for something like sqlplus on your version and start using this, when you want to be on the shell.

For b)
When you have sqlplus or the sqlplus similar tool, extract the data into a file on your AIX box with an appropriate SQL-query and if that's not enough, maybe work it with shell/awk/sed etc.
# 3  
Old 11-04-2008
sqlplus was available in Oracle 7 too Smilie

Under the assumption, that the collected data is in same format all time,I'd approach this task like this:
- Create the tables using your favorite db-tool (be it sqlplus or whatever) once. Creating tables periodically is usually bad practice.
- Use sqlloader to insert your data into your table periodically via cron. You could use sqlplus and here-docs too, but that might be tricky - depending on your data.
- Write a commandscript for sqlplus that creates a CSV-file or any other excel-readable format to present your data.

This links may help you with the commandline tools oracle provides:
SQL*Loader
SQL*Plus
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Problem in accessing Oracle Database Server from Linux Machine

I am facing a strange issue in connecting to Oracle database from Linux Machine - The connectivity is not failing all the time , the failure to success ratio is 1:70. - Error "ORA-12545: Connect failed because target host or object does not exist" - Majority of the time the connection... (6 Replies)
Discussion started by: balaji kumar
6 Replies

2. Shell Programming and Scripting

Password Expiry while accessing Oracle table

Hi All, I am not able to access an oracle table even if the table is present. After initial analysis, found that there is a password warning for the specified oracle user. Can you please help me in ignoring the password expiry and access the oracle table ? However, the log file does not store the... (4 Replies)
Discussion started by: tapan8984
4 Replies

3. Programming

Oracle accessing from remote host

i have installd oracle 10 on Solaris 10 now i want to access this database from remote machine. -bash-3.00$ tnsping 192.168.92.49 TNS Ping Utility for Solaris: Version 10.2.0.2.0 - Production on 17-DEC-2010 21:06:51 Copyright (c) 1997, 2005, Oracle. All rights reserved. Used parameter... (23 Replies)
Discussion started by: akhaliq22
23 Replies

4. UNIX and Linux Applications

Accessing Oracle via encrypted password

Actually in my application there is an XML file. The password and the user name for the database that I need to access the development box is stored there. But using some UNIX command I am able to access the raw content of the file and not the decrypted code for that password. When I am applying... (3 Replies)
Discussion started by: nandumishra
3 Replies

5. Shell Programming and Scripting

Accessing arrays in shell scripts

Hi All, I have an array in my script. For example, array=(file1.xml,file1-summary.xml,file2.xml,file2-summary.xml,file3.xml,file3-summary.xml); I am accessing the elements of the array by using the following code. len=${#array }; while ; do echo "${array}" done I want... (1 Reply)
Discussion started by: ananddr
1 Replies

6. Shell Programming and Scripting

Accessing awk array from shell

Hi, i want awk to read a file and place it's content into two arrays. When trying to read these arrays with a "for a in ${source_path} "-Loop it gives the right result. But when trying to access directly (/bin/echo ${source_path}) it doesn't work. I read "all "the awk threads in this forum and... (6 Replies)
Discussion started by: bateman23
6 Replies

7. AIX

Problem accessing Oracle Directory on AIX

What are we doing ? 1) We ftp a PDF file to Oracle Directory which is on AIX server, using Business Object Server. The ftp account we use is prmtftdv. The oracle directory is owned by "oracle" account on aix. The default file permission is 640. 2) We are trying to read the PDF file using oracle... (1 Reply)
Discussion started by: ssatyaranga
1 Replies

8. Shell Programming and Scripting

Accessing aliases within a shell script

I am not able to access the aliases in my environment within a Python script. If I pass the alias to os.system(), I get a message saying "sh: x: not found". I've tried sourcing my .bashrc file in the script, but this does not work. I would perfer not to source my or any rc file because this... (9 Replies)
Discussion started by: cooldude
9 Replies

9. Programming

accessing unix variables in oracle

Hi, consider the following script. ip='***.***.**.**' user='****' pw='******' ftpresults=`ftp -nv $ip<<EOF user $user $pw cd /home/oracle/practice size $1 bye EOF` fname=$1 echo $ftpresults sqlplus -s tms/tms@dev45 <<"EOF" insert into remote_file_sizes (file_name,file_size)... (1 Reply)
Discussion started by: ravi raj kumar
1 Replies

10. Shell Programming and Scripting

Shell script for accessing a file in the network drive and invoking oracle sql loader

Hi, Please let me know if anybody is having a solution handy for the below tasks... It would be helpful if somebody can resolve my query. I am new to unix and oracle environment and looking for some online reference for completing a task. Task: Check if the network drive exists Check... (0 Replies)
Discussion started by: sayydevara
0 Replies
Login or Register to Ask a Question