Archives For helpers

head over to the blog of dbi services to read the full article:

Linux quick tip – What is the local time in Kolkata?

Advertisements

head over to the blog of dbi services to read the full article:

Launching a VM with the Amazon AWS command line tools

head over to the blog of dbi services to read the full article:

Linux Magic System Request Key Hacks

head over to the blog of dbi services to read the full article:

quickly exchange code or text between workstations or teams

head over to the blog of dbi services to read the full article:

tmux – an alternative to screen

this is merely a documenation post for myself as I always forgot the steps to get this working. as postgres plus advanced server 9.4 was released some days ago we wanted to do another poc for an oracle migration. using edbmtk was clearly the preferred way to do this as it automates most of the tasks. but how did we need to set this up the last time?

as a first step one needs to download the oracle jdbc driver for the java version available on the postgres server.

example:
ojdbc6.jar – for use with java 6
ojdbc7.jar – for use with java 7

put one of these under:

ls -la /etc/alternatives/jre/lib/ext/
total 5264
drwxr-xr-x.  2 root root    4096 Feb 12 12:54 .
drwxr-xr-x. 11 root root    4096 Jan 26 18:26 ..
-rw-r--r--.  1 root root   10075 Jan  9 02:39 dnsns.jar
-rw-r--r--.  1 root root  452904 Jan  9 02:48 gnome-java-bridge.jar
-rw-r--r--.  1 root root  558461 Jan  9 02:40 localedata.jar
-rw-r--r--.  1 root root     427 Jan  9 02:45 meta-index
-rw-r--r--.  1 root root 3698857 Feb 12 12:54 ojdbc7.jar
-rw-r--r--.  1 root root   69699 Jan  9 02:46 pulse-java.jar
-rw-r--r--.  1 root root  225679 Jan  9 02:41 sunjce_provider.jar
-rw-r--r--.  1 root root  259918 Jan  9 02:39 sunpkcs11.jar
-rw-r--r--.  1 root root   78194 Jan  9 02:42 zipfs.jar

the next step is to configure the toolkit.properties file:

cat /opt/PostgresPlus/edbmtk/etc/toolkit.properties
SRC_DB_URL=jdbc:oracle:thin:@[ORACLE_SERVER]:[LISTENER_PORT]:[DATABASE]
SRC_DB_USER=system
SRC_DB_PASSWORD=manager

TARGET_DB_URL=jdbc:edb://localhost:5432/[POSTGRES_DATABASE]
TARGET_DB_USER=postgres
TARGET_DB_PASSWORD=postgres

… and then kickoff the migration:

cd /opt/PostgresPlus/edbmtk/bin
./runMTK.sh -fastCopy -logBadSQL -fetchSize 10000 -loaderCount 6 -dropSchema true -useOraCase ORACLE_SCHEMA1,ORACLE_SCHEMA2,...

pretty easy. wait for edbmtk to finish and start fixing the objects that are invalid :)

btw: for migrations to pure community postgres take a look at ora2pg

this is the last very short post of this series:

Create your own Oracle Staging Environment, Part 1: The Staging Server
Create your own Oracle Staging Environment, Part 2: Kickstart File(s) and Profiles
Create your own Oracle Staging Environment, Part 3: Setup the lab environment
Create your own Oracle Staging Environment, Part 4: Staging the GI

at the end of the last post the GI was up and running. from this point onwards it would be easy to use dbca or scripts to setup a RAC database. but we can even automate this. updated script:

finish_gi_setup_rac.sh

save this under /var/www/html/finish_gi_setup.sh on the cobbler vm and fire up the vms. the result is:

crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS_DG.dg
               ONLINE  ONLINE       mylabp1vm1                                   
               ONLINE  ONLINE       mylabp1vm2                                   
ora.DATA.dg
               ONLINE  ONLINE       mylabp1vm1                                   
               ONLINE  ONLINE       mylabp1vm2                                   
ora.FRA.dg
               ONLINE  ONLINE       mylabp1vm1                                   
               ONLINE  ONLINE       mylabp1vm2                                   
ora.LISTENER.lsnr
               ONLINE  ONLINE       mylabp1vm1                                   
               ONLINE  ONLINE       mylabp1vm2                                   
ora.LISTENER_ASM.lsnr
               ONLINE  ONLINE       mylabp1vm1                                   
               ONLINE  ONLINE       mylabp1vm2                                   
ora.asm
               ONLINE  ONLINE       mylabp1vm1               Started             
               ONLINE  ONLINE       mylabp1vm2               Started             
ora.gsd
               OFFLINE OFFLINE      mylabp1vm1                                   
               OFFLINE OFFLINE      mylabp1vm2                                   
ora.net1.network
               ONLINE  ONLINE       mylabp1vm1                                   
               ONLINE  ONLINE       mylabp1vm2                                   
ora.ons
               ONLINE  ONLINE       mylabp1vm1                                   
               ONLINE  ONLINE       mylabp1vm2                                   
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       mylabp1vm2                                   
ora.cvu
      1        ONLINE  ONLINE       mylabp1vm2                                   
ora.mylabp1vm1.vip
      1        ONLINE  ONLINE       mylabp1vm1                                   
ora.mylabp1vm2.vip
      1        ONLINE  ONLINE       mylabp1vm2                                   
ora.oc4j
      1        ONLINE  ONLINE       mylabp1vm2                                   
ora.racdb.db
      1        ONLINE  ONLINE       mylabp1vm2               Open                
      2        ONLINE  ONLINE       mylabp1vm1               Open                
ora.scan1.vip
      1        ONLINE  ONLINE       mylabp1vm2