When installing Oracle, it is possible that the installation failed because we did not allocate enough swap space. The process steps are as follows:
Swap space is 2G
[[email protected] oracle]# free total used free shared buffers cachedmem:203900 4 1207260 831744 0 22668 833660-/+ buffers/cache:350932 1688072swap:2097144 0 2097144
Create a temporary swap file with a size of 1Gb via the DD command
[email protected] oracle]# dd If=/dev/zero of=/home/oracle/swap.file bs=1024k count=10241024+0 Records in1024+0 Records out1073741824 bytes (1.1 GB) copied, 16.711 s, 64.3 MB/s
2. Format the temporary swap file created in step 1 via the Mkswap command
[Email protected] oracle]# mkswap/home/oracle/swap.file mkswap:/home/oracle/swap.file:warning:don ' t erase bootbits s Ectors on whole disk. Use-f to force. Setting up Swapspace version 1, size = 1048572 kibno label, UUID=99E682DB-BB37-444A-A8DB-EE742A71B5D3
3. The swap file takes effect through the Swapon command, as follows:
[Email protected] oracle]# Swapon/home/oracle/swap.file
4. Check the effect of adding swap with the free command or grep swap/proc/meminfo as follows:
[[email protected] oracle]# free total used free shared buffers cachedmem: 2039004 1955200 83804 0 12348 1569000-/+ buffers/cache: 373852 1665152Swap: 3145712 0 3145712[[email protected] oracle]# grep Swap /proc/meminfo SwapCached: 0 kbswaptotal: 3145712 kbswapfree: 3145712 kb
5. If you need to be permanently active, you will need to write the new swap device file to the Fstab file so that it will automatically take effect each time the server restarts
echo "/home/oracle/swap.file swap swap defaults 0 0" >>/etc/fstab
6. Close swap on the temporary device
[Email protected] oracle]# swapoff/home/oracle/swap.file [[email protected] oracle]# free total used Free shared buffers cachedmem:2039004 1955324 83680 0 12440 1569460-/+ buf fers/cache:373424 1665580swap:2097144 0 2097144
This is not recommended, it is best to allocate enough swap space when installing the system, but if this problem does occur, it is also an efficient solution.
This article is from the "Database Road" blog, make sure to keep this source http://dbaway.blog.51cto.com/7099215/1685300
How to deal with the lack of swap space when installing Oracle