sysdba使用者可以登入,普通使用者登入報錯如下:
[oracle@dbserver ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Mon Oct 17 21:07:09 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> conn zs/123456
ERROR:
ORA-01033: ORACLE initialization orshutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0
Warning: You are no longer connected to ORACLE.
解決辦法:
SQL> conn / as sysdba
Connected.
#正常
SQL> shutdown normal
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.3429E+10 bytes
Fixed Size 2217992 bytes
Variable Size 7113541624 bytes
Database Buffers 6241124352 bytes
Redo Buffers 71770112 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option fordatabase open
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1:'/home/app/oracle/oradata/orcl/system01.dbf'
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 198456936 generated at 10/17/201601:15:48 needed for thread
1
ORA-00289: suggestion : /arlog/1_692_925425318.dbf
ORA-00280: change 198456936 for thread 1 is insequence #692
Specify log: {<RET>=suggested | filename | AUTO |CANCEL}
cancel
ORA-10879: error signaled in parallel recovery slave
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGSwould get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/home/app/oracle/oradata/orcl/system01.dbf'
#查詢redo log
SQL> select v1.group#,member, sequence#, first_change#
2 from v$log v1, v$logfilev2
3 where v1.group# =v2.group#;
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
SEQUENCE# FIRST_CHANGE#
---------- -------------
1
/home/app/oracle/oradata/orcl/redo01.log
691 198456085
3
/home/app/oracle/oradata/orcl/redo03.log
690 198455630
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
SEQUENCE# FIRST_CHANGE#
---------- -------------
2
/home/app/oracle/oradata/orcl/redo02.log
692 198456936
根據之前的錯誤提示:ORA-00280:change 198456936 for thread 1 is in sequence #692
通過first_change 和 sequence 找到對應日誌名/home/app/oracle/oradata/orcl/redo02.log
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 198456936 generated at 10/17/201601:15:48 needed for thread
1
ORA-00289: suggestion : /arlog/1_692_925425318.dbf
ORA-00280: change 198456936 for thread 1 is in sequence#692
Specify log: {<RET>=suggested | filename | AUTO |CANCEL}
/home/app/oracle/oradata/orcl/redo02.log
Log applied.
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.
SQL> conn zs/123456
Connected.
SQL>