LINUX下ORACLE軟體、資料檔案等所在的磁碟分割槽空間不足的解決思路
虛擬機器中的ORACLE執行的久了,歸檔、資料檔案不斷增長,原來安裝ORACLE的分割槽空間不足。
此時可以重新向虛擬機器增加一塊硬碟,將ORACLE的資料檔案或歸檔的目錄掛載到新增加的磁碟分割槽上。
--我這裡未新增加磁碟,而是將原磁碟未劃分分割槽的部分重新分割槽、格式化來掛載使用。--原理和新增加磁碟來分割槽並格式化再掛載是一樣了。
http://blog.csdn.net/q947817003/article/details/12308099 一次因磁碟空間不足歸檔無法完成導致DML操作HANG住。
[root@oel-01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 13G 5.4G 71% /
/dev/sda1 99M 21M 74M 22% /boot
tmpfs 3.0G 528M 2.5G 18% /dev/shm
/dev/sda5 4.6G 3.2G 1.2G 73% /backup
計劃重新掛載的就是這個目錄:---僅為測試,具體根據實際需要來確定需要掛載到新分割槽的目錄。
[root@oel-01 ~]# du -sh /home/oracle/rmanlog/
44K /home/oracle/rmanlog/
[root@oel-01 ~]# ls /home/oracle/rmanlog/
back01.log back11.log back13.log back22.log back24.log
back02_1.log back12.log back21.log back23.log rmanarch2013061815-40.log
############
開始分割槽:--軟體、系統提示為節約篇幅已經省略。
[root@oel-01 ~]# fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2563 20482875 83 Linux
/dev/sda3 2564 2824 2096482+ 82 Linux swap / Solaris
/dev/sda4 2825 3916 8771490 5 Extended
/dev/sda5 2825 3433 4891761 83 Linux
Command (m for help): n
First cylinder (3434-3916, default 3434):
Using default value 3434
Last cylinder or +size or +sizeM or +sizeK (3434-3916, default 3916): +100M ----測試用,所以只劃分了100M。
Command (m for help): p --驗證已經劃分了新分割槽
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2563 20482875 83 Linux
/dev/sda3 2564 2824 2096482+ 82 Linux swap / Solaris
/dev/sda4 2825 3916 8771490 5 Extended
/dev/sda5 2825 3433 4891761 83 Linux
/dev/sda6 3434 3446 104391 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. ----重讀分割槽表失敗,用的扔是舊的分割槽表--直接格式時會出錯找不到新分割槽。
The new table will be used at the next reboot.
Syncing disks.
##################
mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda6 --- No such file or directory ---因為新分割槽表未被讀取
The device apparently does not exist; did you specify it correctly?
對於這個出錯提示:
方法一:重啟後系統重新讀取分割槽表即可解決。
方法二:使用partprobe命令,partprobe包含在parted的rpm軟體包中。partprobe可以修改kernel中分割槽表,使kernel重新讀取分割槽表。
因此,使用該命令就可以建立分割槽並且在不重新啟動機器的情況下系統能夠識別這些分割槽。
[root@oel-01 ~]# rpm -q parted
parted-1.8.1-29.el5
[root@oel-01 ~]# partprobe
Error: Error opening /dev/md0: No such file or directory
[root@oel-01 ~]# partprobe
[root@oel-01 ~]# mkfs -t ext3 /dev/sda6 ---使用這個語句來格式化新分割槽
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
26104 inodes, 104388 blocks
5219 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
#####################################
此時原目錄下檔案仍在原目錄所在的磁碟上。
[root@oel-01 ~]# mount /dev/sda6 /home/oracle/rmanlog/
[root@oel-01 ~]# cd /home/oracle/rmanlog/
[root@oel-01 rmanlog]# ls
lost+found
[root@oel-01 rmanlog]# umount /dev/sda6 ---不能在掛載的目錄內執行 umount
umount: /home/oracle/rmanlog: device is busy
umount: /home/oracle/rmanlog: device is busy
[root@oel-01 rmanlog]# cd
[root@oel-01 ~]# umount /dev/sda6
[root@oel-01 ~]# cd /home/oracle/rmanlog/
[root@oel-01 rmanlog]# ls
back01.log back13.log back24.log
back02_1.log back21.log rmanarch2013061815-40.log
back11.log back22.log
back12.log back23.log
###################################
[root@oel-01 oracle]# pwd
/home/oracle
[root@oel-01 oracle]# mkdir rmanlogbak
[root@oel-01 oracle]# mv rmanlog/* ./rmanlogbak/
[root@oel-01 oracle]# ls ./rmanlogbak/
back01.log back13.log back24.log
back02_1.log back21.log rmanarch2013061815-40.log
back11.log back22.log
back12.log back23.log
[root@oel-01 oracle]# ls ./rmanlog/
[root@oel-01 oracle]# mount /dev/sda6 /home/oracle/rmanlog/
[root@oel-01 oracle]# ls ./rmanlog
lost+found
[root@oel-01 oracle]# mv ./rmanlogbak/* ./rmanlog 把之前移出的資料再移動回來,
[root@oel-01 oracle]# ls ./rmanlog/ 檢視檔案都在,重新掛載完成。
back01.log back13.log back24.log
back02_1.log back21.log lost+found
back11.log back22.log rmanarch2013061815-40.log
back12.log back23.log
[root@oel-01 oracle]# ls ./rmanlogbak/
[root@oel-01 oracle]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 13G 5.4G 71% /
/dev/sda1 99M 21M 74M 22% /boot
tmpfs 3.0G 528M 2.5G 18% /dev/shm
/dev/sda5 4.6G 3.2G 1.2G 73% /backup
/dev/sda6 99M 5.6M 89M 6% /home/oracle/rmanlog
##############
[root@oel-01 ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults,size=3G 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
LABEL=/backup /backup ext3 defaults 0 0
/dev/sda6 /home/oracle/rmanlog ext3 defaults 0 0
"/etc/fstab" 10L, 634C written
[root@oel-01 ~]# mount -a ---這裡沒有錯誤提示(執行語句無輸出)就證明寫入的語句沒問題。
[root@oel-01 ~]# mount -o remount,rw,auto /home/oracle/rmanlog ---同樣無出錯提示
注:mount -a -a代表auto 是將 /etc/fstab 檔案中的掛載內容全部重新掛載一次
mount -o remount,rw,auto / -o remount 引數為重新掛載 rw為掛載為可讀寫 auto 是指定此檔案系統是否以允許被mount -a 自動掛載
檢視分割槽及掛載,目錄已經掛載到新分割槽,進入掛載的目錄檢視,檔案都在。--完成。
[root@oel-01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 13G 5.4G 71% /
/dev/sda1 99M 21M 74M 22% /boot
tmpfs 3.0G 528M 2.5G 18% /dev/shm
/dev/sda5 4.6G 3.2G 1.2G 73% /backup
/dev/sda6 99M 5.6M 89M 6% /home/oracle/rmanlog
[root@oel-01 ~]# cd /home/oracle/rmanlog
[root@oel-01 rmanlog]# ls
back01.log back11.log back13.log back22.log back24.log rmanarch2013061815-40.log
back02_1.log back12.log back21.log back23.log lost+found
此時可以重新向虛擬機器增加一塊硬碟,將ORACLE的資料檔案或歸檔的目錄掛載到新增加的磁碟分割槽上。
--我這裡未新增加磁碟,而是將原磁碟未劃分分割槽的部分重新分割槽、格式化來掛載使用。--原理和新增加磁碟來分割槽並格式化再掛載是一樣了。
1.磁碟空間使用情況的檢視--需要經常關注磁碟空間使用情況
--如果空間使用達到100%,ORACLE資料庫正在執行會HANG住,此時通過SQLPLUS登陸,也會有出錯提示-具體提示未記錄。如未啟動,不能啟動**。http://blog.csdn.net/q947817003/article/details/12308099 一次因磁碟空間不足歸檔無法完成導致DML操作HANG住。
[root@oel-01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 13G 5.4G 71% /
/dev/sda1 99M 21M 74M 22% /boot
tmpfs 3.0G 528M 2.5G 18% /dev/shm
/dev/sda5 4.6G 3.2G 1.2G 73% /backup
計劃重新掛載的就是這個目錄:---僅為測試,具體根據實際需要來確定需要掛載到新分割槽的目錄。
[root@oel-01 ~]# du -sh /home/oracle/rmanlog/
44K /home/oracle/rmanlog/
[root@oel-01 ~]# ls /home/oracle/rmanlog/
back01.log back11.log back13.log back22.log back24.log
back02_1.log back12.log back21.log back23.log rmanarch2013061815-40.log
############
2.使用fdisk檢視分對磁碟分割槽
--我這裡因知道我的磁碟未使用完,直接就可以用fdisk來分割槽。如是新增加磁碟,可以使用 fdisk -l 來檢視出新磁碟的名稱。 --fdisk用法可以百度。開始分割槽:--軟體、系統提示為節約篇幅已經省略。
[root@oel-01 ~]# fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2563 20482875 83 Linux
/dev/sda3 2564 2824 2096482+ 82 Linux swap / Solaris
/dev/sda4 2825 3916 8771490 5 Extended
/dev/sda5 2825 3433 4891761 83 Linux
Command (m for help): n
First cylinder (3434-3916, default 3434):
Using default value 3434
Last cylinder or +size or +sizeM or +sizeK (3434-3916, default 3916): +100M ----測試用,所以只劃分了100M。
Command (m for help): p --驗證已經劃分了新分割槽
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2563 20482875 83 Linux
/dev/sda3 2564 2824 2096482+ 82 Linux swap / Solaris
/dev/sda4 2825 3916 8771490 5 Extended
/dev/sda5 2825 3433 4891761 83 Linux
/dev/sda6 3434 3446 104391 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. ----重讀分割槽表失敗,用的扔是舊的分割槽表--直接格式時會出錯找不到新分割槽。
The new table will be used at the next reboot.
Syncing disks.
##################
3.格式化分割槽--附格式化時出錯解決
[root@oel-01 ~]# mkfs -t ext3 /dev/sda6mke2fs 1.39 (29-May-2006)
Could not stat /dev/sda6 --- No such file or directory ---因為新分割槽表未被讀取
The device apparently does not exist; did you specify it correctly?
對於這個出錯提示:
方法一:重啟後系統重新讀取分割槽表即可解決。
方法二:使用partprobe命令,partprobe包含在parted的rpm軟體包中。partprobe可以修改kernel中分割槽表,使kernel重新讀取分割槽表。
因此,使用該命令就可以建立分割槽並且在不重新啟動機器的情況下系統能夠識別這些分割槽。
[root@oel-01 ~]# rpm -q parted
parted-1.8.1-29.el5
[root@oel-01 ~]# partprobe
Error: Error opening /dev/md0: No such file or directory
[root@oel-01 ~]# partprobe
[root@oel-01 ~]# mkfs -t ext3 /dev/sda6 ---使用這個語句來格式化新分割槽
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
26104 inodes, 104388 blocks
5219 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
#####################################
4.掛載目錄的測試之直接掛載
這種方式不考慮原目錄下是否存在檔案,原目錄有資料而未移出時直接掛載無法訪問到原目錄下資料此時原目錄下檔案仍在原目錄所在的磁碟上。
[root@oel-01 ~]# mount /dev/sda6 /home/oracle/rmanlog/
[root@oel-01 ~]# cd /home/oracle/rmanlog/
[root@oel-01 rmanlog]# ls
lost+found
[root@oel-01 rmanlog]# umount /dev/sda6 ---不能在掛載的目錄內執行 umount
umount: /home/oracle/rmanlog: device is busy
umount: /home/oracle/rmanlog: device is busy
[root@oel-01 rmanlog]# cd
[root@oel-01 ~]# umount /dev/sda6
[root@oel-01 ~]# cd /home/oracle/rmanlog/
[root@oel-01 rmanlog]# ls
back01.log back13.log back24.log
back02_1.log back21.log rmanarch2013061815-40.log
back11.log back22.log
back12.log back23.log
###################################
4.掛載目錄之先移動資料再掛載
適用於所需要重新掛載的目錄下有檔案[root@oel-01 oracle]# pwd
/home/oracle
[root@oel-01 oracle]# mkdir rmanlogbak
[root@oel-01 oracle]# mv rmanlog/* ./rmanlogbak/
[root@oel-01 oracle]# ls ./rmanlogbak/
back01.log back13.log back24.log
back02_1.log back21.log rmanarch2013061815-40.log
back11.log back22.log
back12.log back23.log
[root@oel-01 oracle]# ls ./rmanlog/
[root@oel-01 oracle]# mount /dev/sda6 /home/oracle/rmanlog/
[root@oel-01 oracle]# ls ./rmanlog
lost+found
[root@oel-01 oracle]# mv ./rmanlogbak/* ./rmanlog 把之前移出的資料再移動回來,
[root@oel-01 oracle]# ls ./rmanlog/ 檢視檔案都在,重新掛載完成。
back01.log back13.log back24.log
back02_1.log back21.log lost+found
back11.log back22.log rmanarch2013061815-40.log
back12.log back23.log
[root@oel-01 oracle]# ls ./rmanlogbak/
[root@oel-01 oracle]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 13G 5.4G 71% /
/dev/sda1 99M 21M 74M 22% /boot
tmpfs 3.0G 528M 2.5G 18% /dev/shm
/dev/sda5 4.6G 3.2G 1.2G 73% /backup
/dev/sda6 99M 5.6M 89M 6% /home/oracle/rmanlog
##############
5.修改/etc/fstab,實現開機自動掛載分割槽
紅色語句為新增的,因為格式時未指定LABEL,直接寫上分割槽名就可以。[root@oel-01 ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults,size=3G 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
LABEL=/backup /backup ext3 defaults 0 0
/dev/sda6 /home/oracle/rmanlog ext3 defaults 0 0
"/etc/fstab" 10L, 634C written
[root@oel-01 ~]# mount -a ---這裡沒有錯誤提示(執行語句無輸出)就證明寫入的語句沒問題。
[root@oel-01 ~]# mount -o remount,rw,auto /home/oracle/rmanlog ---同樣無出錯提示
注:mount -a -a代表auto 是將 /etc/fstab 檔案中的掛載內容全部重新掛載一次
mount -o remount,rw,auto / -o remount 引數為重新掛載 rw為掛載為可讀寫 auto 是指定此檔案系統是否以允許被mount -a 自動掛載
檢視分割槽及掛載,目錄已經掛載到新分割槽,進入掛載的目錄檢視,檔案都在。--完成。
[root@oel-01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 13G 5.4G 71% /
/dev/sda1 99M 21M 74M 22% /boot
tmpfs 3.0G 528M 2.5G 18% /dev/shm
/dev/sda5 4.6G 3.2G 1.2G 73% /backup
/dev/sda6 99M 5.6M 89M 6% /home/oracle/rmanlog
[root@oel-01 ~]# cd /home/oracle/rmanlog
[root@oel-01 rmanlog]# ls
back01.log back11.log back13.log back22.log back24.log rmanarch2013061815-40.log
back02_1.log back12.log back21.log back23.log lost+found
相關文章
- 磁碟空間不足,線上移動Oracle的資料檔案Oracle
- oracle dg庫資料檔案空間不足Oracle
- Linux下擴充套件根檔案系統所在的分割槽Linux套件
- win10分割槽磁碟空間不足怎麼回事_win10分割槽磁碟沒有足夠空間如何處理Win10
- boot分割槽剩餘空間不足boot
- Linux下/var/spool/clientmqueue空間不足的解決LinuxclientMQ
- /boot 分割槽空間不足時如何清理boot
- 如何解決 Linux 中“磁碟空間不足”的問題Linux
- linux下磁碟分割槽的案例Linux
- linux建立新分割槽擴充套件磁碟空間Linux套件
- oracle 將表空間下的資料檔案從檔案系統遷移到ASM磁碟組OracleASM
- Oracle資料庫的歸檔日誌寫滿磁碟空間解決辦法Oracle資料庫
- Excel 2003記憶體或磁碟空間不足的解決方法Excel記憶體
- 解決linux下刪除檔案或oracle表空間後空間不釋放的問題LinuxOracle
- Linux 磁碟分割槽及檔案系統管理Linux
- Linux下磁碟分割槽工具cfdisk的使用Linux
- linux磁碟分割槽講解Linux
- Linux下磁碟分割槽,fdisk,mkfsLinux
- ASM磁碟組空間不足ASM
- 救命神文!應對ubuntu磁碟空間不足(已解決)Ubuntu
- 運維實戰:Linux系統擴充套件oracle資料庫所在的分割槽運維Linux套件Oracle資料庫
- Linux磁碟分割槽、掛載、檢視檔案大小Linux
- Oracle 刪除資料後釋放資料檔案所佔磁碟空間Oracle
- Linux下的磁碟分割槽和邏輯卷Linux
- 臨時表空間資料檔案損壞的解決
- linux下增加磁碟改變指定檔案路徑分割槽掛載點和遷移資料Linux
- oracle 回收表空間的資料檔案大小Oracle
- ORACLE 中SCHEMA的概念以及資料庫,表空間,資料檔案等的區別(轉)Oracle資料庫
- ORA-00257-歸檔日誌所在磁碟空間使用100%出錯解決
- oracle 表空間下資料檔案遷移的三種方法Oracle
- Linux 磁碟與磁碟分割槽Linux
- 時間型分割槽欄位不走分割槽的解決
- windows下讀取Linux分割槽軟體WindowsLinux
- oracle的臨時表空間寫滿磁碟空間,解決改問題的具體步驟Oracle
- Liunx 磁碟分割槽與檔案掛載
- Linux下掌控磁碟分割槽的九大神器Linux
- 某個表空間的資料檔案損壞的修復思路
- 詳解ORACLE資料庫的分割槽表Oracle資料庫