Oracle技术栈之"数据库服务器的swap分区" 配置参考


Oracle技术栈之


在Oracle数据库部署时,有很多系统环境需要配置,其中一项是swap分区的设置,分配不合理,会提示"swap交换分区太小"影响数据库安装进程。这里将OS的/temp和/swap分区总结一下。

· temp分区:

即系统临时分区,一般存储一些日志信息,例如操作系统日志、软件安装日志等;


· swap分区:

即交换分区,类似windows的虚拟内存技术,当软件运行时发生RAM不够用的情况,将部分"inactive pages"(不经常用到的内存页)转移到swap分区中,以释放RAM给其他程序。

部署oracle数据库时swap分区怎么考虑?看看oracle的建议:


recommended swap size

· For RHEL 4:

Swap (at least 256 MB) should equal 2x physical RAM for up to 2 GB of physical RAM, and then 1x physical RAM for any amount above 2 GB, but never less than 32 MB.

Using this formula, a system with 2 GB of physical RAM would have 4 GB of swap, while one with 3 GB of physical RAM would have 5 GB of swap. For systems with really large amounts of RAM (more than 32 GB) you can likely get away with a smaller swap partition (around 1x, or less, of physical RAM).

· For RHEL 5:


· For RHEL 6:


结合数据库服务器的内存大小参考上述Oracle官方推荐配置,依次执行下述命令完成swap分区创建。

1) 用dd命令创建一个16G的文件

#dd if=/dev/zero of=/var/swapfile bs=1G count=16


2) 将它创建为Linux Swap虚拟交换文件

#mkswap /var/swapfile


3) 激活并使用/var/swapfile交换文件

#swapon /var/swapfile


4) 设置系统启动后自动激活虚拟交换文件

#vi /etc/fstab

/var/swapfile swap swap defaults 0 0


分享到:


相關文章: