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:
CACHEMGR virtual memory values (may have been adjusted) CACHESIZE: 32G CACHEPAGEOUTSIZE (normal): 8M PROCESS VM AVAIL FROM OS (min): 63.97G CACHESIZEMAX (strict force to disk): 48G
Checking Temp space: must be greater than 120 MB. Actual 8257 MB Passed Checking swap space: 0 MB available, 150 MB required. Failed <<<<
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:
mkswap /swapfile - To enable the swap file immediately but not automatically at boot time:
swapon /swapfile - 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.
$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=5242880 5242880+0 records in 5242880+0 records out 5368709120 bytes (5.4 GB) copied, 16.3986 s, 327 MB/s $ sudo mkswap /swapfile Setting up swapspace version 1, size = 5242876 KiB no label, UUID=11f37f70-2590-4a88-bf4d-00592ed4612c $ sudo swapon /swapfile swapon: /swapfile: insecure permissions 0644, 0600 suggested. $ sudo vi /etc/fstab $ cat /proc/swaps Filename Type Size Used Priority /swapfile file 5242876 0 -1 $ swapon -s Filename Type Size Used Priority /swapfile file 5242876 0 -1
- Oracle GoldenGate 12.3 documentation: 18.5 Managing Virtual Memory and Paging
- Oracle GoldenGate 12.3 documentation: 6.18 CACHEMGR