Oracle Operating system authentication

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.