Redgate How to be Friends with Developers

2,690 views

Published on

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
2,690
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
22
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Redgate How to be Friends with Developers

  1. 1. How to Become Friends withDevelopers and Stop Making DBA Stand for "Dont Bother Asking" Presented by: Kellyn Pot’Vin Sr. Technical Consultant, Enkitec March 27, 2013
  2. 2. Who am I?• Resides in Westminster, Colorado• Oracle ACE, Sr. Technical Specialist at Enkitec• Specialize in performance and enterprise management of large database environments.• Board of directors for RMOUG, Director of Training Days 2014 and Database Track Lead for KSCOPE 2013• Blog: http://DBAKevlar.com• Twitter: @DBAKevlar• Expert EM12c Book- May 16th from Apress 3
  3. 3. Why This Topic?• Conversations with User Group Members/peers.• How Often I Experience it professionally.• Read about it often in blogs, articles and in books.• Some of my biggest wins, consider my most important compliments had to do with this subject.• When first learning, others would seek me out over others who knew more because of it. 4
  4. 4. The Valued Lesson• First “official” Job as a DBA• First Time Managing MSSQL• Instructed NOT to Speak to Dev/App Group.• Two Frustrating Weeks.• Broke “No Communication” Rule• Great Experience• Supported for Four Years 5
  5. 5. The Ball and Chain“If you have been in IT longenough, you are probably aware thatmost DBAs dont get along well withthe developers.They are somewhat akin to ahusband and wife who don’t likeeach other but cant get a divorce.“ 6
  6. 6. Different GoalsDeveloper Goals- To implement new businessenhancements, often by a deadline.Database Administrator- Ensure that databaseenvironments are accessible and functioning 24X7without any interruption to service.Outside Influencers- To ensure they get whatthey want, even if requirements given toDevelopers are unattainable and risk productionuptime for Database Administrators. 7
  7. 7. Negative Culture“[Most] DBAs arent happy unless theyre well establishedas the bottlenecks in the [development] process.”“If Shakespeare were alive in 2012, he’d be a technicalwriter, and his motto would be: “Kill all the DBAs.”“Why does it take two developers to change a light bulb?Because one always leaves in the middle of the project.““The Only way I know to deal with Developers involves abat!”Now, try substituting an minority or racial group when yousay anything similar to the above comments and you maythink twice about what may have become culturallyacceptable in the workplace. 8
  8. 8. What Many DBA’s Think isRequired to talk to DevelopersDangerous Borderline Safe SafestYour code sucks Interesting Would you like This is brilliant coding choice to work on this together?Yeah, You’re You need 2TB I think we This is brilliantnot getting 2 of space for could rewriteTB for THIS. this? this to use less temp.Why would you This may not I’d like to This is brilliantever do this? be the best recommend an way to write alternative this… strategy. 9
  9. 9. What Developers think is requiredto talk with DBA’sDangerous Borderline Safe SafestNothings Could I’m sure You areChanged something something absolutely have changed? must have correct. changed.The database Something Could you help You aresucks seems to be me out and absolutely up with the check the correct. database. database?It works great We did test I could really You arein dev and this, but it is use your help absolutelytest. having issues figuring out correct. in production. why its having issues in prod. 10
  10. 10. We Lack Respect, but Why?• Deadlines• Demands of each group• Lack of respect for each role’s skill set  Truth is, both sides think they are Obi Wan and neither are Darth Vader! 11
  11. 11. Results• Impacts productivity• Causes Turnover, eliminating positions.• Costs business $$In My Opinion-• Demands Developers to fill DBA positions in hopes of meeting deadlines.• Reason for “Agile Like” development processes.• Makes more demand for “open-source” tools to circumvent RDBMS dependent environments. 12
  12. 12. Why DBA’s are NeededDatabase Administrators andDevelopers primary rolesrequire different mindsets.To play both roles often:• Is a conflict of interest.• Leaves priorities unaddressed.• Lessens expertise. 13
  13. 13. Why we Need DevelopersThat differing mindset requires someone who canvisualize quickly how to design a process, yet notoverthink the issues that might arise, (that is theDBA’s job when time comes for code review!)For a Developer toperform his tasks andmaintain the database,do afterhours support,etc.?? 14
  14. 14. Changing the GameHow do we change thenever-ending battle?First identify the source of theconflict-• Is it centralized?• Is it between certain individuals?• Is it cultural in an organization?• Are there outside contributors? 15
  15. 15. Standing Up to the FightFind a responsible manager tobuy-in.Focus on-• Cost to • Resources • Deadlines • Goals • Revenue• Changing the culture, not assigning blame.If you are assigning blame, youmay be part of the problem… 16
  16. 16. As a DBA?• Learn to code- some level, some platform.• Learn the database- the best DBA’s know their data.• Participate in code reviews- Be a productive participant.• Give read only access to key developers• Share with Developers what you know- it shouldn’t look like magic!• Don’t make decisions based on control- base them on the business’ best interest.• Never assume, request time to research and have data behind findings. 17
  17. 17. Options for Developers?• Educate yourself on how Oracle works and about the Cost Based Optimizer, (CBO)• Help with production issues- you are often an integral part of the solution!• Build your code to perform efficiently, not just functionally.• Share your knowledge with the database administrators.• Ensure that anything going to production is ready, support your DBA! 18
  18. 18. When Communication DegradesFocus on:• End-user experience instead of individual goals.• The value to the business• Do not personalize• Remember to show respect• Consult each other when opportunity presents itself.• Support, do not sabotage the other group.• Possess higher authority when issues remain unresolved. 19
  19. 19. Next Level…• Review and verify that expectations were clearly defined.• Verify that respect is being shown.• Don’t allow any negative competition.• Trust and confidence in the other’s capabilities to complete their roles.• Live up to our own expectations.• Involve each group earlier in projects.• Final decision by higher authority when unable to resolve disagreement is agreed to be followed. 20
  20. 20. What the DBA Should Always Do• Ensure development database are FULL/recent copy of production environment.• Ensure Development has FULL access to the development environment.• Grant access to performance metrics.• Less than full copy allows for “assumptions” to lead into testing scenarios.If you have Enterprise Manager 12c, GRANTTHEM ACCESS!! 21
  21. 21. Read Only Access in EM12c• Create User, (Do not Create Like until you create first “read-only user”• Choose to add the EM_ALL_VIEWER Role 22
  22. 22. Setting up Target AccessChoose Global Grants or Target Specific 23
  23. 23. Review and SubmitSet up target access with this login or use existinglogins. 24
  24. 24. Target Level LoginsFor logins to a target, they require the following:• Connect• View_any_dictionary• AdvisorObject Level Privileges for AWR:GRANT SELECT ON SYS.V_$DATABASE TO user;GRANT SELECT ON SYS.V_$INSTANCE TO user;GRANT EXECUTE ON SYS.DBMS_WORKLOAD_REPOSITORY TO user;GRANT SELECT ON SYS.DBA_HIST_DATABASE_INSTANCE TO user;GRANT SELECT ON SYS.DBA_HIST_SNAPSHOT TO user; 25
  25. 25. This is NOT GOODOr this: 26
  26. 26. What Developers Need to Know• Know the difference between an explain plan and an execution plan. • The explain plan is the choice the CBO, (Cost Based Optimizer) may choose. • The execution plan is the actual plan the CBO made with a SQL statement.• Learn how to view temp usage.• Use SQL Monitor after DBA’s grant access. 27
  27. 27. Plans in 11gTurn on Auto-Trace in SQL*Plus: SET AUTOTRACE ON 28
  28. 28. DBMS_XPLANCollect info from DBMS_XPLAN: Execute Query, SELECT * FROMTABLE(DBMS_XPLAN.DISPLAY_CURSOR(format=>ADVANCED)); 29
  29. 29. What is the Cost Based OptimizerThe Cost Based Optimizer, aka CBO:Determines the most efficient path to executing aSQL statement.CBO choices are impacted by:• Parameters, such as OPTIMIZER_MODE• Session level parameters.• Statement Hints• Statistics and Dynamic Sampling• Parallelism, (High DOP)• Complex design• THE SQL• …. 30
  30. 30. Viewing Temp and Memory Usageselect vst.sql_text, swa.sql_id, swa.sid, swa.tablespace, swa.operation_type, trunc(swa.work_area_size/1024/1024) "PGA MB", trunc(swa.max_mem_used/1024/1024)"Mem MB", trunc(swa.tempseg_size/1024/1024)"Temp MB"from v$sql_workarea_active swa, v$session vs, v$sqltext vstwhere swa.sid=vs.sidand swa.sql_id=vs.sql_idand vs.sql_id=vst.sql_idand vst.piece=0order by swa.sql_id SELECT i.COL1, COUNT(t.col4) i.col3 4jv6ja2qa2p7z 515 GROUP BY (HASH) 996 15 SELECT i.COL1, COUNT(t.col4) i.col3 4jv6ja2qa2p7z 515 TEMP BUFFER 1 97 23 31
  31. 31. SQL Monitor 32
  32. 32. SQL Monitor Features• Status of process- active or complete• Wait information, including legend color. 33
  33. 33. SQL Monitor with Parallel• Parallel, requested vs. allocated.• Instance ID for RAC and SQL_ID links 34
  34. 34. We’re All In This Together!• Trust and common vision should be the goal.• Performance is part of the goal, not just functionality.• If you aren’t helping, you’re hindering.• Its the business’ database, no one else has a right to ownership.• Being right is not always the same as doing the right thing. 35
  35. 35. ReferencesDBAs Gone Badhttp://c2.com/cgi/wiki?DbasGoneBadCan DBAs and Programmers Ever Get Along?http://www.creativemac.com/articles/viewarticle.jsp?id=37828-1Communication and the Database Worldhttp://www.scarydba.com/2011/03/21/communication/Kerry Osborne, Oracle Performance for Developers and the DBA’s thatLove Themhttp://kerryosborne.oracle-guy.com/papers/Oracle_Performance_for_Developers_and_the_DBAs_Who_Love_Them-Final.pdfSolving the Problem of Prima-Donna Developershttp://www.techrepublic.com/article/solving-the-problem-of-prima-donna-developers/1046043Survival Tps for Developers/DBA’s: How to talk to [Each Other]http://thomaslarock.com/2012/08/survival-tips-for-developers-how-to-talk-to-your-dba/ 36
  36. 36. Questions?dbakevlar@gmail.comhttp://dbakevlar.comTwitter- @dbakevlarLinkedin- Kellyn Pot’vin Fastest Growing Companies in Dallas 37

×