Oracle作業系統身分識別驗證

來源:互聯網
上載者:User

標籤:

此技術使用與作業系統使用者同樣的名稱建立Oracle使用者,但前面加上了os_authent_prefix參數指定的字串,預設為ops$,下面我們來看看官檔對該參數的說明:

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 is attempted, Oracle compares the prefixed username with Oracle usernames in the database.

The default value of this parameter is 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.

可見,用ops$只是為了向前相容。

下面,我們來實驗一下。

一、建立作業系統使用者

     [[email protected] ~]# useradd test

二、建立Oracle使用者並授予相應的許可權

     SQL> create user ops$test identified externally;

     SQL> grant create session to ops$test;

三、用test使用者登入資料庫

[[email protected] ~]$ /u01/app/oracle/product/11.2.0.4/db_1/bin/sqlplus /Error 6 initializing SQL*PlusSP2-0667: Message file sp1<lang>.msb not foundSP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

    報以上錯誤,根據提示,我們為ORACLE_HOME設定響應的值

    在/home/test/.bash_profile中添加如下值:   

export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/db_1

    重新用test使用者登入資料庫

[[email protected] ~]$ /u01/app/oracle/product/11.2.0.4/db_1/bin/sqlplus /SQL*Plus: Release 11.2.0.4.0 Production on Sat Jan 10 01:14:53 2015Copyright (c) 1982, 2013, Oracle.  All rights reserved.ERROR:ORA-12162: TNS:net service name is incorrectly specifiedEnter user-name: 

    又報TNS:net service name is incorrectly specified錯誤。

    懷疑沒有指定響應的SID,在/home/test/.bash_profile中添加如下值:

export ORACLE_SID=orcl

    重新用test使用者登入    

[[email protected] ~]$ /u01/app/oracle/product/11.2.0.4/db_1/bin/sqlplus /SQL*Plus: Release 11.2.0.4.0 Production on Sat Jan 10 01:18:22 2015Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - ProductionWith the Partitioning, Automatic Storage Management, OLAP, Data Miningand Real Application Testing optionsSQL> show userUSER is "OPS$TEST"

    終於成功登入!

 

    

 

Oracle作業系統身分識別驗證

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.