1. Run the free command to view the Swap partition size in the system. Show free-m: totalusedfreesharedbufferscacheMem: 100296438021410-/+ buffers/cache: 532470 Swap: 95132929. We can see that Swap is only 951 M and does not meet the Oracle-xe-client installation requirements.
1. Run the free command to view the Swap partition size in the system.
Free-m
Display:
Total used free shared buffers cache
Mem: 1002 964 38 0 21 410
-/+ Buffers/cache: 532 470
Swap: 951 32 929
We can see that Swap is only 951 M and does not meet the installation requirements of Oracle-xe-client.
1. 2. Create a Swap file.
Mkdir swap
Cd swap
Sudo dd if =/dev/zero of = swapfile bs = 1024 count = 100000
The following message is displayed. The count in the preceding command indicates the swap file size.
Recorded 100000 + 0 reads
Records 100000 + 0 writes
102400000 bytes (102 MB) Copied, 0.74704 seconds, 137 MB/second
. Convert the generated file into a Swap file
Sudo mkswap swapfile
Setting up swapspace version 1, size = 102395 kB
No label, UUID = 09fde987-5567-498a-a60b-477e302a988b
1. 4. Activate the Swap file.
Sudo swapon swapfile
View the free-m result again.
Total used free shared buffers cached
Mem: 1002 967 34 0 22 410
-/+ Buffers/cache: 534 467
Swap: 1053 32 1021
Added successfully.
Extension:
If you need to uninstall the swap file, you can enter the created swap file directory. Run the following command.
Sudo swapoff swapfile
If you need to keep this swap, you can write it into the/etc/fstab file.
Swapfilepath swap ults 0 0
NOTE: Refer to the last step swapfilepath swap defaults 0 0 above.
The specific operation is to open/etc/fstab in vi and append/xxx swap defaults 0 0 at the end.