Sun Solaris UNIX offers a straightforward way to add a swap file/partition on the fly without rebooting the Solaris system.
Solaris add a new swap file for database
First, login as the root user. For example:
$ su -
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
Where,
- -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. Verify it:
# swap -l
OR
# swap -s
Please note that this swap file is slow as compare to your regular raw swap device.
Solaris add swap space in ZFS root setup
List all swap spaces:
# swap -l
# swap -s
Create a new swap space with 4GiB size:
# zfs create -V 4G tank/myswap2
Let us activate it:
# swap -a /dev/zvol/dsk/tank/myswap2
# swap -l
# swap -s
Finally, add an entry for swap volume in the /etc/vfstab file as follows:
# vi /etc/vfstab
Append/edit as follows:
/dev/zvol/dsk/tank/myswap2 - - swap - no -
Conclusion
You learned how to add a new swap file for a database server or any other purpose on Oracle/Sun Solaris Unix operating system using the command-line options. For futher information refer to man pages of swap and mkfile command.
$ man mkfile
$ man swap
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |