head over to the blog of dbi services to read the full article:
Archives For helpers
head over to the blog of dbi services to read the full article:
head over to the blog of dbi services to read the full article:
head over to the blog of dbi services to read the full article:
head over to the blog of dbi services to read the full article:
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:
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
Lets continue this series of posts:
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
In Part 3 we had two (or more) VMs up and running with the following specs:
- eth0 configured as the public network
- eth1 configured as the private interconnect
- three shared storage devices for the ASM disks
- oracle users and groups
- a sample source file deployed on all Vms
this might be sufficiant for starting a lab if you want to demonstrate the installation of a grid infratructure. but we can even go further and automate the setup of the GI. what else would be required?
- the source file for the grid infrastructure (stored in /var/www/html/sources). in this case the 11.2.0.4 files downloaded from mos
- kernel parameters
- partitions on the disks
- limits for the oracle users
- setting the io scheduler
- the cluster configuration file
- the gi software installation
- password-less ssh connectivity for the grid user
here are the updated scripts (as pdfs to reduce the length of this post):
- create_gi_rac_lab.sh
- finish_gi_setup.sh (this needs to placed in the /var/www/html directory of the cobbler server)
- oracledatabaseserver.ks
place these on the cobbler server in same locations as in the previous posts, then:
./create_gi_rac_lab.sh mylab 2
fetch one of the vm setup scripts:
ls -la /var/www/html/mylab/setup*.sh -rw-r--r--. 1 root root 3821 Jan 11 09:32 /var/www/html/mylab/setup_p_1.sh -rw-r--r--. 1 root root 3821 Jan 11 09:32 /var/www/html/mylab/setup_p_2.sh
… and fire up the VMs on your workstation.
give each vm some minutes before starting the next one. the reason is that the last vm will do the configuration of the GI and therefore the other vms should be up and running when the configuration starts. once the last one completed you have the GI up and running on all the nodes:
[root@mylabp1vm1 ~]# /opt/oracle/product/crs/11.2.0.4/bin/crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.CRS_DG.dg 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 mylabp1vm1 ora.mylabp1vm1.vip 1 ONLINE ONLINE mylabp1vm1 ora.mylabp1vm2.vip 1 ONLINE ONLINE mylabp1vm2 ora.oc4j 1 ONLINE ONLINE mylabp1vm1 ora.scan1.vip 1 ONLINE ONLINE mylabp1vm2
there still is much room for improvement, but for now it at least works … takes around 20 minutes on my workstation until both nodes are up and configured.
a nice article on the history of grep:
today ( by accident ) I discovered a nice tool that shows socket information on linux:
ss -s Total: 666 (kernel 0) TCP: 21 (estab 7, closed 1, orphaned 0, synrecv 0, timewait 1/0), ports 0 Transport Total IP IPv6 * 0 - - RAW 0 0 0 UDP 24 17 7 TCP 20 16 4 INET 44 33 11 FRAG 0 0 0
there are much more options:
Usage: ss [ OPTIONS ] ss [ OPTIONS ] [ FILTER ] -h, --help this message -V, --version output version information -n, --numeric don't resolve service names -r, --resolve resolve host names -a, --all display all sockets -l, --listening display listening sockets -o, --options show timer information -e, --extended show detailed socket information -m, --memory show socket memory usage -p, --processes show process using socket -i, --info show internal TCP information -s, --summary show socket usage summary -b, --bpf show bpf filter socket information -4, --ipv4 display only IP version 4 sockets -6, --ipv6 display only IP version 6 sockets -0, --packet display PACKET sockets -t, --tcp display only TCP sockets -u, --udp display only UDP sockets -d, --dccp display only DCCP sockets -w, --raw display only RAW sockets -x, --unix display only Unix domain sockets -f, --family=FAMILY display sockets of type FAMILY -A, --query=QUERY, --socket=QUERY QUERY := {all|inet|tcp|udp|raw|unix|packet|netlink}[,QUERY] -D, --diag=FILE Dump raw information about TCP sockets to FILE -F, --filter=FILE read filter information from FILE FILTER := [ state TCP-STATE ] [ EXPRESSION ]
have fun with sockets …