Monday, February 6, 2023
Copy sql profile/baseline from one sql id to another for Oracle database out of a modified SQL using coe_load scripts
Saturday, February 4, 2023
Force monitor Oracle Database Operations / Sql -- Monitoring Settings to capture Sql that are not monitored
Sunday, January 29, 2023
Oracle database 19c Dynamic sequence cache - LAST_VALUE for sequences is incorrectly calculated
Saturday, January 21, 2023
Gathering Information for Troubleshooting Oracle Physical Standby Database /Dataguard
Writing this blog to keep all scripts handy for handling dataguard issues
Checking Log Transport Lag and Log transport error :
Have documented sql used in below separate blog foe easiness
https://abdul-hafeez-kalsekar-tuning.blogspot.com/2023/01/monitoring-oracle-standby-log-transport.html
Improving Log transport :
1) Using multithreaded log writer / lgwr process for Sync log transport
2) Increasing Archiver process for async log transport .
Handling Huge archive gap or when archive is missing :
1) Applying Incremental Scn based backup
Logs to checks :
1) Prod and Dr Site Alert Logs
2) Prod and Dr Site dg broker log
3) Prod site lgwr logfile .
DGMGRL Commands :
Spool dgconfig.log
DGMGRL> show database STYDB InconsistentProperties
DGMGRL>show database STYDB InconsistentLogXptProps
Checking Dataguard Parameters :
Thursday, December 15, 2022
Gathering Concurrent Statistics in Oracle Database -- Speeding up Statistics gather
col spare4 format a40 head 'VALUE' | |
select sname,spare4 | |
from sys.optstat_hist_control$ | |
order by 1 | |
/ |
Saturday, November 26, 2022
Oracle Rac database Rman Backup using multiple Instances -- Node affinity
Sunday, November 6, 2022
Oracle Database DBMS_Scheduler job to run on preferred node in RAC -- instance_stickiness
Using Job Class and Database Service :
This can also be achieved using service defined in Job class
Reference :
How To Run A Job On Specific Node Using DBMS_SCHEDULER (Doc ID 472535.1)
Doc ID 2214476.1
Monday, October 31, 2022
Reading Unix Compressed files without uncompressing them using Zcat, Zless, Zgrep, Zdiff
Wednesday, October 26, 2022
Oracle Database Health Check with DBMS_HM -- HEALTH CHECK MONITOR
Health check run in the two mode :
1) Online Mode: Health check run while database is in open or mounted mode.
2) Offline Mode: Health check run while database is in nomount mode.Only the Redo Integrity Check and the DB Structure Integrity Check can be used in DB-offline mode.
Types of health check :
1) DB Structure Integrity Check: This option check datafiles if there is corruption or inaccessible situtation.if database is open this check logfile and datafile if nomount mode only checkhed controlfile.
2) Data Block Integrity Check: This check detects disk image block corruptions such as checksum failures and logical inconsistencies within the block.
3) Redo Integrity Check: This check scans redo log for accessibility and corruption, as well as the archive logs, if available.
4) Undo Segment Integrity Check: This check finds logical undo corruptions.
5) Transaction Integrity Check: This check is identical to the Undo Segment Integrity Check but it checks only one specific transaction.
6) Dictionary Integrity Check: This check integrity of core dictionary objects, such as tab$ and col$
Sample :
1) DB Structure Integrity Check:
SQL> BEGIN
DBMS_HM.RUN_CHECK('Dictionary Integrity Check', 'hk_run');
END;
/
2) Data Block Integrity Health Check
BEGIN
DBMS_HM.RUN_CHECK (
check_name => ‘Data Block Integrity Check’,
run_name => ‘datablockint’,
input_params => ‘BLC_DF_NUM=4;BLC_BL_NUM=111’);
END;
/
3) Transaction Health Check:
BEGIN
DBMS_HM.RUN_CHECK (
check_name => ‘Transaction Integrity Check’,
run_name => ‘transacitoncheck’,
input_params => ‘TXN_ID=7.33.2’);
END;
/
4) Undo Segment Health Check:
BEGIN
DBMS_HM.RUN_CHECK (
check_name => ‘Undo Segment Integrity Check’,
run_name => 'undosegmentcheck',
input_params => ‘USN_NUMBER=1’);
END;
/
Health Monitor Views:
V$HM_CHECK – lists all Health checks
V$HM_CHECK_PARAM - lists information about Health checks, input parameters and defaults. Join CHECK_ID with V$HM_CHECK.ID.
V$HM_FINDING – Information about findings of Health Monitor runs.
V$HM_INFO – Information about runs, finding and recommendations.
V$HM_RECOMMENDATION – information about any recommendation from Health check runs.
V$HM_RUN – Information about checker runs like name, mode, time of run, etc.
SQL>SELECT c.name check_name, p.name parameter_name, p.type,
p.default_value, p.description
FROM v$hm_check_param p, v$hm_check c
WHERE p.check_id = c.id and c.internal_check = ‘N’
ORDER BY c.name;
SQL>select * from V$HM_RECOMMENDATION;
SET LONG 100000
SET LONGCHUNKSIZE 1000
SET PAGESIZE 1000
SET LINESIZE 512
SELECT DBMS_HM.get_run_report('undosegmentcheck') FROM dual;
Viewing Reports Using the ADRCI Utility
adrci>>
adrci> show hm_run