oracle@host-a[orcl]:~$ netstat -natp|grep 8000
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 3767/ssh
tcp 0 0 ::1:8000 :::* LISTEN 3767/ssh
oracle@host-a[orcl]:~$ tnsping orcl
TNS Ping Utility for Linux: Version 11.1.0.7.0 - Production on 05-JUL-2010 09:13:25
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ENABLE=BROKEN) (ADDRESS_LIST= (FAILOVER=ON) (LOAD_BALANCE=YES) (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=8000))) (CONNECT_DATA= (SID=orcl)))
OK (340 msec)
oracle@host-c:~$ netstat -natp |grep 8888
(No info could be read for "-p": geteuid()=1001 but you should be root.)
tcp 0 0 127.0.0.1:8888 0.0.0.0:* LISTEN -
tcp6 0 0 ::1:8888 :::* LISTEN -
然后就是测试下这个端口的可用性,执行如下的命令:
代码如下:
oracle@host-c:~$ ssh -p 8888 oracle@localhost
Password:
Last login: Mon Jul 5 02:34:50 2010 from 172.24.43.103
oracle@host-b.office$ hostname
host-b.office.mycompany.com
oracle@host-b.office$