暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
ogg
981
13页
11次
2019-10-22
5墨值下载
1 --创建 ogg 用户
useradd -u 2100 -g oinstall -G dba ogg
passwd ogg
su - ogg
vi .bash_profile
export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH
source .bash_profile
2 下载安装 ogg
mkdir -p /u01/app/ogg
chown -R oracle:oinstall /u01/app/ogg
unzip V34339-01.zip
tar -xvf fbo_ggs_Linux_x64_ora11g_64bit.tar -C /u01/app/ogg/
chown -R oracle:oinstall /u01/app/ogg
登录 OGG 测试
/u01/app/ogg
./ggsci
3 源端和目标端创建 OGG 表空间和 OGG 用户
create tablespace ogg datafile '/u01/app/oracle/oradata/orcl/ogg01.dbf' size 50M
autoextend on;
create user ogg identified by ogg default tablespace ogg;
grant CONNECT, RESOURCE to ogg;
grant SELECT ANY DICTIONARY, SELECT ANY TABLE to ogg;
grant ALTER ANY TABLE to ogg;
grant FLASHBACK ANY TABLE to ogg;
grant EXECUTE on DBMS_FLASHBACK to ogg;
grant insert any table to ogg;
grant update any table to ogg;
grant delete any table to ogg;
源端开归档,开日志补充,开最小附加日志
select NAME,OPEN_MODE,FORCE_LOGGING,SUPPLEMENTAL_LOG_DATA_MIN from v$database;
select LOG_MODE,SUPPLEMENTAL_LOG_DATA_MIN,FORCE_LOGGING from
v$database;
开归档:
shutdown immediate
startup mount
alter database archivelog;
alter database open;
开日志补充:
alter database force logging;
开启开最小附加日志:
alter database add supplemental log data;
再次查看状态:
select LOG_MODE,SUPPLEMENTAL_LOG_DATA_MIN,FORCE_LOGGING from
v$database;
开启 enable_goldengate_replication 参数
开启数据库 GoldenGate 参数(这个参数 OGG12 版本以后需要开启)
alter system set enable_goldengate_replication=true scope=both;
---源端运行 OGG 支持 DDL 脚本
如果要让 OGG 支持 DDL 操作,还需要额外运行几个脚本,这些脚本是 OGG 带的而不是 ORACLE 带的,源
端与目标端都需要
---SYS@ orcl >@/u01/app/ogg/marker_setup.sql
---SYS@ orcl >@/u01/app/ogg/ddl_setup.sql
---SYS@ orcl >@/u01/app/ogg/role_setup.sql
---SYS@ orcl >@/u01/app/ogg/ddl_enable.sql
4 开始进行搭建
源端
4.1 创建 OGG 的管理目录
GGSCI (DSI) 1> create subdirs
Creating subdirectories under current directory /u01/app/ogg
Parameter files /u01/app/ogg/dirprm: already exists
Report files /u01/app/ogg/dirrpt: created
Checkpoint files /u01/app/ogg/dirchk: created
Process status files /u01/app/ogg/dirpcs: created
SQL script files /u01/app/ogg/dirsql: created
Database definitions files /u01/app/ogg/dirdef: created
Extract data files /u01/app/ogg/dirdat: created
Temporary files /u01/app/ogg/dirtmp: created
Stdout files /u01/app/ogg/dirout: created
4.2 建立测试表
SYS@ ogg >@/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlsampl.sql
--源端
SYS@ orcl> conn scott/tiger
Connected.
SCOTT@ orcl >create table emp_ogg as select * from emp;
Table created.
SCOTT@ orcl >create table dept_ogg as select * from dept;
Table created.
SCOTT@ orcl >alter table EMP_OGG add constraint PK_EMPNO_OGG primary key
(EMPNO);
Table altered.
SCOTT@ orcl >alter table DEPT_OGG add constraint PK_DEPTNO_OGG primary key
(DEPTNO);
Table altered.
--目标端
SYS@ ogg >conn scott/tiger
Connected.
SCOTT@ ogg > create table emp_ogg as select * from emp where 1=2;
Table created.
SCOTT@ ogg >create table dept_ogg as select * from dept where 1=2;
Table created.
SCOTT@ ogg >alter table EMP_OGG add constraint PK_EMPNO_OGG primary key (EMPNO);
Table altered.
SCOTT@ ogg >alter table DEPT_OGG add constraint PK_DEPTNO_OGG primary key
(DEPTNO);
Table altered.
4.3 源端添加表级 TRANDATA
GGSCI (DSI) 2> DBLOGIN USERID ogg, PASSWORD ogg
Successfully logged into database.
GGSCI (DSI) 3> add trandata scott.emp_ogg
Logging of supplemental redo log data is already enabled for table
of 13
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜