Script to Generate Index Rebuild Scripts for Heavily Fragmented Indexes

This script generates index rebuild scripts for heavily fragmented indexes with clustering factors greater than 1000. It uses a PL/SQL block to iterate over the indexes and generates an ALTER INDEX ... REBUILD statement for each index. The generated scripts are displayed using the DBMS_OUTPUT.PUT_LINE function. These advanced scripts provide additional functionality,

Script to Analyze Index Fragmentation and Generate Maintenance Scripts

This script analyzes the fragmentation of indexes with clustering factors greater than 1000 and generates maintenance scripts based on the fragmentation level. It uses a PL/SQL block to iterate over the indexes, and for each index, it determines whether to rebuild it (if clustering factor > 2000) or reorganize it (if clustering factor <= 2000). The generated scripts are displayed using the DBMS_OUTPUT.PUT_LINE function.

Oracle SQL Script to Check Index Fragmentation and Maintenance

1. Check Index Fragmentation and Determine Level 

This script checks the index fragmentation level for indexes on a specific table. It queries the all_indexes data dictionary view based on the schema name and table name, and displays the index name, table name, B-level (branching factor), number of leaf blocks, distinct keys, and clustering factor. Higher clustering factor values indicate potential fragmentation.

Oracle SQL Script for Index Usage and Performance:

1. Identify Underused or Unused Indexes 

 This script identifies underused or unused indexes in a specific schema. It queries the all_indexes data dictionary view based on the schema name, status, and index statistics (num_rows and leaf_blocks). The output displays the index name, table name, status, number of rows, and number of leaf blocks.

Oracle SQL Script to Retrieve Index Information - with Description and Sample Output

1. Query to list all indexes on a specific table or schema.

This script lists all indexes on a specific table. It queries the all_indexes data dictionary view based on the table name and displays the index name, table name, uniqueness (UNIQUE or NONUNIQUE), and status (VALID or INVALID) of each index.

Script to Analyzes the Efficiency of Indexes in an Oracle Database:

This script performs the following steps: 
 1. Creates a temporary table (index_analysis_results) to store the index analysis results. 
2. Loops through all non-system indexes (NORMAL index type) in the database (excluding system schemas and recycle bin objects). 

RMAN Script That Incorporates Various Backup and Recovery Operations

This script includes the following operations:

Full Backup:
  • Allocates a channel for the backup destination.
  • Performs a compressed backup of the database using the BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG command.
  • Releases the allocated channel.

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-25 All Rights Reserved | Site Map | Contact | Disclaimer