Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   1   PPT  Slide  1  (Title  Slide):     Using  EDB  Postgres   Replication  Server  to   Offload  Oracle  Reporting   Database  to  Postgres  

Audio   Presenter:     Hello.       My  name  is  Matt  Lewandowski.    I  am  a  Sales   Engineer  with  EnterpriseDB.   EnterpriseDB  is  the  leading  worldwide   provider  of  Postgres  software  and  services   that  enable  enterprises  to  reduce  their   reliance  on  costly  proprietary  database   solutions  and  in  turn  significantly  reduce   their  database  expenditures.   In  this  video,  I  am  going  to  show  you  how   you  can  use  the  EDB  Postgres  Replication   Server  to  offload  Oracle  reporting   workloads  to  a  Postgres  database.  

2   PPT  Slide  2  /  Title:  

Presenter:  

Why  offload  reporting   workloads  from  Oracle  to   Postgres?  

At  this  point,  you  may  be  asking  yourself   why  you  would  want  to  offload  your   reporting  workloads  from  Oracle  to   Postgres.   There  are  several  reasons.  

3   PPT  Slide  2  /  Bullet  1:  

Perhaps  the  most  common  reason  is  to   reduce  your  Oracle  licensing  costs.  

4   PPT  Slide  2  /  Bullet  1  /   Sub-­‐bullet  1:  

By  moving  some  or  all  of  your  reporting   workloads  to  Postgres,  you  can  free  up  your   existing  Oracle  licenses  for  other  more   critical  uses.  

5   PPT  Slide  2  /  Bullet  1  /   Sub-­‐bullet  2:  

Doing  so  can  also  help  provide  a  safeguard   against  violating  existing  Oracle  licensing   constraints,  which  could  result  in   unexpected  additional  costs.  

Page 1 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   6   PPT  Slide  2  /  Bullet  1  /   Sub-­‐bullet  3:  

Audio   It’s  also  possible  that  by  moving  your   reporting  workloads  to  Postgres  you  can   take  advantage  of  free  or  lower  cost  options   instead  of  investing  in  additional  Oracle   components  or  features.    For  example,  if  you   want  to  extend  your  reporting  capabilities   to  include  Geospatial  information,  you  could   use  the  freely  available,  yet  powerful,   PostgreSQL  PostGIS  extension  as  an   alternative  to  using  Oracle  Spatial.  

7   PPT  Slide  2  /  Bullet  2:  

Another  reason  why  you  might  choose  to   offload  some  of  your  reporting  workloads   from  Oracle  is  to  facilitate  the  integration  of   data  contained  in  Oracle  with  reporting   workloads  already  being  performed  in   Postgres  that  may  or  may  not  include   information  from  other  data  sources  as  well.  

8   PPT  Slide  2  /  Bullet  3:  

Yet  another  reason  for  choosing  to  move   reporting  workloads  from  Oracle  to   Postgres  may  be  to  support  a  phased   approach  of  migrating  your  existing   applications  off  of  Oracle  to  Postgres   altogether.       Taking  a  phased  approach  where  possible   can  ease  the  transition  of  migrating  critical   applications  off  of  Oracle  to  the  much  lower   cost  EDB  Postgres  Advanced  Server.  

9   PPT  Slide  2  /  Bullet  3  /   Sub-­‐bullet  1:  

Such  an  approach  can  help  you  reduce  risk   by  allowing  you  to  migrate  the  often-­‐ simpler  read-­‐only  applications  first.   One  of  the  derivative  benefits  of  this   approach  is  that  you  can  build  up  Postgres   proficiency  that  can  be  applied  on  your   remaining  application  migration  efforts.  

10   PPT  Slide  2  /  Bullet  3  /   Sub-­‐bullet  2:  

A  phased  approach  also  provides  increased   schedule  flexibility.  

Page 2 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   11   PPT  Slide  2  /  Bullet  3  /   Sub-­‐bullet  3:  

Audio   In  addition,  offloading  your  reporting   workloads  as  part  of  a  phased  application   migration  strategy  provides  the  ability  to   deploy  the  Postgres  based  read-­‐only   applications  in  parallel  with  your  current   Oracle  applications,  thus  supporting  a  more   graceful  switch  over  of  the  applications   after  they  have  been  sufficiently  tested.  

12   PPT  Slide  2  /  Bullet  4:  

Finally,  moving  your  reporting  workloads   off  of  your  Oracle  server  can  possibly  result   in  performance  benefits.  

13   PPT  Slide  2  /  Bullet  4  /   Sub-­‐bullet  1:  

Doing  so  may  allow  you  to  more  fully  utilize   the  resources  on  your  Oracle  server  and   tune  your  Oracle  OLTP  system  for  optimal   transaction  performance.  

14   PPT  Slide  2  /  Bullet  4  /   Sub-­‐bullet  2:  

Similarly,  having  your  reporting  system  on  a   dedicated  Postgres  server  will  allow  it  to  be   tuned  for  optimal  query  performance.  

15   PPT  Slide  3  /  Title:  

Now  that  we  have  offered  some  reasons   why  you  might  choose  to  offload  your   reporting  workloads  from  Oracle  to   Postgres,  you  may  be  wondering  what  EDB   Postgres  Replication  Server  is  and  how  it   can  be  used  to  perform  this  function.  

What  is  EDB  Postgres   Replication  Server?  

16   PPT  Slide  3  /  Answer  

EDB  Postgres  Replication  Server  is  a  tool   provided  by  EnterpriseDB  for  near  real-­‐ time  replication  of  data  from  one  database   to  another.  

17   PPT  Slide  3  /  Highlights  /   The  following  are  some  of  the  highlights  of   Intro   the  EDB  Postgres  Replication  Server  tool.  

Page 3 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   Audio   18   PPT  Slide  3  /  Highlights  /   The  Replication  Server  provides  the  ability   Bullet  1   to  perform  both  Single  Master  Replication   (or  SMR)  and  Multi  Master  Replication  (or   MMR).   Single  Master  Replication  is  used  to  produce   and  synchronize  read-­‐only  replicas  of   information  from  a  master  database  to  one   or  more  target  databases.   Multi  Master  Replication  is  used  to  produce   and  synchronize  replicas  that  support   database  writes  in  each  of  the  replicas.     Typically,  an  MMR  system  is  deployed  to   promote  the  performance  of  localized  reads   and  writes  in  a  geographically  dispersed   database  system.   19   PPT  Slide  3  /  Highlights  /   The  EDB  Replication  Server  supports  Oracle   Bullet  1  /  Sub-­‐bullet   –to-­‐Postgres  replication  under  a  Single   Master  Replication  configuration.   20   PPT  Slide  3  /  Highlights  /   The  EDB  Replication  Server  provides  the   Bullet  2   ability  to  filter  the  data  available  in  a  source   table  so  that  you  can  replicate  only  the  data   you  need.   21   PPT  Slide  3  /  Highlights  /   Replication  operations  can  be  scheduled  or   Bullet  3   performed  continuously.   In  addition,  synchronizations  can  be   performed  on  an  on-­‐demand,  or  manual,   basis  if  desired.   22   PPT  Slide  3  /  Highlights  /   EDB  Postgres  Replication  Server,  like  all   Bullet  4   EDB  tools,  is  included  in  any  of  the  EDB   subscription  offerings  and  may  be  used  on   all  the  databases  covered  by  the   subscription.   23   PPT  Slide  3  /  Highlights  /   For  those  of  you  who  are  current  EDB   Bullet  5   customers,  “EDB  Postgres  Replication   Server”  is  the  new  name  for  the  tool   formerly  known  as  “xDB  Replication   Server”.  

Page 4 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   24   PPT  Slide  3  /  SMR  Intro  

Audio   Since  the  offloading  of  reporting  workloads   from  Oracle  to  Postgres  is  supported  under   a  Single  Master  Replication  configuration,   the  following  graphic  is  provided  to   illustrate  a  high  level  depiction  of  an  SMR   system.  

25   PPT  Slide  3  /  SMR  Intro  /   In  a  Single  Master  Replication  system,  there   Source  DB   will  be  a  source  database  in  which  reads   and  writes  are  performed  that  will  serve  as   the  SMR  master.       Currently,  the  EDB  Replication  Server   supports  Oracle,  SQL  Server,  community   PostgreSQL,  and  EDB  Postgres  Advanced   Server  databases  being  used  as  SMR   masters.   25   PPT  Slide  3  /  SMR  Intro  /   One  or  more  subscription  databases  can  be   Target  DB   configured  to  receive  replication  updates   from  the  master,  or  publication,  database.   The  EDB  Replication  Server  supports   Community  PostgreSQL  and  EDB  Postgres   Advanced  Server  databases  being  used  as   SMR  subscription  databases.   26   PPT  Slide  3  /  SMR  Intro  /   After  an  SMR  subscription  has  been   Replication   configured  and  initialized,  changes  made  to   data  in  the  corresponding  publication  are   applied  to  the  subscription  databases  either   on  a  near  real-­‐time  continuous  basis,   scheduled  basis,  or  on-­‐demand  basis.   If  table  filters  have  been  assigned  to  tables   in  a  subscription,  only  those  changes  that   meet  the  filtering  criteria  will  be  applied  in   the  subscription  database.   27   PPT  Slide  3  /  SMR  Intro  /   After  replication  has  occurred,  the   Replica   subscription  database  will  contain  a  replica   of  the  publication  data,  making  it  available   for  read-­‐only  workloads.  

Page 5 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   28   PPT  Slide  4  /  Title:   What  are  the  components   in  an  Oracle-­‐to-­‐Postgres   Replication?  

Audio   Now  that  we  know  a  little  about  the  EDB   Postgres  Replication  Server,  let’s  take  a  look   at  the  various  components  that  make  up  a   typical  Oracle-­‐to-­‐Postgres  replication   system.    

29   PPT  Slide  4  /  Oracle  DB  

First  of  all,  and  quite  obviously,  there  will  be   an  Oracle  database  that  will  have  one  or   more  tables,  possibly  in  more  than  one   schema  that  will  be  the  publication   database.  

30   PPT  Slide  4  /  Postgres   DB  

There  will  also  be  a  Postgres  database,   either  a  community  PostgreSQL  database  or   an  EDB  Postgres  Advanced  Server  database,   which  will  serve  as  the  subscription   database  and  receive  a  read-­‐only  copy  of   the  information  from  the  publication  tables.    

31   PPT  Slide  4  /  EDB   Postgres  Replication   Server  

Next,  there  is  the  EDB  Postgres  Replication   Server  itself,  which  consists  of  both  a   Publication  Server  and  a  Subscription   Server.   The  Publication  Server  is  a  program  that   configures  the  publication  database  for   replication  and  performs  replication,  and   the  Subscription  Server  is  a  program  that   configures  the  subscription  database  for   replication  and  initiates  replication.   Both  the  Publication  Server  and  the   Subscription  Server  run  as  services  on  the   machine  on  which  they  are  installed.   Upon  startup,  they  retrieve  connection  and   authentication  information  for  the   publication  database  that  has  been   designated  as  the  controller  database  from   the  xDB  Replication  Configuration  file.  

Page 6 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   32   PPT  Slide  4  /  xDB   Replication  Interfaces  

Audio   Either  the  “xDB  Replication  Console”  or  the   “xDB  Replication  Server  Command  Line   Interface”  can  be  used  to  configure,  operate,   and  maintain  replication  systems.   The  “xDB  Replication  Console”  is  a  graphical   user  interface,  whereas,  the  “xDB   Replication  Server  Command  Line  Interface   (or  CLI)”  is  a  command  line  interface   providing  equivalent  functionality  as  the   graphical  user  interface.       The  CLI  commands  may  be  used  in   operating  system  scripts  to  automate   replication  system  operations.  

33   PPT  Slide  4  /  Oracle   Publication  Database   Definition  

The  first  step  in  setting  up  the  Oracle-­‐to-­‐ Postgres  replication  system  is  to  create  an   “Oracle  Publication  Database  Definition”,   which  identifies  the  Oracle  database   connection  parameters.  

34   PPT  Slide  4  /  Control   Schema  

When  the  Publication  Database  is  added,   the  replication  control  schema  is  created  in   the  publication  database.   The  control  schema  is  used  to  store   configuration  and  operational  metadata  for   the  replication  system.  

35   PPT  Slide  4  /  Publication   To  identify  which  tables  in  the  publication   database  are  to  be  replicated,  a  publication   is  created.   The  publication  can  contain  tables  from  one   or  more  schemas  in  the  database.  

Page 7 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   36   PPT  Slide  4  /  Postgres   Subscription  Database   Definition  

Audio   With  the  publication  information  in  place,  a   “Postgres  Subscription  Database  Definition”   is  added.   Like  the  publication  database  definition,  the   subscription  database  definition  identifies   the  parameters  for  connecting  to  the  target   Postgres  database.   Adding  the  subscription  database  definition   results  in  metadata  being  recorded  in  the   control  schema  about  the  subscription   database.  

37   PPT  Slide  4  /   Subscription  

To  complete  the  configuration  of  the   replication  system,  a  Subscription  is   created.   The  subscription  identifies  the  tables  from   the  publication  that  are  to  be  included  in  the   replication,  as  well  as  any  filters  that  should   be  applied  to  the  publication  tables.   A  replication  schedule  can  also  be  specified   for  a  subscription  if  desired.     When  a  subscription  is  created,  schemas   and  tables  corresponding  to  those  in  the   publication  database  are  created  in  the   subscription  database.   At  this  point,  the  tables  in  the  subscription   database  are  empty.  

38   PPT  Slide  4  /  Replication   To  perform  the  initial  population  of  the   subscription  tables,  a  snapshot  replication   operation  is  performed.   Thereafter,  changes  will  be  propagated   from  the  publication  tables  to  the   subscription  tables  via  synchronization   replication  operations.   All  of  the  data  in  a  subscription  can  be   refreshed  via  a  snapshot  replication  if   desired.  

Page 8 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   39   PPT  Slide  5  /  Title:   What  are  the  steps  to   configure  and  perform  an   Oracle-­‐to-­‐Postgres   Replication?   40   PPT  Slide  5  /  Bullet  1  

Audio   Now  that  we  have  a  better  understanding  of   the  different  parts  of  an  Oracle-­‐to-­‐Postgres   replication  system,  let’s  identify  the  steps   that  are  followed  to  configure  and  perform   the  replication.   The  first  step  is  to  prepare  the  publication   database  for  replication.   This  essentially  requires  creating  or   configuring  an  Oracle  user  with  the   necessary  privileges  for  managing   publication  information  and  retrieving   publication  data.   The  publication  user  needs  to  be  able  to:  

41   PPT  Slide  5  /  Bullet  1  /   Sub-­‐bullet  1  



connect  to  the  publication  database,  

42   PPT  Slide  5  /  Bullet  1  /   Sub-­‐bullet  2  



create  control  schema  objects,  

43   PPT  Slide  5  /  Bullet  1  /   Sub-­‐bullet  3  



read  the  publication,  

44   PPT  Slide  5  /  Bullet  1  /   Sub-­‐bullet  4  



and  create  triggers  on  publication  tables  

45   PPT  Slide  5  /  Bullet  2  

The  subscription  database  also  needs  to  be   prepared  to  support  replication.   To  prepare  a  Postgres  database  for  a   subscription,  

46   PPT  Slide  5  /  Bullet  2  /   Sub-­‐bullet  1  

Create  a  new  superuser  or  choose  an   existing  superuser,  like  the  advanced  server   “enterprisedb”  user,  to  be  the  subscription   database  user.  

Page 9 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   47   PPT  Slide  5  /  Bullet  2  /   Sub-­‐bullet  2  

Audio   Finally,  create  or  choose  the  subscription   database.   With  the  database  preparations  in  place,  the   remaining  steps  can  be  performed  using  the   xDB  Replication  Console  or  the  xDB   Replication  Server  Command  Line  Interface.  

48   PPT  Slide  5  /  Bullet  3  

First,  add  the  Oracle  database  as  an  SMR   publication  database.    

49   PPT  Slide  5  /  Bullet  4  

Then,  create  a  publication  with  tables  from   the  Oracle  database.  

50   PPT  Slide  5  /  Bullet  5  

Next,  add  a  PostgreSQL  or  EDB  Postgres   Advanced  Server  subscription  database.  

51   PPT  Slide  5  /  Bullet  6  

Then,  create  a  subscription  under  the   subscription  database,  selecting  tables  from   the  previously  defined  Oracle  database   publication.  

52   PPT  Slide  5  /  Bullet  7  

Next,  perform  the  initial  population  of  the   subscription  tables  with  data  from  the   publication  tables  by  performing  a  snapshot   replication.  

53   PPT  Slide  5  /  Bullet  8  

Finally,  perform  on-­‐demand  or  scheduled   synchronization  replications  to  update  the   subscription  tables  with  changes  made  in   the  publication  tables.  

54   PPT  Slide  6  /  Title:  

At  this  point,  we’re  just  about  ready  for  a   demonstration.  

Demo  Preparation  

Before  jumping  right  into  the  demo,  let  me   first  set  the  stage  by  providing  some   information  about  the  demo  environment.  

Page 10 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   Audio   55   PPT  Slide  6  /  Publication   For  my  demo,  I  am  using  an  Oracle  Express   Database   Edition  database  with  the  HR  sample   schema  running  in  a  docker  container  on   my  host  machine.   The  S-­‐I-­‐D  of  the  Oracle  Express  Edition   database  is  “XE”.   This  database  will  serve  as  my  publication   database.   Note  that  since  Oracle  is  running  within  the   docker  container,  the  normal  Oracle  TNS   listener  port  of  1521  has  been  mapped  to   port  49161.    In  most  typical  Oracle-­‐to-­‐ Postgres  replication  systems,  the  port  used   for  the  Oracle  database  definition  will  be   port  1521  instead.   56   PPT  Slide  6  /   Subscription  Database  

Also  for  my  demo,  I  have  installed  EDB   Postgres  Advanced  Server  9.5  on  a  CentOS  7   virtual  machine  running  on  my  host.   In  preparation  for  my  demo,  I  have  created   an  “orarepdemo”  database  running  on  port   5450  within  the  virtual  machine.     I  have  also  created  a  superuser  named   “subuser”  to  serve  as  the  subscription  user.    

57   PPT  Slide  6  /  EDB   Replication  Server  

Finally,  I  have  also  installed  the  EDB   Postgres  Replication  Server  in  the  same   CentOS  7  virtual  machine  where  Postgres   Advanced  Server  is  installed.   The  Publication  Server  and  the  Subscription   Server  are  both  configured  to  use  the   default  ports  and  user.    

Page 11 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   58   Demo  /  Start  /  CentOS   Desktop   Open  xDB  Replication   Console.   Expand  left  navigation   pane.  

Audio   For  this  demo,  I  am  going  to  use  the  xDB   Replication  Console  to  configure  and   perform  the  Oracle-­‐to-­‐Postgres  replication.   So,  let’s  go  ahead  and  launch  it.   On  my  linux  machine  I  can  launch  the   replication  console  using  the  shortcut  in  the   “Postgres  Plus  Add-­‐ons”  menu  under  the   “Applications”  menu.   If  I  were  running  on  Windows,  I  could   similarly  launch  the  application  from  the   Start  menu.   After  launching  the  replication  console,  if   the  Publication  Server  and  the  Subscription   Server  hadn’t  already  been  registered,  I   would  have  had  to  perform  this  step  first.   However,  since  I  already  registered  the   servers  in  the  course  of  preparing  for  this   demonstration,  I  don’t  need  to  do  this  now.   When  I  registered  the  Publication  and   Subscription  servers,  I  chose  to  save  the   login  information.       As  a  result,  when  the  replication  console   was  launched,  it  automatically  logged  into   the  servers,  making  them  available  for  me   to  start  working  with  them.  

Page 12 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   59   Demo  /  xDB  Replication   Console  Window  

Audio   Since  I  have  already  prepared  an  Oracle   database  to  serve  as  my  Publication   Expand  Publication  Server   database  and  an  EDB  Advanced  Server   database  as  my  Subscription  database,  the   node.   first  step  I  need  to  take  is  to  add  a  database   Expand  SMR  node.   definition  for  the  Oracle  database  under  the   Publication  server.   Select  SMR  node.   To  do  so,  I  will  expand  the  “Publication   Select  “Add  Database”   Server”   option.   If  I  expand  the  “SMR”  node,  the  list  of  any   publication  databases  I  may  have  previously   added  will  be  displayed.    To  add  the  Oracle  database,  I  will  select  the   “SMR”  node,  bring  up  the  context  menu,  and   then  select  “Add  Database”.  

60   Demo  /  Add  Database   Window   Select  Database  Type:   Oracle.   Enter  Host,  Port  User,   Password,  and  Database.   Select  “Test”  button.   Close  Test  Result  dialog.   Select  “Save”  button.  

In  the  “Add  Database”  window,  I  will  first   select  “Oracle”  from  the  “Database  Type”   drop  down.   Then,  I  will  enter  the  information  that  will   be  used  to  connect  to  the  Oracle  database.   As  I  mentioned  earlier,  normally  “1521”   would  be  entered  for  the  “Port”;  however,   since  I’m  connecting  to  an  Oracle  XE   instance  running  in  a  docker  container,  port   “1521”  has  actually  been  mapped  to  port   “49161”.    That’s  why  I’m  using  that  here.   Now  that  I’ve  entered  the  connection   parameters,  let  me  select  the  “Test”  button   to  verify  that  I  can  connect  to  the  database.   The  connection  parameters  are  good.       I  will  select  “OK”  to  close  the  message  dialog   …  and  then  the  “Save”  button  to  save  the   database  definition.  

Page 13 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   61   Demo  /  xDB  Replication   Console  Window   Select  Oracle  database   under  SMR  node.  

Audio   As  you  can  see,  there  is  now  an  “Oracle”   database  under  the  “SMR”  node.   Now,  I  need  to  create  a  publication.   To  do  so,  I  will  select  the  Oracle  database,    

Select  “Create  Publication”   …  open  the  context  menu,     option.   …  and  select  the  “Create  Publication”  menu   option.   62   Demo  /  Create   Publication  Window   Enter  “Publication  Name”:   Oracle  HR  Publication.   Select  “Select  All”   checkbox.   Select  “Create”  button.   Select  “OK”  in  Create   Publication  message   dialog.  

In  the  “Create  Publication”  window,  you  can   see  the  list  of  tables  in  the  Oracle  database   that  are  available  to  be  included  in  the   publication.   First,  I  will  give  the  publication  a  name.   Since  I  want  all  of  the  tables  that  are  shown,   I  will  check  the  “Select  All”  checkbox.   If  I  wanted  to  define  any  filters  on  the   tables,  I  could  select  the  “Table  Filters”  tab.   However,  since  I  plan  to  replicate  all  of  the   data,  I  am  not  going  to  worry  about  creating   any  filters  at  this  time.   Also,  since  I  plan  to  perform   synchronization  replications,  I  will  leave  the   “Snapshot-­‐only  replication”  option   unchecked.   Now  that  I’ve  gotten  everything  specified   the  way  I  want,  I  select  the  “Create”  button   to  save  the  publication  information.   If  the  publication  is  created  successfully,  a   message  box  will  be  displayed.   Select  the  “OK”  button  to  close  the  message   box  and  the  “Create  Publication”  window.  

Page 14 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   63   Demo  /  xDB  Replication   Console   Newly  created  publication   and  corresponding  tables   in  the  publication  are   displayed.   Expand  Subscription   Server  node.  

Audio   Now  we  see  the  publication  we  just  created   under  the  Oracle  database  as  well  as  the   tables  that  make  up  the  publication.   Let’s  now  set  up  our  subscription.   First,  expand  the  “Subscription  Server”  node   to  see  the  list  of  any  previously  defined   subscription  databases.   Since  we  don’t  see  our  subscription   database  in  the  list,  we  need  to  add  it.  

Select  the  Subscription   Server  node.   Select  the  “Add  Database”   option.   64   Demo  /  Subscription   Service  –  Add  Database   Window   Select  Database  Type:   Postgres  Plus  Advanced   Server.  

Select  the  “Add  Database”  option  from  the   “Subscription  Server”  context  menu.   Since  we  are  going  to  use  an  EDB  Postgres   Advanced  Server  database  for  our   subscription  database,  we  don’t  need  to   change  the  “Database  Type”  option.   We  simply  need  to  enter  our  database   connection  information.  

Enter  data  in  Host,  Port,   User,  Password,  and   Database  fields.  

The  database  we  will  be  using  for  the   subscription  is  on  the  local  machine  and   running  on  port  “5450”.  

Select  the  “Test”  button.  

Our  subscription  user  is  the  “subuser”  

Close  the  Test  Result   dialog.  

…  and  our  database  name  is  “orarepdemo”.  

Select  the  “Save”  button.  

To  make  sure  our  connection  information  is   good,  we’ll  select  the  “Test”  button.  

Select  the  “Yes”  button  in   warning  dialog.  

Select  the  “OK”  button  to  close  the  success   message     …  and  then  the  “Save”  button  to  save  the   subscription  database  information.   Since  we  specified  “localhost”  for  the   database  host,  a  warning  message  is   displayed.    In  a  production  environment,  we   would  want  to  follow  the  advice  in  the   warning  message;  however,  since  this  is   only  a  demo,  we  can  select  “Yes”  to  ignore   the  warning  and  to  continue.  

Page 15 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   65   Demo  /  xDB  Replication   Console   Select  the  newly  added   subscription  database.  

Audio   The  database  has  been  added  to  the   “Subscription  Server”.   Now,  we  need  to  create  a  subscription.   We  can  do  this  by  selecting  the  newly  added   database  and  selecting  the  “Create   Subscription”  option  from  the  context   menu.    

Select  the  “Create   Subscription”  option.   66   Demo  /  Create   Subscription  Window   Enter  a  Subscription   Name:  Oracle  HR   Subscription  

In  the  “Create  Subscription”  window,  we’ll   specify  a  name  for  the  subscription  and   enter  the  appropriate  “Host”,  “Port”,  “User   Name”,  and  “Password”  information  for  the   “Publication  Server”.  

Enter  data  in  Host,  Port,   User  Name,  and  Password   fields.  

Keep  in  mind  these  parameters  are  for  the   EDB  Replication  Server  Publication  Server,   not  the  publication  database.  

Select  the  “Load”  button.  

In  my  environment,  the  Publication  Server   is  running  on  the  local  machine  on  the   default  port  of  “9051”.  

Select  the  Publication   name:  Oracle  HR   Publication  

The  default  “admin”  user  is  also  being  used.  

Select  the  “Create”  button.   Select  the  “Yes”  button  in   the  warning  dialog.   Select  “OK”  in  Create   Subscription  message   dialog.  

After  entering  the  information,  select  the   “Load”  button  to  load  the  list  of  available   publications  in  the  “Publication  Name”  drop   down.   For  this  demo,  we’re  going  to  select  “Oracle   HR  Publication”.   Then,  we’ll  hit  the  “Create”  button  to  create   the  subscription.   Again,  since  we  specified  “localhost”  for  the   Publication  Server  host,  a  warning  message   will  be  displayed.   As  before,  we  will  select  the  “Yes”  button  to   ignore  the  warning  and  continue  creating   the  subscription.   A  message  box  is  displayed  indicating  that   the  subscription  has  been  created.   Click  the  “OK”  button.  

Page 16 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   67   Demo  /  xDB  Replication   Console   Expand  the  Oracle  HR   Publication  node  under  the   Oracle  HR  Subscription   node.   Select  the  Oracle  HR   Subscription  node.   Select  the  “Snapshot”   option.  

Audio   Now  we  see  the  “Oracle  HR  Subscription”   under  our  subscription  database.   If  we  expand  the  “Oracle  HR  Publication”   node  under  the  subscription,  we  will  see  the   tables  that  make  up  the  subscription.   At  this  point,  if  we  were  to  look  in  the   “orarepdemo”  database,  we  would  see  that   the  “hr”  schema  and  tables  from  the   publication  have  been  created.    However,  no   data  has  been  transferred  to  these  tables   yet.   To  perform  the  initial  population  of  the   tables,  we  need  to  perform  a  snapshot  by   selecting  the  subscription  and  then  the   “Snapshot”  option  from  the  context  menu.  

68   Demo  /  Snapshot  –   Oracle  HR  Subscription  

A  “Snapshot”  dialog  is  opened.  

Select  the  “Verbose   Output”  checkbox.  

If  desired,  we  can  check  the  “Verbose   Output”  option  to  display  logging   information  as  the  snapshot  is  performed.  

Select  the  “Snapshot”   button.  

Selecting  the  “Snapshot”  performs  the  data   snapshot.  

Select  the  “OK”  button  in   the  message  dialog.  

The  message  box  indicates  that  the   snapshot  was  successful.  

Select  the  “Close”  button.  

Hit  the  “OK”  button  to  close  the  message   box  and  then  the  “Close”  button  to  return   back  to  the  replication  console  window.  

Page 17 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   69   Demo  /  PEM   Open  Postgres  Enterprise   Manager.   Double  click  on  prod   database  to  connect.   Enter  password  and  select   “OK”  button  if  prompted.  

Audio   Now  is  a  good  time  to  take  a  look  at  our   subscription  database  and  inspect  some  of   the  tables.   I  installed  the  EDB  Postgres  Enterprise   Manager  or  PEM  tool  in  my  environment.  So   I’ll  use  it  to  do  some  inspecting.   I’ll  open  the  PEM  tool  using  the  shortcut   under  the  CentOS  desktop  “Applications”   menu.   Our  subscription  database  is  running  on   port  5450  on  the  local  machine  as  the   “prod”  database  cluster.   I’ll  double  click  this  server  to  connect  to  it   and  enter  a  password  if  prompted.  

70   Demo  /  PEM  

To  inspect  the  tables  replicated  to  our   subscription  database,  we’ll  expand  the   “Tables”  node  for  the  “hr”  schema  under  the   “orarepdemo”  database.  

Expand  Databases  node   under  prod  cluster  node.   Expand  “orarepdemo”   database.  

Let’s  start  by  looking  at  the  “regions”  table.       If  we  expand  the  “Columns”  node  under  the   “regions”  table,  we’ll  see  that  there  is  a   “region_id”  column  and  a  “region_name”   column.  

Expand  Schemas  node.   Expand  Tables  node.   Expand  “regions”  table   node.  

 To  look  at  the  data,  I’ll  choose  the  “View  All   Rows”  option  from  the  “regions”  table   context  menu.  

Expand  Columns  node.   Select  “regions”  table.   Select  “View  Data  -­‐>  View   All  Rows”  option.   71   Demo  /  Edit  Data  –  prod   –  orarepdemo  –   hr.regions  Window  

The  “regions”  table  has  4  rows  in  it.  

Display  data.   Close  window.  

Page 18 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   72   Demo  /  PEM  

Audio   Now,  let’s  look  at  the  “countries”  table.  

Expand  “countries”  table   node.   Select  “countries”  table   node.   Select  “View  Data  -­‐>  View   All  Rows”  option.   73   Demo  /  Edit  Data  –  prod   –  orarepdemo  –   hr.countries  Window  

The  “countries”  table  has  3  columns     …  and  25  rows.  

Display  data.   Sort  data  by  country_id.   Scroll  through  data.   Close  window.   74   Demo  /  PEM  

Finally,  let’s  look  at  the  “locations”  table.  

Expand  “location”  table   node.   Select  “location”  table   node.   Select  “View  Data  -­‐>  View   All  Rows”  option.   75   Demo  /  Edit  Data  –  prod   –  orarepdemo  –   hr.locations  Window   Display  data.  

The  “locations”  table  has  6  columns     It  also  currently  has  23  rows,     …  4  of  which  correspond  to  US  locations.  

Filter  data  by  country_id  of   ‘US’.   Scroll  through  data.   Close  window.  

Page 19 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   76   Demo  /  PEM  

Audio   To  test  a  synchronization  replication,  let’s   open  an  Oracle  SQL  Developer  window  and   enter  some  data  in  the  Oracle  publication   tables.  

Minimize  PEM  window.  

First  I’ll  minimize  the  PEM  window  and   switch  views  to  the  machine  where  Oracle   and  SQL  Developer  are  installed.   77   Demo  /  Mac  Desktop   Switch  to  Mac  desktop   -­‐ -­‐

all  desktop  icons   hidden   SQL  Developer   window  displayed   with  connection  to  hr   schema  with  SQL   Worksheet  already   initiated.  

I  have  already  opened  a  SQL  Developer   connection  to  my  Oracle  database  as  the   “hr”  user.  

Page 20 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   78   Demo  /  Oracle  SQL   Developer  

Audio   I’ll  start  by  inserting  a  new  record  in  the   “REGIONS”  table.  

Expand  “hr”  connection   node.  

Let’s  add  a  row  with  a  REGION_ID  of  “5”  and   a  “REGION_NAME”  of  Other”  

Expand  Tables  node.  

Next,  I’ll  perform  a  commit.  

Expand  “REGIONS”  table.  

Then,  let’s  add  a  row  to  the  “COUNTRIES”   table  with  a  reference  to  the  new  REGION   record.  

Select  “REGIONS”  table.   Select  Data  tab.   Select  New  Row  button.   Enter  data  for  new  row   (REGION_ID  =  5  |   REGION_NAME  =  ‘Other’).   Select  Commit  button.   Expand  “COUNTRIES”   table.   Select  “COUNTRIES”  table.   Select  Data  tab.  

I’ll  create  a  COUNTRY  record  with  a   COUNTRY_ID  of  “A-­‐T”,  “COUNTRY_NAME”  of   “Atlantis”,  and  a  REGION_ID  of  “5”.   Commit  the  new  row.   Finally,  let’s  update  a  “LOCATIONS”  table   record  and  also  delete  a  record  from  that   table.   Now  that  I’ve  updated  the  one  row  and   chosen  to  delete  another,  I’ll  perform  a   commit.  

Select  New  Row  button.   Enter  data  for  new  row   (COUNTRY  _ID  =  ‘AT  |   COUNTRY_NAME  =   ‘Atlantis’  |  REGION_ID=  5).   Select  Commit  button.   Expand  “LOCATIONS”   table.   Select  Data  tab.   Select  the  LOCATIONS   record  with  LOCATION_ID   of  “1600”  and  delete  it.   Update  the  LOCATIONS   record  with  LOCATION_ID   of  “1500”,  setting  the   following  values:   STREET_ADDRESS  =  ’34   Crosby  Drive,  Suite  200’  |   POSTAL_CODE  =  ‘01730’  |   CITY  =  ‘Bedford’  |   STATE_PROVINCE  =  ‘MA’   Page 21 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   79   Demo  /  CentOS  Desktop   Display  the  xDB   Replication  Console   window.   80   Demo  /  xDB  Replication   Console   Select  the  “Oracle  HR   Subscription”  node.  

Audio   Now  let’s  switch  back  to  our  machine  with   the  xDB  Replication  Console.  

To  replicate  the  changes  that  were  just   made  in  the  Oracle  publication  database,  I’ll   select  the  “Oracle  HR  Subscription”  and   select  “Synchronize”  from  the  context  menu.  

Select  the  “Synchronize”   option.   81   Demo  /  Synchronize  –   Oracle  HR  Subscription   window   Select  the  “Synchronize”   button.  

In  the  Synchronize  window,  I’ll  select  the   “Synchronize”  button.   The  “Synchronization”  operation  appears  to   have  been  successful.  

Select  the  “OK”  button  in   the  message  dialog.   82   Demo  /  PEM  

Let’s  take  a  look  in  the  database  to  be  sure.  

Open  the  Postgres   Enterprise  Manager   window.  

First,  I’ll  look  at  the  data  in  the  “regions”   table.    

Select  “regions”  table.   Select  “View  Data  -­‐>  View   All  Rows”  option.   83   Demo  /  Edit  Data  –  prod   –  orarepdemo  –   hr.regions  Window  

As  you  can  see,  our  new  “region”  record  has   been  added  to  the  table.  

Display  data.   Highlight  the  newly  added   region  row.   Close  window.  

Page 22 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   84   Demo  /  PEM  

Audio   Next,  let’s  look  at  the  “countries”  table.  

Select  “countries”  table   node.   Select  “View  Data  -­‐>  View   All  Rows”  option.   85   Demo  /  Edit  Data  –  prod   –  orarepdemo  –   hr.countries  Window  

As  expected,  the  new  “countries”  table   record  has  also  been  added  to  the  database.  

Display  data.   Sort  data  by  country_id.   Highlight  the  newly  added   country  row.   Close  window.   86   Demo  /  PEM  

Finally,  let’s  look  at  the  “locations”  table.  

Select  “locations”  table   node.   Select  “View  Data  -­‐>  View   All  Rows”  option.   87   Demo  /  Edit  Data  –  prod   –  orarepdemo  –   hr.countries  Window   Display  data.  

The  “locations”  record  that  was  updated  in   the  publication  database  has  been  updated   and  the  record  that  was  deleted  is  no  longer   present  in  the  subscription  database.  

Sort  data  by  country_id.   Highlight  the  newly  added   country  row.   Close  window.   88   Demo  /  PEM   Minimize  PEM  window.  

The  xDB  Replication  Console  also  provides   views  for  reviewing  synchronization   history.  

Page 23 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   89   Demo  /  xDB  Replication   Console   Select  the  “Oracle  HR   Publication”  node.   Select  the  “Replication   History”  tab.  

Audio   If  I  select  the  “Oracle  HR  Publication”  node   under  the  “Oracle  HR  Subscription”  node   and  then  select  the  “Replication  History”  tab   in  the  right  hand  pane,  a  summary  history   of  replication  operations  performed  for  the   publication  is  displayed.   In  this  view,  we  can  see  a  listing  of  the   replications  that  have  been  performed  and   the  number  of  transactions  processed   during  each  operation.  

Select  the  “HR.REGIONS”   table  node  under  the   “Oracle  HR  Publication”   node.  

It  is  also  possible  to  view  the  replication   history  for  each  individual  table  in  the   publication.  

Select  the  “Replication   History”  tab.   Select  the  “View  data”  link   for  the  most  recent   transaction.  

Selecting  the  “HR.REGIONS”  table  and  then   the  “Replication  History”  tab  shows  the   initial  Snapshot  that  contained  4   transactions  to  populate  the  table  and  a   Synchronize  operation  with  1  transaction.   Selecting  the  “View  data”  link  opens  a   window  that  displays  information  about  the   specific  transactions  that  were  processed.       As  expected,  the  history  details  window   shows  that  1  insert  was  processed  for  the   table.    

90   Demo  /  Synchronize   History  –  Oracle  HR   Publication  

 

Show  transaction  history.   Select  the  “Close”  button.  

Page 24 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   91   Demo  /  xDB  Replication   Console  

Audio   Likewise,  we  can  look  at  the   “HR.COUNTRIES”  table  replication  history.  

Select  the   Again,  selecting  the  “View  data”  link  shows   “HR.COUNTRIES”  table   the  individual  transactions  that  were   node  under  the  “Oracle  HR   processed.     Publication”  node.   Select  the  “Replication   History”  tab.   Select  the  “View  data”  link   for  the  most  recent   transaction.   92   Demo  /  Synchronize   History  –  Oracle  HR   Publication  

 

Show  transaction  history.   Select  the  “Close”  button.   93   Demo  /  xDB  Replication   Console   Select  the   “HR.LOCATIONS”  table   node  under  the  “Oracle  HR   Publication”  node.  

Finally,  if  we  view  the  details  of  the  most   recent  replication  on  the  “HR.LOCATIONS”   table  we  see  that  1  update  and  1  delete   were  processed.  

Select  the  “Replication   History”  tab.   Select  the  “View  data”  link   for  the  most  recent   transaction.   94   Demo  /  Synchronize   History  –  Oracle  HR   Publication  

 

Show  transaction  history.   Select  the  “Close”  button.  

Page 25 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   95   Demo  /  xDB  Replication   Console   Select  the  “Oracle  HR   Subscription”  node.   Select  the  “Configure   Schedule”  option.  

Audio   Up  until  now,  we  have  only  performed  on-­‐ demand  replications.    However,  it  is   possible  to  have  changes  in  the  publication   be  automatically  replicated  for  a   subscription.   To  configure  the  system  to  perform   automatic  replication  operations,  select  the   subscription  and  then  the  “Configure   Schedule”  context  menu  option.   This  opens  a  wizard  for  configuring  the   desired  schedule.  

96   Demo  /  Scheduled  Task   Wizard   Select  the  “Continuously”   option.  

For  example,  to  have  synchronization   replications  performed  on  a  continuous   basis,  select  the  “Synchronize”  and   “Continuously”  radio  buttons.  

Select  the  “Next”  button.  

Selecting  the  “Next”  button,  loads  a  wizard   screen  corresponding  to  the  previously   selected  options.  

Select  the  “Finish”  button   (or  “Cancel”  button).  

By  default,  continuous  replications  are   performed  every  10  seconds.  

Select  the  “Next”  button.  

For  our  demo,  we’ll  go  with  the  default   setting  and  select  the  “Next”  button.   Selecting  the  “Finish”  button  saves  the   schedule  configuration.  

Page 26 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   97   Demo  /  xDB  Replication   Console   Select  the  database  node.   Select  the  “Oracle  HR   Subscription”  node.   Show  Schedule   information  in  the   “General”  tab.   Select  the  “Oracle  HR   Publication”  node  under   the  “Oracle  HR   Subscription”  node.   Select  the  “Realtime   Monitor”  tab.  

Audio   We  can  verify  the  replication  schedule  we   configured  by  selecting  the  subscription   database  and  then  selecting  the   subscription.       The  “General”  tab  now  shows  the   “Scheduled  time”,  “Previous  fire  time”  and   “Next  fire  time”.   If  I  select  the  publication,  the  “Realtime   Monitor”  tab  shows  the  date  and  time,   status,  number  of  rows  updated,  and   duration  of  the  last  replication.       The  values  of  these  fields  are  updated  in   realtime  after  each  replication  operation.  

If  I  select  the  “Replication  History”  tab  and   uncheck  the  option  at  the  bottom  of  the   Select  the  “Replication   pane  to  “Show  history  with  transactions   History”  tab.   count  >  0”,  the  history  of  all  replication  runs   Uncheck  the  “Show  history   will  be  displayed,  even  if  no  transactions   with  transactions  count  >   were  processed.   0”  checkbox.   Checking  this  option  results  in  the  history   only  showing  those  replications  that   Check  the  “Show  history   with  transactions  count  >   processed  transactions.   0”  checkbox.   98   Demo  /  End  /  xDB   Replication  Console    

That  brings  us  to  the  end  of  our  demo.   During  this  demo,  we  focused  on  the  typical   steps  involved  in  configuring  a  Single   Master  Replication  system  to  support  the   replication  of  data  from  Oracle  to  Postgres.   While  there  are  many  aspects  of  the  EDB   Postgres  Replication  Server  left  to  explore,   hopefully,  this  demo  has  resulted  in  a  better   understanding  of  the  main  features  of  this   powerful  tool.    

99   PPT  Slide  7  /  Title:   Thank  You  

Thank  you  for  viewing  this  video.   I  hope  that  you  found  it  informative.  

Page 27 of 28  

Script  for  “Using  xDB  to  Offload  Reporting  Workload  from  Oracle  to  Postgres”  Demo   Item  #   Video   100   PPT  Slide  7  /  Message  

101   PPT  Slide  7  /  URL  

Audio   To  learn  more  about  the  EDB  Postgres   Replication  Server  or  for  more  information   about  EnterpriseDB,  our  products,  and   services  or  to  download  installers  of  our   Postgres  database  products  and  tools  visit   our  website  at:   www.enterprisdb.com   Thanks  again.  

 

Page 28 of 28  

Using xDB to Offload Oracle Reporting Database to Postgres-script ...

Using xDB to Offload Oracle Reporting Database to Postgres-script-2.pdf. Using xDB to Offload Oracle Reporting Database to Postgres-script-2.pdf. Open.

227KB Sizes 1 Downloads 141 Views

Recommend Documents

So you want to connect to an Oracle Database?
Connect to an Oracle Database from within Visual Basic 6 (Part 1) ... One of the things I am most frequently asked about is using Visual Basic 6 to connect to an ...

Read Online OCP Upgrade to Oracle Database 12c ...
privileges, data redaction, and other. Oracle security features ... Oracle Recovery Manager backup and recovery improvements Oracle. Database Resource ...

(PDF) Free Database Systems Using Oracle: United ...
Database Systems Using Oracle: United States Edition PDF, Read Online Database Systems ... understand and utilize Oracle 9i architecture and administration.