Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Jai Shree Ram Oracle
  • Rman Notes -1 Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • Very Good Oralce Internal Tuning Book Oracle
  • runsql_once.ksh Linux/Unix
  • Distributed Transaction Troubleshooting. Oracle
  • cif crons Linux/Unix
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • Rman Notes -1 Oracle
  • online_bkup.sql Oracle
  • Drop database in Oracle 10g Oracle
  • move_arch_files.ksh Linux/Unix
  • Oracle Internal Good Websites 1 Oracle
  • RAC 11g with vmware Oracle
  • ORACLE_SID in sqlplus 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

  • Good notes on Oracle Events Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • Jai Shree Ram Oracle
  • Good RAC & Standby Notes Oracle
  • DBMS_UTILITY PACKAGE Oracle
  • mutex in Oracle 10.2.0.2 or Oracle 10g 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 (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Explain Plan Output 2 Oracle
  • RAC 11g with vmware Oracle
  • .profile Linux/Unix
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • Proc code Oracle
  • Find long Running Transaction Linux/Unix
  • Jai Shree Ram Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme