Home > Ask the Oracle Database / Applications Experts > Oracle database backup and recovery Questions & Answers > Performance tuning questions
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Performance tuning questions

Brian Peasland1 EXPERT RESPONSE FROM: Brian Peasland1

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 17 November 2005
  1. What is the formula to calculate space for the tables in a database?
  2. For example, if I want to create a datafile in a database what should be the minimum size that I define for the datafile (is there any formula)?
  3. If I run a query that displays the number of physical read and writes per second for each datafile and they are high numbers, then what should I do to tune the database?
  4. If I run a query that displays users with high CPU processing since instance startup, then what area do I need to focus on?
  5. If I run a query that displays waiting sessions blocked through other sessions, then what do I need to do?
  6. If I run a query that displays the user that has performed the most physical disk reads then what do I need to do?
  7. If I run a query that displays the most resource-intensive SQL statements that have been recently executed, what should I do to tune the database?

>
  1. DBAs used to have complex spreadsheets to correctly size tables and indexes in their database. These are no longer used as the cost of disk storage has dropped dramatically. Unless you are running a VLDB, you probably have more storage than you need. So do not worry about how much space a table requires. If you are running a VLDB, then disk may be a factor for you. In either case, use Locally Managed Tablespaces to let Oracle size your tables for you.
  2. The minimum for your tablespace's datafiles is the minimum size to hold your data while accomodating some period of growth. But you can make your datafiles small initially and then let them grow (autoextend) until they are as large as they need to be.
  3. If the sum of your physical read and writes for a datafile is high, then it is likely that you have a very active segment (table or index) in that tablespace. You might want to consider moving this highly active segment to a tablespace of its own, residing on a disk device of its own. That way, the activity against this segment will not impact activity against other segments, and vice versa. To figure out which segments are experiencing the highest read and write activity in your database, query V$SEGMENT_STATISTICS similar to the following:
    SELECT owner,object_name,tablespace_name,SUM(value) 
    AS IO_COUNT FROM v$segment_statistics 
    WHERE statistic_name IN ('physical reads','physical writes',
            'physical reads direct','physical writes direct') 
    GROUP BY owner,object_name,tablespace_name ORDER BY 4;
    
  4. Just because a session has accumulated lots of CPU does not necessarily mean that a problem exists. Maybe this is intended. Or maybe they wrote inefficient PL/SQL code. You'll have to look at this on a case-by-case basis and examine what that session is running against the database.
  5. Again, just because a session is waiting on another session does not necessarily mean that a problem exists. The Oracle database is a multi-user transactional environment. Oracle handles all of these transactions from many users via locking. Once a transaction commits or rolls back, the lock is released. If a session is holding onto a lock for a long time, then there are a few things you can focus on. One, have that session commit more often if possible. Two, tune the session's transactions so that they run faster and do not hold the lock as long.
  6. If a user has performed a large amount of physical reads, then the first place I would look is at the SQL statements they are running. A large amount of physical reads might mean that they are running suboptimal SQL statements, which can mean unnecessary full table scans. Tune their SQL statements. Another place I would look is at my buffer cache. It might be that the buffer cache is too small, leading to physical reads.
  7. If you know the most resource-intensive SQL statements, then your next course of action is to tune those SQL statements. If you can get these SQL statements to run and consume fewer resources, then the user will get results faster and other users will be impacted less.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Oracle database backup and recovery
How to perform Oracle database recovery with a corrupt online redo log
Can I create an Oracle Catalog Database with the Enterprise Console?
Do I need to recreate views after an Oracle table reorg?
Client-based apps vs. web-based apps in Developer 2000
How to perform an Oracle 8i to 10g migration
Can I move the tablespace online with missing datafiles in Oracle?
Oracle upgrade process vs. Oracle exp/imp for 9i to 10g migration
How to use RMAN CONVERT to migrate from Solaris to Oracle 11g RHEL
Why am I having trouble installing Oracle 10g on Vista?
Can I load Oracle 8 on Windows Server 2003?

Oracle database backup and recovery
How to perform Oracle database recovery with a corrupt online redo log
Can I create an Oracle Catalog Database with the Enterprise Console?
Do I need to recreate views after an Oracle table reorg?
Client-based apps vs. web-based apps in Developer 2000
Can I move the tablespace online with missing datafiles in Oracle?
How to perform an Oracle 8i to 10g migration
Oracle upgrade process vs. Oracle exp/imp for 9i to 10g migration
How to use RMAN CONVERT to migrate from Solaris to Oracle 11g RHEL
Why am I having trouble installing Oracle 10g on Vista?
Can I load Oracle 8 on Windows Server 2003?
Oracle database backup and recovery Research

Oracle database availability
Review: Oracle's 11g R2 database has some good and bad
Oracle releases new database, says 11g upgrade will cut costs
Firm dumps MySQL on Red Hat for Oracle Database on Oracle Linux
Data modeling tools no substitute for hard work
Oracle RMAN case study: Improving backup and recovery efficiency
Oracle and the rise of the virtual machine
Using connection load balancing with Oracle RAC
Grid computing adoption slow amid fears of complexity
DBA 102: Beyond the basics
Difference between Oracle RAC and Data Guard
Oracle database availability Research

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts