Oracle
 sql >> Teknologi Basis Data >  >> RDS >> Oracle

Pengembang Sql dapat menghubungkan Oracle Database 12c dengan TNS tetapi tidak dapat terhubung dengan dasar

Saat menghubungkan ke PDB, Anda harus menggunakan nama LAYANAN.

SID hanya untuk database container.

Lihat halaman ini, khusus bekerja dengan PDB

Service Name. When you create a PDB, Oracle automatically adds it as a service in the listener. You can confirm it by looking at the listener status: 

[[email protected] trace]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 24-FEB-2013 12:20:14
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date 19-FEB-2013 21:09:05
Uptime 4 days 15 hr. 11 min. 9 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u02/app/oracle/product/12.1.0/grid/network/admin/listener.ora
Listener Log File
/u02/app/oracle/diag/tnslsnr/prosrv1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prosrv1.proligence.com)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "CONA" has 1 instance(s).
Instance "CONA", status READY, has 1 handler(s) for this service...
Service "CONAXDB" has 1 instance(s).
Instance "CONA", status READY, has 1 handler(s) for this service...
Service "pdb1" has 1 instance(s).
Instance "CONA", status READY, has 1 handler(s) for this service...
The command completed successfully
The service "pdb1" actually points to the PDB called PDB1. It's very important to note that that this is not a service name in initialization parameter of the database, as you can see from the service_names parameter of the database.

SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CONA
You can place that service name in an entry in the TNSNAMES.ORA file:

PDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prosrv1.proligence.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDB1)
)
)
Now you can connect to PDB1 using the connect string:

[[email protected] ~]$ sqlplus system/[email protected]


  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Kerangka Entitas Tidak Dapat Memperbarui Data Dalam Tabel Dengan Kunci Komposit (Oracle)

  2. Metode alternatif ke tabel temp global untuk Oracle Stored Procedure

  3. Cara Mengubah Bahasa untuk Sesi Oracle Anda

  4. melakukan perhitungan pada data dalam tipe tabel

  5. Bagaimana cara mengekstrak hanya nilai tanggal dari bidang tanggal di Oracle?