熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

Oracle Net8 網絡配置和聯接

2013-11-13 22:20:38  來源: Oracle 

  
  1)服務器端配置Listener
  添加Listeners 設置選擇 DataBase Name方式填寫個參數 { HomeDir = /ora/ SID =ora }
  2)啟動Net服務lsnrctl start
  3)停止Net服務lsnrctl stop
  4)參數文件摘要
  5)客戶端配置添加 Net Service Name 同Windows客戶端一樣格式
  1)服務器端配置Listener
  執行/ora/bin/netasst
  填寫描述>首選Oracle服務
  PROTOCOL = TCP
  HOST =
  PORT =
  查看生成的 Net Server配置文件listenerora
  [oracle@lin admin]$ more listenerora
  # LISTENERORA Configuration File:/ora/network/admin/listenerora
  # Generated by Oracle Net Assistant
  LISTENER =
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = ))
   (PROTOCOL_STACK =
   (PRESENTATION = TTC)
   (SESSION = NS)
   )
   )
  SID_LIST_LISTENER =
   (SID_LIST =
   (SID_DESC =
   (ORACLE_HOME = /ora)
   (SID_NAME = ora)
   )
  )
  ### 如果指明監聽服務的全局名則有類似這一行(GLOBAL_DBNAME = ora)
  2)啟動Net服務lsnrctl start
  首先你可以這樣取得幫助
  [oracle@lin /ora]$ lsnrctl
  LSNRCTL> help
  然後開始啟動start
  [oracle@lin bin]$ lsnrctl start
  聯接時機器會逐步告訴你正在啟動…正在聯接…已經聯接的狀態最後他說成功啦! 下面是一些簡要信息
  LSNRCTL for Linux: Version Production on NOV ::
  (c) Copyright Oracle Corporation All rights reserved
  Starting /ora/bin/tnslsnr: please wait
  TNSLSNR for Linux: Version Production
  System parameter file is /ora/network/admin/listenerora
  Log messages written to /ora/network/log/listenerlog
  Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=))
  (PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
  
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=))
  (PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
  STATUS of the LISTENER
  
  Alias LISTENER
  Version TNSLSNR for Linux: Version Production
  Start Date NOV ::
  Uptime days hr min sec
  Trace Level off
  Security OFF
  SNMP OFF
  Listener Parameter File /ora/network/admin/listenerora
  Listener Log File /ora/network/log/listenerlog
  Services Summary
  ora has service handler(s)
  The command completed successfully
  以上提示說個服務被處理命令成功完成
  3)停止Net服務lsnrctl stop
  最簡單的方法是 [oracle@lin /ora]$ lsnrctl stop
  有時侯進程出了差錯tnslsnr沒有響應像WindowsNT常犯的毛病一 樣
  這裡有一個強硬的手段先找出它的進程號然後 kill掉!
  [oracle@lin /ora]$ ps ef|grep tns
  oracle : ? :: /ora/bin/tnslsnr LISTENER inher
  或使用更少的參數也能找到tnslsnr:
  [oracle@lin /ora]$ ps e
  PID TTY TIME CMD
   ? :: tnslsnr
  現在殺死PID = 的進程
  [oracle@lin /ora]$ kill
  LSNRCTL象 SVRMGRL一樣是一個服務器管理程序有不少參數或者說是 子程序帶星號的是一個外部程序
  [oracle@lin bin]$ lsnrctl stop
  LSNRCTL for Linux: Version Production on NOV ::
  (c) Copyright Oracle Corporation All rights reserved
  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=))
  (PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
  The command completed successfully
  Listeners =DataBase Name = Global DB Name =ora HomeDir = /ora/ SID =ora
  [oracle@lin oracle]$ cd /ora/net*/ad*
  [oracle@lin admin]$ ls
  listenerora namesinisql samples sqlnetora
  namesdrpsql namesupgsql sqlnetfdf tnsnamesora
  下面是在 Windwos NT/ 上遠程控制 TNSLSNR 的情形(圖略)
  4)參數文件摘要
  [oracle@lin admin]$ more /u/app/oracle/admin/ora/pfile/initoraora
  db_name = ora
  instance_name = ora ## 事例名是關鍵字
  service_names = ora
  control_files = (/u/app/oracle/oradata/ora/controlctl /u/app/oracle/oradata/ora/controlctl)
  db_block_buffers =
  shared_pool_size =
  log_checkpoint_interval =
  log_checkpoint_timeout =
  processes =
  log_buffer =
  log_archive_start = true
  log_archive_dest_ = location=/u/app/oracle/admin/ora/arch
  log_archive_format = %t_%sdbf
  # 切記打開回滾段
  rollback_segments = (r r r r)
  # global_names = false ### 監聽服務無需指明全局名
  # oracle_trace_enable = true
  # define directories to store trace and alert files
  background_dump_dest = /u/app/oracle/admin/ora/bdump
  core_dump_dest = /u/app/oracle/admin/ora/cdump
  user_dump_dest = /u/app/oracle/admin/ora/udump
  db_block_size =
  remote_login_passwordfile = exclusive
  os_authent_prefix =
  compatible = ## 也可以兼容
  )客戶端網絡配置
  [oracle@lin admin]$ more tnsnamesora
  # TNSNAMESORA Configuration File:/ora/network/admin/tnsnamesora
  # Generated by Oracle Net Assistant
  使用net助理結果自動保存在 tnsnamesora 中
  [oracle@lin /ora]$ netass* 添加Service: 名稱ora參數如下
  PROTOCOL=TCP HOST= PORT= Oracle_SID=ora
  機器解釋成一個Oracle服務器地址包
  ( DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=))
   (PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS))
  )
  一般說來客戶端采用Windowsx/NT/因為這裡軟件開發容易程序員和工具較為普及
  Windows 客戶端網絡配置與此類似其內容見於: \OraNT\net\Admin\tnsnameora
  ORAWORLD =
   (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = ))
   (CONNECT_DATA = (SID = ora))
   )
  
   在Windows(beta專業版)中安裝Personal Oeacle監聽服務安裝失敗
  只要理解以上oracle結構原理可以手工復制Net文件修改配置
  copy CDROM\\NT_x\server\lsnrctlexetnslsnrexetnspingexe C:\orant\bin
  copy CDROM\\listenerora C:\orant\net\admin
  我不久前有這麼一次經歷
From:http://tw.wingwit.com/Article/program/Oracle/201311/18835.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.