详细讲述经过 局域网内访问ORACLE11G 数据库和MYSQL 数据库

公司要求局域网访问 数据库自己之前也没有经验看了网上很多资料也试了很多 也都不行后面经过不断尝试 终于可以了 把自己的解决问题思路及其方法分享下
与MYSQL局域网连接4.扩展知识2.MYSQL解决思路
1.解决思路 1.我们首先找到的配置文件地址
....\lenovo\product\10.2.0\db_1\NETWORK\ADMIN
.ora:配置监听
.ora:配置本地访问及其远程访问
.ora:配置访问级别(个人理解)
备份内容:(如果不小心修改错了可复制,但地址还是你们本地的 最好自己保存下)
.ora
# listener.ora Network Configuration File: D:\app\lenovo\product\11.2.0\dbhome_1\network\admin\listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(SID_NAME = CLRExtProc)(ORACLE_HOME = D:\app\lenovo\product\11.2.0\dbhome_1)(PROGRAM = extproc)(ENVS = "EXTPROC_DLLS=ONLY:D:\app\lenovo\product\11.2.0\dbhome_1\bin\oraclr11.dll")))LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))))ADR_BASE_LISTENER = D:\app\lenovo
.ora
# tnsnames.ora Network Configuration File: D:\app\lenovo\product\11.2.0\dbhome_1\network\admin\tnsnames.ora# Generated by Oracle configuration tools.LISTENER_ORCL =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))ORACLR_CONNECTION_DATA =http://www.kingceram.com/post/(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)))(CONNECT_DATA =(SID = CLRExtProc)(PRESENTATION = RO)))ORCL =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))
.ora
# sqlnet.ora Network Configuration File: D:\app\lenovo\product\11.2.0\dbhome_1\network\admin\sqlnet.ora# Generated by Oracle configuration tools.# This file is actually generated by netca. But if customers choose to # install "Software Only", this file wont exist and without the native # authentication, they will not be able to connect to the database on NT.SQLNET.AUTHENTICATION_SERVICES= (NTS)NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
2.配置相关文件
(切记操作之前先ping 或 是否通 不通是肯定访问不到)
操作之前记得先把监听关掉:
我们要把ip配置为本地的ip
win+R 输入 cmd
进入之后输入
拿到IP之后下面我们就去配置相关的文件:
# listener.ora Network Configuration File: D:\app\lenovo\product\11.2.0\dbhome_1\network\admin\listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(SID_NAME = CLRExtProc)(ORACLE_HOME = D:\app\lenovo\product\11.2.0\dbhome_1)(PROGRAM = extproc)(ENVS = "EXTPROC_DLLS=ONLY:D:\app\lenovo\product\11.2.0\dbhome_1\bin\oraclr11.dll")))LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.169)(PORT = 1521))))ADR_BASE_LISTENER = D:\app\lenovo
网上很多基本都是操作到一步就结束了我本地是不行的;再网上找了很多相关案例都不太行;
还要再此处加入ip的地址(很重要的)
# tnsnames.ora Network Configuration File: D:\app\lenovo\product\11.2.0\dbhome_1\network\admin\tnsnames.ora# Generated by Oracle configuration tools.LISTENER_ORCL =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))ORACLR_CONNECTION_DATA =http://www.kingceram.com/post/(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)))(CONNECT_DATA =(SID = CLRExtProc)(PRESENTATION = RO)))ORCL =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.169)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))