Connecting To 12CR2 RAC Pluggable Database With ORA-1033

eric0435發表於2017-05-16

作業系統為Oracle Linux 7.1 資料庫為Oracle 12.2.0.1,今天在登入pdb時使用sysdba許可權登入正常,使用非sysdba許可權登入出現ora-01033錯誤,錯誤資訊如下:

[root@jytest1 ~]# su - oracle
Last login: Tue May 16 18:32:29 CST 2017
[oracle@jytest1 ~]$ sqlplus /nolog

SQL*Plus: Release 12.2.0.1.0 Production on Tue May 16 18:39:42 2017

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

SQL> conn sys/xxzx7817600@jypdb as sysdba
Connected.
SQL> conn jy/jy@jypdb
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0


Warning: You are no longer connected to ORACLE.

在MOS上有篇文件" Connecting To A 12c RAC Pluggable Database Intermittently Fails With ORA-1033 (Doc ID 1998112.1)"描述相關問題,原因有兩個,一是pdb所使用的服務名與pdb資料庫名相同,二是PDB沒有在所有RAC例項上open,說使用pdb資料庫名作為服務名對於RAC來說不是一個最佳方案,因為當例項使用SCAN來註冊pdb名時並且節點監聽到pdb被mounted。這可能造成連線被髮送到pdb被mounted的例項上,當以非sysdba許可權登入時就會出現ora-0133錯誤。

pdb的服務名確實是使用pdb名作為其服務名

[grid@jytest1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-MAY-2017 18:42:17

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                02-MAY-2017 11:14:02
Uptime                    14 days 7 hr. 28 min. 15 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/jytest1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.175)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.171)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=jytest1.jydba.net)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.2.0/db/admin/jy/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_CRS" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_TEST" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "4b2c6373ae2547cce053ab828a0a7ca3" has 1 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
Service "4e0ba8d9d278217be053ab828a0a1330" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jy" has 1 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
Service "jyXDB" has 1 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
Service "jycs" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jycsXDB" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jycspdb" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jypdb" has 1 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
The command completed successfully

pdb資料庫在所有例項上都open了

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

給pdb增加服務名jypdb_srv

[grid@jytest1 ~]$ su - oracle
Password: 
Last login: Tue May 16 18:39:02 CST 2017 on pts/0
[oracle@jytest1 ~]$ srvctl add service  -db jy -pdb jypdb -s jypdb_srv  -preferred "jy1" -available "jy2"
[oracle@jytest1 ~]$ srvctl start service -db jy -s jypdb_srv

[grid@jytest1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-MAY-2017 18:56:55

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                02-MAY-2017 11:14:02
Uptime                    14 days 7 hr. 42 min. 54 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/jytest1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.175)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.138.130.171)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=jytest1.jydba.net)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/product/12.2.0/db/admin/jy/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_CRS" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_TEST" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "4b2c6373ae2547cce053ab828a0a7ca3" has 2 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
  Instance "jy1", status READY, has 2 handler(s) for this service...
Service "4e0ba8d9d278217be053ab828a0a1330" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jy" has 1 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
Service "jyXDB" has 1 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
Service "jycs" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jycsXDB" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jycspdb" has 1 instance(s).
  Instance "jycs1", status READY, has 1 handler(s) for this service...
Service "jypdb" has 2 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
  Instance "jy1", status READY, has 2 handler(s) for this service...
Service "jypdb_srv" has 2 instance(s).
  Instance "jy1", status READY, has 1 handler(s) for this service...
  Instance "jy1", status READY, has 2 handler(s) for this service...
Service "orcl" has 1 instance(s).
  Instance "orcl1", status READY, has 1 handler(s) for this service...
The command completed successfully

使用新服務名再次以非sysdba許可權登入成功
SQL> conn jy/jy@jypdb
Connected.
SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2139166/,如需轉載,請註明出處,否則將追究法律責任。

相關文章