Golden Gate配置实例:RHEL 4.7下的Oracle 10g RAC到单实例的单向同步
Golden Gate配置实例:RHEL 4.7下的Oracle 10g RAC到单实例的单向同步
环境
rac1 rac2: RHEL 4u7 + Oracle 10.2.0.4 + ASM
rac1 外网IP 192.168.47.241 虚拟IP 192.168.47.243
rac2 外网IP 192.168.47.242 虚拟IP 192.168.47.244
目标端是一个单机
ggdb: RHEL 4u7 + ORACLE 10.2.0.4 + ASM
IP: 192.168.47.211
两台主机均已创建数据库,sid分别为oradb 和 dyggdb
配置oradb 到 dyggdb的数据同步
goldengate版本11.1.1.0
将rac1配置为NTP服务器
rac1:
修改配置文件。配置一个server指向自己
cat>/etc/ntp.confrestrict default nomodify notrap noquery
restrict 127.0.0.1
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
server 192.168.47.241
server 127.127.1.0
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
keys /etc/ntp/keys
EOF
启动ntpd服务
service ntpd restart
chkconfig --level 345 ntpd on
rac2:
rac2上的操作与rac1类似,不同的是配置的server指向rac1
cat>/etc/ntp.confrestrict default nomodify notrap noquery
restrict 127.0.0.1
server 0.rhel.pool.ntp.org
server 1.rhel.pool.ntp.org
server 2.rhel.pool.ntp.org
server 192.168.47.241
fudge 192.168.47.241 stratum 10
driftfile /var/lib/ntp/ntp.drift
broadcastdelay 0.008
keys /etc/ntp/keys
EOF
service ntpd restart
chkconfig --level 345 ntpd on
需要注意的是,配置完ntp后大概需要5-10分钟的时候,才会开始进行同步。可以通过ntpq -p 命令来查看
[root@rac1 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
rac1 .INIT. 16 u - 64 0 0.000 0.000 4000.00
*LOCAL(0) LOCAL(0) 10 l 30 64 377 0.000 0.000 0.001
[root@rac2 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
rac1 LOCAL(0) 11 u 9 64 1 0.187 0.072 0.001
源端和目标端之间的时间同步则不是那么重要。可以在目标端手动对时间进行一次同步(目标端的ntpd服务没有启动),并将同步后的系统时间写入bios
[root@ggdb ~]# ntpdate 192.168.47.241
8 Dec 15:40:20 ntpdate[8311]: adjust time server 192.168.47.241 offset 0.003007 sec
[root@ggdb ~]# /sbin/hwclock -w
如果不能成功,可以在ntpdate命令中加上-d参数来排查具体原因
useradd -g oinstall -G dba goldengate
passwd goldengate
配置资源限制:
官方建议尽可能将资源限制放开,其实我们可以根据具体情况进行配置,但不能设得太小
cat >>/etc/security/limits.confgoldengate soft memlock 3145728
goldengate hard memlock 3145728
goldengate soft nproc 200
goldengate hard nproc 1024
goldengate soft stack -
goldengate hard stack -
goldengate soft fsize -
goldengate hard fsize -
EOF
以下的在rac1上做就可以了
这里有一个分区/dev/sdg1,可以被rac1和rac2访问。我们将其格式化ext3文件系统,并挂载到rac1上(在正常情况下,我们在rac1上启动extract进程):
[root@rac1 ~]# mkfs.ext3 /dev/sdg1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
12500992 inodes, 24993115 blocks
1249655 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
763 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@rac1 ~]#
挂载到rac1的/opt/gg下:
[root@rac1 ~]# mkdir /opt/gg
[root@rac1 ~]# mount /dev/sdg1 /opt/gg
然后在rac1中配置开机自动挂载(这一步不要在rac2上做):
echo "mount /dev/sdg1 /opt/gg" >> /etc/rc.local
目标端
mkdir /opt/gg
在源端和目标端上,赋予goldengate用户/opt/gg目录的使用权限
chown -R goldengate:oinstall /opt/gg
chmod -R 775 /opt/gg

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In Go, WebSocket messages can be sent using the gorilla/websocket package. Specific steps: Establish a WebSocket connection. Send a text message: Call WriteMessage(websocket.TextMessage,[]byte("Message")). Send a binary message: call WriteMessage(websocket.BinaryMessage,[]byte{1,2,3}).

Memory leaks can cause Go program memory to continuously increase by: closing resources that are no longer in use, such as files, network connections, and database connections. Use weak references to prevent memory leaks and target objects for garbage collection when they are no longer strongly referenced. Using go coroutine, the coroutine stack memory will be automatically released when exiting to avoid memory leaks.

In Go, the function life cycle includes definition, loading, linking, initialization, calling and returning; variable scope is divided into function level and block level. Variables within a function are visible internally, while variables within a block are only visible within the block.

In Go, you can use regular expressions to match timestamps: compile a regular expression string, such as the one used to match ISO8601 timestamps: ^\d{4}-\d{2}-\d{2}T \d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-][0-9]{2}:[0-9]{2})$ . Use the regexp.MatchString function to check if a string matches a regular expression.

Go and the Go language are different entities with different characteristics. Go (also known as Golang) is known for its concurrency, fast compilation speed, memory management, and cross-platform advantages. Disadvantages of the Go language include a less rich ecosystem than other languages, a stricter syntax, and a lack of dynamic typing.

View Go function documentation using the IDE: Hover the cursor over the function name. Press the hotkey (GoLand: Ctrl+Q; VSCode: After installing GoExtensionPack, F1 and select "Go:ShowDocumentation").

Writing clear and comprehensive documentation is crucial for the Golang framework. Best practices include following an established documentation style, such as Google's Go Coding Style Guide. Use a clear organizational structure, including headings, subheadings, and lists, and provide navigation. Provides comprehensive and accurate information, including getting started guides, API references, and concepts. Use code examples to illustrate concepts and usage. Keep documentation updated, track changes and document new features. Provide support and community resources such as GitHub issues and forums. Create practical examples, such as API documentation.

Unit testing concurrent functions is critical as this helps ensure their correct behavior in a concurrent environment. Fundamental principles such as mutual exclusion, synchronization, and isolation must be considered when testing concurrent functions. Concurrent functions can be unit tested by simulating, testing race conditions, and verifying results.
