473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shell Scripting in UNIX environment for Oracle Database

19 New Member
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 8473
pragatiswain
96 Recognized Expert New Member
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 New Member
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
Sanket80
19 New Member
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
Sanket80
19 New Member
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
Sanket80
19 New Member
can somebody pls help me on this
Dec 8 '06 #6
Mondo Tofu
12 New Member
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
1997
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 server site? Can we develop client application on VS.Net and put database on Unix environment? Can Web Services be deployed onto Unix environment Any advice?
19
2475
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 heavy users of shell scripts, for exports, backups, etc.
3
5056
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 database... Thanks ------------------------- Philippe Lang
10
3519
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 databases who would like to share their data using this visualization tool but do not want to import their data into the Oracle server back-end.
5
2259
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 thing from Unix I miss the most - the command line. I've install a Unix like programming environment, call MSys, which let's me do command line programming the way I want to, with the bash shell, and this is running smoothly (vim editor, bash,...
10
2265
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
1325
by: ravjobs | last post by:
helo my dear friends give me main advatages of shell scripting in unix with oracle thanks in advance
21
3012
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 take it as -winpath "c:\temp\" and csh will take it literally (with the double-slashes). Is there a way for me to know what shell is currently running my
2
10283
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 @ Db_name.Packagename.function_name('p1','P2'); and after executing the shell scripts i am getting the follwing error:-ERROR at line 13: ORA-06550: line 13, column 2: PLS-00221: 'function_name' is not a procedure or is undefined
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.