Solaris add a new swap file for database

www.lau‮oc.irutt‬m
Solaris add a new swap file for database

To add a new swap file for a database in Solaris, you will need to follow these steps:

  1. Create a new swap file. Use the dd command to create a new swap file. Specify the size of the swap file and the name of the file as arguments.

For example, to create a 1GB swap file named /swapfile, you can use the following command:

dd if=/dev/zero of=/swapfile bs=1M count=1024
  1. Set the file permissions. Use the chmod command to set the file permissions of the swap file to 600.
chmod 600 /swapfile
  1. Set up the swap file. Use the mkswap command to set up the swap file. Specify the name of the swap file as an argument.
mkswap /swapfile
  1. Enable the swap file. Use the swapon command to enable the swap file. Specify the name of the swap file as an argument.
swapon /swapfile
  1. Add the swap file to /etc/vfstab. Open the /etc/vfstab file in a text editor, and add the following line to the end of the file:
/swapfile   -   swap    -   -

This will ensure that the swap file is enabled every time the system is booted.

Created Time:2017-10-30 14:27:19  Author:lautturi