The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.

18.2.3 Creating and Using a Swap Partition

To create and use a swap partition:

  1. Use fdisk to create a disk partition of type 82 (Linux swap) or parted to create a disk partition of type linux-swap of the size that you require.

  2. Initialize the partition (for example, /dev/sda2) as a swap partition:

    # mkswap /dev/sda2
  3. Enable swapping to the swap partition:

    # swapon /swapfile
  4. Add an entry to /etc/fstab for the swap partition so that the system uses it following the next reboot:

    /dev/sda2       swap       swap       defaults       0 0