Solaris add a new swap file for database

Q. I am running out of swap space due to Oracle database. This is a production server. How do I add a new swap file or area that doesn’t demand a reboot of the system?


A. Sun Solaris UNIX offers very easy way to add swap file or space on fly without rebooting Solaris system.

Login as the root user

Type the following command to create swap file. It creates file that are suitable for use as NFS- mounted swap areas.
# mkfile -v 2g tmp-swap.file

-v : Report the names and sizes of created files (verbose)
2g : 2Gbyte file size.

Now turn on or add the new swap file to the Solaris UNIX swap area:
# swap -a tmp-swap.file

The swap command provides a method of adding, deleting, and monitoring the system swap areas used by the memory manager.

This will do the job. Please note that this swap file is slow as compare to your regular raw swap device.

For more information refer to man pages of swap and mkfile command.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.