1. What is SWAP space?
Swap space is located on hard drives to provide additional memory when the physical memory (RAM) is full.
2. How does Oracle GoldenGate use the SWAP space?
Because Oracle GoldenGate only writes committed transaction to the trail files, all of the uncommitted transactions are cached in memory. The cache requires both the physical memory (RAM) and virtual memory (SWAP space). The cache can be configured with the Oracle GoldenGate CACHEMGR (128 GB by default) parameter. The following is an example content from Oracle GoldenGate report file for the CACHE related information:
To estimate the required swap space, you can:
- Start up one Extract or Replicat.
- Run GGSCI.
- View the report file and find the line PROCESS VM AVAIL FROM OS (min).
- Round up the value to the next full gigabyte if needed. For example, round up 1.76GB to 2 GB.
- Multiply that value by the number of extract and replicat processes that will be running. The result is the maximum amount of swap space that could be required
4. How to add SWAP space for Oracle GoldenGate?
The following is an example instruction on how to add the SWAP space on an AWS EC2 instance running on LINUX:
- Determine the size of the new swap file in megabytes and multiple by 1024 to determine the block size.
For example, the block size of a 5GB swap file is 5242880.
- At a shell prompt as root, type the following command with count being equal to the desired block size:
dd if=/dev/zero of=/swapfile bs=1024 count=5242880
- Setup the swap file with the command:
- To enable the swap file immediately but not automatically at boot time:
- To enable it at boot time, edit /etc/fstab to include:
/swapfile swap swap defaults 0 0
- The next time the system boots, it enables the new swap file.