测试环境:Oracle Enterprise Linux 64-bit (5.8版本) + Oracle 11g 64位
相关说明: Oracle11g64位软件的安装位置为/u01/app/oracle/product/11.2.0/dbhome_1 ,数据库名为默认的orcl,Linux虚拟机的IP设置为192.168.1.121
一、修改listener.ora文件内容
命令:[oracle@gpdb ~]$ vi /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
LISTENER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.121)(PORT=1521)))
命令:[oracle@gpdb ~]$ vi /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
命令:[oracle@gpdb ~]$ lsnrctl start
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.121)(PORT=1521)))
命令:[oracle@gpdb ~]$ sqlplus / as sysdba
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.121)(PORT=1521)))
四、Windows下的测试步骤
命令:C:\Documents and Settings\Administrator>tnsping 192.168.1.121
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Used parameter files:
Used EZCONNECT adapter to resolve the alias
C:\Documents and Settings\Administrator>
2>使用plsqldev.exe测试,修改C:\Program Files\Oracle\Instant Client\bin\tnsnames.ora文件,新增到虚拟机Oracle的连接内容
GPDB =