Solution for the lack of swap space when installing Oracle under Linux __ios

Source: Internet
Author: User
Solution to low swap space when installing Oracle on Linux
There are two ways to increase swap space: Strictly speaking, there is only one way to add swap after the system is installed, and that is the second method of this article, as the first method should be to set up the swap area when the system is installed. 1, the use of partitions: in the installation of the OS to partition a special swap partition, the size of the space to be planned in advance, start the system automatically mount. This method can only be set when installing the OS, once the settings are not easy to change, unless the system is reinstalled. 2, the use of Swapfile: (or the entire free partition) new temporary swapfile or is an idle partition, when needed, set to swap space, can add up to 8 swapfile. The size of the swap space, closely related to the CPU, in the i386 system, can use up to 2GB of space. After the system start-up, according to the needs of the total capacity of 2G to increase or decrease. This method is more flexible and convenient, the disadvantage is that the system needs to manually set up after the boot. The following is the use of swapfile to increase the exchange of space steps: Related to the command: Free---View the memory status command, you can display the size and use of Memory,swap,buffer cache, the DD---read, convert and output data commands; Mkswap--- Set the Swap area Swapon---Enable the swap area, equivalent to the Mount Swapoff---Close the swap area, equivalent to Umount steps: 1, create Swapfile:root permissions, create Swapfile, assuming the current directory is "/", execute the following command: # DD If=/dev/zero Of=swapfile bs=1024 count=500000 creates a swapfile in the root directory named "Swapfile" with a size of 500M, or you can export the file to any directory you want, Personally think it's better to just put it in the root directory, at a glance, it is not easy to accidentally destroy, put in the other directory is not; the option in the command explains:---of: the path and name of the interchange file for output;---BS: block size, unit byte, typically 1k or 1024 byte;--- Count: Total block size, which is the total amount of space, the unit is k;---if: the source free space read, why is zero, not clear, first fixed so write it; 2, set Swapfile to swap space # Mkswap Swapfile 3, enable swap space, This operation is somewhat similar to mount operation (Personal Understanding): # Swapon Swapfile the operation to increase the swap space is over, you can use the free command to see whether the swap space size changes, 4, if you no longer use the space can choose to turn off the intersectionTo change the space, this operation is somewhat similar to the umount operation (Personal Understanding):: # Swapoff Swapfile Use this method in each system startup need to manually set, open the Swapfile, more trouble, the solution: in the/etc/rc.d/rc.local Add the following at the end of the file: (edit this file of course with VI ~)/sbin/swapon/swapfile Save after the exit, so that after the system is started, swap space will automatically load; Summary: When installing the OS, be sure to plan for the after swap size, usually twice times the memory , but take into account the possibility of additional memory, so you can consider a slightly larger,   want to install oracle10g in the virtual machine, found that the default swap space does not meet the minimum requirements, because I allocated the physical memory is 1G, then the required 2G swap swap space , the default is only 1G swap space. The steps to add swap space are as follows:   the first step: Make sure there is enough space in the system for swap swap, I'm using KVM, and I'm going to add a swap file to a standalone filesystem, in/opt/ Add 2G swap file in image Second step: Add the swap file and set its size to 2G, using the following command [Root@sense image]# dd If=/dev/zero of=/opt/image/swap bs=1024 count= 2048000 after a period of time returned the following results: 2048000+0 records in 2048000+0 Records out 2097152000 bytes (2.1 GB) copied, 272.867 seconds, 7.7 mb/ S step three: Create (set) Swap space, use command MKSWAP [root@sense image]# mkswap/opt/image/swap Setting up swapspace version 1, size = 2097147 KB Four step: Check the existing swap space size, using the command free [root@sense image]# free-m total used free shared buffers cached mem:1011 989 0 1 875-/+ buf fers/cache:112 898 swap:1027 0 1027 or check meminfo file grep swaptotal/Proc/meminfo Step Fifth: Start the newly added 2G swap space and use the command swapon [root@sense image]# Swapon/opt/image/swap Sixth step: Confirm that the new 2G swap space is in effect, using the command free [ Root@sense image]# free-m Total used free shared buffers cached mem:1011 995 0 4 877-/+ buffers/cache:113 897 Swap: 3027 0 3027 or check the Meminfo file grep swaptotal/proc/meminfo Seventh: Modify the/etc/fstab file so that the newly added 2G swap space automatically takes effect after the system restarts. Last added to file:/opt/image/ Swap swap defaults 0 0
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.