❶ linux怎么远程连接ORACLE数据库
很简单,你在A电脑安装一个ORACLE 客户端,然后,在你所安装的ORACLE主目录文件找到tnsnames.ora文件打开,然后,(testdb是你要连接的B服务器实例名)加入一条记录如:
TESTDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.xx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = testdb)
)
)
或者,你在A机器上Oracle Net Manager 手动添加一条记录,按步骤来。
❷ 如何连接到linux上的oracle数据库
装好oracle数据库,我们准备用PLSQL Developer 这个软件来连接服务器的数据库!
下面简单介绍设置此软件并连接oracle数据库的方法:
一、下载并安装好PLSQL Developer(绿色版的也可以);
二、下载并解压
Oracle免安装版的客户端:
http://download.oracle.com/otn/nt/instantclient/112030/instantclient-basic-nt-11.2.0.3.0.zip
三、建立tns配置文件。
1、在解压的:“nstantclient-basic-nt-11.2.0.3.0”文件夹的下面建文件夹,路径像这样“nstantclient-basic-nt-11.2.0.3.0
eidownadmin“,其实这个倒是无所谓的,只是看起来与服务端上的更接近而已,与文章后面的环境变量要对应。
2、拷贝服务端目录“$ORACLE_HOME$
etworkadmin nsnames.ora”到客户端的“nstantclient-basic-nt-11.2.0.3.0
eidownadmin“目录,这个文件的内容如下:(也可自行建立)
# tnsnames.ora Network Configuration File: /home/oradb/oracle/proct/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.localdomain)
)
)
ORACLE_BASE=/home/oradb/oracle
ORACLE_HOME=$ORACLE_BASE/proct/11.2.0/db_1
ORACLE_SID=orcl
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
LANG=C
# tnsnames.ora Network Configuration File: /home/oradb/oracle/proct/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.localdomain)
)
)
在菜单“工具-首选项”中的“连接”中,
找到“Oracle主目录名”,输入
找到“OCI库”,输入
❸ 鍦╓indows 涓嫔备綍璁块梾Linux 涓镄凮racle 鏁版嵁搴 濡备綍閰岖疆tns
棣栧厛蹇呴’瀹夎匴indows鐗堟湰镄凮ralce瀹㈡埛绔绋嫔簭(链嶅姟绔涔熷彲浠ワ纴瀹冨寘钖瀹㈡埛绔鍐呭癸纴浣嗗畨瑁呭悗鏂囦欢浼氭洿澶)銆
瀹夎呭埌链钖庯纴闇瑕佽惧畾涓绘満IP銆佹湇锷″悕绉扮瓑锛岃繖浜涘彲浠ラ殢镒忓~鍐欙纴锲犱负钖庨溃鍙镓嫔伐閰岖疆銆
瀹夎呭畬Oracle绋嫔簭钖庯纴杩涘叆瀹夎呯洰褰曪纴鍦–lientNetorkAdmin鐩褰曚笅浼氭湁涓涓猼nsnames.ora鏂囦欢锛岀敤璁颁簨链镓揿紑瀹冦
缂栬緫鎴栨柊澧炲唴瀹癸纴test鏄鍏朵粬绋嫔簭璋幂敤鏁版嵁搴撶殑钖岖О锛孒ost鏄疧racle鏁版嵁搴揿湴鍧锛孭ort涓鑸榛樿1521锛宻ervice_name鏄疧racle镄勬暟鎹搴撴湇锷″悕绉帮纴杩欎簺鍐呭逛竴瀹氲佹g‘銆傛ゆ椂鍙瀹夎呬竴涓狿L/SQL绋嫔簭锛屽畨瑁呭悗镓揿紑PL/SQL锛娈atabase阃夋嫨test锛岃緭鍏ヨ处鍙峰瘑镰侊纴鍗冲彲锏婚檰锛屽规暟鎹杩涜屾搷浣溿
test =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = mytest)
)
)
❹ LINUX怎么远程连接ORACLE数据库
1、安装client或者instantclient
2、配置$ORACLE_HOME/network/admin/tnsnames.ora
例如:
DB02 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.1.2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = remotedb)
)
)
3、像remoteDB一样配置oracle环境变量
4、用sqlplus或者软件访问
例如:
sqlplus user/passwd@orcl
❺ linux操作系统下oracle数据库如何配置监听
1. 修改监听器配置文件
Linux下Oracle监听器配置文件在:$ ORACLE_HOME/network/admin/listerer.ora, 如:
/bank/oracle/oracle10g/proct/10.2.0/network/admin/listener.ora
修改并配置要监听SID的相关信息,如:
#listener.ora Network Configuration File: /bank/oracle/oracle10g/proct/10.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /bank/oracle/oracle10g/proct/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL DBNAME = bkserver)
(SID_NAME = bkserver)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.7.13.242)(PORT = 1521))
)
)
2. 启动监听器
(1). 切换至oracle安装用户(一般为oracle)
su - oracle
(2). 启动监听器
lsnrctl start
另:停止监听器
lsnrctl stop
3. 测试监听器是否运行正常
在客户端修改tnsnames.ora配置文件就访问Oracle数据库,如:
BKSERVER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.7.13.242)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = BKSERVER)
)
)
通过命令tnsping测试是否能访问到监听器,如:
M:\>tnsping bkserver
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Proction on 12-8月 -
2010 17:11:04
Copyright (c) 1997, 2005, Oracle. All rights reserved.
已使用的参数文件:
D:\oracle\proct\10.2.0\client_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 10.7.13.242)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVIC
E_NAME = BKSERVER)))
OK (20 毫秒)
注意: 监听器是否能被tnsping通跟数据库的开启/关闭无关,所以就算可以tnsping通监听器但未必能连接到数据库,这时请检查listener.ora文件配置信息是否正确,还有数据库是否已经被开启。