2. Using Virtualization to setup Oracle QA/Development Database Environments Rocky Mountain Training Days Feb. 16, 2011 Mike Gangler – Ithaka / JSTOR
3.
4. Describe QA / Development ChallengesPre-Virtual Oracle Environment layout Solaris Zones and ZFS ZFS Commands Used Virtual Oracle Environment layout Steps required – Zones Scripts required Demo if time / Wifi Recap and QA 16-Feb-2011 3
5. Quick Survey How many people are using a form of Virtualization ? 16-Feb-2011
6. Quick Survey How many people are using a form of Virtualization ? VMWARE ? 16-Feb-2011
7. Quick Survey How many people are using a form of Virtualization ? VMWARE ? Solaris ? 16-Feb-2011
8. Quick Survey How many people are using a form of Virtualization ? VMWARE ? Solaris ? Oracle VM ? 16-Feb-2011
9. Quick Survey How many people are using a form of Virtualization ? VMWARE ? Solaris ? Oracle VM ? Other ? 16-Feb-2011
10. Quick Survey How many people are using a form of Virtualization ? VMWARE ? Solaris ? Oracle VM ? Other ? How many are running oracle instances on these VM machines ? 16-Feb-2011
11. Michael J. Gangler (Mike) Database Specialist – Ithaka Working with Oracle, MSSQL, MySQL Working with Oracle since Oracle Version 5 IOUG Executive Vice President – Finance Director of Membership services www.ioug.org April 10 – 14 – Collaborate –Orlando Southeast Michigan Oracle Professionals (SEMOP) Past President and Current Director www.semop.org Michigan Oracle User Summit (MOUS) Database / Tech. director www.mous.us Wednesday November 30th – Schoolcraft College 16-Feb-2011
12. Ithaka’s mission ITHAKA is a not-for-profit organization dedicated to helping the academic community take full advantage of rapidly advancing information and networking technologies. We serve scholars, researchers, and students by providing the content, tools, and services needed to preserve the scholarly record and to advance research and teaching in sustainable ways. We are committed to working in collaboration with other organizations to maximize benefits to our stakeholders. 16-Feb-2011 11
13. Ithaka’s Services Ithaka S+R works with initiatives and organizations to develop sustainable business models and conducts research and analysis on the impact of digital media on the academic community as a whole. www.ithaka.org JSTOR helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive of over 1,200 academic journals and other content. JSTOR uses information technology and tools to increase productivity and facilitate new forms of scholarship. www.jstor.org Portico preserves scholarly literature published in electronic form—more than 10,000 e-journals and 28,000 e-books—and ensures that these materials remains accessible to future scholars, researchers, and students. www.portico.org 16-Feb-2011 12
16. Database / Application Specifics Oracle 10.2.0.4 SGA – 11 gb Oracle Dataguard / standby used Data is replicated via application and Daemons 1 schema – 160 – 200 gb Holds only pointers versus actual files Files are stored at each data center Software is a 3rd party application 16-Feb-2011 15
17. QA / Development Challenges QA requires restoration from Production - Long export / Import times – (6-8 Hours) QA restore every 1 – 2 weeks. Multi-Data Center requires additional work and headaches Development needs many restores due to changes and testing Application written data replication (Versus Database) 16-Feb-2011 16
18. Pre-Virtual QA Environment 16-Feb-2011 Qa.jstor.org Data Replication Data Replication Web App Master Web App Slave Web App Slave Data Center 1 Data Center 2 Data Center 3 17
19. Pre-Virtual QA Steps Export Production database – 2 hours Zip production export – 30 minutes Copy production export file to sites Manchester, England – 3 hours Princeton , NJ – 1.5-2 hours Ann Arbor – 1 hour Unzip export file – 30 minutes Import export file – 3 – 5 hours Total Time for all 3 sites (approx) – 10 – 12 hours 16-Feb-2011 18
50. 16-Feb-2011 31 ZFS Clone Example Example Clone Script – Page 1 #!/usr/bin/env bash export PATH=/usr/local/bin:$PATH host=aa2x4240-04 echo =====Must be run as SU====== echo =====Cloning omega - 217, 218, 219 ====== echo =====listing out the zone copies======= echo zfs list -o name,origin zfs list -o name,origin echo =====halting zones======= zoneadm -z aa2vps218 halt zoneadm -z aa2vps219 halt
51. 16-Feb-2011 32 ZFS Clone Example – Page 2 Example Clone Script – Page 2 (cont) echo =====destroying old u01 directories====== zfs destroy -r tank/zones/aa2vps218-u01 zfs destroy -r tank/zones/aa2vps219-u01 echo =====cloning snapshots=========== zfs clone tank/zones/aa2vps217-u01@`date +%Y%m%d` tank/zones/aa2vps218-u01 zfs clone tank/zones/aa2vps217-u01@`date +%Y%m%d` tank/zones/aa2vps219-u01 echo =====listing out the new zone copies====== echo zfs list -o name,origin zfs list -o name,origin
52. 16-Feb-2011 33 ZFS Clone Example – Page 3 Example Clone Scripts – Page 3 (cont) echo =====setting the mount points======== zfs set mountpoint=/u01 tank/zones/aa2vps218-u01 zfs set mountpoint=/u01 tank/zones/aa2vps219-u01 echo =====set zoned=on=========== zfs set zoned=on tank/zones/aa2vps218-u01 zfs set zoned=on tank/zones/aa2vps219-u01 echo =====boot machines======= zoneadm -z aa2vps218 boot zoneadm -z aa2vps219 boot echo =====listing out the new zone copies====== zfs list -o name,origin
53. After Clone Script - Slaves NOTE – used if the database name needs to be the same Rename listener.ora, tnsnames.ora with new machine name Clean up Grid Control – Remove entries from sysman/emd directory Change sysman/emd/targets.xml – new machine Change sysman/emd/emd.proprties – new machine name 16-Feb-2011 34
54. After Clone Example Script - Slaves NOTE – used if the database name needs to be the same Runs on Slave Sites – as Oracle User Needs to be in $HOME #!/bin/bash ### set -xv oldmach=$1 newmach=$2 for FILE in $ORACLE_HOME/network/admin/*.ora do sed -e 's/'"$oldmach"'/'"$newmach"'/g' $FILE > tmp.out mvtmp.out $FILE done 16-Feb-2011 35
55. After Clone Example Script – Slaves – part 2 rm -r -f $AGENT_HOME/sysman/emd/core*.* rm -r -f $AGENT_HOME/sysman/emd/state/* rm -r -f $AGENT_HOME/sysman/emd/upload/* rm -r -f $AGENT_HOME/sysman/emd/recv/* rm -r -f $AGENT_HOME/sysman/emd/collection/* rm -r -f $AGENT_HOME/sysman/emd/lastupld.xml rm -r -f $AGENT_HOME/sysman/emd/agntstmp.txt for FILE in $AGENT_HOME/sysman/emd/targets.xml do sed -e 's/'"$oldmach"'/'"$newmach"'/g' $FILE > tmp.out mvtmp.out $FILE Done for FILE in $AGENT_HOME/sysman/config/emd.properties do sed -e 's/'"$oldmach"'/'"$newmach"'/g' $FILE > tmp.out mvtmp.out $FILE done exit 0 16-Feb-2011 36
56. 16-Feb-2011 37 Example Run – ZFS Clone – Page 1 # ./clone-presentation.sh =====Must be run as SU====== =====Cloning omega - 97, 98, 99 and ====== =====halting zones======= zoneadm -z aa2vps98 halt zoneadm -z aa2vps99 halt =====destroying old u01 directories====== zfs destroy -r tank/zones/aa2vps98-u01 zfs destroy -r tank/zones/aa2vps99-u01 =====cloning snapshots=========== zfs clone tank/zones/aa2vps97-u01@20101012 tank/zones/aa2vps98-u01 zfs clone tank/zones/aa2vps97-u01@20101012 tank/zones/aa2vps99-u01 =====setting the mount points======== zfs set mountpoint=/u01 tank/zones/aa2vps98-u01 zfs set mountpoint=/u01 tank/zones/aa2vps99-u01 cannot mount '/u01': directory is not empty property may be set but unable to remount filesystem =====set zoned=on=========== zfs set zoned=on tank/zones/aa2vps98-u01 zfs set zoned=on tank/zones/aa2vps99-u01 =====boot machines========= zoneadm -z aa2vps98 boot zoneadm -z aa2vps99 boot
57. 16-Feb-2011 38 Example Run – ZFS Clone – Page 2 =====listing out the new zone copies====== zfs list -o name,origin NAME ORIGIN tank - tank/snaps - tank/swap1 - tank/zones - tank/zones/aa2vps191 - tank/zones/aa2vps191-u01 - tank/zones/aa2vps247-v01 - tank/zones/aa2vps247-v01@20081106_detached - tank/zones/aa2vps247-v02 - tank/zones/aa2vps247-v02@20081105_detached - tank/zones/aa2vps248-v01 tank/zones/aa2vps247-v01@20081106_detached tank/zones/aa2vps248-v02 tank/zones/aa2vps247-v02@20081105_detached tank/zones/aa2vps249-v01 tank/zones/aa2vps247-v01@20081106_detached tank/zones/aa2vps249-v02 tank/zones/aa2vps247-v02@20081105_detached tank/zones/aa2vps97 tank/zones/aa2vps98@200909131322-migration tank/zones/aa2vps97-u01 - tank/zones/aa2vps97-u01@20101008 - tank/zones/aa2vps98 tank/zones/aa2vps99@200909131307-migration tank/zones/aa2vps98@200909131322-migration - tank/zones/aa2vps98-u01 tank/zones/aa2vps97-u01@20101008 tank/zones/aa2vps99 - tank/zones/aa2vps99@200909131307-migration - tank/zones/aa2vps99-u01 tank/zones/aa2vps97-u01@20101008 #
58.
59. Keep the resource management simple – Use dedicated CPU feature in lieu resource pools
----- Meeting Notes (2/15/11 19:49) -----Basically we digitize scholar journals for University's and researchers.
----- Meeting Notes (2/15/11 19:49) -----Ithaka is the main holding company, www.jstor.org is the main application and www.portico.org is for journals nolonger being published.We also categorize and digitize African Plants – www.aluka.org and art – www.artstor.orgBasically in the old days we use to look up a journal, give the card to the librarian and then they would return with the magazine.
Explain the dispiplines
Multi datacenter – have to move the data to each place, latency etc.
Data is replicated via home grown db replication versus built in database replication like Streams, golden gate. Databases and data is duplicated at each data center
First of all we need a global Zone (s) and local zones
ZFS is the file system that allows the zones to function and provide the tools used in snapshots, cloning and restores
Note – remind them that a load balancer fits between the url and the web servers
Negotiated a deal to use the prior nights backup file versus a fresh copy !