当前位置:操作系统 > Unix/Linux >>

ORA-12514 ,ORA-00119, ORA-00132解决

ORA-12514 ,ORA-00119, ORA-00132解决
 
今天使用pl/sql链接oracle的时候遇到点小麻烦,主要是对oracle的监听理解不透所致,在这里把遇到的问题记录一下,其实真正的原理的东西还有待研究;
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

 

 
用pl/sql链接数据库,出现了下列错误:
正在连接...ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务;
于是就用oracle的网络配置助手配置监听和tns
因为之前我升级过数据库,从服务中也能看到有两个版本的监听服务,就感觉是这个原因,就一遍遍的尝试删除、创建监听,创建tns,结果弄的焦头烂额的也没有搞定;打算看看spfile里的变量设置,因为监听只是用在客户端链接的时候用,所以我在服务器端用sql*plus是可以链接上的,谁知当我链接上的时候发现数据库没有启动(低级错误),当数据库没有启动的时候用网络配置助手配置的时候就是会出现这个错误;  于是就启动数据库,无奈,屋漏偏锋连阴雨,有出现了下列的错误:
SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'

 

看错误应该是跟监听有关的系统变量的设置出了问题;用下列方法解决:
SQL> create pfile='c:\pfile2.ora' from spfile;

 

文件已创建。
打开之后找到,变量 *.local_listener='LISTENER_ORCL'  
先干掉,然后保存该文件,用它先来启动;
SQL> startup pfile='c:\pfile2.ora';
ORACLE 例程已经启动。

Total System Global Area  836976640 bytes
Fixed Size                  1377812 bytes
Variable Size             683674092 bytes
Database Buffers          146800640 bytes
Redo Buffers                5124096 bytes

 

数据库装载完毕。
数据库已经打开。
 
看来是可以了,那么用此pfile 创建spfile;
SQL> create spfile from pfile=‘c:\pfile2.ora’;

 

再次试验
SQL> shutdown immediate;

 

数据库已经关闭。
已经卸载数据库。
SQL> startup
ORACLE 例程已经启动。

Total System Global Area  836976640 bytes
Fixed Size                  1377812 bytes
Variable Size             683674092 bytes
Database Buffers          146800640 bytes
Redo Buffers                5124096 bytes

 

数据库装载完毕。
数据库已经打开。
查看那个变量的情况:
SQL> show parameter loc


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_block_buffers                     integer     0
db_block_checking                    string      FALSE
db_block_checksum                    string      TYPICAL
db_block_size                        integer     8192
db_file_multiblock_read_count        integer     16
ddl_lock_timeout                     integer     0
distributed_lock_timeout             integer     60
dml_locks                            integer     1088
local_listener                       string
lock_name_space                      string
lock_sga                             boolean     FALSE

 

值为空,既然能够正常使用就先不去设置了;
 
官方文档对此变量的解释:
LOCAL_LISTENER
Property Description
Parameter type String
Syntax LOCAL_LISTENER = network_name
Default value (ADDRESS = (PROTOCOL=TCP)(HOST=hostname)(PORT=1521)) where hostname is the network name of the local host.
Modifiable ALTER SYSTEM
Basic No
LOCAL_LISTENER
 specifies a network name that resolves to an address or address list of Oracle Net local listeners (that is, listeners that are running on the same machine as this instance). The address or address list is specified in the TNSNAMES.ORA file or other address repository as configured for your system.
 
最后在说一下那个ORA-12514错误,由于数据库的启动也自动解决了,呵呵;
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,