High level steps upgrade from 11g to 12c database:

1)    Check network between source and target.

2)    Prepare goldengate Software.

3)    Setup extract and datapump for source site.

4)    Setup replict for target side.

5)    Start extract.

6)    Export and import initial load.

7)    Start the replicat.

This hands-on lab will demonstrate how to migrate the ‘TEST’ schema from Oracle database 11.2.0.4 to Oracle database 12.2.0.1.0 pdb with zero down time.

1)    Check network between source and target. For example, ping 10.182.242.176

2)    Prepare GoldenGate Software, we are using DIPC remote agent in this tutorial

Unzip it, the structure like following

./dicloud

|---- gghome11g

|---- gghome

|---- oci11g

|---- oci

The gghome11g is for the 11g source database, and the gghome is for the 12c target database.

Setup the tnsnames for source database and target database.

$mkdir –p ./dicloud/oci11g/network/admin/

$mkdir –p ./dicloud/oci/network/admin/

Prepare the tnsname.ora file.

src =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.182.242.176)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

tar =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.182.211.15)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = tar)

)

)

The environment parameters for ogg source like following:

export ORACLE_HOME=/home/oracle/ogg/dicloud/oci11g

export LD_LIBRARY_PATH=$ORACLE_HOME:/lib:/usr/lib

export TNS_ADMIN='/home/oracle/ogg/dicloud/oci11g/network/admin/'

The environment parameters for ogg target like following:

export ORACLE_HOME=/home/oracle/ogg/dicloud/oci

export LD_LIBRARY_PATH=$ORACLE_HOME:/lib:/usr/lib

export TNS_ADMIN='/home/oracle/ogg/dicloud/oci/network/admin/'

After setting above environment parameters, you can run the ./ggsci command under the gghome or gghome11g.

For Source

For Target

Setting for Source Database:

SQL>shutdown immediate;

SQL>startup mount;

SQL>alter database archivelog;

SQL>alter database open;

SQL>alter system switch logfile;

SQL>archive log list;

SQL>SELECT supplemental_log_data_min, force_logging FROM v$database;

SQL>alter database add supplemental log data;

SQL>alter database force logging;

SQL>SELECT supplemental_log_data_min, force_logging FROM v$database;

SQL> alter system set enable_goldengate_replication = true scope=both;

SQL>create user ogg identified by ogg;

SQL>GRANT DBA to ogg;

SQL>BEGIN

dbms_goldengate_auth.grant_admin_privilege (

grantee => 'ogg',

privilege_type => 'CAPTURE',

grant_select_privileges => TRUE

);

END;

/

--create test user

SQL>create user test identified by test default tablespace users quota unlimited on users;

SQL>grant create table, create session, execute on dbms_lock to test;

OGG setting for Source:

GGSCI> view param extsrc

extract extsrc

userid ogg@src,password ogg

exttrail ./dirdat/es

table TEST.*;

GGSCI> add extract extsrc, integrated tranlog, begin now

GGSCI > add exttrail ./dirdat/es, extract extsrc

GGSCI> dblogin userid ogg@src, password ogg

GGSCI> register extract extsrc database

GGSCI> add schematrandata TEST

GGSCI> info trandata TEST.*

GGSCI> view param pumsrc

extract pumsrc

passthru

rmthost 10.182.209.212,mgrport 7910

rmttrail ./dirdat/rs

table TEST.*;

GGSCI> add extract pumsrc, exttrailsource ./dirdat/es

GGSCI> add rmttrail ./dirdat/rs, extract pumsrc

Prepare the target PDB:

sqlplus / as sysdba

SQL>create pluggable database tar admin user adm identified by adm

file_name_convert=('/u01/app/oracle/oradata/dbaas/pdbseed', '/u01/app/oracle/oradata/dbaas/tar');

SQL>alter session set container=tar;

SQL>create user ogg identified by ogg;

SQL>GRANT DBA to ogg;

SQL>create bigfile tablespace users datafile '/u01/app/oracle/oradata/dbaas/tar/users.dbf' size 100m autoextend on maxsize 5G;

SQL>BEGIN

dbms_goldengate_auth.grant_admin_privilege

(

grantee => 'ogg',

privilege_type => 'APPLY',

grant_select_privileges => TRUE

);

END;

/

OGG setting for the target:

GGSCI > view param repsrc

replicat repsrc

userid ogg@tar, password ogg

discardfile repsrc.dsc, append

DBOPTIONS ENABLE_INSTANTIATION_FILTERING

map TEST.*, target TEST.*;

GGSCI > dblogin userid ogg@tar, password ogg

GGSCI > add replicat repsrc, integrated ,exttrail ./dirdat/rs

For the source database without Patch 17030189. You can apply follow workaround now. Or later back to this step if the capture abended with the errors mentioned the patch 17030189.

There is a script "prvtlmpg.plb" under gghome11g directory. Need to run this script in the source database.

sqlplus / as sysdba

SQL>@prvtlmpg.plb

Open a new terminal to run the sample application in source database. This PL/SQL block simulate a running application.

SQL>conn test/test

SQL>create table tmp_check (s integer);

SQL>declare

i pls_integer:=0;

begin

loop

insert into tmp_check values(i);

commit;

i:=i+1;

dbms_lock.sleep(2);

end loop;

end;

/

--Please note that the above PL/SQL is running forever. You can press ‘Ctrl’ + ‘c’ from your keyboard to stop it.

Start the OGG capture.

GGSCI>start EXTRACT EXTSRC

GGSCI>start EXTRACT PUMSRC

Check the status.

GGSCI>info all

Create the directory for exporting.

sqlplus / as sysdba

SQL>create directory ogg_dir as ‘/home/oracle/migration’;

Export Schema ‘TEST’ from the source database.

expdp \' / as sysdba\' directory=ogg_dir dumpfile=test_%U.dmp schemas=test statistics=none parallel=2

Move the dump files from source to target.

scp *.dmp <target_ip>:<target directory>

Create directory for importing.

sqlplus / as sysdba

SQL> alter session set container=tar;

SQL> create directory ogg_dir as ‘/home/oracle/migration’;

Import the schema ‘TEST’ to the target PDB.

impdp system/oracle@tar directory=ogg_dir dumpfile=test_%U.dmp parallel=2

After the above import successfully. Start the replicate to sync the source and target data.

GGSCI>start REPLICAT REPSRC

Stop the running PL/SQL application.

Check the records in Source database.

SQL>conn test/test

SQL>select * from tmp_check order by 1;

Check the records in Target database. The results should be the same as the results from the Source database.

SQL>conn test/test@tar

SQL>select * from tmp_check order by 1;

Summary

With OGG, it is easy to achieve zero down time migration + upgrade from Oracle 11g to Oracle 12c.We use DBOPTIONS ENABLE_INSTANTIATION_FILTERING - Tells Replicat to filter records per table based on Data Pump system table data, no SCN record or used in the data initialization. However, in real case, you need to consider more according to your specific environment.

Zero down time upgrade with OGG -from 11g to 12c.的更多相关文章

  1. Oracle 收集统计信息11g和12C在差异

    Oracle 基于事务临时表11g和12C下,能看到临时表后收集的统计数据,前者记录被清除,后者没有,这是一个很重要的不同. 关于使用企业环境12C,11g,使用暂时表会造成时快时慢.之前我有帖子ht ...

  2. Oracle 11g与12c的审计详解

    最近遇到一些脚本诱发的审计相关BUG,感觉有必要重新梳理一下11g与12c的审计模式,于是根据官网修正了一下以前的一篇笔记这里发出来. 一.审计功能的开启: SQL> show paramete ...

  3. 11g与12c启动,关闭RAC

    oracle11g 关闭,启动顺序 1.关闭数据库(oracle)srvctl stop database -d rac 2.关闭集群(root)crsctl stop cluster -all 3. ...

  4. 11g,12c Oracle Rac安装

    安装 Oracle 12cR1 RAC on Linux 7 本文介绍如何在Oracle Linux 7上安装2节点Oracle 12cR1 Real Application Cluster(RAC) ...

  5. 11G、12C安装结束需要做的一些操作

    修改spfile参数:修改前,先备份 create pfile from spfile; alter system set memory_target=0 scope=spfile;alter sys ...

  6. 本地Oracle客户端11g升级12c导致PowerCenter无法连接ODBC数据源

    问题: 本地Oracle客户端由11g-32bit升级为12c-64bit时,在PowerCenter Designer使用原来的ODBC连接导入数据库表时,发生如下错误: 原因: 原oracle11 ...

  7. 解决11g r2,12c使用wm_concat报错问题

    创建type CREATE OR REPLACE TYPE zh_concat_im AUTHID CURRENT_USER AS OBJECT ( CURR_STR ), STATIC FUNCTI ...

  8. 11G、12C Data Guard Physical Standby Switchover转换参考手册

    Switchover转换   Step 1: switchover 切换先前检查 (1)确保主备两端log_archive_config和db_unique_name参数都已经正确设置. 需要注意的是 ...

  9. 单机11g ogg 双向DML复制

    环境说明: Linux为Linux 2.6.32-573.el6.x86_64 Oracle为 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Pr ...

随机推荐

  1. yum安装错误:CRITICAL:yum.cli:Config Error: Error accessing file for config file:///home/linux/+

    上网搜了一下然后自己总结一份 : 出现原因:yum可能没有,或者损坏 解决: 第一步:下载   wget  http://yum.baseurl.org/download/3.2/yum-3.2.28 ...

  2. Postman:非专业的并发测试

    Postman是开发中常用的接口测试工具,也可以用来进行并发测试. 使用方法如下: 1. 直接输入url 选择GET方法,点击Send. 结果打印一个"test",如下: 2. 使 ...

  3. hdu 6852Path6(最短路+最小割)

    传送门 •题意 有n个城市,标号1-n 现花费最小的代价堵路 使得从1号城市到n号城市的路径边长 (注意只是变长不是最长) 堵一条路的代价是这条路的权值 •思路 在堵路以前,从1到n的最小路径当然是最 ...

  4. CP防火墙使用命令批量创建对象和策略

    Step1:批量创建网络对象 使用mgmt_cli 命令批量创建host对象,注意该命令需要管理员账号和密码 mgmt_cli add host name Host_10.133.1.100 ip-a ...

  5. QP简介

    QP简介 QP(Quantum Platform)是一个轻量级的.开源的.基于状态机的.事件驱动型应用程序框架.这个框架包括四部分: 事件处理器(QEP): 轻量级的事件驱动框架(QF): 任务调度微 ...

  6. Dubbo-本地Bean测试

    Dubbo本地测试API的Bean 一.建立一个测试类文件 二.测试API // 自己要测试的API public static final XxApi xxApi; 三.注入Bean static ...

  7. 超简单!pytorch入门教程(一):Tensor

    http://www.jianshu.com/p/5ae644748f21 二.pytorch的基石--Tensor张量 其实标量,向量,矩阵它们三个也是张量,标量是零维的张量,向量是一维的张量,矩阵 ...

  8. Django的安装命令

    国内的一些pipy镜像源: 1.清华源: https://pypi.tuna.tsinghua.edu.cn/simple 2.豆瓣源: https://pypi.douban.com/simple ...

  9. Linux忘记root密码后如何在grub界面中以单用户模式进入系统并重置密码的方法

    本文将介绍在Linux系统中忘记root用户密码的情况下,如何在gurb界面进入单用户模式并重置root用户密码.在单用户模式下,用户不需要输入任何密码即可进入系统并可以修改密码.实验步骤如下: 1. ...

  10. 【阿里云IoT+YF3300】10.快速开发188协议设备驱动

    188协议的全称为CJ-T188-2004 <户用计量仪表数据传输技术条件>,是针对水表.燃气表.热量表和其他集中采集的一个国家行业标准协议. YFIOs就是YFSoft I/O Serv ...