两种方法:一、使用第三方,下载instantclient_11_2二、配置如下,1进入开始菜单-数据库-找到net manager-本地-服务命名-左上角添加-网络服务名(随意)-下一步-下一步-主机名:llocalhost-下一步服务名:要连接的数据库名(orcl),2找到数据库的安装路径:D:\Oracle11g\product\1120\db_1\NETWORK\ADMIN\tnsnamesora修改
网络服务名(随意) =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = [输入另一个数据库所在的IP])(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL) /要连接的数据库名(我是orcl)/
)
)
1,非集群下 Windows环境下数据库
conn scott/123@127001:1521/orcl
conn scott/123456@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =
(PROTOCOL = TCP)(HOST = 127001)(PORT = 1521)))(CONNECT_DATA =
(SERVER = DEDICATED)(SERVICE_NAME = orcl)))
Linux环境下数据库
conn scott/123@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST
= 127001)(PORT = 1521)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME =
orcl)))
2,集群下连接
conn scott/123@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE = yes)(FAILOVER = on)
(ADDRESS=(PROTOCOL=TCP)(HOST=127001)(PORT=1521))(ADDRESS=
(PROTOCOL=TCP)(HOST=127002)(PORT=1521)))(CONNECT_DATA=(SERVER=default)
(SERVICE_NAME=orcl)))
扩展资料
在命令行中登录oracle数据库:
sqlplus username/password 如:普通用户登录 sqlplus scott/tiger
sqlplus username/password as sysdba 如:sqlplus sys/admin as sysdba
sqlplus username/password@net_service_name 如: sqlplus scott/tiger@orcl
sqlplus username/password@//host:port/sid
参考资料:
很简单,你在A电脑安装一个ORACLE 客户端,然后,在你所安装的ORACLE主目录文件找到tnsnamesora文件打开,然后,(testdb是你要连接的B服务器实例名)加入一条记录如:
TESTDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1921680xx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = testdb)
)
)
或者,你在A机器上Oracle Net Manager 手动添加一条记录,按步骤来。Linux详细知识需求可参考下《Linux就该这么学》。
以上就是关于怎么远程连接oracle数据库全部的内容,包括:怎么远程连接oracle数据库、如何用cmd命令连接oracle数据库、如何在linux下连接远程oracle数据库等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)