首页 > 数据库 > Oracle > 安装oracle12c swap不足

free 命令用于显示当前系统中内存的使用量
1、查看当前内存
[root@happy ~]# free -m
total used free shared buffers cached
Mem: 1826 1706 120 8 0 531
-/+ buffers/cache: 1174 652
Swap: 2063 2 2061
2、创建用于交换分区的文件:增加2G大小的交换分区,count等于想要的块大小
[root@happy ~]# dd if=/dev/zero of=/home/swap bs=block_size count=number_of_block
dd: invalid number ‘block_size’
[root@happy ~]# dd if=/dev/zero of=/home/swap bs=1024 count=2048000
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB) copied, 10.0768 s, 208 MB/s
3、设置交换分区文件
[root@happy ~]# mkswap /home/swap
Setting up swapspace version 1, size = 2047996 KiB
no label, UUID=2a8e8c81-fe4b-4111-ae60-715715cdb400
4、立即启用交换分区文件
[root@happy ~]# swapon /home/swap
swapon: /home/swap: insecure permissions 0644, 0600 suggested.
5、再次查看
[root@happy ~]# free -m
total used free shared buffers cached
Mem: 1826 1741 85 7 0 742
-/+ buffers/cache: 998 827
Swap: 4063 81 3982
6、如果想使得开机自启动,想要修改文件/etc/fastb 修改swap行
#
# /etc/fstab
# Created by anaconda on Mon May 14 16:09:52 2018
#
# 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/rhel-root / xfs defaults 1 1
UUID=6fef81a7-d81f-4a22-8795-f714054edb2e /boot xfs defaults 1 2
/home/swap swap swap defaults 0 0
/mvp/RHEL-server-7.0-x86_64-LinuxProbe.Com.iso /mnt/cdrom iso9660 defaults,ro 0 0
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31536355/viewspace-2154729/ ,如需转载,请注明出处,否则将追究法律责任。