Adding Swap Space on a Linux System

Unable to allocate physical memory during WLS start will be resolved by adding more SWAP space as below:


  1. Become a superuser (root) by typing:
    % su
    Password: root-password
  2. Create a file in a selected directory to add swap space by typing:
    dd if=/dev/zero of=/dir/myswapfile bs=1024 count=number_blocks_needed

    where dir is a directory in which you have permission to add swap space. The myswapfile is the name of the swap file you are creating. The number_blocks_needed is an amount of 1024-byte blocks you want to create. See the dd(1) man page for more information.

  3. Verify that the file was created by typing:
    ls -l /dir/myswapfile

    The new file appears in the directory.

  4. Initialize the new swap area by typing:
    mkswap /dir/myswapfile

    See the mkswap(8) man page for more detailed information.

  5. Run the swapon command to enable the new swap space for paging and swapping by typing the following:
    swapon -a /dir/myswapfile
  6. Verify that the extra swap space was added by typing:
    swapon -s

    The output shows the allocated swap space.

IN SHORT FOLLOWING COMMANDS NEED TO BE EXECUTED :

dd if=/dev/zero of=/oraprod/myswapfile bs=2G count=5
ls -lhrt /oraprod/myswapfile
[root@shsebs121mt002 ~]#  mkswap /oraprod/myswapfile
Setting up swapspace version 1, size = 10485736 KiB
no label, UUID=6eaf7636-9f19-4376-8a7e-5090bc4a3b40
chmod 600 /oraprod/myswapfile
swapon -a /oraprod/myswapfile
swapon -s


dd if=/dev/zero of=/orastage/myswapfile bs=2G count=5

# cat /proc/swaps

Filename				Type		Size	Used	Priority
/dev/sda10                              partition	8282108	0	-1
# free -h

             total       used       free     shared    buffers     cached
Mem:          7.7G       4.7G       3.0G       408M       182M       1.8G
-/+ buffers/cache:       2.7G       5.0G
Swap:         7.9G         0B       7.9G
# swapon --all

If want to view a summary of swap space usage by device

# swapon --summary

Filename				Type		Size	Used	Priority
/dev/sda10                              partition	8282108	0	-1

Comments

Popular posts from this blog

How to fix Oracle SQL Developer connection issue "Got minus one from a read call"

How to drop index and before dropping it how to get the DDL.

How to troubleshoot Long Running Concurrent Request in EBS 12.2

How to autopopulate user_guid in fnd_user table ( EBS Blank Page)

Opatch is getting faild for GI patch with error code 2 while doing prereq

Few Important steps of Oracle Database Clone

How to Check AD and TXK code levels in your EBS environment

The Server is not able to service this request: [Socket:000445]Connection rejected, filter blocked Socket, weblogic.security.net.FilterException

CPU Patch Analysis

PRVG-11250 : The check "RPM Package Manager database" was not performed because