1、客户端trace
修改客户端的sqlnet.ora文件
D:\>type d:\Oracle\product\10.2.0\client_2\network\admin\sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
# Below item added by Robinson
Trace_level_client=16
Trace_directory_client=d:\oracle\product\10.2.0\client_2\network\admin
Trace_unique_client=on
Trace_timestamp_client=on
Diag_adr_enabled=off
tnsping.trace_directory=d:\oracle\product\10.2.0\client_2\network\admin
tnsping.trace_level=admin
D:\>tnsping cnmmbo
............
Used parameter files:
d:\oracle\product\10.2.0\client_2\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=192.168.7.2) (PORT=1910))
(CONNECT_DATA= (SERVICE_NAME=CNMMBO)))
OK (20 msec)
D:\>dir d:\oracle\product\10.2.0\client_2\network\admin\
Volume in drive D has no label.
Volume Serial Number is EC2E-8A31
Directory of d:\oracle\product\10.2.0\client_2\network\admin
04/12/2012 09:58 AM <DIR> .
04/12/2012 09:58 AM <DIR> ..
06/08/2012 10:45 AM <DIR> SAMPLE
04/12/2012 09:58 AM 725 sqlnet.ora
12/11/2012 02:04 PM 10,648 tnsnames.ora
22/08/2012 02:31 PM 6,564 tnsnames.ora.bak
04/12/2012 09:58 AM 5,932 tnsping.trc #-->刚刚产生的trace文件
D:\>sqlplus goex_admin@cnmmbo
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Dec 4 10:02:05 2012
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
D:\>dir d:\oracle\product\10.2.0\client_2\network\admin
Volume in drive D has no label.
Volume Serial Number is EC2E-8A31
Directory of d:\oracle\product\10.2.0\client_2\network\admin
04/12/2012 10:02 AM <DIR> .
04/12/2012 10:02 AM <DIR> ..
04/12/2012 10:02 AM 15,892 cli_12172.trc
04/12/2012 10:02 AM 114,703 cli_12172_1.trc
06/08/2012 10:45 AM <DIR> SAMPLE
04/12/2012 09:58 AM 725 sqlnet.ora
............
修改tnsnames.ora的cnmmbo项的service_name之后再连接
#Author : Robinson
#Blog : http://blog.csdn.net/robinson_0612
D:\>sqlplus goex_admin@cnmmbo
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Dec 4 10:07:57 2012
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
D:\>dir d:\oracle\product\10.2.0\client_2\network\admin
Volume in drive D has no label.
Volume Serial Number is EC2E-8A31
Directory of d:\oracle\product\10.2.0\client_2\network\admin
04/12/2012 10:08 AM <DIR> .
04/12/2012 10:08 AM <DIR> ..
04/12/2012 10:08 AM 15,902 cli_11444.trc
04/12/2012 10:08 AM 24,897 cli_11444_1.trc #--又产生了两个新的trace文件
04/12/2012 10:02 AM 15,892 cli_12172.trc
04/12/2012 10:02 AM 114,703 cli_12172_1.trc
..............
在文件cli_11444_1.trc可以看到相关的错误
[04-DEC-2012 10:08:02:560] niqme: reporting NS-12564 error as ORA-12564
[04-DEC-2012 10:08:02:560] niqme: exit
[04-DEC-2012 10:08:02:560] niomapnserror: exit
[04-DEC-2012 10:08:02:560] niqme: entry
[04-DEC-2012 10:08:02:560] niqme: reporting NSG-12514 error as ORA-12514
[04-DEC-2012 10:08:02:560] niqme: exit
[04-DEC-2012 10:08:02:560] niotns: Couldn't connect, returning 12514
[04-DEC-2012 10:08:02:562] niotns: exit
