全部博文(212)
分类: Oracle
2010-12-17 10:18:22
SQL> conn sys/change_on_install as sysdba; Connected. SQL> CREATE TABLE person( * ERROR at line 1: ORA-01109: database not open SQL> select * from emp; select * from scott.emp * ERROR at line 1: ORA-01034: ORACLE not available |
SQL> conn /as sysdba Connected to an idle instance. 如果你是在服务器开启后发现问题的,那通过登陆sysdba账户,就能立刻发现问题."Connected to an idle instance."说明数据库根本没mounted |
启动数据库,出现ORA-01102错误 SQL> startup; ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers ORA-01102: cannot mount database in EXCLUSIVE mode |
SQL> select
open_mode from v$database; select open_mode from v$database ERROR at line 1: ORA-01507: database not mounted |
1. 关闭这个未完全启动的数据库 SQL> shutdown immediate; ORA-01507: database not mounted ORACLE instance shut down. |
2.查找dbs目录,找到lkORCL文件 这个目录随不同的安装过程,可能出现在不同的地方,有的时候在oracle账户的home目录下,有时出现在$ORACLE_HOME下 [oracle@oracle ~]$ cd $ORACLE_HOME [oracle@oracle db_1]$ cd dbs [oracle@oracle dbs]$ ls hc_orcl.dat |
3.检查1kORCL,是否在数据库关闭的情况下,仍存在不正常进程关联 [oracle@oracle dbs]$ fuser -u 1kORCL -bash: fuser: command not found [oracle@oracle dbs]$ /sbin/fuser -u 1kORCL 1kORCL: 没有那个文件或目录 注意是小写的西文字母l,不是数字1,别弄错了 此时在数据库shutdown的情况下,仍然有不少进程关联着进程,显然是"死锁" [oracle@oracle dbs]$ /sbin/fuser -u lkORCL lkORCL: |
4.杀掉关联到lkORCL文件的进程 [oracle@oracle dbs]$ /sbin/fuser -k lkORCL lkORCL: [oracle@oracle dbs]$ /sbin/fuser -u lkORCL |
5.重启oracle,数据库正常启动 [oracle@oracle dbs]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 9月 15 05:50:35 2010 Copyright (c) 1982, 2005, Oracle. Connected to an idle instance. SQL> startup; ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. Database opened. SQL> select open_mode from v$database; OPEN_MODE ---------- READ WRITE SQL> |