Skip to content

Instantly share code, notes, and snippets.

View dincosman's full-sized avatar

Osman DINC dincosman

View GitHub Profile
@dincosman
dincosman / query_underscore.sql
Last active March 6, 2022 20:43
The query for Oracle Hidden Parameters
SQL> SELECT PI.KSPPINM PARAMETER_NAME, PSV.KSPPSTVL INSTANCE_VALUE
FROM X$KSPPI PI, X$KSPPCV PCV, X$KSPPSV PSV
WHERE PI.INDX = PCV.INDX
AND PI.INDX = PSV.INDX
AND ( PI.KSPPINM = '_HIGH_PRIORITY_PROCESSES'
OR PI.KSPPINM = '_HIGHEST_PRIORITY_PROCESSES'); --PARAMETER NAME
PARAMETER_NAME INSTANCE_VALUE
-------------- --------------
_highest_priority_processes VKTM
@dincosman
dincosman / required_mdrt_tables.sql
Last active March 6, 2022 19:29
The query to detect required mdrt_# tables
SQL> SELECT SM.*
FROM ALL_TABLES T, ALL_SDO_INDEX_METADATA SM
WHERE T.TABLE_NAME LIKE 'MDRT%' AND T.TABLE_NAME = SM.SDO_INDEX_TABLE
ORDER BY SDO_INDEX_OWNER;
@dincosman
dincosman / drop_mdxt_tables.sql
Last active March 6, 2022 19:29
The query to detect and drop, not needed mdxt_ tables.
SQL> SELECT 'DROP TABLE ' || T.OWNER || '.' || '"' || T.TABLE_NAME || '" PURGE;'
AS DROP_MDXTS_COMMAND
FROM DBA_TABLES T
WHERE T.TABLE_NAME LIKE 'MDXT%';
@dincosman
dincosman / secondary_objs_starts_with_mdrt.sql
Last active March 6, 2022 19:28
Secondary objects related with spatial index
SQL> SELECT *
FROM DBA_SECONDARY_OBJECTS
WHERE SECONDARY_OBJECT_NAME LIKE 'MDRT%';
@dincosman
dincosman / drop_mdrt_tables.sql
Last active March 6, 2022 19:27
The query to detect and drop, not needed mdrt_ tables.
SQL> SELECT 'DROP TABLE ' || T.OWNER || '.' || '"' || T.TABLE_NAME || '" PURGE;'
AS DROP_ORPHANED_MDRTS_COMMAND
FROM DBA_TABLES T
WHERE T.TABLE_NAME LIKE 'MDRT%'
AND T.TABLE_NAME NOT IN (SELECT SM.SDO_INDEX_TABLE
FROM ALL_SDO_INDEX_METADATA SM);
@dincosman
dincosman / change_tablespace_of_mdrt_table.sql
Last active March 6, 2022 19:26
The command to change the tablespace of mdrt_# tables.
SQL> ALTER INDEX OWNER.SDO_INDEX_NAME
REBUILD PARAMETERS ('TABLESPACE=NEW_TBS');
@dincosman
dincosman / last_reboot_output.txt
Last active May 6, 2024 19:49
Last reboot output
[oracle@bltdb02 ~]$ last reboot
reboot system boot 4.14.35-2047.506 Tue Feb 22 13:35 - 11:32 (1+21:56)
reboot system boot 4.14.35-2047.506 Sat Feb 19 19:05 - 11:32 (4+16:27)
...
@dincosman
dincosman / lastgasp_records.txt
Last active October 7, 2023 06:30
lastgasp records
[oracle@bltdb02 trace]$ ls -lsc /etc/oracle/lastgasp/
total 8
4 -rwxr--r-- 1 root root 4096 Apr 8 2020 cssagent_bltdb02.lgl
4 -rwxr--r-- 1 root root 4096 Apr 8 2020 cssmonit_bltdb02.lgl
@dincosman
dincosman / var-log-messages_output.txt
Last active October 7, 2023 06:30
Records in var/log/messages
[root@bltdb02 ~]# vi /var/log/messages
...
Feb 22 13:25:15 bltdb02 systemd-logind: Removed session 1202.
Feb 22 13:25:57 bltdb02 systemd-logind: New session 1203 of user oracle.
Feb 22 13:25:57 bltdb02 systemd: Started Session 1203 of user oracle.
Feb 22 13:25:57 bltdb02 systemd-logind: Removed session 1203.
Feb 22 13:27:25 bltdb02 chronyd[2019]: Selected source 95.140.32.4
Feb 22 13:28:13 bltdb02 rtkit-daemon[1999]: The canary thread is apparently starving. Taking action.
Feb 22 13:28:13 bltdb02 rtkit-daemon[1999]: Demoting known real-time threads.
Feb 22 13:28:13 bltdb02 rtkit-daemon[1999]: Demoted 0 threads.
@dincosman
dincosman / alert_clouddg2.log
Last active October 7, 2023 06:28
Alert log of sample db.
[oracle@bltdb02 trace]$ vi $ORACLE_BASE/diag/rdbms/clouddg/clouddg2/trace/alert_clouddg2.log
...
2022-02-22T13:28:11.385787+03:00
Warning: VKTM detected a forward time drift.
2022-02-22T13:28:12.528795+03:00
Please see the VKTM trace file for more details:
/u01/app/oracle/diag/rdbms/clouddg/clouddg2/trace/clouddg2_vktm_7250.trc
2022-02-22T13:40:27.076354+03:00
Starting ORACLE instance (normal) (OS id: 24477)
...