我尝试启动侦听器并执行 dbstart,但它看起来仍然在说“Oracle 不可用”。也许 dbstart 没有工作。任何建议都会对我有所帮助。
[user@fedora16 bin]$ echo $ORACLE_HOME
/home/user/app/user/product/11.2.0/dbhome_1
[user@fedora16 bin]$ echo $ORACLE_SID
orcl
[user@fedora16 bin]$ cat $ORACLE_HOME/network/admin/listener.ora
# listener.ora Network Configuration File: /home/user/app/user/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
orcl =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /home/user/app/user/product/11.2.0
[user@fedora16 bin]$ cat $ORACLE_HOME/network/admin/sqlnet.ora
# sqlnet.ora Network Configuration File: /home/user/app/user/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /home/user/app/user/product/11.2.0
[user@fedora16 bin]$ dbstart $ORACLE_HOME
[user@fedora16 ~]$ lsnrctl start orcl
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-MAR-2012 09:04:19
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /home/user/app/user/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /home/user/app/user/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /home/user/app/user/product/11.2.0/diag/tnslsnr/fedora16/orcl/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias orcl
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 04-MAR-2012 09:04:19
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/user/app/user/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/user/app/user/product/11.2.0/diag/tnslsnr/fedora16/orcl/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
The listener supports no services
The command completed successfully
[user@fedora16 bin]$ ps -ef | grep '\(ora\|smon\|lsnr\)'
user 2405 1 0 08:46 ? 00:00:00 /home/user/app/user/product/11.2.0/dbhome_1/bin/tnslsnr orcl -inherit
user 2553 1611 0 08:49 pts/0 00:00:00 grep --color=auto \(ora\|smon\|lsnr\)
[user@fedora16 bin]$ sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Sun Mar 4 08:46:29 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter user-name: scott
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
dbstart
只会启动oratab
文件中第三个参数设置为Y
. 检查该文件中的值。您也不需要将 theORACLE_HOME
作为参数传递;不确定你是否真的打算通过 SID,但无论如何,家也是从那里拿走的oratab
。脚本本身说它只应作为系统引导过程的一部分执行,例如从
/etc/rc*.d
目录引导期间运行的脚本执行。传入的$ORACLE_HOME
参数仅用于启动监听器;每个数据库的主目录取自oratab
.根据文档,
dbstart
不推荐使用 11g 第 2 版中的 Oracle Restart(在非 RAC 环境中);我想这意味着你应该crsctl start has
从那时开始使用监听器和数据库。那也使用第三个oratab
值来决定是否启动数据库。最近我遇到了以下问题:
它不允许我连接 sql,我检查了活动用户会话
V$sessionn
,其中一个用户占用了更多会话。为了修复它,我杀死了活动用户会话