[20150924]tnsnames.ora是否可以带斜线.txt

[20150924]tnsnames.ora是否可以带斜线.txt

--10g开始oracle支持ezconnect简单连接方式建立与数据库的连接。

d:\tools\sqltemp>sqlplus scott/xxxxxx@192.168.100.40:1521/test.com
SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 24 08:32:43 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SCOTT@192.168.100.40:1521/test.com> select utl_inaddr.get_host_address from dual;
GET_HOST_ADDRESS
------------------
192.168.100.40

--如果在本机的tnsnames.ora也配置一样的连接串,会出现什么情况呢?在本机的配置文件加入:
192.168.100.40/test =
  (DESCRIPTION =
    (SDU=32768)
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

d:\tools\sqltemp>sqlplus scott/xxxxxx@192.168.100.40/test.com
SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 24 08:50:31 2015
Copyright (c) 1982, 2013, 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

SCOTT@192.168.100.40/test.com> select utl_inaddr.get_host_address c20 from dual;
C20
--------------------
192.168.100.89

--很明显这个时候使用的是tnsnames.ora里面的配置:
--在本机的配置文件修改如下:
192.168.100.40:1521/test.com =
  (DESCRIPTION =
    (SDU=32768)
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

d:\tools\sqltemp>sqlplus scott/xxxxxx@192.168.100.40:1521/test.com
SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 24 08:51:14 2015
Copyright (c) 1982, 2013, 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

SCOTT@192.168.100.40:1521/test.com> select utl_inaddr.get_host_address c20 from dual;
C20
--------------------
192.168.100.89

--很明显依旧使用的是tnsnames.ora配置,并且里面还可以包含冒号。

--再本机的配置文件修改如下:
192.168.100.40:1521/test.com,192.168.100.40/test.com =
  (DESCRIPTION =
    (SDU=32768)
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.89)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

d:\tools\sqltemp>sqlplus scott/xxxxxx@192.168.100.40:1521/test.com
SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 24 08:51:56 2015
Copyright (c) 1982, 2013, 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

SCOTT@192.168.100.40:1521/test.com> select utl_inaddr.get_host_address c20 from dual;
C20
--------------------
192.168.100.89

SCOTT@192.168.100.40:1521/test.com> connect scott/xxxxxx@192.168.100.40/test.com
Connected.
SCOTT@192.168.100.40/test.com> select utl_inaddr.get_host_address c20 from dual;
C20
--------------------
192.168.100.89

--当然最好不要这样配置,容易混淆。这样的测试仅仅是为了玩^_^。
--关于tnsnames.ora还可以参考我以前写的:
[20150409]tnsnames.ora与IFILE.txt http://blog.itpub.net/267265/viewspace-1561107/
[20141229]配置tnsnames.ora使用rsp文件 http://blog.itpub.net/267265/viewspace-1383445/
[20140226]tnsnames.ora别名之间使用逗号 http://blog.itpub.net/267265/viewspace-1090384/
[20130528]tnsnames.ora的格式问题.txt http://blog.itpub.net/267265/viewspace-762224/
[20111220]tnsnames.ora的定位.txt   http://blog.itpub.net/267265/viewspace-713629/

时间: 2024-10-23 01:49:09

[20150924]tnsnames.ora是否可以带斜线.txt的相关文章

[20111220]tnsnames.ora的定位.txt

[20111220]tnsnames.ora的定位.txt 1.跟踪在linux下sqlplus的执行过程,可以很容易定位tnsnames.ora的定位过程. $ export TNS_ADMIN=/tmp$ strace -o  findtnsnames.txt sqlplus scott/xxxx@noexist $ grep -i tnsname findtnsnames.txtaccess("/home/oracle/.tnsnames.ora", F_OK) = -1 ENO

[20170914]tnsnames.ora的管理.txt

[20170914]tnsnames.ora的管理.txt --//昨天朋友讲tnsnams.ora的内容太长了,而且许多不需要的.管理不方便.我记得以前写[20150409]tnsnames.ora与IFILE.txt.链接 --//http://blog.itpub.net/267265/viewspace-1561107/ --//这样你可以按照某种分类管理.实际上这个我也是以前看别人的机器学来的,很简单就是建立多个tnsnames配置文件. --//使用参数IFILE=/path/xxx

[20160512]tnsnames.ora配置文件.txt

[20160512]tnsnames.ora配置文件.txt --今天再次解决1个tnsnames.ora配置文件.看来这个文件最好不要手工修改!! --通过例子来说明: 78 =   (DESCRIPTION =     (ADDRESS_LIST =       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.78)(PORT = 1521))     )     (SDU = 32768)     (CONNECT_DATA =       (

[20130528]tnsnames.ora的格式问题.txt

[20130528]tnsnames.ora的格式问题.txt --注:为了blog的显示问题,空格使用下划线. 40X =(DESCRIPTION =_(ADDRESS_LIST =_(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.40)(PORT = 1521))_)_(CONNECT_DATA =__(SERVER = DEDICATED)__(SERVICE_NAME = test.com))) 使用上面的连接数据库,会出现:ERROR:OR

[20141229]配置tnsnames.ora使用rsp文件

[20141229]配置tnsnames.ora使用rsp文件.txt --大部分配置tnsnames.ora,特别是服务器都是直接编辑,使用copy & paste. --我个人特别讨厌copy & paste 使用vim出现阶梯显示的情况,特别讨厌,我多次跟我同事在copy & paste设置:set paste来避免这种情况. --但是就是不改,按照他们的道理这样做是能正常访问的. --如果能看看我以前写的 http://blog.itpub.net/267265/views

[20160310]神奇的斜线.txt

[20160310]神奇的斜线.txt --今天发现同事配置的数据库服务器,没有配置NLS_DATE_FORMAT环境变量,当打开.bash_profile时发现同事配置的-ORACLE_HOME环境变 --量结尾带有/,忍不住想说一番,还好我测试以下,发现11.2.0.4版本,ORACLE_HOME最后有没有/都可以正常进入连上数据库(当执行 --sqlplus / as sysdba). --相关链接可以看我以前写的blog: [20140513]ORACLE_HOME环境变量结尾的斜杠 h

[20140226]tnsnames.ora别名之间使用逗号

[20140226]tnsname.ora别名之间使用逗号.txt 前几天看到别人在tnsnames.ora中定义中出现如下的定义: 40,40test =   (DESCRIPTION =     (ADDRESS_LIST =       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.XXX.40)(PORT = 1521))     )     (CONNECT_DATA =       (SERVER = DEDICATED)       (SER

Oracle TNSNAMES.ORA配置

在安装目录下,如:E:\Oracle\Ora81\network\ADMIN下用写字板或记事本打开TNSNAME.ORA文件,文件内容大概如下: TEST.SOFTONE.COM = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = zcb_8115)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = test) ) ) 蓝色部分为安装时录入的信息. 如果该文件没有配置

浅析如何在tnsnames.ora中配置监听

以下是对如何在tnsnames.ora中配置监听进行了详细的分析介绍,需要的朋友可以过来参考下   tnsnames.ora所在位置:D:Installedoracleproduct11.1.0db_1NETWORKADMINtnsnames.ora也就是说在product中 只有配置了监听之后才可以登录到数据库中 复制代码 代码如下: TOTO =   (DESCRIPTION =     (ADDRESS = (PROTOCOL = TCP)(HOST = 这里是IP地址)(PORT = 1