Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report