Oracle

ORA-01031: 連接到備用的權限不足

  • March 2, 2016

我配置了一個備用數據庫,它工作了一段時間,但現在我注意到備用數據庫上的重做日誌執行緒遠遠落後於主數據庫。在研究了警報日誌和跟踪文件後,我發現與備用伺服器的連接存在問題。

當我在主伺服器上鍵入時:

sqlplus sys/manager@TESTSTAN as sysdba

輸出是:

SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 29 13:36:17 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

ERROR: ORA-01031: insufficient privileges

但我能夠從備用連接到主:

[oravis@standbysrv bin]$ sqlplus sys/manager@TESTPROD as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 29 13:46:18 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area  422670336 bytes
Fixed Size          1336960 bytes
Variable Size         335546752 bytes
Database Buffers       79691776 bytes
Redo Buffers            6094848 bytes
Database mounted.
SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
testprod     MOUNTED

兩台主機上的密碼文件相同。此外,我已經重新創建了幾次,但這並沒有幫助。remote_login_passwordfile參數在兩台伺服器上都是獨占的。

備用伺服器上的 listener.ora

   SID_LIST_LISTENER = 
   (SID_LIST = 
    (SID_DESC =
       (GLOBAL_DBNAME = teststan)
       (ORACLE_HOME = /u01/app/oravis/product/11.2.0/dbhome_1)
       (SID_NAME = test) ) )

   LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standbysrv)(PORT = 1521))
    ) )
   DYNAMIC_REGISTRATION_LISTENER=off

主節點上的 tnsnames.ora:

TESTSTAN =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS =
        (PROTOCOL = TCP)
        (HOST = standbysrv)
        (PORT = 1521)) )
(CONNECT_DATA = (SERVICE_NAME = teststan) ) 
)

TESTPROD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
        (PROTOCOL = TCP)
        (HOST = oratest)
        (PORT = 1521)) )
(CONNECT_DATA =
        (SID = test)
        (SERVICE_NAME = testprod)
) )

根據ps -ef|grep pmon已經顯示備庫實例名稱的命令輸出teststan

[oravis @standbysrv ~] $ ps -ef | grep pmon oravis 2749 1 0 16:02? 00:00:00 ora_pmon_teststan oravis 2825 2697 0 16:03 pts / 0 00:00:00 grep pmon

但是在備用數據庫上的監聽器的描述中,SID_NAME被定義為“測試”。

Oracle 嘗試使用從未存在的密碼文件 (orapwtest) 驗證 sys 使用者。

因此,將備用站點上 listener.ora 文件上的 SID_NAME 參數設置為“teststan”。

引用自:https://dba.stackexchange.com/questions/127705