A chained row is called a row that does not fit into a single database block. For example, when you try to add a 16K size row to a database that has a block size of 8KB, that record will use 3 blocks. This row is called a chained row because it does not fit into a block.
The tables that may contain a chained row are as follows:
- If the row size exceeds the database block size in a table.
- Tables with long and long raw columns.
- Tables with more than 255 columns.
Chained row detection:
First, we create the required table as follows.
1 2 | SQL> @$ORACLE_HOME/rdbms/admin/utlchain.sql; Table created. |
Then, the related table needs to be analyzed as follows.
1 | SQL> ANALYZE TABLE tablename LIST CHAINED ROWS; |
After these operations, the chained_rows table will display the information if the corresponding table has a chained row.
1 | SQL> SELECT * FROM chained_rows; |
We can also query tables with chained row with the following query.
1 | SQL> SELECT owner, table_name, chain_cnt FROM dba_tables WHERE chain_cnt > 0; |
When you receive an error such as the following during the analysis of the table, the chained_rows table does not exist in the user schema that you are running the analysis. In this case, you must run utlchain.sql and perform the analysis with the same user.
ORA-01495: specified chain row table not found