oracle ORA-00119: 无效规范 ORA-00132: 语法错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28765999/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ORA-00119: invalid specification ORA-00132: syntax error
提问by user3308131
Below are outputs from my SQLPLUS startup , LSNRCTRL SERVICES, LSNRCTRL STATUS and TNSPING. Also included are my LISTENER.ORA file, TNSNAMES.ORA and my PFILE.
下面是我的 SQLPLUS 启动、LSNRCTRL SERVICES、LSNRCTRL STATUS 和 TNSPING 的输出。还包括我的 LISTENER.ORA 文件、TNSNAMES.ORA 和我的 PFILE。
As you can see from the SQLPLUS startup output the database will not startup because init.ora file local_listener is setup as LISTENER and it says its unable to resolve that name. However the LSNCTRL status shows the name of the LISTENER to be LISTENER, so I'm not sure how LSNCTRL utility is seeing the LISTENER and SQLPLUS can't. My guess, is I'm missing something and I'm sure its OBVIOUS and SIMPLE. Any help would be appreciated!
正如您从 SQLPLUS 启动输出中看到的那样,数据库不会启动,因为 init.ora 文件 local_listener 被设置为 LISTENER 并且它说它无法解析该名称。然而,LSNCTRL 状态将 LISTENER 的名称显示为 LISTENER,所以我不确定 LSNCTRL 实用程序如何看到 LISTENER 而 SQLPLUS 不能。我的猜测是我遗漏了什么,我确定它很明显而且很简单。任何帮助,将不胜感激!
ORACLE_HOME=C:\app\product.1.0\dbhome_1
SQLPLUS STARTUP
================================================================================
sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Fri Feb 27 06:37:51 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER'
SQL>
================================================================================
LSNRCTL SERVICES
================================================================================
LSNRCTL for 64-bit Windows: Version 12.1.0.2.0 - Production on 27-FEB-2015 06:36:45
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "EDMP1" has 1 instance(s).
Instance "EDMP1", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:6 refused:0
LOCAL SERVER
The command completed successfully
================================================================================
LSNRCTL STATUS
================================================================================
LSNRCTL for 64-bit Windows: Version 12.1.0.2.0 - Production on 27-FEB-2015 06:36:59
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.1.0.2.0 - Production
Start Date 27-FEB-2015 06:07:14
Uptime 0 days 0 hr. 29 min. 49 sec
Trace Level support
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\product.1.0\dbhome_1\network\admin\listener.ora
Listener Log File C:\app\diag\tnslsnr\MWKS137477\listener\alert\log.xml
Listener Trace File C:\app\diag\tnslsnr\MWKS137477\listener\trace\ora_9096_8848.trc
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "EDMP1" has 1 instance(s).
Instance "EDMP1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
================================================================================
TNSPING
================================================================================
TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 27-FEB-2015 06:37:31
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
C:\app\product.1.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = EDMP1)))
OK (10 msec)
================================================================================
LISTENER.ORA
================================================================================
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\product.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\product.1.0\dbhome_1\bin\oraclr12.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = EDMP1)
(ORACLE_HOME = C:\app\oracle\product.2.0\dbhome_1)
(SID_NAME = EDMP1)
)
)
================================================================================
TNSNAMES.ORA
================================================================================
EDMP1.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = EDMP1)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
================================================================================
PFILE.ORA
================================================================================
edmp1.__data_transfer_cache_size=0
edmp1.__db_cache_size=1795162112
edmp1.__java_pool_size=16777216
edmp1.__large_pool_size=33554432
edmp1.__oracle_base='C:\app'#ORACLE_BASE set from environment
edmp1.__pga_aggregate_target=855638016
edmp1.__sga_target=2533359616
edmp1.__shared_io_pool_size=117440512
edmp1.__shared_pool_size=553648128
edmp1.__streams_pool_size=0
*.audit_file_dest='C:\app\admin\EDMP1\adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='C:\app\oradata\EDMP1\control01.ctl','C:\app\oradata\EDMP1\control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='EDMP1'
*.diagnostic_dest='C:\app'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=EDMP1XDB)'
*.local_listener='LISTENER'
*.open_cursors=300
*.pga_aggregate_target=804m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2413m
*.undo_tablespace='UNDOTBS1'
================================================================================
采纳答案by Alex Poole
Your initialisation parameter is looking for an alias LISTENER
; and you've shown that exists in your listener.ora
, but the database does not look at that file - it may not even be able to read it.
您的初始化参数正在寻找别名LISTENER
;并且您已经证明存在于您的 中listener.ora
,但数据库不会查看该文件 - 它甚至可能无法读取它。
If you specify an alias then it has to exist in the tnsnames.ora
file, so add a matching same entry to that file:
如果您指定别名,则它必须存在于tnsnames.ora
文件中,因此向该文件添加匹配的相同条目:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
Or alternatively set your initialisation parameter to the connect string rather than an alias, so it doesn't need to refer to tnsnames.ora
:
或者将您的初始化参数设置为连接字符串而不是别名,因此它不需要引用tnsnames.ora
:
*.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))'
回答by Solomon Raja
Try below procedure. It worked for me.
试试下面的程序。它对我有用。
C:\Users\Hp>sqlplus SYSTEM as SYSDBA
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 3 12:28:32 2016
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'
SQL> create pfile from spfile;
File created.
**************************
Now open the PFILE (INIT%ORACLE_SID%.ORA) from %ORACLE_HOME%\database
Search for string local_listener='LISTENER_ORCL' and remove it and save the file.
**************************
SQL> startup nomount pfile='C:\app\Hp\product.2.0\dbhome_1\database\INITorcl.ORA'
ORACLE instance started.
Total System Global Area 1686925312 bytes
Fixed Size 2176368 bytes
Variable Size 1291848336 bytes
Database Buffers 385875968 bytes
Redo Buffers 7024640 bytes
SQL> create spfile from pfile;
File created.
SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1686925312 bytes
Fixed Size 2176368 bytes
Variable Size 1291848336 bytes
Database Buffers 385875968 bytes
Redo Buffers 7024640 bytes
Database mounted.
Database opened.
SQL>
回答by Lalit Kumar B
(SID_DESC =
(GLOBAL_DBNAME = EDMP1)
(ORACLE_HOME = C:\app\oracle\product.2.0\dbhome_1)
(SID_NAME = EDMP1
C:\app\product.1.0\dbhome_1\network\admin\sqlnet.ora
C:\app\product.1.0\dbhome_1\network\admin\listener.ora
ORACLE_HOME- Your ORACLE_HOME environment variable is incorrectly set. You have multiple ORACLE_HOME(s), one is pointing to
11.2.0
and the other is pointing to12.1.0
.LOCAL LISTENER- More importantly, set the LOCAL LISTENER properly.
STATIC registration- Another thing, why do you use STATIC listener registration? Remove the
SID_LIST_LISTENER
. It uses static registration, and that's the reason that you seeSTATUS
asUNKNOWN
service. Let it register dynamically.PLUGGABLE DATABASE- If you are on
12c
, and if you have created it as PLUGGABLE DATABASE, then you must include the PDB details in thetnsnames.ora
file. Else, you would by default connect toCDB
when you doSQLPLUS / AS SYSDBA
.
ORACLE_HOME- 您的 ORACLE_HOME 环境变量设置不正确。您有多个 ORACLE_HOME,一个指向,
11.2.0
另一个指向12.1.0
。本地监听器- 更重要的是,正确设置本地监听器。
STATIC 注册- 另一件事,你为什么使用 STATIC 监听器注册?删除
SID_LIST_LISTENER
. 它使用静态注册,这就是您将其STATUS
视为UNKNOWN
服务的原因。让它动态注册。PLUGGABLE DATABASE- 如果您在 上
12c
,并且已将其创建为 PLUGGABLE DATABASE,则必须在tnsnames.ora
文件中包含 PDB 详细信息。否则,默认情况下,您会CDB
在执行SQLPLUS / AS SYSDBA
.
Please read Oracle 12c Post Installation Mandatory Steps.
回答by user3132194
Had a similar problem. In my case it was solved by changing hostname.
有类似的问题。就我而言,它是通过更改主机名解决的。
Found that local_listener
variable is calculated somewhere based on hostname which was initiated random, so the value incorrect.
发现local_listener
变量是根据随机启动的主机名在某处计算的,因此值不正确。
Changed it in /etc/sysconfig/network
and set it with hostname myshost.mydomain
. Did not edit /etc/hosts
cause i already have dns set up, but otherwise it could be necessary.
将其更改/etc/sysconfig/network
并设置为hostname myshost.mydomain
. 没有编辑,/etc/hosts
因为我已经设置了 dns,否则可能是必要的。