oracle 使用SSH 转发功能

主要转发过程 通过客户端的 1555 端口 转发到服务器的 1521端口上具体步骤

1、在客户端上执行

[oracle@normal admin]$ ssh -CNfg -L 1555:192.168.137.11:1521 oracle@192.168.137.11 
oracle@192.168.137.11''s password: 
2、使用netstat查看信息(这里我客户端和服务器是在同一台机器上)

[oracle@normal admin]$ netstat -an | grep 155
tcp        0      0 0.0.0.0:1555                0.0.0.0:*                   LISTEN      
tcp        0      0 :::1555                     :::*                        LISTEN    
3、在客户端上配置tnsname.ora

normal1 = ( 
    DESCRIPTION = (  
        ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.11)(PORT = 1555)  
    )  
    (CONNECT_DATA =  
        (SERVER = DEDICATED)  
        (SERVICE_NAME = normal)  
    )  
)  
4、测试转发功能
[oracle@normal admin]$ sqlplus chenhao/oracle@normal1

SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 26 17:30:10 2014

Copyright (c) 1982, 2011, 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

SQL>
5、停用SSH转发功能
[oracle@normal admin]$ ps -ef | grep ssh
oracle    2861     1  0 17:28 ?        00:00:00 ssh -CNfg -L 1555:192.168.137.11:1521 oracle@192.168.137.1
[oracle@normal admin]$ kill -9 2861
6、测试停用
[oracle@normal admin]$ sqlplus chenhao/oracle@normal1

SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 26 17:40:01 2014

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

ERROR:
ORA-12541: TNS:no listener


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值