Home > Database > Mysql Tutorial > mv oracle数据文件os分区不释放处理

mv oracle数据文件os分区不释放处理

WBOY
Release: 2016-06-07 16:36:42
Original
1178 people have browsed it

生产系统的oracle数据文件的分区/home满了,需要移动部分oracle datafile到别的空闲分区 [oracle@localhost ~]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 97G 9.6G 83G 11% / /dev/sda6 582G 552G 0 100% /home /dev/sda2 388G 95G 274G

生产系统的oracle数据文件的分区/home满了,需要移动部分oracle datafile到别的空闲分区<br> [oracle@localhost ~]$ df -h<br> Filesystem Size Used Avail Use% Mounted on<br> /dev/sda3 97G 9.6G 83G 11% /<br> /dev/sda6 582G 552G 0 100% /home<br> /dev/sda2 388G 95G 274G 26% /oracle<br> /dev/sda1 190M 12M 169M 7% /boot<br> tmpfs 16G 9.2G 6.6G 58% /dev/shm

[oracle@localhost ~]$ mv /home/rman_backup/sms_01.dbf /oracle/oracle_back/sms_01.dbf
You have new mail in /var/spool/mail/oracle
[oracle@localhost ~]$ mv /home/rman_backup/sms_02.dbf /oracle/oracle_back/sms_02.dbf

移动完成后发现 /home 分区依旧占用率100%
[oracle@localhost ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 97G 9.6G 83G 11% /
/dev/sda6 582G 552G 0 100% /home
/dev/sda2 388G 127G 242G 35% /oracle
/dev/sda1 190M 12M 169M 7% /boot
tmpfs 16G 9.2G 6.6G 58% /dev/shm

由于linux下都是由文件组成的,对于大型文件的mv或者rm操作,很有可能由于相应进程没有释放对这个文件的锁定,我们用lsof查看下oracle占用的数据文件
[root@localhost ~]# lsof |grep delete|grep oracle
oracle 32173 oracle 257u REG 8,6 34359730176 94142471 /home/rman_backup/sms_01.dbf (deleted)
oracle 32173 oracle 258u REG 8,6 34359730176 94142473 /home/rman_backup/sms_02.dbf (deleted)
oracle 32173 oracle 261u REG 8,6 11010056192 94142490 /home/rman_backup/temp001.dbf (deleted)
oracle 32175 oracle 256u REG 8,6 34359730176 94142473 /home/rman_backup/sms_02.dbf (deleted)
oracle 32175 oracle 257u REG 8,6 34359730176 94142471 /home/rman_backup/sms_01.dbf (deleted)
oracle 32175 oracle 258u REG 8,6 11010056192 94142490 /home/rman_backup/temp001.dbf (deleted)
oracle 32250 oracle 256u REG 8,6 34359730176 94142473 /home/rman_backup/sms_02.dbf (deleted)

看看这几个进程对应的是哪些进程,如果是核心的后台进程那么请慎重了,这里由于是服务器进程可以直接kiil掉来释放这些文件的锁定。
[root@localhost ~]# ps -ef|grep 32173|grep -v grep
oracle 32173 1 0 May10 ? 00:02:39 oracledxdb (LOCAL=NO)
[root@localhost ~]# ps -ef|grep 32175|grep -v grep
oracle 32175 1 0 May10 ? 00:02:40 oracledxdb (LOCAL=NO)
[root@localhost ~]# ps -ef|grep 32250|grep -v grep
oracle 32250 1 0 May10 ? 00:00:00 oracledxdb (LOCAL=NO)

[root@localhost ~]# kill -9 32173
[root@localhost ~]# kill -9 32175
[root@localhost ~]# kill -9 32250

Kill掉进程再进行查看发现空间已经释放了。
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 97G 9.6G 83G 11% /
/dev/sda6 582G 478G 75G 87% /home
/dev/sda2 388G 159G 210G 44% /oracle
/dev/sda1 190M 12M 169M 7% /boot
tmpfs 16G 9.2G 6.6G 58% /dev/shm

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template