Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1471667
  • 博文数量: 246
  • 博客积分: 3353
  • 博客等级: 中校
  • 技术积分: 3295
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-09 17:56
个人简介

精通测试技术,linux,shell,性能测试

文章分类

全部博文(246)

文章存档

2024年(3)

2023年(7)

2022年(7)

2021年(4)

2020年(1)

2019年(2)

2017年(2)

2016年(3)

2015年(11)

2014年(20)

2013年(10)

2012年(176)

分类:

2012-06-15 20:07:47

原文地址:Client connect to Oracle Server 作者:miloluo

1. Environment:
Server: RHEL 5
Client: Windows XP
Database version: 10.2.0.1.0

2. Using netca create a listener:
configuration file:

  1. [milo@milo admin]$ pwd
  2. /u01/app/oracle/product/10201/db_1/network/admin
  3. [milo@milo admin]$ cat listener.ora
  4. # listener.ora Network Configuration File: /u01/app/oracle/product/10201/db_1/network/admin/listener.ora
  5. # Generated by Oracle configuration tools.

  6. SID_LIST_LISTENER =
  7. (SID_LIST =
  8. (SID_DESC =
  9. (SID_NAME = PLSE xtProc) #E和x之间空格应该没有, 由于blog有屏蔽, 所以拆分。
  10. (ORACLE_HOME = /u01/app/oracle/product/10201/db_1)
  11. (PROGRAM = extproc)
  12. )
  13. )

  14. LISTENER =
  15. (DESCRIPTION_LIST =
  16. (DESCRIPTION =
  17. (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
  18. (ADDRESS = (PROTOCOL = TCP)(HOST = milo.com)(PORT = 1521))
  19. )
  20. )


3. Start listener on server:
lsnrctl start

4. Install client software: 10201_client_win32.zip
Better install network utils (including tnsping tool)

5. Client side tnsnames.ora configuration:
  1. MILO =
  2. (DESCRIPTION =
  3. (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.128.129)(PORT = 1521))
  4. (CONNECT_DATA =
  5. (SERVER = DEDICATED)
  6. (SERVICE_NAME = orcl)
  7. )
  8. )

  9. EXTPROC_CONNECTION_DATA =
  10. (DESCRIPTION =
  11. (ADDRESS_LIST =
  12. (ADDRESS = (PROTOCOL =IPC)(KEY = EXTPROC1))
  13. )
  14. (CONNECT_DATA =
  15. (SID = PLSE xtProc) #E和x之间空格应该没有, 由于blog有屏蔽, 所以拆分。
  16. (PRESENTATION = RO)
  17. )
  18. )


6. Test setting in client side:
Before doing tnsping to check the name service resolve, you should make sure the network between server and client works good.
  1. C:\Documents and Settings\IBM>tnsping MILO

  2. TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 23-2月 -
  3. 2011 23:34:17

  4. Copyright (c) 1997, 2005, Oracle. All rights reserved.

  5. 已使用的参数文件:
  6. D:\oracle\product\10.2.0\client_4\network\admin\sqlnet.ora

  7. 已使用 TNSNAMES 适配器来解析别名
  8. Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.
  9. 128.129)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl
  10. )))
  11. OK (80 毫秒)


7. Connect the server side:
  1. D:\>sqlplus /nolog

  2. SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 2月 23 23:52:30 2011

  3. Copyright (c) 1982, 2005, Oracle. All rights reserved.

  4. SQL> conn system@MILO
  5. 输入口令:
  6. 已连接。
  7. SQL> select instance_name, status from v$instance;

  8. INSTANCE_NAME STATUS
  9. -------------------------------- ------------------------
  10. orcl OPEN

NOTE:
I have placed the configuration files in wrong place, so I can't get my result, until I place them to the correct path.


The files should place to D:\oracle\product\10.2.0\client_4\network\admin\ ,
                                 NOT D:\oracle\NETWORK\admin.

ALWAYS BE AWARD OF THAT!


阅读(923) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~