Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIX environment variables for Oracle login

Status
Not open for further replies.

fsnyder

Programmer
Oct 10, 2003
11
US
I'm looking for environment shell variables to be created within my .profile that would provide the user ID and password for the Oracle instance on that server.

These would be in additon to ORACLE_HOME and ORACLE_BASE. I seem to remember having these at a previous job a few years back.

Then when you issue the command SQLPLUS it doesn't ask for login credentials.

Thanks
 
Hi,

not quite sure if I understood your question.

You wrote:
Then when you issue the command SQLPLUS it doesn't ask for login credentials.
There are a few ways how you can login with a default username and without a password. But afaik these ways are not related to shell variables.
I may be wrong here; then someone will correct me.

One way is to log on as user SYS by typing sqlplus "/ as sysdba"; for this you have to be in OS group dba.

Another way is to log on as user OPS$<OS-username>; I don't have the details at hand now; I suggest you look for OPS$ in the docs.

And if your question was meant to be What additional shell variables will I need?, the answer may depend on your installation; but common ones, besides ORACLE_HOME and ORACLE_BASE, are:

ORACLE_SID
ORA_NLS33, something like $ORACLE_HOME/ocommon/nls/admin/data
NLS_LANG
PATH has to include Oracle binaries like sqlplus

hope this helps
 
well, after some consideration:

Of course you may have something like this in your .profile:
SQLPLUS="/path/to/sqlplus my_username/my_password"

Then, to invoke sqlplus, just type:
$SQLPLUS

But it is highly insecure to store a password in a plain file.
So I hope this is not what you wanted.
 
You could do something like alias sqlp='sqlplus user/password'

Again this is a bit dodgy as you have to specify the username and password in the .profile.
 

Thanks, all

The last two are options for setting the Oracle login in the .profile of a production UNIX ID instead of hardcoding it in multiple shell scripts. Whether it's good practice or not, I don't know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top