LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3073|回复: 7

弱弱的问题:如何启动、关闭Oracle数据库?

[复制链接]
发表于 2004-6-28 22:37:00 | 显示全部楼层 |阅读模式
数据库终于工作正常了,但是服务器重启动后,数据库没能自动启动。

检查 /etc/oratab ,把相应实例改为Y,还是不能启动,直接在命令行下
运行 dbstart,提示如下:

[oracle@cs oracle]$ dbstart csdb

Can't find init file for Database "csdb".
Database "csdb" NOT started.

如何是好? 总不能启动X后再建一次吧。。。
发表于 2004-6-29 10:20:12 | 显示全部楼层

这是由于dbstart没有找到配置文件

********以下是metalink上的解决办法*********
-make a backup copy of your existing dbstart script prior to proceeding

- edit the dbstart script

- add the following line:

SPFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora

after this line: PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora

- change:

if [ -f $PFILE ] ; then

to:

if [ -f $PFILE -o -f $SPFILE ] ; then

**************** end************
希望对你有帮助
 楼主| 发表于 2004-6-29 11:12:47 | 显示全部楼层
OK! 谢谢。
不过修改之后运行dbstart还是没有任何反应,仔细看dbstart的写
法,直接运行:
[oracle@cs 9.2.0]$ sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Jun 29 11:08:41 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> startup
ORA-01031: insufficient privileges
SQL> connect internel
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory


SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  420549952 bytes
Fixed Size                   451904 bytes
Variable Size             184549376 bytes
Database Buffers          234881024 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.

数据库正确启动了。。。
发表于 2004-6-30 16:48:08 | 显示全部楼层
oracle: ~ $ sqlplus /nolog

SQL*Plus: Release 10.1.0.2.0 - Production on Wed Jun 30 16:48:54 2004

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

SQL> startup
ORA-01031: insufficient privileges
SQL> connect internel
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory


SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/family/oracle/product/10.1.0/db_1/dbs/inittest.ora'
SQL>


我的是怎么回事 ?
发表于 2004-7-1 14:09:32 | 显示全部楼层

参数文件没找到

找到initora****那个文件,应该在${ORACLE_HOME}/dbs/目录下,cp 成
inittest.ora应该就可以了
发表于 2004-7-1 15:23:08 | 显示全部楼层
oracle: ~ $ sqlplus /nolog

SQL*Plus: Release 10.1.0.2.0 - Production on Thu Jul 1 15:21:55 2004

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

SQL> startup
ORA-01031: insufficient privileges
SQL> connect internel
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory


SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORA-00371: not enough shared pool memory, should be atleast 52132659 bytes


现在变成这样,可top出来还有内存呀

15:24:49  up  1:53,  2 users,  load average: 0.09, 0.14, 0.15
78 processes: 76 sleeping, 1 running, 1 zombie, 0 stopped
CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
           total    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%  100.0%
Mem:   513476k av,  397472k used,  116004k free,       0k shrd,   24944k buff
       265424k active,              88484k inactive
Swap:  907632k av,       0k used,  907632k free                  205024k cached
                                                                                
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
    1 root      15   0   516  516   460 S     0.0  0.1   0:04   0 init
    2 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 keventd
    3 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kapmd
    4 root      35  19     0    0     0 SWN   0.0  0.0   0:00   0 ksoftirqd/0
    7 root      25   0     0    0     0 SW    0.0  0.0   0:00   0 bdflush
    5 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kswapd
    6 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kscand
    8 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kupdated
    9 root      25   0     0    0     0 SW    0.0  0.0   0:00   0 mdrecoveryd
   13 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kjournald
   75 root      25   0     0    0     0 SW    0.0  0.0   0:00   0 khubd
1869 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kjournald
1900 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kjournald
1954 root      24   0     0    0     0 SW    0.0  0.0   0:00   0 kjournald
2001 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kjournald
 楼主| 发表于 2004-7-1 17:06:04 | 显示全部楼层
Shared Pool Memory是Oracle的共享池,最小要50M,
这个东西是在建库时设置的。
建议用系统内存的50-70%分配给SGA,Oracle会自动分配共享池大小。

另外,我开头的那几条命令: startup、connect internel是错误的,实际只要后面的两条。。。
发表于 2004-7-1 20:50:33 | 显示全部楼层

看一下你shmmax值是不是太小了

设到物理内存的一半,再试试
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表