132.The tnsnames.ora file has an entry for the service alias ORCL as follows: ORCL = ( DESCRIPTION =

132.The tnsnames.ora file has an entry for the service alias ORCL as follows:
ORCL =
( DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.156.24.216)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.oracle.com)
)
)
The TNSPING command executes successfully when tested with ORCL, but you are not able to connect
to the database instance with the following command:
SQL> CONNECT scott/tiger@orcl
What could be the reason for this?
A.The listener is not running on the database node.
B.The TNS_ADMIN environmental variable is set to a wrong value.
C.The orcl.oracle.com database service is not registered with the listener.
D.The DEFAULT_DOMAIN parameter is set to a wrong value in the sqlnet.ora file.
答案:C
解析:
A:错误,都tnsping成功了
如果没有启动监听
[oracle@wahaha3 admin]$ tnsping wahaha3
TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 28-JUL-2016 12:52:58
Copyright (c) 1997, 2011, Oracle.  All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = wahaha3.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = wahaha31)))
TNS-12541: TNS:no listener
B:错误,tns_admin,是指定tnsnames.ora的,tnsping成功了,说明设置没有问题
  在linux环境下设置后不起作用
C:正确
SQL> show parameter service_name
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      wahaha3
将tnsnames.ora中的service_name修改为SERVICE_NAME = wahaha31
重启监听后
[oracle@wahaha3 admin]$ tnsping wahaha3
TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 28-JUL-2016 12:54:26
Copyright (c) 1997, 2011, Oracle.  All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = wahaha3.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = wahaha31)))
OK (30 msec)
--测试登陆
[oracle@wahaha3 admin]$ sqlplus scott/tiger@wahaha3


SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 28 12:55:06 2016


Copyright (c) 1982, 2011, Oracle.  All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
D:错误,不知道干啥的
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值