警告!此文档只用与测试与参考,千万不要用于正式库上,FSCK后可能会导致系统起不起来。
问题:测试库断电后发现oracle数据库起不起来,报以下错误,并且linux系统磁盘变为了readonly。
$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 268 11:29:49 2017
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
ERROR:
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 30: Read-only file system
Additional information: 9925
ORA-01075: you are currently logged on
解决:
1.先进root用户看能不能touch或新建一个文件,如果是说文件只读就继续往下读
# touch a
touch: cannot touch `a': Read-only file system
2.dmesg发现EXT-3 文件系统存在问题
# dmesg
EXT3-fs error (device dm-0): ext3_free_blocks: Freeing blocks not in datazone - block = 539784035, count = 1
Aborting journal on device dm-0.
...
EXT3-fs error (device dm-0): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device dm-0): ext3_remount: Abort forced by user
3.使用fsck修复(-y可以免除输入yes的麻烦)
# fsck -y
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/VolGroup00/LogVol00: recovering journal
Resize inode not valid. Recreate? yes
/dev/VolGroup00/LogVol00 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Root inode is not a directory. Clear? yes
Reserved inode 3 () has invalid mode. Clear? yes
Inode 3, i_blocks is 8, should be 0. Fix? yes
Reserved inode 4 () has invalid mode. Clear? yes
Inode 4, i_blocks is 8, should be 0. Fix? yes
Reserved inode 6 () has invalid mode. Clear? yes
Inode 6, i_blocks is 8, should be 0. Fix? yes
Inode 8, i_blocks is 0, should be 262416. Fix? yes
Reserved inode 9 () has invalid mode. Clear? yes
...
4.重启系统
#reboot