Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Specify the Rollback segment to use in Transaction Oracle
  • longtx.sql Oracle
  • refre.sql Oracle
  • xargs use Linux/Unix
  • This is im telling Kishore Oracle
  • Renaming Oracle Instance Name Oracle
  • export import with parameter file. Oracle
  • sid_wise_sql.sql Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • adding new line after specific pattern using sed Linux/Unix
  • SQL_PROFILE – I explaination Oracle
  • Read CSV File using Python Python/PySpark
  • Oracle 11g RAC on OEL 5 and Vmware 2 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

  • get_vmstat_solaris Oracle
  • Jai Shree Ram Oracle
  • Exadata Basics Oracle
  • Temporary Tablespace Information and restriction. Oracle
  • Kill a session dynanically using execute immediate Oracle
  • Rman Notes -1 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
  • Kernel Parameters for Solaris Linux/Unix
  • create database syntax Oracle
  • How to start CRS manually Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL
  • Query to Generate aggregate on every 30 mins. Oracle
  • Roles and Stored Object behaviour Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme