LINUX下安裝ORACLE時SWAP不足的兩種解決方法
當前磁碟分割槽及SWAP分割槽情況如下:
[root@bys3 ~]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 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 2078 16587112+ 83 Linux
/dev/sda3 2079 2600 4192965 82 Linux swap / Solaris
[root@bys3 ~]# free -m
total used free shared buffers cached
Mem: 2013 1850 163 0 131 1274
-/+ buffers/cache: 444 1568
Swap: 4094 0 4094
增加SWAP交換分割槽有兩種方法:關於tmpfs的使用詳見:http://blog.csdn.net/haibusuanyun/article/details/17199617點選開啟連結
1. 使用dd命令新建一個檔案並掛載為SWAP
2. 增加一個新交換分割槽
增加的步驟都是:
1.free ---檢視記憶體狀態命令,可以顯示memory,swap,buffer cache等的大小及使用狀況;
2.dd ---讀取,轉換並輸出資料命令;fdisk切分新分割槽
3.mkswap ---設定交換區
4.swapon ---啟用交換區,相當於mount;swapoff ---關閉交換區,相當於umount
5.設定開機自動掛載/etc/fstab
1.使用DD命令建立一個檔案
[root@bys3 ~]# dd if=/dev/zero of=/root/swap bs=1024 count=1024000 ---這裡bs=是bytes,count是 blocks 個塊,這裡的就是1024bytes=1K,1024000K=1000M1024000+0 records in
1024000+0 records out
1048576000 bytes (1.0 GB) copied, 43.5605 seconds, 24.1 MB/s
[root@bys3 ~]# mkswap /root/swap
Setting up swapspace version 1, size = 1048571 kB
[root@bys3 ~]# swapon /root/swap
[root@bys3 ~]# free -m
total used free shared buffers cached
Mem: 2013 1864 149 0 37 1389
-/+ buffers/cache: 436 1577
Swap: 5094 0 5094 --與最開始的相比,增加了近1000M。
設定開機自動掛載-
[root@bys3 ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
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
LABEL=SWAP-sda3 swap swap defaults 0 0
/root/swap swap swap defaults 0 0
[root@bys3 ~]# mount -a --無報錯,修改/etc/fstab成功
重啟後檢視:--SWAP空間包含了新增加的空間。
[oracle@bys3 ~]$ free -m
total used free shared buffers cached
Mem: 2013 214 1799 0 15 150
-/+ buffers/cache: 48 1964
Swap: 5094 0 5094
###############################################################################
2.用FDISK將未使用的分割槽格式化並掛載為SWAP分割槽
[root@bys3 ~]# fdisk -lDisk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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 2078 16587112+ 83 Linux
/dev/sda3 2079 2600 4192965 82 Linux swap / Solaris
[root@bys3 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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 2078 16587112+ 83 Linux
/dev/sda3 2079 2600 4192965 82 Linux swap / Solaris
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Selected partition 4
First cylinder (2601-2610, default 2601):
Using default value 2601
Last cylinder or +size or +sizeM or +sizeK (2601-2610, default 2610): +50m ---新增加個50M的擴充套件分割槽。
Command (m for help): p
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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 2078 16587112+ 83 Linux
/dev/sda3 2079 2600 4192965 82 Linux swap / Solaris
/dev/sda4 2601 2607 56227+ 5 Extended
Command (m for help): n
First cylinder (2601-2607, default 2601):
Using default value 2601
Last cylinder or +size or +sizeM or +sizeK (2601-2607, default 2607):
Using default value 2607
Command (m for help): p
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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 2078 16587112+ 83 Linux
/dev/sda3 2079 2600 4192965 82 Linux swap / Solaris
/dev/sda4 2601 2607 56227+ 5 Extended
/dev/sda5 2601 2607 56196 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.
[root@bys3 ~]# free -m
total used free shared buffers cached
Mem: 2013 218 1795 0 15 153
-/+ buffers/cache: 49 1964
Swap: 5094 0 5094
[root@bys3 ~]# swapoff /root/swap 關閉一個SWAP空間
[root@bys3 ~]# free -m
total used free shared buffers cached
Mem: 2013 218 1795 0 15 153
-/+ buffers/cache: 49 1964
Swap: 4094 0 4094
[root@bys3 ~]# mkswap /dev/sda5
/dev/sda5: No such file or directory
[root@bys3 ~]# partprobe ---同步下分割槽表的意思
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
Segmentation fault
[root@bys3 ~]# mkswap /dev/sda5
Setting up swapspace version 1, size = 57540 kB
[root@bys3 ~]# swapon /dev/sda5
[root@bys3 ~]# free -m
total used free shared buffers cached
Mem: 2013 218 1795 0 15 153
-/+ buffers/cache: 49 1964
Swap: 4149 0 4149
###############
開機時自動掛載的配置
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
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
LABEL=SWAP-sda3 swap swap defaults 0 0
/dev/sda5 swap swap defaults 0 0
"/etc/fstab" 8L, 568C written
[root@bys3 ~]# mount -a
#########################################
相關文章
- Linux下安裝Oracle時報swap不夠解決方法LinuxOracle
- Linux安裝MySQL的兩種方法LinuxMySql
- linux製作安裝包的兩種方法Linux
- swap空間不足問題解決
- 安裝ORACLE db /tmp空間不足解決辦法Oracle
- 更改Linux時區的兩種方法Linux
- 解決ORACLE共享記憶體不足的方法Oracle記憶體
- Linux下安裝oracle,遇到錯誤的解決辦法LinuxOracle
- 建立安裝程式的兩種方法 (轉)
- 在裝完Linux系統之後自己去修改Swap分割槽的大小(兩種方法)Linux
- Linux遺忘root密碼的其中兩種解決方法Linux密碼
- 在Linux上安裝Oracle時DISPLAY問題解決方案LinuxOracle
- mac安裝mysql的兩種方法(含配置)MacMySql
- 徹底解決Linux下mongodb的安裝LinuxMongoDB
- linux下安裝mysql的問題解決LinuxMySql
- linux下安裝loudmouth庫中碰到的問題 & 解決方法薦Linux
- linux 下oracle的安裝LinuxOracle
- 在Linux下安裝Oracle 10g的方法LinuxOracle 10g
- visualbox中linux磁碟不足的解決方法Linux
- Linux下/var/spool/clientmqueue空間不足的解決LinuxclientMQ
- pip安裝selenium超時解決方法
- solaris x86安裝ORACLE 11.2.0.3軟體時因SWAP不足報錯: INFO: ld: fatal: mmap anon failedOracleAI
- MyEclipse SVN外掛的兩種安裝方法Eclipse
- oracle安裝linux時的核心引數解釋OracleLinux
- Linux安裝mysql的幾種方法LinuxMySql
- Oracle歸檔空間不足,delete archivelog all;命令失效時解決方法OracledeleteHive
- Ocaml windows 下安裝的各種坑及解決方案Windows
- 安裝ORACLE EBS LINUX 平臺上找不到SATA 硬碟的解決方法OracleLinux硬碟
- 四種OS下安裝Docker的方法Docker
- ubuntu下安裝程式的三種方法Ubuntu
- win8 C盤空間不足的幾種解決方法
- linux 下 sysben for oracle 的安裝LinuxOracle
- Linux環境下Swap配置方法Linux
- java解決請求跨域的兩種方法Java跨域
- 【轉】RAC安裝時,報The specified nodes are not clusterable 的解決方法
- 完全解除安裝MacOS應用程式的兩種方法Mac
- Arch linux下安裝bochs失敗解決Linux
- Linux安裝軟體的幾種方法Linux