Oracle工具的探索之旅(一)
Oracle工具的探索之旅(一~四)的前提是服务端的Net Manager已存在
使用Net Manager配置服务命名(对访问数据库的配置)及使用Net Configuration Assistant配置本地Net服务名时(对数据库的配置),要注意一一对应关系;
前提我还没有弄清:服务,服务名,本地服务名,网络服务名,SID ,数据库的服务名,全局数据库名,....
localhost,127.0.0.1,IP,计算机名...........等之间的联系...
嘿嘿.基本上是无聊之旅,见谅见谅...
监听:
服务:
C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.42.129)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) )
C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = C:\oracle\product\10.2.0\db_1) (PROGRAM = extproc) ) )
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.42.129)(PORT = 1521)) ) )
一,客户端工具
1.Oracle默认数据库orcl
Enterprise Manager Console初始状态
Net Manager初始状态
C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\...路径下没有tnsnames.ora文件,listener.ora文件内没有内容.
探索开始:
①只建立服务命名 主机名:localhost
测试不成功,
将数据库添加到树连接数据库不成功(无监听)
结论:只有服务没有监听,不成功。
②建立监听:地址:localhost
路径C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\listener.ora 下出现
LISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) )
路径:C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\...下tnsnames.ora文件
ORCLTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)
)
)
结果是:
是否是和服务与监听的建立关系有联系?改变顺序重新建立服务。
路径:C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\...下tnsnames.ora文件出现
ORCLTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
测试服务结果:
正在尝试使用以下用户 ID 连接:system 测试没有成功。
ORA-12541: TNS: 无监听程序
在输入的字段中可能有错误, 或者服务器连接未就绪。
添加进数据树后路径:C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\...下tnsnames.ora文件改变
ORCLTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)
)
)
将数据库添加到树连接数据库不成功(无监听)
结论:服务命名 主机名:localhost(重新建立服务) 监听:地址:localhost 将数据库添加到树连接数据库不成功
③建立监听地址 127.0.0.1 (服务命名 主机名:localhost)
路径C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\listener.ora 下出现
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
测试不成功,
C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora出现
ORCLTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
将数据库添加到树连接数据库不成功C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora出现
ORCLTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)
)
)
将数据库添加到树连接数据库不成功(无监听)
结论:服务命名 主机名:localhost 监听:地址:127.0.0.1 将数据库添加到树连接数据库不成功
④建立监听地址 本机IP地址 (服务命名 主机名:localhost)
路径C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\listener.ora 下出现
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.42.129)(PORT = 1521))
)
测试不成功,将数据库添加到树连接数据库不成功(无监听)
结论:服务命名 主机名:localhost 监听:地址:192.168.42.129 将数据库添加到树连接数据库不成功
⑤建立监听地址 本机计算机名 (服务命名 主机名:localhost)
路径C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\listener.ora 下出现
LISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = RTSKCVYSFEBDR8J)(PORT = 1521)) )
测试不成功,加进数据树连接数据库不成功(无监听)
结论:服务命名 主机名:localhost 监听:地址:将数据库添加到树连接数据库不成功将数据库添加到树连接数据库不成功
总结:
名称 | 测试服务结果 | 将数据库添加到树连接状态 | |
服务 (主机名:localhost) |
无监听 | 不成功 | ORA-12541:TNS:无监听程序 |
监听地址:localhost | 不成功 | ORA-12541:TNS:无监听程序 | |
监听地址: 127.0.0.1 | 不成功 | ORA-12541:TNS:无监听程序 | |
监听地址: 本机IP地址 | 不成功 | ORA-12541:TNS:无监听程序 | |
监听地址: 本机计算机名 | 不成功 | ORA-12541:TNS:无监听程序 |
![](https://files.cnblogs.com/files/wjshan0808/0.bmp)