GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  Database Administration
Go To First  |  Previous Question  |  Next Question 
 Database Administration  |  Question 132 of 231    Print  
What is the difference between Pctused and PctFree?

  
Total Answers and Comments: 2 Last Update: November 19, 2007     Asked by: Mohammed Abdul Afroze 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: dinesh1909
 

Consider 8K block size. The total bytes 8 x 1024 = 8196 bytes
Each block requires approximately 117 bytes for the header. Please note that the header size varies depending upon the block size.
The total available bytes for data = ( 8196 – 117) = 8079 bytes.

A table is created with PCTFREE 20 PCTUSED 50 .

PCTRFREE in bytes = 1615
PCTUSED in bytes = 4039

Now the data available for insert and update = (8079 – (20 * 8079)/100 ) = 6463 Bytes.

Now user can insert new rows into this block as long as the old rows’ total bytes + new row’s total byte is less than or equal to 6463 bytes. If the new row’s total byte cannot be put into this block, then Oracle will get the next block from the free list, and inserts into it.

When a row is updated and the row’s data is expanded, then PCTFREE come into play. The updated row’s data is placed into PCTFREE’s area, provided the updated row’s new data can be fit into PCTFREE area. If it is not fit into that area, another new block will be obtained from the Freelist, and the row will be migrated. But the original row info (pointer) is kept in the old block. For subsequent access to this row involves 2 read I/O. That is why row migration should be avoided because of excessive I/Os.

ROW DELETION:

The PCTUSED parameter value (in this example 50 %) is the threshold limit for the old block to be added in the FREELIST. To understand better, let us assume that a block is of full data. Now the user starts deleting rows from the block. When a row is deleted, Oracle does not put the block into the FREELIST because it requires many recursive calls to update the FREELIST. The PCTUSED % (50) determines when the block should be added into FREELIST. When the total bytes in the block is less than or equal to 4039 bytes, then the block will be added into FREELIST.

If a table has high inserts and high deletion, then you should decrease the PCTUSED value in order to minimize the frequent update of FREELIST.

I think you got clear about pctused and pctfree



Above answer was rated as good by the following members:
bassem_farouk
November 16, 2007 09:17:18   #1  
C.Ramesh        

RE: What is the difference between Pctused and PctFree...

PCT USERD - The Percentage of Minimum space user for insertion of New Row data. The value determines when the block gets into the FREELISTS structure

PCTFREE - The Percentage of Space reserved for future updation of existing data


C.Ramesh


 
Is this answer useful? Yes | No
November 19, 2007 08:59:57   #2  
dinesh1909 Member Since: November 2007   Contribution: 4    

RE: What is the difference between Pctused and PctFree...

Consider 8K block size. The total bytes 8 x 1024 8196 bytes
Each block requires approximately 117 bytes for the header. Please note that the header size varies depending upon the block size.
The total available bytes for data ( 8196 – 117) 8079 bytes.

A table is created with PCTFREE 20 PCTUSED 50 .

PCTRFREE in bytes 1615
PCTUSED in bytes 4039

Now the data available for insert and update (8079 – (20 * 8079)/100 ) 6463 Bytes.

Now user can insert new rows into this block as long as the old rows’ total bytes + new row’s total byte is less than or equal to 6463 bytes. If the new row’s total byte cannot be put into this block then Oracle will get the next block from the free list and inserts into it.

When a row is updated and the row’s data is expanded then PCTFREE come into play. The updated row’s data is placed into PCTFREE’s area provided the updated row’s new data can be fit into PCTFREE area. If it is not fit into that area another new block will be obtained from the Freelist and the row will be migrated. But the original row info (pointer) is kept in the old block. For subsequent access to this row involves 2 read I/O. That is why row migration should be avoided because of excessive I/Os.

ROW DELETION:

The PCTUSED parameter value (in this example 50 ) is the threshold limit for the old block to be added in the FREELIST. To understand better let us assume that a block is of full data. Now the user starts deleting rows from the block. When a row is deleted Oracle does not put the block into the FREELIST because it requires many recursive calls to update the FREELIST. The PCTUSED (50) determines when the block should be added into FREELIST. When the total bytes in the block is less than or equal to 4039 bytes then the block will be added into FREELIST.

If a table has high inserts and high deletion then you should decrease the PCTUSED value in order to minimize the frequent update of FREELIST.

I think you got clear about pctused and pctfree


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

The primary functional difference between logical and physical standby database setups is that logical standby permits you to add additional objects (tables, indexes, etc) to the database, while physical 
Latest Answer : A physical or logical standby database is a database replica created from a backup of a primary database. A physical standby database is physically identical to the primary database on a block-for-block basis.  It's maintained in managed ...

Enqueues are another type of locking mechanism used in Oracle. An enqueue is a more sophisticated mechanism which permits several concurrent processes to have varying degree of sharing of "known" 
Latest Answer : An enqueue is a sophisticated locking mechanism that permits several concurrent processes to share known resources to varying degrees. Any object that can be used concurrently can be protected with enqueues. For example, Oracle allows varying levels of ...

Latest Answer : SQLNET.ora tells you what path to take in resolving the name of an instance (among other things). In the context of this question, the NAMES.DIRECTORY_PATH parameter specifys the order of the naming methods used for client name resolution lookups. (TNSNAMES, ...
Read Answers (2) | Asked by : Hasan

What is the difference between .ora and net file or .ora and .net or tnsnames.ora sqlnet.ora listener.ora what ever the differnence makes between ora and net.
Read Answers (1) | Asked by : hasanvtu

Latest Answer : Pfile1. text file2. changes take effect on the next startup3. initSID.oraSPfile1. binary file2. changes perisitent across startup and shutdown3. spfileSID.ora Only way to start db with spfile in non default location SPFILE = must beplaced in pfile ...
Read Answers (7) | Asked by : hasanvtu

Latest Answer : snapshots can't upated. While MV can be updated contantley. ...
Read Answers (2) | Asked by : sanju`

Latest Answer : Often the word "lock" is synonymous to enqueue. In this document, "enqueue" will be used for the locking mechanism that you can find in V$LOCK. "locking" will be used when talking about requesting an enqueue, waiting on an ...
Read Answers (1) | Asked by : jayant Nimje

Latest Answer : When Oracle allocates space to a segment (like a table or index), a group of contiguous free blocks, called an extent, is added to the segment. Metadata regarding extent allocation and unallocated extents are either stored in the data dictionary, or in ...
Read Answers (2) | Asked by : shrihari

Latest Answer : Consider 8K block size. The total bytes 8 x 1024 = 8196 bytesEach block requires approximately 117 bytes for the header. Please note that the header size varies depending upon the block size. The total available bytes for data = ( 8196 – 117) = ...
Read Answers (2) | Asked by : Mohammed Abdul Afroze

Latest Answer : HiBase tables are made when the database is created and these tables are stored in data dictionary. these base tables contains the information related to the database.  these tables are own by sys.the information in these tables is crypted and cannot ...
Read Answers (1) | Asked by : richa chohan


 Sponsored Links

 
Related Articles

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Using Oracle XML DB Repository

Using Oracle XML DB Repository Another variation on accessing and manipulating XML content stored in Oracle database is provided by Oracle XML DB repository which is an essential component of Oracle XML DB mosgoogle NOTE Oracle XML DB repository also known as XML repository is a hierarchically organ
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Moving All the XML Processing into the Database

Moving All the XML Processing into the Database In the preceding example the database server performs only a part of the XML processing while the rest is still performed by the PHP engine Specifically the database server generates an employees XML document based on the records from the hr employees
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

XML Processing in PHP and Oracle Applications

Processing XML in PHP Oracle Applications As mentioned there are two alternatives when it comes to performing XML processing in your PHP Oracle application You can perform any required XML processing using either PHP s XML extensions or PEAR XML packages or Oracle s XML features mosgoogle In the fol
 

PHP Oracle Web Development

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax is a good starting b
 

Getting Started with Oracle and ODP.NET

ODP NET Developer’ s Guide by Jagadish Chatarji Pulakhandam Sunitha Paruchuri A practical guide for developers working with the Oracle Data Provider for NET and the Oracle Developer Tools for Visual Studio 2005 Application development with ODP NET Dealing with XML DB using ODP NET Oracle
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape