- 问题现象:
SQL> startup
ORACLE instance started.
Total System Global Area 1854021632 bytes
Fixed Size 2242584 bytes
Variable Size 1136658408 bytes
Database Buffers 708837376 bytes
Redo Buffers 6283264 bytes
ORA-00205: error in identifying control file, check alert log for more info
查看alert日志
SQL> select value from v$diag_info where name ='Diag Alert';
VALUE
-------------------------------------------------------------------------------
/data/oracle/ora11g/diag/rdbms/tjdb/tjdb/alert
[oracle@hrtestdb ~]cd /data/oracle/ora11g/diag/rdbms/tjdb/tjdb/alert
[oracle@hrtestdb alert]# ll
?荤.?.102508
-rw-r-----. 1 oracle oinstall 10485978 12?.30 2014 log_16.xml
-rw-r-----. 1 oracle oinstall 10485945 1?. 25 2015 log_17.xml
-rw-r-----. 1 oracle oinstall 10485763 2?. 13 2015 log_18.xml
-rw-r-----. 1 oracle oinstall 10485996 3?. 8 2015 log_19.xml
-rw-r-----. 1 oracle oinstall 10485761 3?. 21 2015 log_20.xml
-rw-r-----. 1 oracle oinstall 10485841 4?. 3 2015 log_21.xml
-rw-r-----. 1 oracle oinstall 10485932 4?. 15 2015 log_22.xml
-rw-r-----. 1 oracle oinstall 10485792 7?. 4 17:42 log_23.xml
-rw-r-----. 1 oracle oinstall 10485970 7?. 4 23:41 log_24.xml
-rw-r-----. 1 oracle oinstall 10392897 10?.21 09:20 log.xml
[oracle@hrtestdb alert]# less log.xml
Alert 日志片断:
host_id='hrtestdb' host_addr='10.3.64.204' module=''
pid='7210'>
<txt>ORA-00210: cannot open the specified control file
ORA-00202: control file: '/data/oracle/ora11g/oradata/tjdb/control03.ctl'
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 11: Resource temporarily unavailable
解决:
1.先使用lsof 或fuser 查询出正在使用这些文件的进程:
[root@hrtestdb ~]#fuser -m -v /data
或
[root@hrtestdb ~]# lsof /data/oracle/ora11g/oradata/tjdb/control*
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
oracle 8041 oracle 256u REG 0,19 11026432 1867986 /data/oracle/ora11g/oradata/tjdb/control01.ctl
oracle 8041 oracle 257u REG 0,19 11026432 1868772 /data/oracle/ora11g/oradata/tjdb/control02.ctl
oracle 8041 oracle 258u REG 0,19 11026432 1868514 /data/oracle/ora11g/oradata/tjdb/control03.ctl
oracle 8043 oracle 256u REG 0,19 11026432 1867986 /data/oracle/ora11g/oradata/tjdb/control01.ctl
oracle 8043 oracle 257u REG 0,19 11026432 1868772 /data/oracle/ora11g/oradata/tjdb/control02.ctl
oracle 8043 oracle 258u REG 0,19 11026432 1868514 /data/oracle/ora11g/oradata/tjdb/control03.ctl
oracle 8045 oracle 256uW REG 0,19 11026432 1867986 /data/oracle/ora11g/oradata/tjdb/control01.ctl
oracle 8045 oracle 257uW REG 0,19 11026432 1868772 /data/oracle/ora11g/oradata/tjdb/control02.ctl
oracle 8045 oracle 258uW REG 0,19 11026432 1868514 /data/oracle/ora11g/oradata/tjdb/control03.ctl
oracle 8051 oracle 258u REG 0,19 11026432 1867986 /data/oracle/ora11g/oradata/tjdb/control01.ctl
oracle 8051 oracle 259u REG 0,19 11026432 1868772 /data/oracle/ora11g/oradata/tjdb/control02.ctl
oracle 8051 oracle 260u REG 0,19 11026432 1868514 /data/oracle/ora11g/oradata/tjdb/control03.ctl
oracle 8278 oracle 257u REG 0,19 11026432 1867986 /data/oracle/ora11g/oradata/tjdb/control01.ctl
oracle 8278 oracle 258u REG 0,19 11026432 1868772 /data/oracle/ora11g/oradata/tjdb/control02.ctl
oracle 8278 oracle 259u REG 0,19 11026432 1868514 /data/oracle/ora11g/oradata/tjdb/control03.ctl
[root@hrtestdb ~]# ps -ef | grep /data/oracle |grep -v grep |cut -c 9-15 |xargs kill -s 9
或
[root@hrtestdb ~]# lsof /data |cut -c 9-13 |xargs kill -s 9
或
[root@hrtestdb ~]# fuser –k /data
2.卸载文件系统
[root@hrtestdb ~]#umount /data
3.重新装载文件系统
mount nfs目录的方法:
mount -t nfs hostname(orIP):/directory /mount/point
[oracle@hrtestdb ~]# df -h
/dev/mapper/VolGroup-lv_root 18G 4.4G 13G 27% /
tmpfs 1.9G 1.8G 140M 93% /dev/shm
/dev/sda1 485M 37M 423M 8% /boot
10.5.6.250:/nfs/hrtestdb 178G 74G 95G 44% /data
[root@hrtestdb ~]#mount -t nfs -o nolock 10.5.6.250:/nfs/hrtestdb /data
- 自动挂载存储
1.在/etc/fstab 添加自动挂载,如下配置格式
# <file system> <mount point> <type> <options> <dump> <pass>
[root@hrtestdb etc]# vi fstab # # /etc/fstab # Created by anaconda on Mon Jan 20 09:49:11 2014 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/VolGroup-lv_root / ext4 defaults 1 1 UUID=90bc6e34-39f4-45b1-a68b-8c5ecc81d7e0 /boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 10.5.6.250:/nfs/hrtestdb /data nfs defaults 0 0
或:
添加到 /etc/rc.d/rc.local
2.把mount 的命令放到/etc/rc.d/rc.local 里面去,vi /etc/rc.d/rc.local ,然后在rc.local 中配置挂载命令:
mount -t nfs -o nolock 10.5.6.250:/nfs/hrtestdb /data