Question

HOWTO with Tablespace maintenance and tuning

Asked by: fargo

Hi All,

I am just trying to learn more tips and tricks on managing-maintaining-tuning the tablespaces in Oracle.
Best way for me is to get the feedback from the experts regarding the above. Any step by step way to create a tablespace and further maintain it....tuning etc would be great.

I can search for it in google..so just don't make a plain search and post the links. I would expect a detailed explaination here.

Thx.
fargo

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-04-17 at 03:04:40ID21815994
Tags

oracle

,

tablespace

,

howto

,

maintenance

Topic

Oracle Database

Participating Experts
2
Points
500
Comments
8

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Tablespace fragmentation
    Hello, How will I come to know if the database/tablespace is fragmented. And what are other possible ways to defragment the tablespace other than 'alter tablespace coalesce' Please help Juno
  2. tuning parameters
    Please give me all tuning parameters. I am new to performance and only know remove check constraints, do indexing and maintain optimum tablespace size.
  3. tablespace error
    Hi...i got below error; * ERROR at line 1: ORA-01630: max # extents (100) reached in temp segment in tablespace TEMP ORA-06512: at "NMSPROD.ARCHIVELDCOUTPUT", line 120 ORA-06512: at line 1 when i add datafile to the tablespace, let say 100M, what is actually ch...
  4. Using tablespace
    Hi! I have a select query statement and put it in the script file. When i tried to run the script i got this following error: java.sql.SQLException: ORA-01652: unable to extend temp segment by 128 in tablespace TEMPDB The above error indicates that the tablespace TEMPDB d...
  5. tablespace
    how we can make tablespace in existing oracle database.
  6. Assigning TableSpace During Create
    Hi, How do I assign a particular tablespace during a create? I'm using a Create/Select: Create table NOTE_BAK as Select * from MASTER_NOTE; When I do this, I get an error: ORA-01652: Unable to extend temp segment by 25 in TableSpace PDefault Thanks!

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: markgeerPosted on 2006-04-17 at 06:19:44ID: 16468807

Usually no maintenance or tuning is required on tablespaces *IF* they were initially created based on a plan to use tablespaces wisely and efficiently.  This planning work must be done before the tablespaces are created, and before the tables and indexes are assigned to tablespaces.

I'm assuming you are talking about "locally-managed" tablespaces, with equally-sized extents in each tablespace, and not the older "dictionary-managed" tablespaces tablespaces.  I don't recommend them at all.

In a simple system, you will need just three manually-created tablespaces in addition to the default ones in Oracle, and you can name them: small, medium and large.  They will have different extent sizes, and you then place your tables and indexes into an appropriate tablespace based on the size of the table/index.  Many DBAs like to have tables and indexes separate from each other, so you may want six tablespaces for your application, with three for indexes and three for tables.

What exact sizes should you use for extents in your "small", "medium" and "large" tablespaces, and what should the size of the datafiles be?  That will vary depending on your numbers of tables and indexes, your disk system and your OS.  For example, your OS and/or disk system may or may not be able to support individual datafiles over 2GB in size, so that may be a constraint you have to work around.  If that is an issue, you may need multiple separate datafiles per tablespace, or you may want multiple tablespaces of each size.

We use a slightly more complex system for tablespaces, with five different sizes: small, medium-small, medium, medium-large, and large.  We also have separate tablespaces for tables and indexes.  Because of the number of tables in our application, and our desire to have just one datafile per tablepace and to keep the individual datafiles under 2GB, we have multiple tablespaces for some of the sizes.  Just FYI, we using the following extent sizes, but you may want other sizes depending on your data volumes and/or your block sizes:

                       Tables         Indexes                      
small                      8k                 8k
medium-small       40k                20k
medium              400k              200k
medium-large    4000k            2000k
large               40000k          20000k

If your application has any tables that are used for large amounts of transactions, then the tables are deleted (or truncated) before the next interface or batch job, you will want to separate these tables from the more permanent tables, probably into a "work" or "scratch" tablespace, so these objects don't cause excessive fragmentation among your more-permanent objects.

 

by: fargoPosted on 2006-04-17 at 06:26:33ID: 16468840

Hi markgeer,

Thx for your detailed reply. Some doubts

1) why do one wish to seperate the table and index tablespaces? OR even something like small, big, medium..??
2) why not define tablespace for each oracle dbuser? By having tablespace for each oracle dbuser, one can clearly identify which tablespace is bundled with which dbuser.

 

by: markgeerPosted on 2006-04-17 at 06:39:36ID: 16468923

1a.  Why separate tables and indexes?  For performance and recovery.  These separate tablespaces (datafiles) can then be on separate disks, so the same read/write heads do not have to first read the index blocks, then jump to read the corresponding table blocks.  Also, you may want the tables on a RAID5 device, but the indexes on RAID0, RAID1 or non-RAID.  If you have a disk failure someday, for recovery the data is more important than the indexes (since they can be rebuilt from the data) and if the tables and indexes are on separate disks, you have more recovery options.

1b. Why multiple sizes?  All applications will have tables of different sizes: some small code or lookup tables, some with moderate amounts of data, and some with large amounts of data.  If you don't separate them into different tablespaces, then someday when your tablespace gets full, or if you choose to drop or move a table or index, the amount of free space left may not be easily or efficiently re-used.

2. Why not define a separate tablespace for each user?  In most application that I have worked with, all of the tables are owned by just one schema owner, and all other users share these tables.  If your application is designed differently, it may make sense for you to have the tables for each owner in their own tablespace.

 

by: fouaddbaPosted on 2006-04-19 at 07:36:22ID: 16488204

As you asked in detail, will try to reply appropriately:

Tablesspace > Segments > Extents > Data Blocks (Oracle)
In Oracle we have several different types of Segments: Data, Index, Lob, Cache, IOT, Undo, Temp....etc
And each n every has different attributes and properties, that is the reason that it is HIGHLY recommended (basically ordered) to put them, in there respective tablespaces, don't MIX & MINGLE, as they have different properties.

So 1st thing to remember, should have atleast 6 tablespaces (minimum) for a small type of db, where as in actual env., there are a lot more then this...

2nd: As now u must have understand the concept of different tbsps (tablespaces), according to req. of segments, lets take one segment, the most important one, the DATA segment, where our actual DATA is residing: eg., SOCTT.EMP.ENAME --- 'KING'

Just to make things understandable:
EMP         ------ has one million rows      >   there average row size is also very important, having different sizes
DEPT       ------ has 1 thousand rows
BONUS    ------ has 500 rows

Now if we put all these in one tbsp, you can see there maintenance is different from each other, the number of extent allocation will be  entirely different too, and u must be aware that allocation and de-allocation of extents are the most expensive task for Oracle Server,
so at the time of creation of tbsps, need to assign extent sizes keeping in mind that the table can stay within this tbsp for the whole of coming year, this should be ur space assignment strategy, should have atleast 3 different tbsps.

And yes it should be according to applicaton/owner, eg, in our case we have so many applications are running, so when I create there env., this'll be my strategy, as we are a warehous shop, for each application we have 3 envs. and 3 sizes, accordingly:

GBS is  application name, & 3 phases; staging area, warehouse, marts, and 3 sizes small, medium & large

1. GBS_STG_DATAS (for small tables), ....DATAM (for medium sized tables), ...DATAL (large tables, having million of rows)
2. GBS_WHO_DATAS
3. GBS_DMT_DATAS

S extent size is 64k, M extent size is 128kb, L extent size is 4mb,
obviously the sizing is according to ur needs and availability of resources (storage).

The biggest benefit u get, after having multiple tbsps, that if one goes currupt, other data will still be available, where as if u put all in ONE, if anythng goes wrong....nothing will be available.

In order to understand this concept, you need to understand ur data, from core:
EMP, DEPT, BONUS -------- what is the growth of each of ur object/tables and then only u can assign them to appropriate tbsps.

Inform, if u need any more info. or clarification on this.

 

by: fargoPosted on 2006-04-20 at 01:59:56ID: 16496025

very detailed explaination by both of you. Will come back to you fellas in coming days...(little busy with work..)

 

by: fargoPosted on 2006-04-23 at 03:57:03ID: 16518701

i agree with both of you to keep different tablespaces for data and indexs etc. But may be a question of a newbie..
For ex: If i m adding some indexes on a table, is it that i have to define the tablespace used for index explicitely?
Is it possible to say that all present indexes for a db user, should go to small_idx tablespace and whatever index will be created should by default use the tablespace defined for indexs??

 

by: fargoPosted on 2006-04-26 at 07:09:12ID: 16543981

Seems that my last post was not good enough to ask. But it is still open..ok.. :-)
Thx for your help guys.

 

by: markgeerPosted on 2006-04-28 at 09:58:01ID: 16563761

When you add an index to a table, it is best to explicitly define the tablespace you want the index to be created in.  If you don't, it will be created in the "default tablespace" for that user.

You can rebuild all present indexes (if you want) for a user to a particular tablespace, but you have to execute a command like this for each index:
alter index [index_name] rebuild [new_tablespace_name];

You can set the default tablespace for a user, but remember that both tables and indexes will be created here, unless you explicitly provide a different tablespace for either a table or index when you create one.

(I was at the annual IOUG Conference in Nashville, TN for most of this week, and I was quite busy there, so this is my first day on this site this week.)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...