1. 程式人生 > >配置和自動啟動Oracle的監聽(lsnrctl)

配置和自動啟動Oracle的監聽(lsnrctl)

配置Oracle lsnrctl 和自動啟動

1.設定主機名稱
[[email protected] ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=www.redhat6.com

2.設定主機名稱與IP地址的對應
[[email protected] ~]# cat /etc/hosts
127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
::1          localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.2.16 www.redhat6.com

3.修改:/u01/app/oracle/network/admin/listener.ora
[[email protected] admin]$ cat listener.ora 
# listener.ora Network Configuration File: /u01/app/oracle/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = www.redhat6.com)(PORT = 1521))
    )
  )


ADR_BASE_LISTENER = /u01/app

4.修改:/u01/app/oracle/network/admin/tnsnames.ora
[[email protected] admin]$ cat tnsnames.ora 
# tnsnames.ora Network Configuration File: /u01/app/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = www.redhat6.com)
    )
  )

5.lsnrctl 的常用方法
[[email protected] admin]$ lsnrctl

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-NOV-2013 21:56:57

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.
LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:

start               stop                status              
services            version             reload              
save_config         trace               spawn               
change_password     quit                exit                
set*                show* 


lsnrctl start  -- 啟動監聽
lsnrctl stop   -- 停止監聽
lsnrctl status -- 檢視狀態

6.設定Oracle資料庫和lsnrct自動啟動方法

(我的機器是RedHat6_64,Oracle11g)

6.1.編輯: /etc/oratab

[[email protected] ~]# cat /etc/oratab 
#



# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
#orcl:/u01/app/oracle:N
orcl:/u01/app/oracle:Y    #這裡把"N"改為"Y"


6.2.修改 /etc/rc.local

[[email protected] ~]# cat /etc/rc.local 
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

# 新增下面兩條
su - oracle -c 'dbstart'
su - oracle -c 'lsnrctl start'


6.3.重新啟動系統.Oracle資料庫正常啟動.監聽也啟動了.

[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 29 21:49:56 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select status from v$instance;

STATUS
------------
OPEN
[[email protected] ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-NOV-2013 22:03:23

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=www.redhat6.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                29-NOV-2013 21:25:24
Uptime                    0 days 0 hr. 37 min. 59 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/network/admin/listener.ora
Listener Log File         /u01/app/diag/tnslsnr/www/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=www.redhat6.com)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
其它問題:

關閉linux防火牆:

暫時關閉:
service iptables stop

永久性,需重啟:
chkconfig iptables off

[[email protected] ~]# chkconfig --list | grep iptables
iptables       	0:off	1:off	2:on	3:on	4:on	5:on	6:off
[[email protected] ~]# chkconfig iptables off
[[email protected] ~]# chkconfig --list | grep iptables
iptables       	0:off	1:off	2:off	3:off	4:off	5:off	6:off


關閉selinux:

1 永久方法 – 需要重啟伺服器
修改/etc/selinux/config檔案中設定SELINUX=disabled ,然後重啟伺服器。

2 臨時方法 – 設定系統引數
使用命令setenforce 0
附:
setenforce 1 設定SELinux 成為enforcing模式
setenforce 0 設定SELinux 成為permissive模式

相關推薦

配置自動啟動Oracle(lsnrctl)

配置Oracle lsnrctl 和自動啟動 1.設定主機名稱 [[email protected] ~]# cat /etc/sysconfig/network NETWORKING=ye

Oracle lsnrctl命令啟動報錯(TNS-12537,TNS-12560,TNS-00507)

LINUX登入oracle使用者,通過lsnrctl start命令啟動資料庫時,報錯如下: “ [[email protected] ~]$ lsnrctl start LSNRCTL for Linux: Version 11.2

linux下啟動oracle

命令: lsnrctl start 參考如下: SQL> startup ORA-01031: insufficient privileges SQL> startup ORA-32004: obsolete or deprecated paramet

windows 啟動關閉Oracle服務

break stat local 程序啟動 tle -- add network 寫入 經常要用數據庫,讓他自己啟動的話,開機太慢,所以用命令啟動方便點。 1.開啟: 在運行中輸入cmd,進入控制臺,lsnrctl start回車,提示啟動監聽成功後

配置oracle oracle EM

配置和啟動Oracle Enterprise Manager 關閉順序:EM、isql*plus---->監聽---->資料庫 啟動順序:監聽---->資料庫----->EM、isql*plus 啟動詳解:(注意網路的配置)  配置、啟動監聽 ① 

oracle 啟動的時候 lsnrctl start 的顯示 什麼服務read unknown 之類的解釋

Listener Status June 8, 2009 Tags: oracle listener     監聽有三種狀態:block、unkown、ready Service “+ASM” has 1 instance(s). Instance “+ASM2″, sta

Oracle程序未啟動或數據庫服務未註冊到該

數據庫服務 pri ora iat lis oracle服務 建數據庫 ip地址 his oracle新建數據庫的時候提示Could not find appropriate listener for this database要做的操作如下: 1、查看netmanage

oracle配置

mes toc col tcp pre class app 改ip 監聽 在listener.ora文件中指定監聽的實例名和修改ip地址: 查看實例名:[localhost$] echo $ORACLE_SID LISTENER = (DESCRIPTION_LIS

Oracle啟動無法連接

監聽配置現象 遠程客戶端toad連接,卡死沒有反應.oracle服務器端使用 tsping {ip地址} 提示無法連接. 按照提示查詢相應問題,提示可能配置問題,檢查listener.ora(路徑F:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\

Oracle已經啟動了 sqlplus / as sysdba 仍然報 ERROR:ORA-12560

  我的Oracle是11g的 system 的密碼忘記了, 但是scott的密碼我還記得而且能登入 。  想以sqlplus /as sysdba 修改system密碼 一直在報 ERROR:ORA-12560: TNS: 協議介面卡錯誤

Oracle配置講解

本文作者:賀聖軍,叩丁狼高階講師。原創文章,轉載請註明出處。 很多使用Oracle的朋友遇到最多的問題就是Oracle資料庫已經安裝完成, 但是在使用Oracle客戶端pl/sql等工具卻怎麼都連線不上去, 如果遇到這種問題, 請好好看下這篇文章,必有收穫. 在這裡我們簡單說明

oracle常見錯誤】oracle程式配置/“ORA-12541: TNS: 無程式”

一、問題描述 在用PL/SQL Developer連線Oracle 11g時報錯“ORA-12541: TNS: 無監聽程式”,如下圖所示。可以按照如下的步驟進行解決。 二、解決方案 1、監聽程式配置  從開始選單中開啟“Oracle Net Configu

Oracle LISTENER 主機名修改為IP地址後LISTENER無法聽到例項 oracle錯誤與hosts檔案配置

# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP

ORACLE 服務啟動後又停止了

出現“OracleOraHome81TNSListener 服務啟動後又停止了,一些服務自動停止,如果他們沒什麼可做的 出先原因:無線網絡卡獲得的ip改表了 d:\oracle\product\10.1.0\db_2\network\admin\listener.ora 監聽檔案改為如下: HOST 值改

oracle程式無法啟動,無程式

^_^ 試過可行 oracle監聽不能啟動的問題及處理過程! oracle環境如下: SQL> select * from V$version 2 ; BANNER --------------------------------------------------

Oracle配置——主機只能寫主機名,IP是錯誤的,localhost也是錯誤的

如圖(一)示,選中樹形目錄中監聽程式項,再點選左上側“+”按鈕新增監聽程式,點選監聽程式目錄,預設新加的監聽器名稱是LISTENER(該名稱也可以由任意合法字元命名)。選中該名稱,選中視窗右側欄下拉選項中的“監聽位置”,點選新增地址按鈕。在出現的網路位址列的協議下拉選項中選中“TCP/IP”,主機文字框中輸入

oracle 啟動、停止、檢視命令

Oracle配置好環境變數,則cd $ORACLE_HOME即可定位到Oracle主目錄 1.su oracle 然後啟動監聽器 1.lsnrctl start 會看到啟動成功的介面; 1.lsnrctl stop 停止監聽器命令. 1.lsnrctl statu

Linux oracle啟動失敗

報錯提示:The listener supports no services The command completed successfully 修改伺服器主機名 [[email protected]]# vi /etc/hosts 新增 127.0.0.1 主

oracle服務啟動不了 啟動後又停止問題解決

C:\Documents and Settings\All Users\「開始」選單\程式\Oracle - OraHome81\Network Administration\Net8 Assistant 重建監聽 ORACLE監聽重建 在登錄檔裡清理啟動項就OK了

oracle 服務啟動失敗

檢查監聽的host的主機名是否存在/etc/hosts 檢視如果沒有則新增, 前面對應伺服器IP 後面為主機名修改oracle的監聽host oracle/product/11.2.0/dbhome_1/network/adminvim listener.ora# list