測試環境: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 =