ORA-12514 错误的处理

Posted dingdingfish

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORA-12514 错误的处理相关的知识,希望对你有一定的参考价值。

实在只是一个简单的错误,只是记录下过程。

登录报错:

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 18 00:50:26 2022
Version 19.16.0.0.0

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

ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor


Enter user-name:

查看监听,并没有发现对应的数据库服务:

$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 18-OCT-2022 00:50:39

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                17-OCT-2022 22:38:01
Uptime                    0 days 2 hr. 12 min. 37 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/19.0.0.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/bigtsiys/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.155)(PORT=1521)))
Services Summary...
Service "+APX" has 1 instance(s).
  Instance "+APX1", status READY, has 1 handler(s) for this service...
Service "+ASM" 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_RECO" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
The command completed successfully

原来是数据库没有启动,因此启动之:

$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 18 00:51:07 2022
Version 19.16.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 3.2749E+10 bytes
Fixed Size                 13873784 bytes
Variable Size            3892314112 bytes
Database Buffers         2.8655E+10 bytes
Redo Buffers              187449344 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
Version 19.16.0.0.0

此时监听中已有注册的服务:

$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 18-OCT-2022 00:51:40

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                17-OCT-2022 22:38:01
Uptime                    0 days 2 hr. 13 min. 38 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/19.0.0.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/bigtsiys/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.0.155)(PORT=1521)))
Services Summary...
Service "+APX" has 1 instance(s).
  Instance "+APX1", status READY, has 1 handler(s) for this service...
Service "+ASM" 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_RECO" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "DB0921_nrt1mz.sub07290808380.training.oraclevcn.com" has 1 instance(s).
  Instance "DB0921", status READY, has 2 handler(s) for this service...
Service "e92e139443c62209e0539b00000afd03.sub07290808380.training.oraclevcn.com" has 1 instance(s).
  Instance "DB0921", status READY, has 2 handler(s) for this service...
Service "orclpdb1.sub07290808380.training.oraclevcn.com" has 1 instance(s).
  Instance "DB0921", status READY, has 2 handler(s) for this service...
The command completed successfully

登录成功了:

$ ssb

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 18 00:51:45 2022
Version 19.16.0.0.0

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

Last Successful login time: Mon Oct 17 2022 23:06:01 +00:00

Connected to:
Oracle Database 19c EE Extreme Perf Release 19.0.0.0.0 - Production
Version 19.16.0.0.0

SQL>

以上是关于ORA-12514 错误的处理的主要内容,如果未能解决你的问题,请参考以下文章

ORACLE本地数据库连接错误ORA-12514问题

侦听器拒绝连接并出现以下错误:ORA-12514

连接Oracle远程数据库错误:ORA-12541,ORA-12514,ORA-01017的解决方法!

连接Oracle远程数据库错误:ORA-12541,ORA-12514,ORA-01017的解决方法!

PLSQL不好用,提示ora-12514 错误解决方法

Oracle ORA-12541,ORA-12514错误