Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Some OS level threshold for performance. Linux/Unix
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • Multiple listeners Oracle
  • Goldengate Tutorial Oracle
  • cur_sql.sql Oracle
  • This is im telling Kishore Oracle
  • Oracle Connections expire_time and firewall Oracle
  • Sending email with file attachment. Linux/Unix
  • Find Plan Hash value fphv.sql Oracle
  • Rename Tablespace Oracle
  • FGA Part-I Oracle
  • How to set Processes Parameter Oracle
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • Adding addidional hard drive and attach it to a linux box. Linux/Unix
  • V$ROLLSTAT status is Full Oracle

TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1

Posted on 14-Oct-2005 By Admin No Comments on TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1

===================================================================

STEP-I First, calculate the total block header size:

===================================================================

block header = fixed header + variable transaction header + table directory + row directory

where:

fixed header = 57 bytes (the 4 bytes at the end of the block have already been taken account of in the 24 bytes for the cache header)

variable transaction header = 23 * i where i is the value of INITRANS for the table, or can grow dynamically up to MAXTRANS.

table directory = 4 * n where n is the number of tables. n = 1 for non-clustered tables.

row directory = 2 * x where x is the number of rows in the block.

Using the above formula, the initial block header size for a non-clustered table with INITRANS = 1 is:

block header = 57 + 23 + 4 + 2x = (84 + 2x) bytes

The space reserved for data within the block, as specified by PCTFREE, is calculated as a percentage of the block size minus the block header.

available data space = (block size – total block header) – ((block size – total block header) * (PCTFREE/100))

For example, with PCTFREE = 10 and a block size of 2048, the total space for new data in a block is:

available data space = (2048 – (84 + 2x)) – ((2048 – (84 + 2x)) *(10/100))

= (1964 – 2x) – ((2048 – 84 – 2x) * (10/100))

= (1964 – 2x) – (1964 – 2x) * 0.1

= (1964 – 2x – 196 + 0.2x) bytes

= (1768 – 1.8x) bytes

==================================================================================

Step II Now, calculate the combined data space required for an average row.

==================================================================================

Calculating this depends on the following:

1. The number of columns in the table definition.

2. The datatypes used for each column.

3. The average value size for variable length columns.

A test database similar to the production database will be helpful here. To calculate the combined data space for an average row in a table, use the following query:

SELECT AVG(NVL(VSIZE(col1), 1)) +

AVG(NVL(VSIZE(col2), 1)) +

… +

AVG(NVL(VSIZE(coln), 1)) “SPACE OF AVERAGE ROW”

FROM table_name;

col1, col2, … , coln are the column names of the table and table_name is the table being evaluated.

Oracle, SQL scripts

Post navigation

Previous Post: FGA Part-I
Next Post: My Test Case On 21-OCT-2005

Related Posts

  • How to find password change date for user Oracle
  • Reclaim temp tablespace for oracle 8, 8i Oracle
  • Convert multiple rows to single column Oracle
  • sbind.sql Find Bind variable from sql_id sqlid Oracle
  • How to stop OCSSD Daemon Oracle
  • Oracle10g – Using SQLAccess Advisor (DBMS_ADVISOR) with the Automatic Workload Repository Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Search and Replace vi editor command. Linux/Unix
  • replace alphabets using sed Linux/Unix
  • Another export with Query Oracle
  • catting.sh Linux/Unix
  • Running select from V$ views from remote server Linux/Unix
  • How To Transfer Passwords Between Databases (ref note: 199582.1) Oracle
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • ext#.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme