OracleNet8网络配置和联接
1) 服务器 端配置Listener: 添加Listeners , 设置选择 DataBase Name方式,填写2个参数 { HomeDir = /ora/ , SID =ora8 } 2)启动Net8服务lsnrctl start 3)停止Net8服务lsnrctl stop 4)参数文件摘要 5)客户端配置:添加 Net Service Name ,同Wind
1)
服务器端配置Listener:
添加Listeners , 设置选择 DataBase Name方式,填写2个参数 { HomeDir = /ora/ , SID =ora8 }
2)启动Net8服务lsnrctl start
3)停止Net8服务lsnrctl stop
4)参数文件摘要
5)客户端配置:添加 Net Service Name ,同
Windows客户端一样格式
1)
服务器端配置Listener:
执行/ora/bin
.netasst
填写描述->首选
Oracle服务:
。PROTOCOL = TCP
。HOST = 172.17.2.22
。PORT = 1521
查看生成的 Net8 Server配置文件:listener.ora
[oracle@lin admin]$ more listener.ora
# LISTENER.ORA Configuration File:/ora/network/admin/listener.ora
# Generated by Oracle Net8 Assist
ant LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.2.22)(PORT = 1521))
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /ora)
(SID_NAME = ora8)
)
)
### 如果指明监听服务的"全局名",则有类似这一行:(GLOBAL_DBNAME = ora8)
2)启动Net8服务lsnrctl start
首先你可以这样取得帮助:
[oracle@lin /ora]$ lsnrctl
LSNRCTL> help
然后开始启动:start
[oracle@lin bin]$ lsnrctl start
联接时,机器会逐步告诉你正在启动…,正在联接…,已经联接的状态,最后他说成功啦! 下面是一些简要信息:
LSNRCTL for
Linux: Version 8.1.5.0.0 - Production on 19-NOV-99 22:02:54
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Starting /ora/bin/tnslsnr: please wait...
TNSLSNR for
Linux: Version 8.1.5.0.0 - Production
System parameter file is /ora/network/admin/listener.ora
Log messages written to /ora/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.2.22)(PORT=1521))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.2.22)(PORT=1521))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 8.1.5.0.0 - Production
Start Date 19-NOV-99 22:02:54
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /ora/network/admin/listener.ora
Listener Log File /ora/network/log/listener.log
Services Summary...
ora8 has 1 service handler(s)
The command completed su
clearcase/" target="_blank" >ccessfully
以上提示说,1个服务被处理,命令成功完成。
3)停止Net8服务lsnrctl stop
最简单的方法是 [oracle@lin /ora]$ lsnrctl stop
有时侯,进程出了差错,tnslsnr没有响应,像WindowsNT常犯的毛病一 样,
这里有一个强硬的手段:先找出它的进程号,然后 kill掉!
[oracle@lin /ora]$ ps -ef|grep tns
oracle 1331 1 0 15:51 ? 00:00:00 /ora/bin/tnslsnr LISTENER -inher
或使用更少的参数也能找到tnslsnr:
[oracle@lin /ora]$ ps -e
PID TTY TIME CMD
1331 ? 00:00:00 tnslsnr
现在杀死PID = 1331的进程:
[oracle@lin /ora]$ kill 1331
LSNRCTL象 SVRMGRL一样,是一个服务器管理程序,有不少参数,或者说是 子程序,带星号的是一个外部程序。
[oracle@lin bin]$ lsnrctl stop
LSNRCTL for Linux: Version 8.1.5.0.0 - Production on 19-NOV-99 22:02:50
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.2.22)(PORT=1521))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
The command completed successfully
Listeners =DataBase Name = Global DB Name =ora8, HomeDir = /ora/ ,SID =ora8
[oracle@lin oracle]$ cd /ora/net*/ad*
[oracle@lin admin]$ ls
listener.ora namesini.
sql samples sqlnet.ora
namesdrp.sql namesupg.sql sqlnet.fdf tnsnames.ora
下面是在 Windwos NT/98 上远程控制 TNSLSNR 的情形(图略)。
4)参数文件摘要
[oracle@lin admin]$ more /u01/app/oracle/admin/ora8/pfile/initora8.ora
db_name = ora8
instance_name = ora8 ## "事例名"是关键字
service_names = ora8
control_files = ("/u01/app/oracle/oradata/ora8/control01.ctl", "/u01/app/oracle/oradata/ora8/control02.ctl")
db_block_buffers = 8192
shared_pool_size = 4194304
log_checkpoint_interval = 10000
log_checkpoint_timeout = 1800
processes = 50
log_buffer = 163840
log_archive_start = true
log_archive_dest_1 = "location=/u01/app/oracle/admin/ora8/arch"
log_archive_format = %t_%s.dbf
# 切记打开回滚段
rollback_segments = (r01, r02, r03, r04)
# global_names = false ### 监听服务无需指明"全局名"
# oracle_trace_enable = true
# define directories to store trace and alert files
background_dump_dest = /u01/app/oracle/admin/ora8/bdump
core_dump_dest = /u01/app/oracle/admin/ora8/cdump
user_dump_dest = /u01/app/oracle/admin/ora8/udump
db_block_size = 2048
remote_login_passwordfile = exclusive
os_authent_prefix = ""
compatible = "8.1.5" ## 也可以兼容 "8.0.5"
5)客户端
网络配置
[oracle@lin admin]$ more tnsnames.ora
# TNSNAMES.ORA Configuration File:/ora/network/admin/tnsnames.ora
# Generated by Oracle Net8 Assistant
使用net8助理,结果自动保存在 tnsnames.ora 中,
[oracle@lin /ora]$ netass* 添加Service: 名称ora8,参数如下:
PROTOCOL=TCP HOST=172.17.2.22 PORT=1521 Oracle_SID=ora8
机器解释成一个Oracle服务器地址包:
( DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.17.2.22)(PORT=1521))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS))
)
一般说来,客户端采用Windows9x/NT/2000,因为这里软件
开发容易,
程序员和工具较为普及。
Windows 客户端网络配置与此类似,其内容见于: \OraNT\net80\Admin\tnsname.ora
ORA8.WORLD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.2.22)(PORT = 1521))
(CONNECT_DATA = (SID = ora8))
)
-------------------------------------------
在Windows2000(beta3专业版)中安装Personal Oeacle8.05时,监听服务安装失败,
只要理解以上oracle结构原理,可以手工复制Net8文件,修改配置:
copy CD-ROM\.\NT_x86\server\lsnrctl80.exe,tnslsnr80.exe,tnsping80.exe C:\orant\bin
copy CD-ROM\.\listener.ora C:\orant\net80\admin
我不久前有这么一次经历。
原文转自:http://www.ltesting.net
|