This technique uses the same name as the operating system user to create the Oracle user, but preceded by the string specified by the Os_authent_prefix parameter, which defaults to ops$, let's take a look at the official document's description of the parameter:
OS_AUTHENT_PREFIX specifies a PREFIX that Oracle uses to authenticate users attempting to connect to the server. Oracle concatenates the value of this parameter to the beginning of the user's operating system account name. When a connection request was attempted, Oracle compares the prefixed username with Oracle usernames in the database.
The default value of this parameter are ops$ for backward compatibility with previous versions. However, you might prefer to set the prefix value to "" (a null string), thereby eliminating the addition of any prefix to Operating system account names.
Visible, with ops$ just for forward compatibility.
Here, let's experiment.
First, create operating system users
[Email protected] ~]# Useradd test
II. Create an Oracle user and grant the appropriate permissions
Sql> Create user ops$test identified externally;
Sql> Grant create session to Ops$test;
Third, log in database with test user
[[email protected] ~]$/U01/App/Oracle/Product/11.2.0.4/Db_1/Bin/Sqlplus/Error6Initializing SQL*PlusSP2-0667: MessagefileQPs<Lang>. MSB notfoundSP2-0750: May need to SetOracle_home toYour Oracle software directory
Report the above error, as prompted, we set the value of the response for Oracle_home
Add the following values in the/home/test/.bash_profile:
Export oracle_base=/u01/app/oracleexport oracle_home=$ORACLE _base /Product/11.2. 0.4 /Db_1
Re-login to database with test user
[[email protected] ~]$/U01/App/Oracle/Product/11.2.0.4/Db_1/Bin/Sqlplus/SQL*Plus:release11.2.0.4.0Production onSat JanTen on: -: - -Copyright (c)1982, -, Oracle. Allrights reserved. Error:ora-12162: Tns:net Service Name isincorrectly specifiedenterUser-Name
Also reported tns:net service name is incorrectly specified error.
Suspect that there is no SID specified for the response, add the following value in/home/test/.bash_profile:
Export Oracle_sid=ORCL
Re-login with test user
[[email protected] ~]$/U01/App/Oracle/Product/11.2.0.4/Db_1/Bin/Sqlplus/SQL*Plus:release11.2.0.4.0Production onSat JanTen on: -: A -Copyright (c)1982, -, Oracle. Allrights reserved. Connected to: OracleDatabase11g Enterprise Edition Release11.2.0.4.0 -Production withThe partitioning, Automatic Storage Management, OLAP, Data Mining and RealApplication Testing Optionssql>ShowUserUSER is"Ops$test"
Finally successfully login!
Oracle Operating system authentication