[oracle@OCPServer]cd network/admin/
[oracle@OCPServer]ls
listener.ora listener12111811AM1301.bak shrept.lst tnsnames.ora
listener.ora.bak samples sqlnet.ora
[oracle@OCPServer]
主要是
listener.ora 、sqlnet.ora 、tnsnames.ora
NAMES.DIRECTORY_PATH= (TNSNAMES,HOSTNAME)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
# 下面是这个TNSNAME 对应的主机,端口,协议
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
# 使用专用服务器模式去连接需要跟服务器的模式匹配,如果没有就根据服务器的模式自动调节
(SERVER = DEDICATED)
# 对应service_name ,SQLPLUS>;show parameter service_name; 进行查看
(SERVICE_NAME = orcl)
)
)
# 下面这个类似
SALES =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dg1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sales)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = boway)
(ORACLE_HOME = /u01/app/oracle)
(SID_NAME = ORCL)
)
)
# 监听器的名字,一台数据库可以有不止一个监听器
# 再向下面是监听器监听的协议,ip,端口等,这里使用的tcp1521端口,并且使#用的是主机名
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dg1)(PORT = 1521))
)
LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 18-NOV-2012 12:37:18
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:
start stop status
services version reload
save_config trace spawn
change_password quit exit
set* show*
LSNRCTL>
- netca
- netmgr
service name配置的是tnsnames.ora 文件
listeners配置的是listener.ora 文件,即监听器进程
具体的配置可以尝试一下然后来看一下配置文件。
2.sqlplus sys/oracle 这种连接方式只能连接本机数据库,同样不需要listener 进程
3.sqlplus sys/oracle@orcl 这种方式需要listener 进程处于可用状态。最普遍的通过网络连接。
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Feb 13 16:18:33 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Enter user-name:
EXCLUSIVE :
1. 表示只有一个数据库实例可以使用密码文件
2. 允许将SYSORA 和SYSOPER 权限赋值给SYS 以外的其它用户
SHARED:
1. 表示可以有多个数据库实例可以使用密码文件
2. 不允许将SYSORA 和SYSOPER 权限赋值给SYS 以外的其它用户
所以,如果要以操作系统身份登录,Remote_Login_Passwordfile 应该设置为NONE
LSNRCTL>status
LSNRCTL>services
TNS Ping Utility for Solaris: Version 11.2.0.3.0 - Production on 18-NOV-2012 12:53:28
Copyright (c) 1997, 2011, Oracle. All rights reserved.
Used parameter files:
/opt/oracle/product/11.2.0.1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.188.88)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ocpserver)))
OK (20 msec)
[oracle@OCPServer]
INSTANCE_NAME STATUS
------------------------------ ------------------------------------
orcl OPEN
NAME
---------------------------
ORCL
# 使用host naming 则不再需要tnsname.ora 文件做本地解析
# listener.ora Network Configuration File: d:\oracle\product\10.1.0\db_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
# (SID_NAME = PLSExtProc)
(SID_NAME = orcl)
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /u01/app/oracle)
# (PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dg1)(PORT = 1521))
)
)
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (HOSTNAME)
alter system set pga_aggregate_target=512m scope=both;
ORA-12560 STARTING LISTENER ON NT - TROUBLESHOOTING
---------------------------------------------------
ORA-12560: TNS Protocol adapter error
Cause: A generic protocol adapter error occurred.
Action: Check addresses used for proper protocol specification. Before reporting this error, look at the error stack and check for lower level transport errors.For further details, turn on tracing and reexecute the operation. Turn off tracing when the operation is complete.
This is a high level error just reporting an error occurred in the actual transport layer. Look at the next error down the stack and process that.
1.- Starting Listener with TCP/IP Protocol
Problem:
You start the TNS Listener from command line and the TCP/IP address fails with a TNS-12560.
Solution:
Check if Microsoft Winsock Proxy(WSP) Client is enabled on the Windows NT Server, if that is the case then go to windows Control Panel, click WSP icon and select the disable Proxy Client option.
Explanation:
The Winsock application may fail to bind to a specific port on a Proxy Server computer when the Winsock is running Proxy Client.
2.- TNS-12560 TNS-512 Starting the listener.
Problem:
You try to start up the listener and receive the following error stack:
TNS-12542: TNS:address already in use
TNS-12560: TNS Protocol adapter error
TNS-00512: Address already in use
32-bit Windows Error: 48: Unknown error
Error: TNS 512
Text: Address already in use
--------------------------------------------
Cause: Specified listener address is already being used.
Action: Start your listener with an unused address.
Generally this problem may ocurr for a incorrect setting in the listener.ora. Some causes of this problems may be:
a.- Some defined address in the listeners.ora is been used. Make sure other listeners are not running. Either listener.log and screen output appear the address with problem.
b.- Just for 8i: in windows NT the algorithm to acquire
the address has change, please check the Note 69026.1: Oracle 8i and socket LISTEN operations.
Explanation:
The listener will try to acquire the address in exclusive mode, if this is been used then the process to get it will fail.
3.- Starting the listener the errors ORA-12203,ORA-12560, NL-462 or NL-427 may be raised.
Problem:
You try to start up the listener and receive the following errors
ORA-12203,ORA-12560, NL-462 or NL-427.
Solution:
Recreate the listener.ora file.
Explanation:
Some corruption in the listener.ora may get unable to the tnslsnr to work adequatly.
4.- Failed to start service, TNS-12560, TNS-00530 when create new listener services
Problem:
To recreate Oracle TNS listener service on Windows NT, you delete the service entry in registry. When using lsnrctl to start the listener, you get the following errors:
LSNRCTL> start
Starting tnslsnr: please wait...
Failed to start service, error 3.
TNS-00530: Protocol adapter error
The Listener service is not recreated and the Listener would not start.
You are using a valid listener.ora file and protocol adapters.
Solution:
After you delete the Listener service from registry, you have to reboot NT for it to take effect. Then you can use lsnrctl to start the Listener, which would re-create the listener service.
Explanation:
The Listener service is marked 'disabled', but it still exists after you delete the service from registry.
本文出自 “Focus on Oracle” 博客,请务必保留此出处http://alexy.blog.51cto.com/6115453/1063052
5337



被折叠的 条评论
为什么被折叠?



