问题一:数据库无法启动。
此处解决方案借鉴大神,链接为https://blog.youkuaiyun.com/kiral07/article/details/94028235。
查看/admin/orcl/bdump下alert日志。发现每次启动数据库时,均提示Beginning crash recovery of 1 threads,说明数据库有损坏,自行修复。
但是自行修复总是不成功,因此,可通过以下命令进行修复:
recover database using backup controlfile until cancel;
具体步骤如下:
sqlplus “/ as sysdba”
SQL*Plus: Release 10.1.0.2.0 - Production on 星期二 1月 8 19:09:20 2008Copyright © 1982, 2004, Oracle. All rights reserved.连接到:Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - ProductionWith the Partitioning, OLAP and Data Mining options
SQL> alter database backup controlfile to trace;
数据库已更改。
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup nomount
ORACLE 例程已经启动。
Total System Global Area 171966464 bytesFixed Size 787988 bytesVariable Size 145750508 bytesDatabase Buffers 25165824 bytesRedo Buffers 262144 bytes
SQL> alter database open resetlogs;
alter database open resetlogs*ERROR at line 1:ORA-01194: file 1 needs more recovery to be consistentORA-01110: data file 1: ‘xxxxx.DBF’
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 476049 generated at 01/08/2008 19:13:19 needed for thread 1ORA-00289: suggestion : F:ORACLEFLASH_RECOVERY_AREASUNARCHIVELOG2008_01_08O1_MF_1_18_%U_.ARCORA-00280。
/****
根据提示,输入日志文件路径。一般位于数据库安装位置的/ORADATA/ORCL/下。
*****/
/*****
此处注意,当提示needs more recovery to be conaistent时,请重复恢复命令,键入其他的log,直至提示如下信息:Log applied.Media recovery complete.
******/
SQL> alter database open;alter database open*ERROR at line 1:ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
/*****
此时数据库恢复成功。
*****/
SQL> alter database open resetlogs;
Database altered.
SQL>
问题二:ORA-00600: 内部错误代码, 参数: [4194], [19], [8]
解决方案借鉴了大神,链接去下:http://www.blogjava.net/KingKong/archive/2011/05/05/349593.html
ORA-00600: 内部错误代码, 参数: [4194], [15], [8]
1.错误描述:在做一次恢复后,数据库能正常打开,数据表也能正常查询,但过不了多久数据库会自动down掉
2.查看alert日志,发现如下信息
ORA-00600: 内部错误代码, 参数: [4194], [15], [8], [], [], [], [], []
PMON: terminating instance due to error 472
ORA-00472: PMON 进程因错误而终止
3.经查询metalink,有如下提示
Short Description of ORA-00600[4194]
A mismatch has been detected between Redo records and rollback (Undo)
records.
ARGUMENTS:
Arg [a] Maximum Undo record number in Undo block
Arg [b] Undo record number from Redo block
Refer to Note:39283.1 for more details on the description of this error.
4.根据metalink的提示方案来解决问题(ID 281429.1)(我的数据库版本是10.2.1,window32的)
代码如下:
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 5月 5 14:28:31 2011
Copyright © 1982, 2005, Oracle. All rights reserved.
已连接到空闲例程。
/** 第一步:启动到nomount状态,创建pfile,
将pfile里面的自动undo管理改为手工管理,并打开数据库*/
SQL> startup nomount
ORACLE 例程已经启动。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 222301060 bytes
Database Buffers 381681664 bytes
Redo Buffers 7135232 bytes
SQL> create pfile=‘c:\p1.ora’ from spfile;
文件已创建。
SQL> shutdown immediate
ORA-01507: ???
ORACLE 例程已经关闭。
/****
此时应注意,手动打开c:\p1.ora,进行编辑,将undo_management由AUTO修改为MANUAL。
******/
SQL> startup mount pfile=‘c:\p1.ora’;
ORACLE 例程已经启动。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 222301060 bytes
Database Buffers 381681664 bytes
Redo Buffers 7135232 bytes
数据库装载完毕。
SQL> show parameter undo
NAME TYPE VALUE
undo_management string MANUAL
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> alter database open;
数据库已更改。
/*第二步:先创建一个回滚段并使用,
再新建一个新的undo表空间,并将老的undo表空间drop/
SQL> Create rollback segment r01 ;
回退段已创建。
SQL>
SQL> Alter rollback segment r01 online ;
回退段已变更。
SQL> Create undo tablespace undotbs_new datafile ‘D:\oracle\product\10.2.0\oradata\suredd\untotbs_new_01.dbf’ size 50M;
表空间已创建。
SQL> drop tablespace UNDOTBS1 including contents and datafiles;
表空间已删除。
/*第三步:关闭数据库,使用spfile启动到nomount状态(其实就是让undo继续自动管理),
将undo表空间指向新创建的undo表空间,再关闭数据库再启动数据库/
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup nomount
ORACLE 例程已经启动。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 222301060 bytes
Database Buffers 381681664 bytes
Redo Buffers 7135232 bytes
SQL> alter system set undo_tablespace=undotbs_new scope=spfile;
系统已更改。
SQL> shutdown immediate
ORA-01507: ???
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 222301060 bytes
Database Buffers 381681664 bytes
Redo Buffers 7135232 bytes
数据库装载完毕。
数据库已经打开。
SQL> select * from dd.t1;
ID NAME
1 test1
2 test2
SQL> /
ID NAME
1 test1
2 test2
SQL> alter system checkpoint;
系统已更改。
SQL> alter system archive log current;
系统已更改。
SQL> select * from dd.t1;
ID NAME
1 test1
2 test2
SQL> /
ID NAME
1 test1
2 test2
SQL> show parameter undo
NAME TYPE VALUE
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS_NEW
SQL>
至此,数据库完全恢复正常。