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 drop index and before dropping it how to get the DDL.

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

ORA-00257:archiver error, connect internal only until freed

Verifying Daemon “Avahi-Daemon” Not Configured And Running …FAILED (PRVG-1360)

Linux OL7/RHEL7: PRVE-0421 : No entry exists in /etc/fstab for mounting /dev/shm

SKIP DNS RESLOV.CONF CHECK DURING RAC CONFIGURATION

CPU Patch Analysis

How to write to a CSV file using Oracle SQL*Plus

How to troubleshoot Long Running Concurrent Request in EBS 12.2

How To Manage Space of The FRA in the Oracle DB