Parameter Query Tool (xparm80.sql)
Parameter Query Tool
Section titled “Parameter Query Tool”This script provides a user-friendly way to query Oracle system parameters with clear formatting and modification indicators. It works with the advanced parameters view created by xparmall.run.
Script: xparm80.sql
Section titled “Script: xparm80.sql”rem xparmall.sqlremttitle 'All System Parameters'remcol num format 999 heading 'ID'col name format a41 heading 'NAME'col type format 9 heading 'T'col value format a36 heading 'VALUE'col isdefault format a5 heading 'ISDEF'col m format a1 heading 'M'col isses_modifiable format a5 heading 'IS|SESS|MOD'col issys_modifiable format a9 heading 'IS|SYSTEM|MOD'col ismodifiable format a8 heading 'IS|MOD'col isadjusted format a5 heading 'ISADJ'col description format a25 heading 'DESCPIPTION'remselect/* num, type, decode( isses_modifiable, 'FALSE', null, isses_modifiable ) isses_modifiable, decode( issys_modifiable, 'FALSE', null, issys_modifiable ) issys_modifiable, decode( ismodifiable, 'FALSE', null, ismodifiable ) ismodifiable, decode( isadjusted, 'FALSE', null, isadjusted ) isadjusted, description*/ name, decode( isdefault, 'TRUE', null, 'FALSE', '*', '?' ) m, value from x$system_parameters where name like '&name' order by name;
What This Script Does
Section titled “What This Script Does”This script provides an interactive parameter lookup tool that:
- Prompts for Parameter Names: Uses substitution variable for pattern matching
- Shows Modification Status: Displays ’*’ for non-default parameters
- Formatted Output: Clean, readable parameter display
- Pattern Matching: Supports SQL wildcards for parameter searches
- Requires Advanced View: Works with the
x$system_parameters
view
Prerequisites
Section titled “Prerequisites”This script requires the x$system_parameters view created by:
@xparmall.run
See Advanced System Parameters View (xparmall.run) for setup instructions.
-- Run the script and enter parameter pattern when prompted@xparm80.sql
-- Examples of patterns to enter:-- sga% (all SGA-related parameters)-- %optimizer% (all optimizer parameters)-- processes (exact parameter name)-- %memory% (all memory-related parameters)-- _trace% (all trace-related hidden parameters)
Required Privileges
Section titled “Required Privileges”- SELECT privilege on
X$SYSTEM_PARAMETERS
view - The view must exist (created by xparmall.run)
- Typically requires DBA role
Sample Output
Section titled “Sample Output”Enter value for name: sga%
All System Parameters
NAME M VALUE---------------------------------------- - ------------------------------------sga_max_size * 2147483648sga_target * 1073741824
Enter value for name: %optimizer%
All System Parameters
NAME M VALUE---------------------------------------- - ------------------------------------optimizer_adaptive_features TRUEoptimizer_adaptive_plans TRUEoptimizer_adaptive_statistics FALSEoptimizer_adaptive_reporting_only FALSEoptimizer_capture_sql_plan_baselines FALSEoptimizer_dynamic_sampling * 11optimizer_features_enable * 19.1.0optimizer_index_caching 0optimizer_index_cost_adj 100optimizer_mode * FIRST_ROWSoptimizer_secure_view_merging TRUEoptimizer_use_invisible_indexes FALSEoptimizer_use_pending_statistics FALSEoptimizer_use_sql_plan_baselines TRUE
Key Output Elements
Section titled “Key Output Elements”Element | Description |
---|---|
NAME | Parameter name (up to 41 characters) |
M | Modification indicator: blank=default, *=modified, ?=unknown |
VALUE | Current parameter value (up to 36 characters) |
Modification Indicators
Section titled “Modification Indicators”- Blank: Parameter is at its default value
- *****: Parameter has been modified from default
- ?: Parameter status is unknown
Common Search Patterns
Section titled “Common Search Patterns”1. Memory-Related Parameters
Section titled “1. Memory-Related Parameters”-- When prompted, enter: %memory%-- Or run directly:SELECT name, decode(isdefault, 'TRUE', null, 'FALSE', '*', '?') m, valueFROM x$system_parametersWHERE name LIKE '%memory%'ORDER BY name;
2. SGA Parameters
Section titled “2. SGA Parameters”-- When prompted, enter: sga%-- Shows all SGA-related settings
3. Optimizer Parameters
Section titled “3. Optimizer Parameters”-- When prompted, enter: %optimizer%-- Shows all optimizer configuration
4. Hidden Parameters
Section titled “4. Hidden Parameters”-- When prompted, enter: _%-- Shows all hidden/underscore parameters
5. Process Parameters
Section titled “5. Process Parameters”-- When prompted, enter: %process%-- Shows process-related settings
6. Parallel Parameters
Section titled “6. Parallel Parameters”-- When prompted, enter: parallel%-- Shows parallel execution settings
Advanced Usage
Section titled “Advanced Usage”Extended Information Query
Section titled “Extended Information Query”You can modify the script to show more details by uncommenting the extended section:
select num, name, type, decode( isdefault, 'TRUE', null, 'FALSE', '*', '?' ) m, value, decode( isses_modifiable, 'FALSE', null, isses_modifiable ) isses_modifiable, decode( issys_modifiable, 'FALSE', null, issys_modifiable ) issys_modifiable, decode( ismodifiable, 'FALSE', null, ismodifiable ) ismodifiable, decode( isadjusted, 'FALSE', null, isadjusted ) isadjusted, description from x$system_parameters where name like '&name' order by name;
Non-Interactive Version
Section titled “Non-Interactive Version”Create a version that doesn’t prompt:
-- Save as xparm_search.sqlDEFINE search_pattern = '&1'
SELECT name, decode(isdefault, 'TRUE', ' ', 'FALSE', '*', '?') as modified, valueFROM x$system_parametersWHERE UPPER(name) LIKE UPPER('%&search_pattern%')ORDER BY name;
-- Usage: @xparm_search.sql optimizer
Practical Examples
Section titled “Practical Examples”1. Performance Tuning Parameters
Section titled “1. Performance Tuning Parameters”-- Search for key performance parameters@xparm80.sql-- Enter: %sga%
@xparm80.sql-- Enter: %pga%
@xparm80.sql-- Enter: %cpu%
2. Find Modified Parameters
Section titled “2. Find Modified Parameters”-- To find all modified parameters, use this query:SELECT name, value, descriptionFROM x$system_parametersWHERE isdefault = 'FALSE'ORDER BY name;
3. Security-Related Parameters
Section titled “3. Security-Related Parameters”@xparm80.sql-- Enter: %audit%
@xparm80.sql-- Enter: %encrypt%
@xparm80.sql-- Enter: %secure%
4. Database Feature Parameters
Section titled “4. Database Feature Parameters”@xparm80.sql-- Enter: %compatible%
@xparm80.sql-- Enter: %enable%
@xparm80.sql-- Enter: %disable%
Integration with Other Scripts
Section titled “Integration with Other Scripts”This script works well with:
- Advanced Parameters View (xparmall.run) - Required prerequisite
- Parameter Descriptions (xparmdef.sql) - For detailed parameter descriptions
- Database Health Check (db.sql) - For comprehensive database analysis
- System Information (vsga.sql) - For memory configuration analysis
Automation Examples
Section titled “Automation Examples”Create Parameter Documentation
Section titled “Create Parameter Documentation”-- Generate parameter documentationSET PAGESIZE 1000SET LINESIZE 150SPOOL parameter_documentation.txt
SELECT name, value, isdefault, descriptionFROM x$system_parametersWHERE isdefault = 'FALSE'ORDER BY name;
SPOOL OFF
Parameter Change Tracking
Section titled “Parameter Change Tracking”-- Create a parameter tracking tableCREATE TABLE parameter_history ( capture_date DATE, parameter_name VARCHAR2(64), parameter_value VARCHAR2(512), is_default VARCHAR2(5), is_modified VARCHAR2(8));
-- Insert current non-default parametersINSERT INTO parameter_historySELECT SYSDATE, name, value, isdefault, ismodifiableFROM x$system_parametersWHERE isdefault = 'FALSE';
Troubleshooting
Section titled “Troubleshooting”Script Fails with “Table or View Does Not Exist”
Section titled “Script Fails with “Table or View Does Not Exist””-- Verify the prerequisite view existsSELECT COUNT(*) FROM x$system_parameters WHERE rownum = 1;
-- If it fails, run the prerequisite script:@xparmall.run
No Parameters Found
Section titled “No Parameters Found”-- Check if the pattern is correctSELECT name FROM x$system_parametersWHERE LOWER(name) LIKE LOWER('%your_pattern%');
-- Verify view has dataSELECT COUNT(*) FROM x$system_parameters;
Performance Issues
Section titled “Performance Issues”-- For better performance on large parameter sets, add indexes:-- (This would require DBA privileges on the underlying tables)
Best Practices
Section titled “Best Practices”- Use Wildcards Effectively: Learn common parameter prefixes for efficient searches
- Review Modified Parameters: Regularly check what’s been changed from defaults
- Document Changes: Keep track of parameter modifications and their reasons
- Test First: Always test parameter changes in development environments
- Coordinate with xparmall: Use this script in conjunction with the full parameter view
This tool provides an efficient way to explore Oracle’s vast parameter system and quickly find the settings you need to analyze or modify.