oracle goldengate 12c oracle to mongodb replicat 测试

源端 oracle

[oracle@node1 ogg]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Sat Aug 27 10:07:16 2016

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

SQL> connect /as sysDBA
Connected.
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE        11.2.0.4.0        Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 ogg]$ cd $GGHOME
[oracle@node1 ogg]$ ggsci -v

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Dec 12 2015 00:54:38

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.


[oracle@node1 ogg]$ ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Dec 12 2015 00:54:38
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.



GGSCI (node1) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                          
EXTRACT     RUNNING     EOLTP01     00:00:00      00:00:10   
EXTRACT     RUNNING     EPUMP01     00:00:00      00:00:07   


GGSCI (node1) 2> view params mgr

port 7809


GGSCI (node1) 3> view params eoltp01


EXTRACT EOLTP01
SETENV (ORACLE_SID=orcl)
USERID ogg, PASSWORD ogg
EXTTRAIL ./dirdat/sa
TABLE SCOTT.*;


GGSCI (node1) 4> view params epump01

EXTRACT EPUMP01
PASSTHRU
RMTHOST node2, MGRPORT 7809
RMTTRAIL ./dirdat/ta
TABLE SCOTT.*;


GGSCI (node1) 5>

GGSCI (node1) 5>

GGSCI (node1) 5> exit
[oracle@node1 ogg]$ cd
[oracle@node1 ~]$ cat .bash_profile
# ---------------------------------------------------
# OS User:      oracle
# Application:  Oracle Database Software Owner
# Version:      Oracle 11g release 2
# ---------------------------------------------------

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
      . ~/.bashrc
fi
GGHOME=/u01/ogg; export GGHOME
ORACLE_SID=orcl; export ORACLE_SID #another is dgh2
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
PATH=.{JAVA_HOME}/bin{PATH}HOME/binORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${GGHOME}{PATH}:/u01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
# ---------------------------------------------------
# UMASK
# ---------------------------------------------------
# Set the default file mode creation mask
# (umask) to 022 to ensure that the user performing
# the Oracle software installation creates files
# with 644 permissions.
# ---------------------------------------------------
umask 022













目标 mongodb:

[oracle@node2 ogg]$ pwd
/u01/ogg
[oracle@node2 ogg]$ ggsci

Oracle GoldenGate Command Interpreter
Version 12.2.0.1.0 OGGCORE_12.2.0.1.0_PLATFORMS_151101.1925.2
Linux, x64, 64bit (optimized), Generic on Nov 10 2015 16:18:12
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.



GGSCI (node2) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                          
REPLICAT    RUNNING     RMONGO      00:00:00      00:00:03   


GGSCI (node2) 2> view params rmongo

REPLICAT rmongo
-- Trail file for this example is located in "AdapterExamples/trail" directory
-- Command to add REPLICAT
-- add replicat rmongo, exttrail AdapterExamples/trail/tr
---add replicat rmongo, exttrail ./dirdat/ta
TARGETDB LIBFILE libggjava.so SET property=dirprm/mongo.props
REPORTCOUNT EVERY 1 MINUTES, RATE
GROUPTRANSOPS 10000
MAP SCOTT.*, TARGET SCOTT.*;


GGSCI (node2) 3> view params mgr

port 7809



GGSCI (node2) 4> exit
[oracle@node2 ogg]$ more dirprm/mongo.props

gg.handlerlist=mongodb
gg.handler.mongodb.type=oracle.goldengate.delivery.handler.mongodb.MongoDBHandler
gg.handler.mongodb.clientURI=mongodb://localhost:27017/
#gg.handler.mongodb.clientURI=mongodb://ogggg@localhost:27017/?authSource=admin&authMechanism=SCRAM-SHA-1
gg.handler.mongodb.mode=tx
goldengate.userexit.timestamp=utc
goldengate.userexit.writers=javawriter
javawriter.stats.display=TRUE
javawriter.stats.full=TRUE
gg.log=log4j
gg.log.level=DEBUG
gg.report.time=30sec
##CHANGE THE PATH BELOW
gg.classpath=/u01/mongodb/lib/mongo-java-driver-3.2.2.jar:/u01/ogg/bin/ogg-mongodb-adapter-1.0.jar:
javawriter.bootoptions=-Xmx512m -Xms32m -Djava.class.path=ggjava/ggjava.jar:

[oracle@node2 ogg]$ cd
[oracle@node2 ~]$ cat .bash_profile
# ---------------------------------------------------
# OS User:      oracle
# Application:  Oracle Database Software Owner
# Version:      Oracle 11g release 2
# ---------------------------------------------------

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
      . ~/.bashrc
fi
OGG_MONGODB_HOME=/u01/mongodb/;export OGG_MONGODB_HOME
GGHOME=/u01/ogg;export GGHOME
export JAVA_HOME=/usr/java/jdk1.8.0_73
PATH=.{JAVA_HOME}/bin:${PATH}:$HOME/bin
PATH=${GGHOME}:${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$LD_LIBRARY_PATH


[oracle@node2 ogg]$ pwd
/u01/ogg
[oracle@node2 ogg]$ ls -l
total 1425184
drwxr-xr-x. 5 oracle oinstall      4096 Dec  9  2015 AdapterExamples
-rw-r-----. 1 oracle oinstall       426 Oct 15  2010 bcpfmt.tpl
-rw-r-----. 1 oracle oinstall      1725 Oct 15  2010 bcrypt.txt
drwxr-xr-x. 2 oracle oinstall      4096 Mar 15 15:08 bin
-rwxr-xr-x. 1 oracle oinstall   8607541 Nov 10  2015 cachefiledump
-rwxr-xr-x. 1 oracle oinstall   8771702 Nov 10  2015 checkprm
-rwxr-x---. 1 oracle oinstall   9568731 Nov 10  2015 convchk
-rwxr-xr-x. 1 oracle oinstall  15067786 Nov 10  2015 convprm
-rw-r-----. 1 oracle oinstall       159 Oct 15  2010 db2cntl.tpl
drwxr-x---. 2 oracle oinstall      4096 Aug 27 07:49 dirchk
drwxr-x---. 2 oracle oinstall      4096 May 16 23:32 dircrd
drwxr-x---. 2 oracle oinstall      4096 Aug 27 22:18 dirdat
drwxr-x---. 2 oracle oinstall      4096 May 16 23:32 dirdef
drwxr-x---. 2 oracle oinstall      4096 May 17 05:38 dirdmp
drwxr-x---. 2 oracle oinstall      4096 Nov 10  2015 dirout
drwxr-x---. 2 oracle oinstall      4096 Aug 27 22:16 dirpcs
drwxr-x---. 2 oracle oinstall      4096 Aug 27 08:50 dirprm
drwxr-x---. 2 oracle oinstall      4096 Aug 27 22:21 dirrpt
drwxr-x---. 2 oracle oinstall      4096 May 16 23:32 dirsql
drwxr-x---. 2 oracle oinstall      4096 Aug 27 22:16 dirtmp
drwxr-x---. 2 oracle oinstall      4096 May 16 23:32 dirwlt
drwxr-x---. 5 oracle oinstall      4096 Nov 10  2015 dirwww
-rwxr-x---. 1 oracle oinstall  16946612 Nov 10  2015 emsclnt
-rwxr-x---. 1 oracle oinstall  82928816 Nov 10  2015 extract
-rw-r-----. 1 oracle oinstall      1968 Oct 15  2010 freeBSD.txt
-rwxr-xr-x. 1 oracle oinstall    315434 Dec  9  2015 gendef
-rwxr-x---. 1 oracle oinstall  17162570 Nov 10  2015 ggcmd
drwxr-xr-x. 4 oracle oinstall      4096 Dec  9  2015 ggjava
-rw-r-----. 1 oracle oinstall   1847888 Nov 10  2015 ggMessage.dat
-rw-r-----. 1 oracle oinstall  39326056 Nov 10  2015 ggparam.dat
-rw-rw-r--. 1 oracle oinstall 664944640 Dec  9  2015 ggs_Adapters_Linux_x64.tar
-rwxr-x---. 1 oracle oinstall  38916226 Nov 10  2015 ggsci
-rw-r-----. 1 oracle oinstall    228429 Aug 27 22:35 ggserr.log
-rw-r-----. 1 oracle oinstall    278351 Oct 21  2015 help.txt
-rwxr-x---. 1 oracle oinstall    498096 Nov 10  2015 keygen
drwxr-x---. 2 oracle oinstall      4096 Nov 10  2015 lib
-rwxr-x---. 1 oracle oinstall    126863 Oct 17  2014 libantlr3c.so
-rwxr-x---. 1 oracle oinstall   2109463 Jul 13  2015 libdb-6.1.so
-rwxr-x---. 1 oracle oinstall   4841298 Nov 10  2015 libggjava.so
-rwxr-xr-x. 1 oracle oinstall    248730 Dec  9  2015 libggjava_ue.so
-rwxr-xr-x. 1 oracle oinstall    327403 Dec  9  2015 libggjava_vam.so
-rwxr-x---. 1 oracle oinstall  15314931 Nov 10  2015 libgglog.so
-rwxr-x---. 1 oracle oinstall  11469665 Nov 10  2015 libggnnzitp.so
-rwxr-x---. 1 oracle oinstall  50889628 Nov 10  2015 libggparam.so
-rwxr-x---. 1 oracle oinstall   1971862 Nov 10  2015 libggperf.so
-rwxr-x---. 1 oracle oinstall   3552129 Nov 10  2015 libggrepo.so
-rwxr-x---. 1 oracle oinstall  22827292 Oct 17  2014 libicudata.so.48
-rwxr-x---. 1 oracle oinstall  22827292 Oct 17  2014 libicudata.so.48.1
-rwxr-x---. 1 oracle oinstall   2527729 Oct 17  2014 libicui18n.so.48
-rwxr-x---. 1 oracle oinstall   2527729 Oct 17  2014 libicui18n.so.48.1
-rwxr-x---. 1 oracle oinstall   1809818 Oct 17  2014 libicuuc.so.48
-rwxr-x---. 1 oracle oinstall   1809818 Oct 17  2014 libicuuc.so.48.1
-rwxr-x---. 1 oracle oinstall   4925371 Oct 17  2014 libxerces-c.so.28
-rw-r-----. 1 oracle oinstall      1668 Oct 15  2010 libxml2.txt
drwxr-xr-x. 8 oracle oinstall      4096 Dec  9  2015 licenses
-rw-r--r--. 1 oracle oinstall     16621 Feb 25  2016 LICENSE.txt
-rwxr-x---. 1 oracle oinstall  27840715 Nov 10  2015 logdump
-rwxr-x---. 1 oracle oinstall  27721162 Nov 10  2015 mgr
-rwxrwxrwx. 1 oracle oinstall    345521 Aug 25 22:38 mongodb-driver-3.2.2.jar
-rw-r-----. 1 oracle oinstall     43373 Jan 20  2015 notices.txt
-rw-r--r--. 1 oracle oinstall    159689 Dec 17  2015 OGG_BigData_12.2.0.1.0_Release_Notes.pdf
-rw-r--r--. 1 oracle oinstall      1407 Dec 17  2015 OGG_BigData_12.2.0.1_README.txt
-rwxr-x---. 1 oracle oinstall   8964289 Nov 10  2015 oggerr
-rwxrwxrwx. 1 oracle oinstall     29468 Aug 25 22:38 OGG for mongodb adapter_v1.0.zip
-rw-r--r--. 1 oracle oinstall      2465 Mar 15 15:08 pom.xml
-rw-r-----. 1 oracle oinstall      1272 Dec 28  2010 prvtclkm.plb
-rwxr-x---. 1 oracle oinstall  84657570 Nov 10  2015 replicat
-rwxr-x---. 1 oracle oinstall   8980332 Nov 10  2015 retrace
-rwxr-x---. 1 oracle oinstall  16136054 Nov 10  2015 reverse
-rwxr-x---. 1 oracle oinstall  29975376 Nov 10  2015 server
-rw-r-----. 1 oracle oinstall       248 Oct 15  2010 sqlldr.tpl
drwxr-xr-x. 3 oracle oinstall      4096 Feb 18  2016 src
-rw-r-----. 1 oracle oinstall       759 Oct 15  2010 tcperrs
-rw-r-----. 1 oracle oinstall     37455 Mar  4  2015 ucharset.h
drwxr-x---. 7 oracle oinstall      4096 Nov 10  2015 UserExitExamples
-rw-r-----. 1 oracle oinstall     30782 Oct  2  2015 usrdecs.h
-rwxrwxrwx. 1 root   root     198690355 May 16 23:31 V100447-01.zip
-rw-r-----. 1 oracle oinstall      1476 Oct 15  2010 zlib.txt


[oracle@node2 dirprm]$ echo $GGHOME
/u01/ogg
[oracle@node2 dirprm]$ pwd
/u01/ogg/dirprm
[oracle@node2 dirprm]$ ls -l
total 12
-rw-r-----. 1 oracle oinstall  11 May 17 05:38 mgr.prm
-rw-r--r--. 1 oracle oinstall 699 Aug 27 08:50 mongo.props
-rw-r--r--. 1 oracle oinstall 333 Aug 27 07:55 rmongo.prm



/u01/mongodb/目录下解压OGG for mongodb adapter_v1.0.zip文件,注意调整目录权限
[root@node2 /]# cd /u01/mongodb/
[root@node2 mongodb]# ls -l
total 72
drwxr-xr-x. 2 oracle oinstall  4096 Mar 15 15:08 bin
drwxr-xr-x. 2 oracle oinstall  4096 Feb 18  2016 dirprm


-rw-r--r--. 1 oracle oinstall 16621 Feb 25  2016 LICENSE.txt
-rw-r--r--. 1 oracle oinstall 29468 May 17 00:19 OGG for mongodb adapter_v1.0.zip
-rw-r--r--. 1 oracle oinstall  2465 Mar 15 15:08 pom.xml
drwxr-xr-x. 3 oracle oinstall  4096 Feb 18  2016 src

创建lib目录,拷贝mongo-java-driver-3.2.2.jar到lib目录
drwxr-xr-x. 2 oracle oinstall  4096 May 17 06:47 lib[root@node2 lib]# pwd
/u01/mongodb/lib
[root@node2 lib]# ls -l
total 1452
-rwxrwxrwx. 1 oracle oinstall 1484724 May 17 04:50 mongo-java-driver-3.2.2.jar




无需安装ORACLE 数据库!!!!!!


mongodb oracle用户安装,注意调整相关目录权限



[root@node2 mongodb]# pwd
/mongodb
[root@node2 mongodb]# tree
.
└── mongodb_3.2
    ├── bin
    │?? ├── bsondump
    │?? ├── mongo
    │?? ├── mongod
    │?? ├── mongodump
    │?? ├── mongoexport
    │?? ├── mongofiles
    │?? ├── mongoimport
    │?? ├── mongooplog
    │?? ├── mongoperf
    │?? ├── mongorestore
    │?? ├── mongos
    │?? ├── mongostat
    │?? └── mongotop
    ├── data
    │?? ├── collection-0-2377021635459644248.wt
    │?? ├── collection-0--6941413835953115821.wt
    │?? ├── diagnostic.data
    │?? │?? ├── metrics.2016-05-17T04-12-46Z-00000
    │?? │?? ├── metrics.2016-05-17T08-38-07Z-00000
    │?? │?? ├── metrics.2016-08-27T12-46-01Z-00000
    │?? │?? └── metrics.interim
    │?? ├── index-1-2377021635459644248.wt
    │?? ├── index-1--6941413835953115821.wt
    │?? ├── journal
    │?? │?? ├── WiredTigerLog.0000000003
    │?? │?? ├── WiredTigerPreplog.0000000001
    │?? │?? └── WiredTigerPreplog.0000000002
    │?? ├── _mdb_catalog.wt
    │?? ├── mongod.lock
    │?? ├── sizeStorer.wt
    │?? ├── storage.bson
    │?? ├── WiredTiger
    │?? ├── WiredTigerLAS.wt
    │?? ├── WiredTiger.lock
    │?? ├── WiredTiger.turtle
    │?? └── WiredTiger.wt
    ├── GNU-AGPL-3.0
    ├── MPL-2
    ├── README
    └── THIRD-PARTY-NOTICES

5 directories, 37 files




[root@node2 mongodb]# yum list | grep tree
tree.x86_64                            1.5.3-2.el6                  rhel-source
[root@node2 mongodb]# yum -y install tree.x86_64
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tree.x86_64 0:1.5.3-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================
Package                                      Arch                                           Version                                                Repository                                           Size
==============================================================================================================================================================================================================
Installing:
tree                                         x86_64                                         1.5.3-2.el6                                            rhel-source                                          36 k

Transaction Summary
==============================================================================================================================================================================================================
Install       1 Package(s)

Total download size: 36 k
Installed size: 65 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : tree-1.5.3-2.el6.x86_64                                                                                                                                                                    1/1
  Verifying  : tree-1.5.3-2.el6.x86_64                                                                                                                                                                    1/1

Installed:
  tree.x86_64 0:1.5.3-2.el6                                                                                                                                                                                   

Complete!


启动mongodb:
[oracle@node2 data]$ mongod --dbpath /mongodb/mongodb_3.2/data
连接mongodb:
[oracle@node2 ~]$ mongo
MongoDB shell version: 3.2.6
connecting to: test
Server has startup warnings:
2016-08-27T10:10:51.803-0400 I CONTROL  [initandlisten]
2016-08-27T10:10:51.803-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-08-27T10:10:51.803-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-08-27T10:10:51.803-0400 I CONTROL  [initandlisten]
2016-08-27T10:10:51.803-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-08-27T10:10:51.803-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-08-27T10:10:51.803-0400 I CONTROL  [initandlisten]
MongoDB Enterprise >


问题:

[oracle@node2 ~]$ mongod --dbpath /mongodb/mongodb_3.2/data
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] MongoDB starting : pid=2653 port=27017 dbpath=/mongodb/mongodb_3.2/data 64-bit host=node2
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] db version v3.2.6
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] git version: 05552b562c7a0b3143a729aaa0838e558dc49b25
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] allocator: tcmalloc
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] modules: enterprise
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] build environment:
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten]     distmod: rhel62
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten]     distarch: x86_64
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten]     target_arch: x86_64
2016-08-27T22:11:15.606-0400 I CONTROL  [initandlisten] options: { storage: { dbPath: "/mongodb/mongodb_3.2/data" } }
2016-08-27T22:11:15.637-0400 E NETWORK  [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
2016-08-27T22:11:15.637-0400 I -        [initandlisten] Fatal Assertion 28578
2016-08-27T22:11:15.637-0400 I -        [initandlisten]

***aborting after fassert() failure


处理:
[root@node2 ~]# cd /tmp
[root@node2 tmp]# ls
keyring-re8qmP      orbit-gdm           pulse-G0n8H63JsWwj  vmware-root            yum-oracle-yFRvlw
mongodb-27017.sock  pulse-5FE0qbJgjLbk  VMwareDnD           vmware-root-448221729
[root@node2 tmp]# rm mongodb-27017.sock
rm: remove socket `mongodb-27017.sock'? y
[root@node2 tmp]# su - oracle
[oracle@node2 ~]$ mongod --dbpath /mongodb/mongodb_3.2/data
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] MongoDB starting : pid=2687 port=27017 dbpath=/mongodb/mongodb_3.2/data 64-bit host=node2
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] db version v3.2.6
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] git version: 05552b562c7a0b3143a729aaa0838e558dc49b25
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] allocator: tcmalloc
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] modules: enterprise
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] build environment:
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten]     distmod: rhel62
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten]     distarch: x86_64
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten]     target_arch: x86_64
2016-08-27T22:12:28.298-0400 I CONTROL  [initandlisten] options: { storage: { dbPath: "/mongodb/mongodb_3.2/data" } }
2016-08-27T22:12:28.377-0400 I -        [initandlisten] Detected data files in /mongodb/mongodb_3.2/data created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-08-27T22:12:28.378-0400 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten]
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten]
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten]
2016-08-27T22:12:28.921-0400 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/mongodb/mongodb_3.2/data/diagnostic.data'
2016-08-27T22:12:28.922-0400 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-08-27T22:12:28.925-0400 I NETWORK  [initandlisten] waiting for connections on port 27017





测试:

SQL> sqlplus scott/oracle
SP2-0734: unknown command beginning "sqlplus sc..." - rest of line ignored.
SQL> connect scott/oracle
Connected.
SQL> select tname from tab;

TNAME
------------------------------
BONUS
DEPT
EMP
SALGRADE
T1

SQL> select count(*) from t1;

  COUNT(*)
----------
     86959

SQL> delete from t1;

86959 rows deleted.

SQL> commit;

Commit complete.



DDL创建新表,抽取参数匹配SCOTT.*,无需调整:
SQL> create table t2 as select * from emp where 1=2;

Table created.

SQL> commit;

Commit complete.

t2表插入数据测试:

SQL> insert into t2 select * from emp;

14 rows created.

SQL> /

14 rows created.

SQL> /

14 rows created.

SQL> /

14 rows created.

提交:
SQL> commit;

Commit complete.

SQL>





×××××支持源端ddl×××××××××××


目标端查看确认:

[root@node2 ~]# su - oracle
[oracle@node2 ~]$ mongo
MongoDB shell version: 3.2.6
connecting to: test
Server has startup warnings:
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten]
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten]
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-08-27T22:12:28.918-0400 I CONTROL  [initandlisten]
MongoDB Enterprise > show dbs
SCOTT  0.005GB
local  0.000GB
MongoDB Enterprise > use SCOTT
switched to db SCOTT
MongoDB Enterprise > show collections
T1
T2
MongoDB Enterprise > db.t2.find()
MongoDB Enterprise > db.T2.find()
{ "_id" : ObjectId("57c24ad4821c870ad95eef6c"), "ENAME" : "SMITH", "COMM" : "NULL", "HIREDATE" : "1980-12-17:00:00:00", "EMPNO" : "7369", "MGR" : "7902", "JOB" : "CLERK", "DEPTNO" : "20", "SAL" : "800.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef6d"), "ENAME" : "ALLEN", "COMM" : "300.00", "HIREDATE" : "1981-02-20:00:00:00", "EMPNO" : "7499", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1600.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef6e"), "ENAME" : "WARD", "COMM" : "500.00", "HIREDATE" : "1981-02-22:00:00:00", "EMPNO" : "7521", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1250.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef6f"), "ENAME" : "JONES", "COMM" : "NULL", "HIREDATE" : "1981-04-02:00:00:00", "EMPNO" : "7566", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "20", "SAL" : "2975.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef70"), "ENAME" : "MARTIN", "COMM" : "1400.00", "HIREDATE" : "1981-09-28:00:00:00", "EMPNO" : "7654", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1250.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef71"), "ENAME" : "BLAKE", "COMM" : "NULL", "HIREDATE" : "1981-05-01:00:00:00", "EMPNO" : "7698", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "30", "SAL" : "2850.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef72"), "ENAME" : "CLARK", "COMM" : "NULL", "HIREDATE" : "1981-06-09:00:00:00", "EMPNO" : "7782", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "10", "SAL" : "2450.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef73"), "ENAME" : "SCOTT", "COMM" : "NULL", "HIREDATE" : "1987-04-19:00:00:00", "EMPNO" : "7788", "MGR" : "7566", "JOB" : "ANALYST", "DEPTNO" : "20", "SAL" : "3000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef74"), "ENAME" : "KING", "COMM" : "NULL", "HIREDATE" : "1981-11-17:00:00:00", "EMPNO" : "7839", "MGR" : "NULL", "JOB" : "RESIDENT", "DEPTNO" : "10", "SAL" : "5000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef75"), "ENAME" : "TURNER", "COMM" : "0", "HIREDATE" : "1981-09-08:00:00:00", "EMPNO" : "7844", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1500.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef76"), "ENAME" : "ADAMS", "COMM" : "NULL", "HIREDATE" : "1987-05-23:00:00:00", "EMPNO" : "7876", "MGR" : "7788", "JOB" : "CLERK", "DEPTNO" : "20", "SAL" : "1100.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef77"), "ENAME" : "JAMES", "COMM" : "NULL", "HIREDATE" : "1981-12-03:00:00:00", "EMPNO" : "7900", "MGR" : "7698", "JOB" : "CLERK", "DEPTNO" : "30", "SAL" : "950.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef78"), "ENAME" : "FORD", "COMM" : "NULL", "HIREDATE" : "1981-12-03:00:00:00", "EMPNO" : "7902", "MGR" : "7566", "JOB" : "ANALYST", "DEPTNO" : "20", "SAL" : "3000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef79"), "ENAME" : "MILLER", "COMM" : "NULL", "HIREDATE" : "1982-01-23:00:00:00", "EMPNO" : "7934", "MGR" : "7782", "JOB" : "CLERK", "DEPTNO" : "10", "SAL" : "1300.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef7a"), "ENAME" : "SMITH", "COMM" : "NULL", "HIREDATE" : "1980-12-17:00:00:00", "EMPNO" : "7369", "MGR" : "7902", "JOB" : "CLERK", "DEPTNO" : "20", "SAL" : "800.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef7b"), "ENAME" : "ALLEN", "COMM" : "300.00", "HIREDATE" : "1981-02-20:00:00:00", "EMPNO" : "7499", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1600.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef7c"), "ENAME" : "WARD", "COMM" : "500.00", "HIREDATE" : "1981-02-22:00:00:00", "EMPNO" : "7521", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1250.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef7d"), "ENAME" : "JONES", "COMM" : "NULL", "HIREDATE" : "1981-04-02:00:00:00", "EMPNO" : "7566", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "20", "SAL" : "2975.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef7e"), "ENAME" : "MARTIN", "COMM" : "1400.00", "HIREDATE" : "1981-09-28:00:00:00", "EMPNO" : "7654", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1250.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef7f"), "ENAME" : "BLAKE", "COMM" : "NULL", "HIREDATE" : "1981-05-01:00:00:00", "EMPNO" : "7698", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "30", "SAL" : "2850.00" }
Type "it" for more
MongoDB Enterprise > it
{ "_id" : ObjectId("57c24ad4821c870ad95eef80"), "ENAME" : "CLARK", "COMM" : "NULL", "HIREDATE" : "1981-06-09:00:00:00", "EMPNO" : "7782", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "10", "SAL" : "2450.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef81"), "ENAME" : "SCOTT", "COMM" : "NULL", "HIREDATE" : "1987-04-19:00:00:00", "EMPNO" : "7788", "MGR" : "7566", "JOB" : "ANALYST", "DEPTNO" : "20", "SAL" : "3000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef82"), "ENAME" : "KING", "COMM" : "NULL", "HIREDATE" : "1981-11-17:00:00:00", "EMPNO" : "7839", "MGR" : "NULL", "JOB" : "RESIDENT", "DEPTNO" : "10", "SAL" : "5000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef83"), "ENAME" : "TURNER", "COMM" : "0", "HIREDATE" : "1981-09-08:00:00:00", "EMPNO" : "7844", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1500.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef84"), "ENAME" : "ADAMS", "COMM" : "NULL", "HIREDATE" : "1987-05-23:00:00:00", "EMPNO" : "7876", "MGR" : "7788", "JOB" : "CLERK", "DEPTNO" : "20", "SAL" : "1100.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef85"), "ENAME" : "JAMES", "COMM" : "NULL", "HIREDATE" : "1981-12-03:00:00:00", "EMPNO" : "7900", "MGR" : "7698", "JOB" : "CLERK", "DEPTNO" : "30", "SAL" : "950.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef86"), "ENAME" : "FORD", "COMM" : "NULL", "HIREDATE" : "1981-12-03:00:00:00", "EMPNO" : "7902", "MGR" : "7566", "JOB" : "ANALYST", "DEPTNO" : "20", "SAL" : "3000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef87"), "ENAME" : "MILLER", "COMM" : "NULL", "HIREDATE" : "1982-01-23:00:00:00", "EMPNO" : "7934", "MGR" : "7782", "JOB" : "CLERK", "DEPTNO" : "10", "SAL" : "1300.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef88"), "ENAME" : "SMITH", "COMM" : "NULL", "HIREDATE" : "1980-12-17:00:00:00", "EMPNO" : "7369", "MGR" : "7902", "JOB" : "CLERK", "DEPTNO" : "20", "SAL" : "800.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef89"), "ENAME" : "ALLEN", "COMM" : "300.00", "HIREDATE" : "1981-02-20:00:00:00", "EMPNO" : "7499", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1600.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef8a"), "ENAME" : "WARD", "COMM" : "500.00", "HIREDATE" : "1981-02-22:00:00:00", "EMPNO" : "7521", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1250.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef8b"), "ENAME" : "JONES", "COMM" : "NULL", "HIREDATE" : "1981-04-02:00:00:00", "EMPNO" : "7566", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "20", "SAL" : "2975.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef8c"), "ENAME" : "MARTIN", "COMM" : "1400.00", "HIREDATE" : "1981-09-28:00:00:00", "EMPNO" : "7654", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1250.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef8d"), "ENAME" : "BLAKE", "COMM" : "NULL", "HIREDATE" : "1981-05-01:00:00:00", "EMPNO" : "7698", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "30", "SAL" : "2850.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef8e"), "ENAME" : "CLARK", "COMM" : "NULL", "HIREDATE" : "1981-06-09:00:00:00", "EMPNO" : "7782", "MGR" : "7839", "JOB" : "MANAGER", "DEPTNO" : "10", "SAL" : "2450.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef8f"), "ENAME" : "SCOTT", "COMM" : "NULL", "HIREDATE" : "1987-04-19:00:00:00", "EMPNO" : "7788", "MGR" : "7566", "JOB" : "ANALYST", "DEPTNO" : "20", "SAL" : "3000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef90"), "ENAME" : "KING", "COMM" : "NULL", "HIREDATE" : "1981-11-17:00:00:00", "EMPNO" : "7839", "MGR" : "NULL", "JOB" : "RESIDENT", "DEPTNO" : "10", "SAL" : "5000.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef91"), "ENAME" : "TURNER", "COMM" : "0", "HIREDATE" : "1981-09-08:00:00:00", "EMPNO" : "7844", "MGR" : "7698", "JOB" : "SALESMAN", "DEPTNO" : "30", "SAL" : "1500.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef92"), "ENAME" : "ADAMS", "COMM" : "NULL", "HIREDATE" : "1987-05-23:00:00:00", "EMPNO" : "7876", "MGR" : "7788", "JOB" : "CLERK", "DEPTNO" : "20", "SAL" : "1100.00" }
{ "_id" : ObjectId("57c24ad4821c870ad95eef93"), "ENAME" : "JAMES", "COMM" : "NULL", "HIREDATE" : "1981-12-03:00:00:00", "EMPNO" : "7900", "MGR" : "7698", "JOB" : "CLERK", "DEPTNO" : "30", "SAL" : "950.00" }
Type "it" for more
MongoDB Enterprise >

评分

参与人数 1金币 +2 收起 理由
iidba + 2

查看全部评分

标签: 暂无标签
dongxujian

写了 86 篇文章,拥有财富 384,被 13 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

P3 | 发表于 2016-12-15 20:25:47
你好
我刚看了您的 分享 gg for mysql to mongo
我想问下 :
同步到mongo 后 数据类型能保持一致吗 比如源是 date 型 同步到mongo也是 date 型
回复

使用道具

P4 | 发表于 2016-12-19 19:48:52
我是简单的测试,可以
回复

使用道具

P3 | 发表于 2016-12-22 18:57:48
请问下 怎么配置才能 诗句类型保持一致
我 源 mysql datetime 型 过来全变成 string 了
回复

使用道具

P3 | 发表于 2016-12-24 14:37:19
dongxujian 发表于 2016-12-19 19:48
我是简单的测试,可以

请问怎么配置呢 我通过过来的全变成 string了
回复

使用道具

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈