Zero Downtime Upgrade of Oracle 10g to Oracle 11g Using GoldenGate — 2
Prepare 10g Database for OGG
Create GGS and GGS_MON Database Users
SQL> create tablespace ggs_tbs datafile '/u01/app/oracle/oradata/zwc/gg_tbs01.dbf' size 100M;
Tablespace created.
SQL> create user ggs identified by ggs default tablespace ggs_tbs temporary tablespace temp;
User created.
SQL> grant dba to ggs;
Grant succeeded.
SQL> create user ggs_mon identified by ggs_mon default tablespace ggs_tbs temporary tablespace temp;
User created.
SQL> grant connect,resource to ggs_mon;
Grant succeeded.
Enable Database Level Supplemental Logging
SQL> select name,supplemental_log_data_min from v$database;
NAME SUPPLEME
——— ——–
ZWC NO
SQL> alter database add supplemental log data;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> select name,supplemental_log_data_min from v$database;
NAME SUPPLEME
——— ——–
ZWC YES
Enable Force Logging
SQL> select force_logging from v$database;
FOR
—
NO
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 281018368 bytes
Fixed Size 2083336 bytes
Variable Size 155190776 bytes
Database Buffers 117440512 bytes
Redo Buffers 6303744 bytes
Database mounted.
SQL> alter database force logging;
Database altered.
SQL> alter database open;
Database altered.
SQL> select force_logging from v$database;
FOR
—
YES
Check Table-Level Supplemental Logging
SQL> select t.owner,
2 t.tbl_cnt,
3 s.sup_log_grp_cnt,
4 t.tbl_cnt – s.sup_log_grp_cnt "Diff"
5 from (select owner, count(*) tbl_cnt from dba_tables group by owner) t,
6 (select owner, count(*) sup_log_grp_cnt
7 from dba_log_groups
8 group by owner) s
9 where t.owner = s.owner(+)
10 and t.owner in ('HR', 'OE', 'PM');
OWNER TBL_CNT SUP_LOG_GRP_CNT Diff
—– ———- ————— ———-
HR 7
PM 2
OE 12
If you are planning to use sqlplus then you can use commands like:
alter database <table_name> add supplemental log data (all) columns;
alter database <table_name> add supplemental log data (primary key) columns;
For this demo,we will use Oracle GoldenGate command interface to add table level supplemental logging.The command from ggsci interface is "add trandata <table_name>".
[oracle@zwc ggs]$ sqlplus ggs
SQL*Plus: Release 10.2.0.4.0 – Production on Thu Jun 5 22:01:53 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> spool add_trandata.oby
SQL> set linesize 150 pagesize 0 feedback off
SQL> spool add_missing_trandata.oby
SQL> select 'add trandata ' || t.owner || '.' || t.table_name stmt
2 from (select owner, table_name from dba_tables) t,
3 (select owner, table_name from dba_log_groups) s
4 where t.owner = s.owner(+)
5 and t.table_name = s.table_name(+)
6 and s.table_name is null
7 and t.owner in ('HR', 'OE', 'PM');
add trandata HR.REGIONS
add trandata HR.LOCATIONS
add trandata HR.DEPARTMENTS
add trandata HR.JOBS
add trandata OE.WAREHOUSES
add trandata OE.ORDER_ITEMS
add trandata OE.ORDERS
add trandata OE.PRODUCT_INFORMATION
add trandata OE.PROMOTIONS
add trandata OE.SYS_IOT_OVER_52810
add trandata OE.SYS_IOT_OVER_52815
add trandata OE.PRODUCT_REF_LIST_NESTEDTAB
add trandata OE.SUBCATEGORY_REF_LIST_NESTEDTAB
add trandata HR.COUNTRIES
add trandata PM.ONLINE_MEDIA
add trandata PM.PRINT_MEDIA
add trandata OE.CUSTOMERS
add trandata HR.JOB_HISTORY
add trandata OE.PRODUCT_DESCRIPTIONS
add trandata OE.INVENTORIES
add trandata HR.EMPLOYEES
SQL> spool off
[oracle@zwc ggs]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.6 16211226 OGGCORE_11.2.1.0.6_PLATFORMS_130418.1829_FBO
Linux, x64, 64bit (optimized), Oracle 10g on Apr 18 2013 22:43:23
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
GGSCI (zwc) 1> dblogin userid ggs password ggs
Successfully logged into database.
GGSCI (zwc) 2> obey ./diroby/add_missing_trandata.oby
GGSCI (zwc) 3> add trandata HR.REGIONS
Logging of supplemental redo data enabled for table HR.REGIONS.
GGSCI (zwc) 4> add trandata HR.LOCATIONS
Logging of supplemental redo data enabled for table HR.LOCATIONS.
GGSCI (zwc) 5> add trandata HR.DEPARTMENTS
Logging of supplemental redo data enabled for table HR.DEPARTMENTS.
GGSCI (zwc) 6> add trandata HR.JOBS
Logging of supplemental redo data enabled for table HR.JOBS.
GGSCI (zwc) 7> add trandata OE.WAREHOUSES
SQL> select t.owner,
2 t.tbl_cnt,
3 s.sup_log_grp_cnt,
4 t.tbl_cnt – s.sup_log_grp_cnt "Diff"
5 from (select owner, count(*) tbl_cnt from dba_tables group by owner) t,
6 (select owner, count(*) sup_log_grp_cnt
7 from dba_log_groups
8 group by owner) s
9 where t.owner = s.owner(+)
10 and t.owner in ('HR', 'OE', 'PM');
OWNER TBL_CNT SUP_LOG_GRP_CNT Diff
—————————— ———- ————— ———-
HR 7 7 0
OE 12 8 4
PM 2 2 0
Create Tables for Heartbeat
SQL> create table ggs_mon.ggs_heartbeat(id number,ts date);
Table created.
SQL> insert into ggs_mon.ggs_heartbeat values(1,sysdate);
1 row created.
SQL> commit;
Commit complete.
SQL> create table ggs_mon.ggs_lagtime
2 (id number,
3 ts date,
4 committime date,
5 groupname varchar2(8),
6 host varchar2(60),
7 local_insert_time date);
Table created.
版权声明:本文博主原创文章,博客,未经同意不得转载。
Zero Downtime Upgrade of Oracle 10g to Oracle 11g Using GoldenGate — 2的更多相关文章
- Oracle 10g AND Oracle 11g手工建库案例--Oracle 11g
Oracle 10g AND Oracle 11g手工建库案例--Oracle 11g 系统环境: 操作系统: RedHat EL6 Oracle: Oracle 10g and Oracle 11 ...
- Oracle 10g AND Oracle 11g手工建库案例--Oracle 10g
Oracle 10g AND Oracle 11g手工建库案例--Oracle 10g 系统环境: 操作系统: RedHat EL6 Oracle: Oracle 10g and Oracle 11 ...
- Zero Downtime Upgrade of Oracle 10g to Oracle 11g Using GoldenGate — 3
DDL Setup Steps SQL> grant execute on utl_file to ggs; Grant succeeded. Create GLOBALS file [orac ...
- Zero Downtime Upgrade of Oracle 10g to Oracle 11g Using GoldenGate — 4
Target Side Setup Install OGG on Target Side Creates required directories for OGG [oracle@vzwc1 ggs] ...
- Zero Downtime Upgrade of Oracle 10g to Oracle 11g Using GoldenGate — 1
Source Database DB Name: zwc Schemas: HR,OE,PM Version: 10.2.0.4 RAC: ...
- oracle 10g升级到11g
Linux 上Oracle RAC 10g 升级到 Oracle RAC 11g 了解如何在 Oracle Enterprise Linux 5 上逐步将 Oracle RAC 10g 第 2 版升级 ...
- Oracle 10g ORA-01034: ORACLE not available 错误
今天在开发系统的时候,刚开始还好好的,突然就遇到了一个错误 ORA-01034: ORACLE not available 感到莫名其妙.然后排查问题 监听器ok,各项服务ok. 最后解决办法如下: ...
- oracle数据库的迁移(从一台服务器到另一个台服务器,从oracle 10g到oracle 11g)
这个过程呢,还是蛮艰难的.... 一.最初我使用的是Navicat中的数据传输来迁移的,虽说整个数据库的迁移没有成功,但传输指定的对象时还是传输成功了.所以还是记录一下吧. 1.前提连接好数据库.在指 ...
- RHEL6 64位系统安装ORACLE 10g 64bit 数据库
记得去年4月份的时候,为公司部署测试环境和UAT环境时,在红帽RHEL6 64位系统安装ORACLE 10g 64位数据库时遇到了许多小问题,当时匆匆忙忙也没记录一下这些问题,前几天在虚拟机安装ORA ...
随机推荐
- hibernate jpa 2.0 报错Hibernate cannot unwrap interface java.sql.Connection
今天在做报表的时候,利用Hibernate JPA 2.0需要获取数据库连接com.sql.Connection的时候获取不到,网上说用这种方式解决: entityManager.getTransac ...
- LDA-线性判别分析(四)
本来是要调研 Latent Dirichlet Allocation 的那个 LDA 的, 没想到查到很多关于 Linear Discriminant Analysis 这个 LDA 的资料.初步看了 ...
- 练习使用jquery.并将验证强度的功能加到注册页面中
- Visual Studio .NET、.NET Framework和C#之间的联系
Visual Studio .NET是一种集成开发环境(IDE),它包含3种高级程序设计语言,C#就是其中的一种:Visual Studio .NET之所以能把这三种语言有机结合起来并具有与平台无关的 ...
- (转) 制作 Clonezilla live 启动盘
GNU/Linux Method A: Tuxboot 下載 GNU/Linux 版本使用的 Tuxboot 在您的環境 在 GNU/Linux 下, 請依 指示 來執行 Tuxboot 並安裝再生龍 ...
- Codeforces Round #277(Div 2) A、B、C、D、E题解
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud A. Calculating Function 水题,判个奇偶即可 #includ ...
- [Leetcode] Find the minimum in rotated sorted array
我在Github上新建了一个解答Leetcode问题的Project, 大家可以参考, 目前是Java 为主,里面有leetcode上的题目,解答,还有一些基本的单元测试,方便大家起步. 题目: Su ...
- docker镜像与容器存储结构分析
注意:转载请注明出处:http://www.programfish.com/blog/?p=9 Docker是一个开源的应用容器引擎,主要利用linux内核namespace实现沙盒隔离,用cgrou ...
- Django学习(六) 模板
下面是一个新闻的模板:mysite/news/templates/news/year_archive.html mysite/news/templates/news/year_archive.html ...
- VS2012 的MVC4实例
原文链接:http://wenku.baidu.com/link?url=nkq-UZd-Ui83Nuoh66n4KqdwK4V_zzKqakmmG6VBgq2BfWlMiPhz1JXN9R3CWxN ...