安装goldengate在centos5_64
如果当前主机是生产主机,需要创建目录挂载镜像nfs:
用root 创建:mkdir -p /archive2
赋予权限:
Chown -R oracle:dba /archive2 修改当前目录或文件的属主为oracle及dba组;
Chmod -R 755 /archive2 修改当前目录及其下面的文件的读写权限为755,即只有oracle拥有写权限;
改变此目录为oracle用户所有;
执行挂载命令:
Mount 192.168.128.130:/archivelog/arch2
其中192.168.128.130是本地镜像主机,提供nfs服务;
[root@localhost oracle]# mount 192.168.128.130:/archivelog/arch2 /archive2
[root@localhost oracle]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
75G 11G 61G 15% /
/dev/sda1 99M 13M 82M 14% /boot
tmpfs 760M 380M 381M 50% /dev/shm
192.168.128.130:/archivelog/arch2
76G 4.8G 67G 7% /archive2
使用oracle账户登录,
SQL> conn /as sysdba;
Connected to an idle instance.
SQL> archive log list;
ORA-01012: not logged on
SQL> startup
ORACLE instance started.
Total System Global Area 634679296 bytes
Fixed Size 2216024 bytes
Variable Size 406851496 bytes
Database Buffers 218103808 bytes
Redo Buffers 7507968 bytes
Database mounted.
Database opened.
查看是否打开归档模式
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 8
Current log sequence 10
开启归档模式
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 634679296 bytes
Fixed Size 2216024 bytes
Variable Size 406851496 bytes
Database Buffers 218103808 bytes
Redo Buffers 7507968 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
设置第二归档目录参数
SQL> alter system set log_archive_dest_2=’location=/archive_2 OPTIONAL’ scope=spfile;
System altered.
SQL> alter system archive log start to log_archive_dest_2;
System altered.
验证第二归档设置生效
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 8
Next log sequence to archive 10
Current log sequence 10
SQL> show parameter archive
NAME TYPE
———————————— ———————————
VALUE
——————————
archive_lag_target integer
0
log_archive_config string
log_archive_dest string
log_archive_dest_1 string
log_archive_dest_10 string
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_11 string
log_archive_dest_12 string
log_archive_dest_13 string
log_archive_dest_14 string
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_15 string
log_archive_dest_16 string
log_archive_dest_17 string
log_archive_dest_18 string
log_archive_dest_19 string
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_2 string
log_archive_dest_20 string
log_archive_dest_21 string
log_archive_dest_22 string
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_23 string
log_archive_dest_24 string
log_archive_dest_25 string
log_archive_dest_26 string
log_archive_dest_27 string
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_28 string
log_archive_dest_29 string
log_archive_dest_3 string
log_archive_dest_30 string
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_31 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string
enable
log_archive_dest_state_10 string
enable
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_state_11 string
enable
log_archive_dest_state_12 string
enable
log_archive_dest_state_13 string
enable
log_archive_dest_state_14 string
enable
log_archive_dest_state_15 string
NAME TYPE
———————————— ———————————
VALUE
——————————
enable
log_archive_dest_state_16 string
enable
log_archive_dest_state_17 string
enable
log_archive_dest_state_18 string
enable
log_archive_dest_state_19 string
enable
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_state_2 string
enable
log_archive_dest_state_20 string
enable
log_archive_dest_state_21 string
enable
log_archive_dest_state_22 string
enable
log_archive_dest_state_23 string
NAME TYPE
———————————— ———————————
VALUE
——————————
enable
log_archive_dest_state_24 string
enable
log_archive_dest_state_25 string
enable
log_archive_dest_state_26 string
enable
log_archive_dest_state_27 string
enable
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_state_28 string
enable
log_archive_dest_state_29 string
enable
log_archive_dest_state_3 string
enable
log_archive_dest_state_30 string
enable
log_archive_dest_state_31 string
NAME TYPE
———————————— ———————————
VALUE
——————————
enable
log_archive_dest_state_4 string
enable
log_archive_dest_state_5 string
enable
log_archive_dest_state_6 string
enable
log_archive_dest_state_7 string
enable
NAME TYPE
———————————— ———————————
VALUE
——————————
log_archive_dest_state_8 string
enable
log_archive_dest_state_9 string
enable
log_archive_duplex_dest string
log_archive_format string
%t_%s_%r.dbf
log_archive_local_first boolean
NAME TYPE
———————————— ———————————
VALUE
——————————
TRUE
log_archive_max_processes integer
4
log_archive_min_succeed_dest integer
1
log_archive_start boolean
FALSE
log_archive_trace integer
0
NAME TYPE
———————————— ———————————
VALUE
——————————
standby_archive_dest string
?/dbs/arch
SQL> alter system switch logfile;
System altered.
启用数据库级的minimal supplemental logging(最小附加日志)
SQL> alter database add supplemental log data;
Database altered.
确认goldengate版本可以安装在生产端
[oracle@localhost ~]$ ll ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
-rw-r–r– 1 oracle oracle 205096960 01-29 16:49 ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
将goldengate安装到oracle base目录下,由于是绿色软件,只须解压到新建目录:
[oracle@localhost ~]$ cd $ORACLE_BASE
[oracle@localhost oracle]$ ls
admin cfgtoollogs checkpoints diag flash_recovery_area oradata oradiag_oracle oraInventory product
[oracle@localhost oracle]$ mkdir goldengate
[oracle@localhost oracle]$ ls
admin cfgtoollogs checkpoints diag flash_recovery_area goldengate oradata oradiag_oracle oraInventory product
解压缩ftp到oracle根目录下的goldengate压缩包到goldengate目录:
[oracle@localhost oracle]$ cd goldengate
[oracle@localhost goldengate]$ ls
[oracle@localhost goldengate]$ tar xvf ~/ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
确认goldengate目录权限正确
[oracle@localhost oracle]$ ll
总计 72
drwxr-x— 3 oracle oracle 4096 01-18 14:15 admin
drwxr-xr-x 5 oracle oracle 4096 01-18 14:30 cfgtoollogs
drwxr-xr-x 2 oracle oracle 4096 01-18 15:02 checkpoints
drwxrwxr-x 4 oracle oracle 4096 01-18 14:16 diag
drwxr-x— 4 oracle oracle 4096 01-18 14:20 flash_recovery_area
drwxrwxr-x 3 oracle oracle 4096 01-29 16:59 goldengate
drwxr-x— 3 oracle oracle 4096 01-18 14:15 oradata
drwxrwxr-x 3 oracle oracle 4096 01-29 10:37 oradiag_oracle
drwxr-xr-x 2 oracle oinstall 4096 01-18 13:29 oraInventory
drwxr-xr-x 3 oracle oracle 4096 01-18 13:59 product
调整为oinstall组,
[oracle@localhost oracle]$ chown oracle:oinstall goldengate
[oracle@localhost oracle]$ ll
总计 72
drwxr-x— 3 oracle oracle 4096 01-18 14:15 admin
drwxr-xr-x 5 oracle oracle 4096 01-18 14:30 cfgtoollogs
drwxr-xr-x 2 oracle oracle 4096 01-18 15:02 checkpoints
drwxrwxr-x 4 oracle oracle 4096 01-18 14:16 diag
drwxr-x— 4 oracle oracle 4096 01-18 14:20 flash_recovery_area
drwxrwxr-x 3 oracle oinstall 4096 01-29 16:59 goldengate
drwxr-x— 3 oracle oracle 4096 01-18 14:15 oradata
drwxrwxr-x 3 oracle oracle 4096 01-29 10:37 oradiag_oracle
drwxr-xr-x 2 oracle oinstall 4096 01-18 13:29 oraInventory
drwxr-xr-x 3 oracle oracle 4096 01-18 13:59 product
确认环境变量正确:
[oracle@localhost oracle]$ vi ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11g/db_1
ORACLE_SID=orcl
NLS_LANG=AMERICAN_AMERICA.UTF8
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID NLS_LANG PATH
添加环境变量,注意环境变量里不能有不存在的目录
[oracle@localhost oracle]$ vi ~/.bash_profile
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
# LD_LIBRARY_PATH_64=$ORACLE_HOME/lib
# export LD_LIBRARY_PATH_64
PATH=$ORACLE_BASE/goldengate:$PATH
export PATH
为了获取高可用性,golden gate最好安装与共享阵列,可以随集群软件切换到备用节点;
复制软件所在目录的空余空间建议保留相当于数据库归档日志量3-7天的存储空间;
复制软件安装目录可位于任何位置;
声明: 除非转自他站(如有侵权,请联系处理)外,本文采用 BY-NC-SA 协议进行授权 | 嗅谱网
转载请注明:转自《安装goldengate在centos5_64》
本文地址:http://www.xiupu.net/archives-474.html
关注公众号:
微信赞赏
支付宝赞赏