nickjoIT

Checking swap space: 0 MB available, 150 MB required 본문

DB/oracle

Checking swap space: 0 MB available, 150 MB required

nickjo 2018. 9. 15. 20:52
When creating an Oracle GoldenGate replication, you need to correctly configure the swap space for the machine running Oracle GoldenGate. This is especially important when using the replication "Hub" architecture. In this blog, let's talk about what swap space is, how it impacts Oracle GoldenGate replications, how you can estimate the size of the swap space and how you can add more swap space. 

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
From the Oracle GoldenGate documentation, the operating system must have enough swap space to run Oracle GoldenGate. Oracle recommends a minimum of 512GB for the swap and page file space [2]. Without  proper setup, you will get the following error:
Checking Temp space: must be greater than 120 MB.   Actual 8257 MB    Passed
Checking swap space: 0 MB available, 150 MB required.    Failed <<<<
3. How can you estimate the SWAP space needed by Oracle GoldenGate? 
​To estimate the required swap space, you can:
  1. Start up one Extract or Replicat.
  2. Run GGSCI.
  3. View the report file and find the line PROCESS VM AVAIL FROM OS (min).
  4. Round up the value to the next full gigabyte if needed. For example, round up 1.76GB to 2 GB.
  5. 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
Not that this means all the extract and replicat process processing similar transactions. If not, you need to customized space needed per each process. 

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: 
  1. 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.
  2. 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
  3. Setup the swap file with the command:
    mkswap /swapfile
  4. To enable the swap file immediately but not automatically at boot time:
    swapon /swapfile
  5. To enable it at boot time, edit /etc/fstab to include:
    /swapfile               swap                    swap    defaults        0 0
  6. The next time the system boots, it enables the new swap file.
​After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat /proc/swaps or free. An example setup is shown as follows:
$ 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


'DB > oracle' 카테고리의 다른 글

centos7 oracle 11g r2 설치  (0) 2018.09.12
분석함수의 성능개선 그 결과는  (0) 2017.12.06
CURSOR UPDATE  (0) 2017.05.26
CURSOR FOR LOOP  (0) 2017.05.26
CURSOR LOOP  (0) 2017.05.26
Comments