Home  >  Article  >  Database  >  Linux下安装Oracle时SWAP不足的两种解决方法

Linux下安装Oracle时SWAP不足的两种解决方法

WBOY
WBOYOriginal
2016-06-07 17:33:521315browse

当前磁盘分区及SWAP分区情况如下: [root@bys3 ~]# fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes255 heads, 63 sectors

当前磁盘分区及SWAP分区情况如下:

[root@bys3 ~]# fdisk -l

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
[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的使用详见:点击打开链接
1. 使用dd命令新建一个文件并挂载为SWAP

2. 增加一个新交换分区

增加的步骤都是:

1.free ---查看内存状态命令,可以显示memory,,swap,buffer cache等的大小及使用状况;
2.dd ---读取,转换并输出数据命令;fdisk切分新分区
3.mkswap ---设置交换区
4.swapon ---启用交换区,相当于mount;swapoff ---关闭交换区,相当于umount

5.设置开机自动挂载/etc/fstab

#########################################################
Statement:
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