goldengate施工文档

Goldengate施工文档(生产库部分)

按照此文档施工需求:

1. 镜像库需要安装oracle数据库,字符集为utf8

2. 施工介质------(ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar)需要上传至镜像服务器/u01/app/upload目录下。并授权给oracle用户

第一步:准备工作

登录生产服务器:

1. 检查环境变量

[root@localhost ~]# su - oracle

[oracle@localhost ~]$ vi .bash_profile -------------------------编辑oracle用户的环境变量配置文件 # .bash_profile

# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11g/db_1 export ORACLE_SID=orcl

export NLS_LANG=AMERICAN_AMERICA.al32UTF8 export PATH=$PATH:$ORACLE_HOME/bin export LANG=zh_CN.UTF-8

export PATH=$PATH:$ORACLE_BASE/goldengate export

LD_LIBRARY_PATH=$ORACLE_BASE/goldengate:$LD_LIBRARY_PATH :$ORACLE_HOME/lib

主要查看蓝色字体部分,没有的话添加上!光标用上下键移动至文件末尾,摁i键进入编辑模式,摁Enter键换行,然后输入上面的蓝色字体部分,最后摁Esc键,然后输入:wq!再摁回车键保存退出

2. 检查数据库是否开启归档

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Mar 19 20:42:59 2012

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> archive log list;-----------------------------------------------(查看是否开启归档) Database log mode Archive Mode----------------------------(归档模式) Automatic archival Enabled

Archive destination /archive-----------------------------(归档日志路径,牢记,后面会用到)

Oldest online log sequence 10 Next log sequence to archive 12 Current log sequence 12

SQL> archive log list;

Database log mode No Archive Mode----------------------------(非归档模式) Automatic archival Disabled

Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 7 Current log sequence 9

若数据库为非归档模式,当联系当地数据库管理员开启归档模式!

附(开启归档命令): 设置为归档模式 SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@localhost ~]$ exit logout

[root@localhost ~]# mkdir /archive

[root@localhost ~]# chown oracle:oinstall /archive [root@localhost ~]# su - oracle

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 20 21:41:19 2012

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show parameter log

SQL> alter system set log_archive_dest_1='location=/archive' scope=spfile; SQL> alter system set log_archive_format='%s_%t_%r.arc' scope=spfile;

SQL> shutdown immediate ----------- 一致性停库(切记联系当地数据库管理员,取得同意方可停库)

SQL> startup mount

SQL> alter database archivelog ; SQL> alter database open; SQL> alter system switch logfile;

第二步:安装goldengate软件

1. 创建goldengate数据库用户

SQL> select name from v$datafile;

NAME

-------------------------------------------------------------------------------- /u01/app/oracle/oradata/orcl/system01.dbf /u01/app/oracle/oradata/orcl/sysaux01.dbf /u01/app/oracle/oradata/orcl/undotbs01.dbf /u01/app/oracle/oradata/orcl/users01.dbf /u01/app/oracle/oradata/orcl/example01.dbf /u01/app/oracle/oradata/orcl/test1.dbf /u01/app/oracle/oradata/orcl/test2.dbf

SQL> CREATE SMALLFILE TABLESPACE \/u01/app/oracle/oradata/orcl/ggs.dbf' SIZE 200M;---------------------------------------(注意蓝色字体部分的路径必须和上面查出来的保持一致) SQL> create user GGMGR identified by oracle default tablespace GGS; SQL>grant connect to ggmgr; SQL>grant resource to ggmgr;

SQL>grant CREATE SESSION, ALTER SESSION to ggmgr;

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4