473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Shell Scripting in UNIX environment for Oracle Database

Hi,

I have one shell script which runs a report and sends the output to user.
The shell script has some queries written in it in SQL and hence when I execute a shell script via a concurrent programme, I need to ensure that shell script connects to Oracle Database to execute the SQL written inside it.
Now when I hard code the shell script with User ID / PWD, the scripts run fine.....but I dont want to put the user id and pwd in shell script for security reasons.....do we have something better than hard coding user id and pwd

Thanks
Sanket
Dec 5 '06 #1
6 8448
pragatiswain
96 Expert
Hi,

I have one shell script which runs a report and sends the output to user.
The shell script has some queries written in it in SQL and hence when I execute a shell script via a concurrent programme, I need to ensure that shell script connects to Oracle Database to execute the SQL written inside it.
Now when I hard code the shell script with User ID / PWD, the scripts run fine.....but I dont want to put the user id and pwd in shell script for security reasons.....do we have something better than hard coding user id and pwd

Thanks
Sanket
I also stress more on security in a real production environment.
Unix Environmental variables are user/session specific, which other users/sessions can't see.
Set environmental variables for oracle User ID / PWD. which you can put in Unix user's .profile or ask the user at the time of login to unix environment.

Hope this helps
Dec 6 '06 #2
buzznt
3
Hi,

I have one shell script which runs a report and sends the output to user.
The shell script has some queries written in it in SQL and hence when I execute a shell script via a concurrent programme, I need to ensure that shell script connects to Oracle Database to execute the SQL written inside it.
Now when I hard code the shell script with User ID / PWD, the scripts run fine.....but I dont want to put the user id and pwd in shell script for security reasons.....do we have something better than hard coding user id and pwd

Thanks
Sanket
HI :)
One solution is to use in the script connect string inside you script, like:
Expand|Select|Wrap|Line Numbers
  1. sqlplus sqlplus -s /nolog  << *EOF*
  2. conn <user>/<pass>
  3. .....
  4. <SQL>
  5. .....
  6. *EOF* 
10X,

Roni
Dec 6 '06 #3
Hi,

The problem is that I am new to shell scripting and does not know how to set the environment variables. Can u pls help me in that......
Also note that we are keeping the sh script in a custom directory and then we are registering a custom programme in Oracle ERP with execution method as HOST so that the programme will call and execute the shell script. So security wise, my concern is only when a UNIX user logs on to UNIX Custom directory and view the shell script which has the USER ID and PWD.

Pls advice
Thanks

I also stress more on security in a real production environment.
Unix Environmental variables are user/session specific, which other users/sessions can't see.
Set environmental variables for oracle User ID / PWD. which you can put in Unix user's .profile or ask the user at the time of login to unix environment.

Hope this helps
Dec 7 '06 #4
Hi

I guess the conn command will again require me to put the USERID and PWD
My concern is a situatiion when an Unix User Logs on and views the content of the Shell Script

Thanks


HI :)
One solution is to use in the script connect string inside you script, like:
Expand|Select|Wrap|Line Numbers
  1. sqlplus sqlplus -s /nolog  << *EOF*
  2. conn <user>/<pass>
  3. .....
  4. <SQL>
  5. .....
  6. *EOF* 
10X,

Roni
Dec 7 '06 #5
can somebody pls help me on this
Dec 8 '06 #6
You could read from a file where the usernames and passwords are stored.

Store the password file in a directory where only DBAs can get to.

That you read from a file to obtain a password will be obvious to the Unix sysadmin, but what you read from it does not need to be echoed in the logs.

Recommend that you make the passwords very long up to 30 characters, and very difficult to guess.
Dec 10 '06 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jonathan | last post by:
Hi there We are to make the decision on whether to choose .Net or J2EE. One of the questions my client asked is that, can we run the .Net application on Unix and Unix based database systems on...
19
by: DW | last post by:
Hi, all... I have a sizeable database running under Oracle 9.2.0.4 under AIX 5.2.0. I am faced with an impending move to a Windows environment, running under SQL 2000. Currently, we are...
3
by: Philippe Lang | last post by:
Hello, How can open a unix shell from a PLPGSQL function / trigger? I would like to send an email from a postgres database, and also send some unix commands to the server, through the...
10
by: Andrea M. Segovia | last post by:
Hello, I am a newbie to Oracle databases.... We have a visualization front-end tool connected to an Oracle back-end database on a Tru64 UNIX server. We also have clients with MS access...
5
by: Javaman59 | last post by:
Hi all, I'm a Unix guy from way back, who's enjoying learning C# and Windows programming. Overall, it's not such a difficult transition (as long as one keeps an open mind :) ), but there is one...
10
by: A.M | last post by:
Hi, I am having difficulty with shell scripting in Python. I use the following command to run a DOS command and put the return value in a Python variable:
0
by: ravjobs | last post by:
helo my dear friends give me main advatages of shell scripting in unix with oracle thanks in advance
21
by: Tom Gur | last post by:
Hi, It's seems that csh and tcsh acts a bit different when handling special characters in quotes. i.e: if i'll supply my program with the following arguments: -winpath "c:\\temp\\" tcsh will...
2
by: gagandutta01 | last post by:
Hi, Can anyone tell me how to execute a function declared in Oracle Package from Unix shell script? I created a shell script and after connecting to oracle database i am using exec @...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.