GG 单实例10g 到 11g RAC 搭建配置
目标RAC:
oracle用户
vim .bash_profile
export OGG_HOME=$ORACLE_BASE/ogg
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
exportNLS_LANG=AMERICAN_AMERICA.AL32UTF8
vim /etc/hosts
添加源库的IP地址
172.16.10.140 sdb
oracle用户
vim .bash_profile
export OGG_HOME=$ORACLE_BASE/ogg
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
exportNLS_LANG=AMERICAN_AMERICA.AL32UTF8
vim /etc/hosts
#public network
172.16.15.101 m1
172.16.15.102 m2
172.16.15.103 m3
#private network
10.11.11.1 m1-pri
10.11.11.2 m2-pri
10.11.11.3 m3-pri
#VIP network
172.16.15.104 m1-vip
172.16.15.105 m2-vip
172.16.15.106 m3-vip
#racscan network
172.16.15.100 scan
#source IP
172.16.10.140 sdb
172.16.15.107 qr01-vip
SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;
LOG_MODE SUPPLEME FOR
------------ -------- ---
NOARCHIVELOG NO NO
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Current log sequence 3
SQL> shutdown immediate
由于主数据库之前配置了stream,所以这些设置都已经启用,启用上述几个选项的操作如下,以sysdba身份登录到sqlplus命令行,执行下列命令:
--启动到mount状态:
startup mount;
--置于归档模式:
alter database archivelog;
--强制日志记录:
alter database force logging;
--启用最少附加日志
alter database add supplemental log data;
--启动数据库并查询状态:
SQL> alter database open;
Database altered.
SQL> select log_mode,supplemental_log_data_min,force_logging from v$database; LOG_MODE SUP FOR
------------ --- ---
ARCHIVELOG YES YES
SQL> create user ogg identified by ogg;
User created.
SQL> grant execute on utl_file to ogg ;
Grant succeeded.
SQL> grant dba,resource,connect to ogg ;
Grant succeeded.
SQL> Alter system set recyclebin=off;
System altered.
SQL> show parameter recyclebin
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
recyclebin string OFF
SQL>
上面是源上做的准备工作。
RAC上的准备工作 没有写 文档上都是 为觉得 我还是要写因为 有2中环境。
RAC上:
select log_mode,force_logging,supplemental_log_data_min from v$database;
NO NO
接着
crs_stop ora.mes.db 关闭数据库。
节点一 只是需要在一个节点做就可以了
sqlplus / as sysdba
startup mount
alter database archivelog;
alter database open;
alter system set log_archive_dest_state_1='location=/home/oracle/arch' scope=spfile;
alter system set log_archive_dest_1 ='location=+DATA/ARC1' scope=spfile sid='orcl1';
alter system set log_archive_dest_1 ='location=+DATA/ARC2' scope=spfile sid='orcl2';
show parameter db_recovery
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
ALTER DATABASE FORCE LOGGING;
ALTER SYSTEM SWITCH LOGFILE;
select log_mode,force_logging,supplemental_log_data_min from v$database;
commit;
shutdown immediate
节点一 源上 startup
show parameter name
RAC上:
CREATE USER oggadm2 IDENTIFIED BY pswd2a;
exec
DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE ('OGGADM2','capture',TRUE);
rac上
-----------------------------从下面开始我准备创建ACFS集群文件系统来代替DBFS步骤
sqlplus / as sysasm
1 SQL> alter diskgroup data add volume acfsvol size 1G;
2 Diskgroup altered.
3
4 [root@rac1 ~]# mkdir /sharedisk
5 [root@rac2 ~]# mkdir /sharedisk
6 [root@rac1 ~]# /sbin/mkfs -t acfs -n ACFSVOL1 /dev/asm/acfsvol-53
7 mkfs.acfs: version = 11.2.0.3.0
8 mkfs.acfs: on-disk version = 39.0
9 mkfs.acfs: volume = /dev/asm/acfsvol-53
10 mkfs.acfs: volume size = 1073741824
11 mkfs.acfs: Format complete.
12
13 [root@rac1 ~]# /sbin/acfsutil registry -a -f /dev/asm/acfsvol-53 /sharedisk/
14 acfsutil registry: mount point /sharedisk successfully added to Oracle Registry
15
16 [root@rac1 ~]# mount.acfs -o all
17 [root@rac1 ~]# df -h
18 Filesystem Size Used Avail Use% Mounted on
19 /dev/mapper/VolGroup00-LogVol00
20 93G 19G 70G 21% /
21 /dev/sda1 190M 17M 165M 9% /boot
22 tmpfs 2.0G 1.2G 807M 60% /dev/shm
23 /dev/asm/acfsvol-53 1.0G 39M 986M 4% /sharedisk
24
25 [root@rac2 ~]# mount.acfs -o all
26 [root@rac2 ~]# df -h
27 Filesystem Size Used Avail Use% Mounted on
28 /dev/mapper/VolGroup00-LogVol00
29 93G 12G 77G 14% /
30 /dev/sda1 99M 17M 78M 18% /boot
31 tmpfs 2.0G 1.2G 807M 60% /dev/shm
32 /dev/asm/acfsvol-53 1.0G 73M 952M 8% /sharedisk
33
34 [root@rac1 ~]# /sbin/acfsutil info fs
35 /sharedisk
36 ACFS Version: 11.2.0.3.0
37 flags: MountPoint,Available
38 mount time: Wed Feb 20 12:11:52 2013
39 volumes: 1
40 total size: 1073741824
41 total free: 998002688
42 primary volume: /dev/asm/acfsvol-53
43 label: ACFSVOL1
44 flags: Primary,Available,ADVM
45 on-disk version: 39.0
46 allocation unit: 4096
47 major, minor: 252, 27137
48 size: 1073741824
49 free: 998002688
50 ADVM diskgroup DATA
51 ADVM resize increment: 33554432
52 ADVM redundancy: unprotected
53 ADVM stripe columns: 4
54 ADVM stripe width: 131072
55 number of snapshots: 0
56 snapshot space usage: 0
57 replication status: DISABLED
[root@m1 mnt]# chown oracle.oinstall /acfs/ -R
RAC节点:
[oracle@m1 ~]$ echo $OGG_HOME
/u01/oracle/ogg
[oracle@m1 ~]$ cd $ORACLE_HOME
[oracle@m1 db]$ pwd
/u01/oracle/11.2.3/db
[oracle@m1 db]$ cd $ORACLE_BASE
[oracle@m1 oracle]$ pwd
/u01/oracle
[oracle@m1 oracle]$ mkdir ogg
[oracle@m1 oracle]$ cd $OGG_HOME
[oracle@m1 ogg]$ pwd
/u01/oracle/ogg
[oracle@m1 ogg]$ 使用ftp上传数据到这上面 ogg112101_fbo_ggs_Linux_x64_ora11g_64bit
unzip ogg112101_fbo_ggs_Linux_x64_ora11g_64bit
tar -xvf fbo_ggs_Linux_x64_ora11g_64bit.tar
源上同样建立ogg目录。
RAC上:
cd $OGG_HOME
cp ./dirprm/jagent.prm jagent.backup
rm -rf dirprm
mkdir /acfs/acfs_sm/ogg -p
mkdir /acfs/acfs_sm/ogg/dirprm
mkdir /acfs/acfs_sm/ogg/dirpcs
mkdir /acfs/acfs_sm/ogg/dirchk
mkdir /acfs/acfs_big/ogg -p
mkdir /acfs/acfs_big/ogg/dirdat
ln -s /acfs/acfs_sm/ogg/dirprm$OGG_HOME/dirprm
ln -s /acfs/acfs_sm/ogg/dirpcs$OGG_HOME/dirpcs
ln -s /acfs/acfs_sm/ogg/dirchk$OGG_HOME/dirchk
./ggsci
create subdirs
GGSCI (m1) 2> exit
[oracle@m1 ogg]$ mv jagent.prm.bak /acfs/acfs_sm/ogg/dirprm/jagent.prm
[oracle@m1 ogg]$ cd dirprm/
[oracle@m1 dirprm]$ ll
total 4
-rwxr-x--- 1 oracle oinstall 53 Dec 12 14:23 jagent.prm
[oracle@m1 dirprm]$ pwd
/u01/oracle/ogg/dirprm
其他节点上:
cd $OGG_HOME
cp ./dirprm/jagent.prm jagent.backup
rm -rf dirprm
ln -s /acfs/acfs_sm/ogg/dirprm$OGG_HOME/dirprm
ln -s /acfs/acfs_sm/ogg/dirpcs$OGG_HOME/dirpcs
ln -s /acfs/acfs_sm/ogg/dirchk$OGG_HOME/dirchk
./ggsci
create subdirs
GGSCI (m1) 2> exit
[oracle@m1 ogg]$ mv jagent.prm.bak /acfs/acfs_sm/ogg/dirprm/jagent.prm
[oracle@m1 ogg]$ cd dirprm/
[oracle@m1 dirprm]$ ll
total 4
-rwxr-x--- 1 oracle oinstall 53 Dec 12 14:23 jagent.prm
[oracle@m1 dirprm]$ pwd
/u01/oracle/ogg/dirprm
一定要按照上面的步骤来。
源上:
cd $OGG_HOME
vim startup.oby
DBLogin UserID oggadm1@sdb, Password pswd1a
Start Mgr
Info Mgr
Info CheckpointTable
(exit每次退出去之后,就需要dblogin)
vim GLOBALS (大写)不要写成小写
CheckpointTable oggadm1.oggchkpt
GGSCHEMA ogg
./gggsci
create subdirs
edit param mgr
Port 15001
PurgeOldExtracts ./dirdat/*, UseCheckpoints
Obey startup.oby
RAC节点上:
cd $OGG_HOME
vim startup.oby
DBLogin UserID oggadm2@mes, Password pswd2a
Start Mgr
Info Mgr
Info CheckpointTable
vim GLOBALS
CheckpointTable oggadm2.oggchkpt
/ggsci
edit param mgr
Port15002
Autostart ER *
AutoRestart ER *
PurgeOldExtracts ./dirdat/*, UseCheckpoints
obey startup.oby
exit
其他节点上:
vim startup.oby
DBLogin UserID oggadm2@mes, Password pswd2a
Start Mgr
Info Mgr
Info CheckpointTable
vim GLOBALS
CheckpointTable oggadm2.oggchkpt
源上:
ogg下
@marker_setup.sql
@ddl_setup.sql
@role_setup.sql
grant ggs_ggsuser_role to ogg;
@ddl_enable.sql
@?/rdbms/admin/dbmspool.sql
@ddl_pin.sql ogg