Solved

sqlplus command line parameters

Posted on 2001-07-02
8
1,480 Views
Last Modified: 2012-06-21
How is it possible to start sqlplus from unix cron without showing userneme/password ? for example, if it's needed to start sql job, then it goes like: sqlplus userneme/password @some_sql_script, if somebody executes ps -ef , then he/she can see dbase username/and password and thats not good. any suggestions?
0
Comment
Question by:maads
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 1

Expert Comment

by:chdba
ID: 6245660
Create a user identified externally.

Then you start your Script like this:

sqlplus / @some_sql_script

Of course you should then use an unix-user, that is not available for everyone, because you'll be identified by this user.

Hope this will help you.

chdba
0
 
LVL 1

Accepted Solution

by:
chdba earned 29 total points
ID: 6245724
Some further remarks:

You'll be able to connect only by UNIX not by e.g. FORMS.

INIT.ORA:
os_authent_prefix = ""
# Default value is "OPS$" for "Identified by Operation System"

I always work with OPS$ (default value). So I can have for example a user OPS$ORACLE for the reason you mentioned and an user ORACLE for working with SQL*Plus/SQLNavigator ...

So, if your UNIX-user is called "example" you'll have to create an oracle user "OPS$example".

CREATE USER ops$... IDENTIFIED EXTERNALLY ...
0
 
LVL 1

Expert Comment

by:ashokskumar
ID: 6245868
Hi,

You can execute through a shell scipt in which you can specify the username and password.  This is not displayed in ps -ef.  You don't want to see the details by a user who is able to login in to the server. Externally identified user will be able to login without password.

Ashok.
0
 

Expert Comment

by:r_sudip
ID: 6246173
Hi,

 With sqlplus you have an option as "nolog" which starts
 a sqlplus session with no user connected.
 You can use this feature to achieve what u want
 for e.g

 sqlplus /nolog @some_sql_script

 Now in the sql script write
 connect username/password@db  as the first line

 So in effect it will connect to the database but
 a ps -ef will not show the username/password

Sudip
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Expert Comment

by:r_sudip
ID: 6246194
Hi,

 With sqlplus you have an option as "nolog" which starts
 a sqlplus session with no user connected.
 You can use this feature to achieve what u want
 for e.g

 sqlplus /nolog @some_sql_script

 Now in the sql script write
 connect username/password@db  as the first line

 So in effect it will connect to the database but
 a ps -ef will not show the username/password

Sudip
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7038046
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7052572
Recommended disposition:
    Split points between: chdba and ashokskumar and r_sudip

DanRollins -- EE database cleanup volunteer
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7052774
Force accepted

** Mindphaser - Community Support Moderator **

ashokskumar and r_sudip, there will be a separate question with points for your help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now