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>".

[[email protected] 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

[[email protected] 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

时间: 2024-12-28 18:34:05

Zero Downtime Upgrade of Oracle 10g to Oracle 11g Using GoldenGate — 2的相关文章

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 [[email protected] ~]$ cd /ggs/ [[email protected] ggs]$ cat GLOBALS GGSCHEMA GGS run marker_setup.sql [[email protected] ggs]$ sqlplus / as sysdba SQL*Plus:

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 [[email protected] ggs]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.23 18709404 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_140523.1046_FBO Linux,

Oracle 10g AND Oracle 11g手工建库案例--Oracle 10g

Oracle 10g AND Oracle 11g手工建库案例--Oracle 10g 系统环境: 操作系统: RedHat EL6 Oracle:  Oracle 10g and Oracle 11g 手工建库相对来说非常easy实现,本案例是从10g和11g,通过手工建库的方式做一个简单的对照,能够看出11g和10g之间的一个简单的差异! 案例一: 在Oracle 10g 环境下手工建库 DB_NAME='cuug' INSTANCE_NAME='cuug' 1.建立Instance的初始化

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:                No OS Version:     Red Hat Enterprise Linux Server release 5.9 x86_64 OGG Version:   Oracle GoldenGate V11.2.1.0.6 for Oracle 10g on Linux x8

oracle数据库的迁移(从一台服务器到另一个台服务器,从oracle 10g到oracle 11g)

这个过程呢,还是蛮艰难的.... 一.最初我使用的是Navicat中的数据传输来迁移的,虽说整个数据库的迁移没有成功,但传输指定的对象时还是传输成功了.所以还是记录一下吧. 1.前提连接好数据库.在指定的数据库上右击,选择"数据传输". 2.在弹出的框内选择源库和目的库以及模式和你要传输的对象,如下图所示 3.点击开始便可传输 二.在利用Navicat只可传输对象,没办法传输模式等.但是如果要迁移整个数据库,肯定不仅只有迁移对象这么简单了.于是我选择了expdp和impdp导入导出的方

RAC 常用维护工具和命令(oracle 10g)

Oracle 的管理可以通过OEM或者命令行接口. Oracle Clusterware的命令集可以分为以下4种: 节点层:osnodes 网络层:oifcfg 集群层:crsctl, ocrcheck,ocrdump,ocrconfig 应用层:srvctl,onsctl,crs_stat 下面分别来介绍这些命令. 一. 节点层 只有一个命令: osnodes, 这个命令用来显示集群点列表,可用的参数如下,这些参数可以混合使用. [[email protected] bin]# ./olsno

Oracle 10g R2升级到Oracle 11g R2

Oracle 10g R2升级到Oracle 11g R2 系统环境: 操作系统:RedHat EL55 Oracle 软件: Oracle 10g R2.Oracle 11g R2 Oracle 升级线路 本案例是从Oracle 10.2.0.4.0升级到Oracle 11.2.0.1.0 参考文档: Oracle patch CPU Update: http://tiany.blog.51cto.com/513694/846066 Oracle 10g 升级(10.2.0.1.0升级到10.

oracle 10g rac环境升级到10.2.0.5

升级oracle rac环境,以前是oracle 是10.2.0.1版本,现在要10.2.0.5的版本.首先必须安装oracle cluster集群软件,然后下载oracle 10.2.0.5软件包进行打补丁. oracle cluster安装地址: oracle 10.2.0.5下载地址: 1.查看当前的crs版本(两个节点都看一下) [[email protected] ~]$ crsctl query crs softwareversion CRS software version on

Oracle 10g(10.2.0.4)升级到10.2.0.5.19

一.将数据库版本从10.2.0.4 升级到 10.2.0.5,再升级到10.2.0.5.19 (1) 备份等过程略过,一个老库的升级过程,记录之.   (2) 一致性关闭数据库及监听 sqlplus / as sysdba;   shutdown immediate    lsnrctl stop 二.升级数据库软件 1,解压p8202632_10205_Linux-x86-64.zip   2,直接采用安装方式安装,覆盖原安装目录 xhost+   su - oracle    cd Disk