I was wondering how sqlplus takes the username and password in connect statement “sqlplus /”.
How can I change the configuration if i want to connect with “sqlplus /” with different user. It Might seems awkward but in my script “sqlplus /” is harcoded and we cannot change this. Just I want to connect with different user using same command.
From the Oracle documentation:
So it uses your operating system details to construct your Oracle user name, meaning that you probably can’t set an arbitrary name.
The Oracle initialisation parameter for specifying the prefix is
OS_AUTHENT_PREFIXand its default value idOPS$.One thing you could do, if you cannot change the script which calls sqlplus, is to insert your own sqlplus script in the path before the Oracle one, along the lines of (not thoroughly tested):
This would then be the one called by your script and it would check the first parameter to see if it was the simple
/. If not, it would call the realsqlpluswith the same parameters.Otherwise, it would replace the
/with a user/password formed from theMY_ORA_*environment variables.