easy connect

CONNECT username/passwd@IP/service_name

 验证后面带的是service_name,而不是SID
[oracle@jhoa ~]$ ps -ef | grep smon
oracle   18866     1  0 Jul10 ?        00:00:01 ora_smon_orcl
oracle   27967 23120  0 12:49 pts/0    00:00:00 grep smon

[oracle@jhoa ~]$ sysresv 

IPC Resources for ORACLE_SID "orcl" :
Shared Memory:
ID		KEY
4489220 	0x6fe60f10
Semaphores:
ID		KEY
16580609	0x7b8d3258
16613378	0x7b8d3259
16646147	0x7b8d325a
16678916	0x7b8d325b
16711685	0x7b8d325c
16744454	0x7b8d325d
16777223	0x7b8d325e
16809992	0x7b8d325f
16842761	0x7b8d3260
Oracle Instance alive for sid "orcl"


[oracle@jhoa ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Jul 11 12:50:04 2014

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, OLAP, Data Mining and Real Application Testing options

SQL> show parameter service

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
service_names			     string	 jhoa

C:\>sqlplus test/[email protected]/jhoa

SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 7月 11 12:35:55 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

C:\>sqlplus test/[email protected]/orcl

SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 7月 11 12:36:11 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

ERROR:
ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务


请输入用户名:

在RAC环境中:比如devrac1 devrac2 但是service_name为

ora.devrac.devrun1.svc
      1        ONLINE  ONLINE       devrac1                                      
ora.devrac.devrun2.svc
      1        ONLINE  ONLINE       devrac2  

节点1:
SQL> show parameter service

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
service_names			     string	 devrun1

节点2:
SQL> show parameter service

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
service_names			     string	 devrun2

可以连接的方式为:
sqlplus test/[email protected]/devrac

sqlplus test/[email protected]/devrun1

你可能感兴趣的:(easy connect)