ฉันกำลังใช้งานการติดตั้ง Oracle 12c ใหม่บน Solaris 10 และฉันสามารถเชื่อมต่อกับ CDB โดยใช้คางคกได้ดี โปรดบอกฉันว่าตอนนี้ฉันจะเชื่อมต่อกับฐานข้อมูล PDB ชื่อ PDBORCL ตามที่กล่าวไว้ในคำแนะนำได้อย่างไร: https://oracle-base.com/articles/12c/multitenant-connecting-to-cdb-and-pdb-12cr1
ต่อไปนี้เป็นเนื้อหาของไฟล์ tnsnames.ora ของฉัน:
# tnsnames.ora Network Configuration File: /bkofa/oracle/app/oracle
/product/12.1.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL12 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = afxortsts)(PORT = 1523))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl12)
)
)
pdbORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = afxortsts)(PORT = 1523))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdborcl)
)
)
นี่คือเนื้อหาของไฟล์ Listener.ora ของฉัน:
# listener.ora Network Configuration File: /bkofa/oracle/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = afxortsts)(PORT = 1523))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl12)
(SID_NAME = orcl12)
)
(SID_DESC =
(GLOBAL_DBNAME = pdborcl)
(SID_NAME = pdborcl)
)
)
โดยวิธีการเหล่านี้คือคอนเทนเนอร์:
SELECT name, pdb
FROM v$services
ORDER BY name;
NAME PDB
SYS$BACKGROUND CDB$ROOT
SYS$USERS CDB$ROOT
orcl12 CDB$ROOT
orcl12XDB CDB$ROOT
pdborcl PDBORCL
เมื่อฉันพยายามเชื่อมต่อกับ PDB โดยใช้คำสั่งผสมกัน นี่คือสิ่งที่ฉันได้รับ:
bash-3.2$ lsnrctl status
LSNRCTL for Solaris: Version 12.1.0.2.0 - Production on 13-APR-2016 15:42:28
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=afxortsts)(PORT=1523)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 12.1.0.2.0 - Production
Start Date 12-APR-2016 13:56:56
Uptime 1 days 1 hr. 45 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /bkofa/oracle/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /bkofa/oracle/app/oracle/diag/tnslsnr/afxortsts/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=afxortsts)(PORT=1523)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl12" has 1 instance(s).
Instance "orcl12", status UNKNOWN, has 1 handler(s) for this service...
Service "pdborcl" has 1 instance(s).
Instance "pdborcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
bash-3.2$ sqlplus '/ as sysdba'
SQL*Plus: Release 12.1.0.2.0 Production on Wed Apr 13 15:42:44 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> connect sys/[email protected]:1523/pdborcl as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
SQL> connect sys@pdborcl
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4 Error: 2: No such file or directory
Additional information: 2581
Additional information: -2057892281
Process ID: 0
Session ID: 0 Serial number: 0
SQL> connect [email protected]:1523/pdborcl as sysdba
ERROR:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
SQL>
โอ้ ฉันควรทำให้ชัดเจนว่าฉันใช้พอร์ต 1523 เนื่องจากมี Oracle 10g รุ่นเก่าอีกตัวหนึ่งที่ทำงานอยู่บนระบบที่ใช้พอร์ตนี้ ดังนั้นฉันจึงต้องการหลีกเลี่ยงความขัดแย้งกับสิ่งนั้น