12 月 032012
 

使用dbstart启动数据库错误提示

$ ./dbstart
 ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener

增加指定环境变量

#vi /home/oracle/.bash_profile
 export ORACLE_HOME=/app/oracle/product/11.2.0/dbhome_1
 export ORACLE_HOME_LISTNER=$ORACLE_HOME
#source /home/oracle/.bash_profile

修改数据库启动脚本

#vi dbstart
#vi dbshut

将ORACLE_HOME_LISTNER=$1
修改为ORACLE_HOME_LISTNER=$ORACLE_HOME

添加开机启动项

su - oracle -c "/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"
su - oracle -c "/app/oracle/product/11.2.0/dbhome_1/bin/dbstart"
su - oracle -c "/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole"

使用dbstart启动数据库并查看监听

[oracle@oracle bin]$ ./dbstart
[oracle@oracle bin]$ netstat -lutn |grep 1521
tcp 0 0 :::1521 :::* LISTEN
[oracle@oracle bin]$ ./dbshut
[oracle@oracle bin]$ netstat -lutn |grep 1521
[oracle@oracle bin]$

启动企业管理器

[oracle@oracle bin]$ ./emctl start dbconsole
 Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
 Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
 https://oracle:1158/em/console/aboutApplication
 Starting Oracle Enterprise Manager 11g Database Control ...... started.
 ------------------------------------------------------------------
 Logs are generated in directory /app/oracle/product/11.2.0/dbhome_1/oracle_orcl/sysman/log
 [oracle@oracle bin]$

查看企业管理器监听状态

[oracle@oracle bin]$ netstat -lntu|grep 1158
tcp 0 0 :::1158 :::* LISTEN
[oracle@oracle bin]$

启动数据库监听

[oracle@oracle bin]$ ./lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 – Production on 03-DEC-2012 17:34:13

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

Starting /app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 11.2.0.1.0 – Production
System parameter file is /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 – Production
Start Date 03-DEC-2012 17:34:13
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@oracle bin]$

查看数据库监听状态

[oracle@oracle bin]$ netstat -lutn |grep 1521
tcp 0 0 :::1521 :::* LISTEN
[oracle@oracle bin]$

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)