安装问题3:数据库连接报ORA-12545
p7401:/oracle/db/10.2/db_1/network/admin$more listener.ora
# listener.ora.p7401 Network Configuration File: /oracle/db/10.2/db_1/network/admin/listener.ora.p7401
# Generated by Oracle configuration tools.
SID_LIST_LISTENER_P7401 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/db/10.2/db_1)
(PROGRAM = extproc)
)
)
LISTENER_P7401 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = p7401-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.241.15)(PORT = 1521)(IP = FIRST))
)
)
p7401:/oracle/db/10.2/db_1/network/admin$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Nov 25 18:51:48 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP,
Data Mining Scoring Engine and Real Application Testing options
SQL> show parameter listen
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
remote_listener string LISTENERS_GMNC
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP,
Data Mining Scoring Engine and Real Application Testing options
p7401:/oracle/db/10.2/db_1/network/admin$ls
libnk510.imp libnrad10.exp libnrad10.imp listener.ora samples shrept.lst sqlnet.ora tnsnames.ora
p7401:/oracle/db/10.2/db_1/network/admin$more tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/db/10.2/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
GMNC2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = p7402-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = gmnc)
(INSTANCE_NAME = gmnc2)
)
)
GMNC1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = p7401-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = gmnc)
(INSTANCE_NAME = gmnc1)
)
)
LISTENERS_GMNC =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = p7401-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = p7402-vip)(PORT = 1521))
)
GMNC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = p7401-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = p7402-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = gmnc)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
p7401:/oracle/db/10.2/db_1/network/admin$sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Fri Nov 25 18:53:31 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP,
Data Mining Scoring Engine and Real Application Testing options
SQL> show parameter listen
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
remote_listener string LISTENERS_GMNC
SQL> alter system set local_listener=listeners_local;
alter system set local_listener=listeners_local
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENERS_LOCAL'
SQL> alter system set local_listener='(ADDRESS=(PROTOL=TCP)(HOST=192.168.242.151)(PORT=1521))' scope=both sid='gmnc1';
alter system set local_listener='(ADDRESS=(PROTOL=TCP)(HOST=192.168.242.151)(PORT=1521))' scope=both sid='gmnc1'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address
'(ADDRESS=(PROTOL=TCP)(HOST=192.168.242.151)(PORT=1521))'
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = p7401-vip)(PORT = 1521))' sid='gmnc1';
System altered.
SQL> show parameter listen
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = p7402-vip)(PORT = 1521))' sid='gmnc2';
System altered.
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (ADDRESS = (PROTOCOL = TCP)(HO
ST = p7401-vip)(PORT = 1521))
remote_listener string LISTENERS_GMNC
SQL>
如上做完后有时也不管用,还是会出现之前的问题,如下左后问题解决:
SQL> alter system set local_listener='LISTENERS_GMNC';
System altered.
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string LISTENERS_GMNC
remote_listener string LISTENERS_GMNC
SQL>
*.dispatchers='(PROTOCOL=TCP) (SERVICE=gmncXDB)'
gmnc1.instance_number=1
gmnc2.instance_number=2
*.job_queue_processes=10
gmnc1.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = p7401-vip)(PORT = 1521))'
gmnc2.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = p7402-vip)(PORT = 1521))'
*.local_listener='LISTENERS_GMNC'
*.open_cursors=3000
*.optimizer_dynamic_sampling=4
*.optimizer_index_cost_adj=40
*.pga_aggregate_target=3304062976
*.processes=600
*.remote_listener='LISTENERS_GMNC'
*.remote_login_passwordfile='exclusive'
*.sga_max_size=21474836480
*.sga_target=21474836480
gmnc2.thread=2
gmnc1.thread=1
*.undo_management='AUTO'
gmnc2.undo_tablespace='UNDOTBS2'

