Get the App
SLTechnology News&Howtos  ›  Database  › 

How to deal with the lack of SWAP space when installing Oracle

Shulou Source: shulou.com Published: 2022-06-01 21:33:18 09月25日 Update

When installing Oracle, the installation may fail because we do not allocate enough swap space. The processing steps are as follows:

SWAP space is 2G

[root@linux01 oracle] # free total used free shared buffers cachedMem: 2039004 1207260 831744 0 22668 833660 Melissa + buffers/cache: 350 932 1688072Swap: 2097144 0 2097144

Create a temporary swap file with the size of 1Gb through the dd command

[root@linux01 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

two。 Format the temporary swap file created in step 1 with the mkswap command

[root@linux01 oracle] # mkswap / home/oracle/swap.file mkswap: / home/oracle/swap.file: warning: don't erase bootbits sectors on whole disk. Use-f to force.Setting up swapspace version 1, size = 1048572 KiBno label, UUID=99e682db-bb37-444a-a8db-ee742a71b5d3

3. Use the swapon command to make the swap file effective, as follows:

[root@linux01 oracle] # swapon / home/oracle/swap.file

4. Check the effect of adding swap through the free command or grep swap / proc/meminfo, as follows:

[root@linux01 oracle] # free total used free shared buffers cachedMem: 2039004 1955200 83804 0 12348 1569000 + buffers/cache: 373852 1665152Swap: 3145712 0 3145712 [root@linux01 oracle] # grep Swap / proc/meminfo SwapCached: 0 kBSwapTotal: 3145712 kBSwapFree: 3145712 kB

5. If you need to be permanent, you need to write the newly added swap device file to the fstab file so that it will take effect automatically every time the server is restarted

Echo "/ home/oracle/swap.file swap swap defaults 0" > > / etc/fstab

6. Turn off SWAP on temporary equipment

[root@linux01 oracle] # swapoff / home/oracle/swap.file [root@linux01 oracle] # free total used free shared buffers cachedMem: 2039004 1955324 83680 0 12440 1569460 buffers/cache + buffers/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

Tags: Commands files space time valid steps devices allocation processing not enough size effect scheme best efficient server format system solution or Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Xiaomi Shulou Tech Info Huawei