--******************************
-- ORA-00119,ORA-00132 错误处理
--******************************
最近系统启动时,收到了ORA-00119以及ORA-00132的错误,该错误实际上跟LISTENER有关,通常的处理办法是将spfile转储为pfile然后从pfile启动
并生成新的spfile,不过该操作方式代价太高,需要重新启动数据库。另一种方式则是直接修改tnsnames.ora中的服务名,使之与监听器中的listener名字保持一致,具体参考下面的细节。
一.错误提示
SQL> startup nomount;
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ODBP'
二、分析错误
1.查看错误号对应的具体描述
[oracle@odbp admin]$ oerr ora 00132
00132, 00000, "syntax error or unresolved network name '%s'"
// *Cause: Listener address has syntax error or cannot be resolved.
// *Action: If a network name is specified, check that it corresponds
// to an entry in TNSNAMES.ORA or other address repository
// as configured for your system. Make sure that the entry
// is syntactically correct.
描述信息中给出了listener.ora中网络名是否与tnsnames.ora相一致,需要检查
2.查看监听
[oracle@odbp admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/10g/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER_ODBP =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = odbp.oradb.com)
(ORACLE_HOME = /u01/app/oracle/10g)
(SID_NAME = odbp)
)
)
LISTENER_ODBP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = odbp.oradb.com)(PORT = 1521))
)
3.查看tnsnames.ora
[oracle@odbp admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/10g/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ODBP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.192.11)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = odbp.oradb.com)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
由上面的listener.ora与tnsnames.ora可知
listener.ora中的监听名与tnsnames.ora中的服务名不一致
三、解决方法
1.修改tnsnames.ora中的服务名为LISTENER_ODBP,然后重新启动数据库即可
2.可以将spfile(无pfile情况下)转储为pfile文件,将local_listener参数置空,然后使用pfile文件启动数据库后重新生成spfile
可以采用下面的方法来转储,如下
[oracle@odbp dbs]$ ls --没有pfile
hc_odbp.dat initdw.ora init.ora lkODBP orapwodbp spfileodbp.ora
[oracle@odbp dbs]$ strings spfileodbp.ora > initodbp.ora
[oracle@odbp dbs]$ cat initodbp.ora
odbp.__db_cache_size=130023424
odbp.__java_pool_size=33554432
odbp.__large_pool_size=4194304
odbp.__shared_pool_size=113246208
odbp.__streams_pool_size=
*.audit_file_dest='/u01/app/oracle/admin/odbp/adump'
*.background_dump_dest='/u01/app/oracle/admin/odbp/bdump'
*.compatible='10.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/odbp/control01.ctl','/u01/app/oracle/oradata/odbp/control02.ctl'
*.core_dump_dest='/u01/app/oracle/admin/odbp/cdump'
*.db_block_size=8192
*.db_domain='oradb.com'
*.db_file_multiblock_read_count=16
*.db_name='odbp'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=odbpXDB)'
*.job_queue_processes=10
*.local_listener='LISTENER_ODBP' --将改行注释掉或置空
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=285212672
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/odbp/udump'
SQL> startup nomount pfile='/u01/app/oracle/10g/dbs/initodbp.ora';
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1267068 bytes
Variable Size 150997636 bytes
Database Buffers 130023424 bytes
Redo Buffers 2924544 bytes
SQL> create spfile from pfile;
File created.
SQL> startup force;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1267068 bytes
Variable Size 150997636 bytes
Database Buffers 130023424 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
四、更多参考
有关性能优化请参考
Oracle 硬解析与软解析
共享池的调整与优化(Shared pool Tuning)
Buffer cache 的调整与优化(一)
Oracle 表缓存(caching table)的使用
有关闪回特性请参考
Oracle 闪回特性(FLASHBACK DATABASE)
Oracle 闪回特性(FLASHBACK DROP & RECYCLEBIN)
Oracle 闪回特性(Flashback Query、Flashback Table)
Oracle 闪回特性(Flashback Version、Flashback Transaction)
有关基于用户管理的备份和备份恢复的概念请参考
Oracle 冷备份
Oracle 热备份
Oracle 备份恢复概念
Oracle 实例恢复
Oracle 基于用户管理恢复的处理(详细描述了介质恢复及其处理)
有关RMAN的恢复与管理请参考
RMAN 概述及其体系结构
RMAN 配置、监控与管理
RMAN 备份详解
RMAN 还原与恢复
有关Oracle体系结构请参考
Oracle 实例和Oracle数据库(Oracle体系结构)
Oracle 表空间与数据文件
Oracle 密码文件
Oracle 参数文件
Oracle 数据库实例启动关闭过程
Oracle 联机重做日志文件(ONLINE LOG FILE)
Oracle 控制文件(CONTROLFILE)
Oracle 归档日志