Presentation is loading. Please wait.

Presentation is loading. Please wait.

Toad® Database Administration Best Practices

Similar presentations


Presentation on theme: "Toad® Database Administration Best Practices"— Presentation transcript:

1 Toad® Database Administration Best Practices
Title side – introduce yourself and determine what the roles are of the people in the room so you can tweak your presentation accordingly. Presenter

2 Production Database Pressure Points
End Users Developers A discussion around this topic is important as it focuses on the issues which will eventually impact the Production database if nothing is done. Database developers have two types of change that are escalated into the production environment: new development and tuning existing code. New development consists of new functions and features that are pushed into production. Tuning existing code arises if the development process breaks down or the changes are not tested well enough. This will cause performance issues to arise in production. Untuned or poor quality code from Development will also compromise what the DBA is trying to do to mitigate risk to the database and maintain acceptable levels of uptime and performance and so enable them to plan more accurate upgrade strategies. The big unknown is increased user activity which could be a result of natural organic growth or due to mergers or acquisitions. DBAs

3 What is “Best Practice” ?
A set of guiding principles proposed by industry leading experts Acknowledgement that the application is part of an evolving lifecycle which will continue to iterate over a period of time Determination to deliver a quality product or what we used to call “taking pride in your work” ! Why use it ? Involve the customer in what Best Practice means to them. They will probably already know what some of it is or understand its concept Why do we need Database Development Best Practices? The development cycle is carefully planned so when issues arise in production, it causes a reactive process to occur. Depending on the severity of the performance issues, future development cycles can be impacted, productivity lost and the bottom line affected. When these issues arise, it is usually due to problematic code and therefore it is the responsibility of the developers to identify and resolve this poorly performing code. In an age of outsourcing, and multi-skilled developers, whose core focus may not be on database development, there is a pressing need for a process to ensure that code being deployed to production is of the highest quality. Management needs to be certain that the investments that they have made to lower the cost of development are indeed paying off by ensuring they have a process which is both repeatable and measurable via effective reporting.

4 Administration Best Practices
Now we’re going to introduce to you Quest’s methodology for implementing and maintaining Development Best Practices into your organisation’s development process using some of the technology you may already have (if already a Toad for Oracle customer).

5 Toad Database Administration Best Practices
Oracle SQL Server DB2

6 Challenges to implementing Best Practice
Resistance to use tools Already have scripts Yada yada…. The customer may already be aware that they are challenged by implementing and following what development processes and procedures they already have. This is where we can help. Think about code reviews, code testing, version control, etc, etc. The slide shows some examples but ask the customer what they think – can they think of any more (this will also help us refine our presentations)

7 Design Access to data model
Ensures development matches business requirements Ensures data model is correctly optimized Ensures model integrity is maintained Version history

8 Deploy (1) DDL Scripts automatically generated from data model
Alter Script generation based on data model updates Version History retained for auditing Application scalability testing

9 SQL statement or PL/SQL code scalability profile
Deploy (2) Will the application work correctly and adequately under production conditions ? SQL statement or PL/SQL code scalability profile This final stage of the process will enable management or senior developers/DBAs to assess whether qualifying SQL and PL/SQL code can pass the final scrutiny of scalability testing. At this stage, rather than assume the customer understands why we are doing this and what it entails, explain the process and why we’re going it now. When or if SQL or PL/SQL is tuned in development, there is no guarantee it will perform the same in a Production environment with many more users, more data and different Oracle environment. Many applications fail to deliver desired performance for this very reason. Scalability testing involves simulation of anticipated concurrent userload against a given SQL statement in order that we can measure the change in Response Time as userload increases. If a tuned (re-written) SQL statement performs better compared to it’s original, we can assess whether the same performance is achived when 100s or 1000s of users execute the same statement and graph the outcome. Re-writes with lower Response Times than others at high user loads are much more likely to scale well in a production environment than those which don’t. To demo, go back to your previous SQL Optimizer demo window and unselect all re-write scenarios. Now select the top 5 and initiate the SQL Scalability Testing. After it launches, click the Review Results button and review a pre-prepared test (know which one it is) and discuss the graphs. Does not scale well Scales well

10 Detect/Discover Environment (O/S and Database) Instance Performance
Instance Manager UNIX Monitor Windows Service Manager Instance Performance Database Browser (all instances) Database Monitor Database Probe SQL Performance SQL Trace/Optimization ASH Report Index Monitoring Space Management Database Browser Segment Advisor Database Browser (all instances) Database Monitor Oracle Alert Log analysis (FTP and Telnet windows) Database Health Check Session Browser ADDM/AWR StatsPack Top Session Finder SQL Monitor SQL Scan/SQL Detective (Xpert/Dev Suite) Space/IO History Undo Advisor

11 Diagnose Instance Performance SQL Performance Space Management
Database Probe Database Monitor Session Browser Health Check SQL Performance Top Session Finder SQL Trace/Optimization SQL Optimization (Xpert or Dev Suite) Space Management Segment Advisor Tablespace Map Identify Space Deficits Log Switch Frequency Map Undo Advisor

12 Resolve Instance Performance Schema/Data Integrity SQL Performance
Oracle Parameters Schema/Data Integrity Log Miner (access to Undo SQL) Flashback Table Schema Compare Data Compare Data Duplicates SQL Performance Explain Plan SQL Optimization (Xpert or Dev Suite) Space Management Rebuild Multiple Objects Analyze Objects Repair Chained Rows Segment Shrink Advisor DBMS Redefinition Wizard

13 SQL Optimization - How hard can it be to rewrite SQL ?
How many different ways can you write this query? SELECT EMP_NAME,DPT_NAME,GRD_DESC FROM EMPLOYEE, DEPARTMENT DEPARTMENT1, GRADE WHERE EMP_GRADE = GRD_ID AND EMP_DEPT = DPT_ID AND EXISTS (SELECT 'X' FROM DEPARTMENT DEPARTMENT2 WHERE DPT_AVG_SALARY IN (SELECT MIN(DPT_AVG_SALARY) FROM DEPARTMENT DEPARTMENT3) AND DPT_ID = EMPLOYEE.EMP_DEPT); 30,491 !!! Teach Yourself SQL in 30,420 Minutes By Gabriel F. Gargiulo

14 Optimize SQL Proactively identify problematic SQL directly from the source code Thorough transformation of SQL producing every possible semantically equivalent rewrite Optimize SQL in batch in context of source code Generate replacement script Automatic ranking of best alternatives Minimal involvement which can save hours of time This topic covers an area most developers don’t get anywhere near unless they are senior or experienced. The main things to talk about here must be : business related (such as reminding about the cost of under-performing applications to the business and how it’s impossible to expect DBAs to tune all SQL and PL/SQL code from development – they just don’t have the bandwidth) and, to a limited extent : technical. Explain what optimization is and how it’s important for developers because it performs automatically in seconds what a developer could only hope to accomplish in hours, which is re-writing the statement (and even re-writing the rewrites) until every possible combination is determined and assessed. The optimizer will then yield only those statements which have the most chance of giving a performance improvement and the developer can decide, based on Plan Cost, etc, which ones to execute and ultimately make an informed decision as to which to use in the application. The SQL or PL/SQL can then replace the original in the application. Talk about ease-of-use, how it’s possible to take multiple SQL statements and PL/SQL code and perform a Batch Optimization and mention they can also use this in conjunction with the SQL Scan referred to earlier in Code Xpert. In your demo, use a tried and tested SQL statement (from the QUEST_OPTI schema) and perform an optimization based on an Intelligence Level between 2 and 4 (4 is much preferred). After optimization is complete, show the Alert tab and discuss number of re-writes generated, etc. Don’t execute any of the re-writes – instead, have a saved session which you can restore to talk about the execution statistics and comparison graphs. Leave the SQL Optimizer window open for now – you will need it later.

15 Inform Instance Performance Schema Integrity SQL Performance
ADDM/AWR StatsPack Health Check Report (schedulable) Schema Integrity Schema Compare HTML Schema Report (schedulable) Reports Manager (schedulable) ER Diagram (Toad Data Modeler) Master-Detail Browser SQL Performance Plan Change Analyzer (Xpert or Dev Suite) Space Management Tablespace History IO History

16 Administer Instance Schema Integrity Space Management Users
ASM Manager Oracle Parameters Redo Log Manager Schema Browser (Rollback Segment, Jobs, Scheduler) Schema Integrity Object Audit NLS Parameters Export & Import Space Management Schema Browser (Tablespaces) Tablespace Menu Users Audit SQL / Sys Privs Schema Browser (Users, Roles, Object Privs, etc) DBMS Flashback Recycle Bin

17 TOAD DB Optimization Check-List


Download ppt "Toad® Database Administration Best Practices"

Similar presentations


Ads by Google