=====Oracle Health Checks Collection Manager===== Details zu AHF siehe [[dba:oracle_rac_19c_ahf_trace_file_analyser|Eine Oracle RAC Umgebung mit dem AUTONOMOUS HEALTH FRAMEWORK(AHF) überprüfen]] ==== Installation DB Umgebung ==== Ablauf: * Datenbank und APEX Basis Umgebung bereitstellen siehe => [[prog:oracle_apex_20_2_install_windows_19c_linux_8|Oracle Apex 21.1 / ORDS 21.2 / Tomcat 9 / Apache 2.4 mit der Oracle Datenbank 19c - Installation]] * Tablespace für das Repostiory anlegen #falls container! #ALTER SESSION SET CONTAINER = ans; CREATE TABLESPACE oraahf DATAFILE '/opt/oracle/oradata/GPIDB/ans/oraahf01.dbf' SIZE 1G AUTOEXTEND ON NEXT 1M MAXSIZE 8G UNIFORM SIZE 10M; alter TABLESPACE oraahf add DATAFILE '/opt/oracle/oradata/GPIDB/ans/oraahf02.dbf' SIZE 1G AUTOEXTEND ON NEXT 1M MAXSIZE 8G; alter TABLESPACE oraahf add DATAFILE '/opt/oracle/oradata/GPIDB/ans/oraahf03.dbf' SIZE 1G AUTOEXTEND ON NEXT 1M MAXSIZE 8G; alter TABLESPACE oraahf add DATAFILE '/opt/oracle/oradata/GPIDB/ans/oraahf04.dbf' SIZE 1G AUTOEXTEND ON NEXT 1M MAXSIZE 8G; * User "orachkcm" anlegen und Rechte vergeben: * #falls container! #ALTER SESSION SET CONTAINER = ans; create user orachkcm identified by secret45 default tablespace oraahf QUOTA UNLIMITED ON oraahf ; grant connect, resource to ORACHKCM; grant create view to ORACHKCM; grant EXECUTE ON DBMS_RLS to ORACHKCM; grant CREATE JOB to ORACHKCM; grant EXECUTE ON UTL_SMTP to ORACHKCM; * APEX Workspace anlegen und Schema ORACHKCM zuordnen (als Admin im INTERNAL Workspace) * Im Workspache Applikation importieren (Source /orachk/Apex5_CollectionManager_App.sql ) * Im Workspace einen Anwender wie "ORACHKCM" anlegen * AHF auf dem Host mit einem Connectstring zur DB konfigurieren * Bericht erzeugen und in das Repository laden lassen Siehe auch => https://docs.oracle.com/en/engineered-systems/health-diagnostics/autonomous-health-framework/ahfug/apex20-2-managing-oracle-health-check-collection-manager.html ---- ==== Upload Manuell konfigurieren==== Hier wird für die Konfiguration "ahfctl" verwendet, "tfactl" ist veraltet und sollte nicht mehr verwendet werden! Eine evlt. alten Konfiguration entfernen: /opt/oracle.ahf/bin/ahfctl unsetupload -all -name orachkcm Als Root konfigurieren: cd /opt/oracle.ahf/bin ./ahfctl setupload -type sqlnet -name orachkcm -user orachkcm -password -connectstring "(DESCRIPTION =(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.10.1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=gpidb)))" -uploadtable RCA13_DOC Enter orachkcm.sqlnet.password : Successfully synced AHF configuration Upload configuration set for: orachkcm type: sqlnet orachkcm.sqlnet.user: orachkcm orachkcm.sqlnet.password: ****** orachkcm.sqlnet.connectstring: (DESCRIPTION =(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=gpidb))) orachkcm.sqlnet.uploadtable: RCA13_DOC Database upload parameters successfully stored. AHF will continue to upload the collections to the database until unset using ahfctl unsetupload [-all] Überprüfen mit: /opt/oracle.ahf/bin/ahfctl getupload -all -name orachkcm Daten hochladen: [root bin]# ./ahfctl orachk -a -dball ---- ==== Upload per Script konfigurieren==== Ärgerlicherweise muss das Password interaktiv eingegeben werden. Um nun das zu automatisieren bietet sich **expect** an siehe dazu auch => https://likegeeks.com/expect-command/ Ablauf als Ansible Tasks: Im ersten Schritt alles konfigurieren das sich so übergeben läßt: ---- ===Problem: MEMORYCRUNCH: Does not have enough space in data base to process collection...exiting. === **Ursache:** Ein internes SQL fragt die freien Platz des Tablespaces ab, ist der relativ voll und auf auto Exented wird die Collection nicht verarbeitet, da eine zu niedriger Wert ermittelt wird. Aus dem Code: .. ' minRequiredFreeSpace number := 100; -- Size in MB', .. ' -- Check whether there is enough space to process collection or not ', ' begin', ' select tablespace_name into tsName from user_tables where table_name = ''RCA13_DOCS'';', ' SELECT sum(bytes)/1048576 into freeSpace FROM user_free_space where tablespace_name = tsName;', ' exception when others then null;', ' end;', ' if freeSpace < minRequiredFreeSpace then ', ' log_text(''MEMORYCRUNCH: Does not have enough space in data base to process collection...exiting.'',collectionId,docId);', ' update_collection_status(collectionId,''Failed'',''NO_ENOUGH_SPACE'');', ' return; ', ' end if;', **Lösung:** Datendatei des Tablespaces mit entsprechender Größe gleich anlegen! ---- ==== User Definied Checks ==== https://docs.oracle.com/en/engineered-systems/health-diagnostics/exachk/oexug/oracle-orachk-and-exachk-users-guide.pdf ==== Quellen ==== MOS: * Collection Manager for ORAchk, RACcheck and Exachk (Doc ID 1602329.1) * Autonomous Health Framework (AHF) - Including TFA and ORAchk/EXAchk (Doc ID 2550798.1) Netz: * https://www.markusdba.de/wp-content/uploads/2019/12/2019-12-flechtner-it-tage-orachk-v01.pdf * https://www.informatik-aktuell.de/betrieb/datenbanken/oracle-orachk-konfigurationspruefung-und-management.html * https://www.doag.org/formes/pubfiles/8491496/05_2016-Red_Stack-Frank-Schneede_Ueberwachungs-und-Analyse-Werkzeuge-nicht-nur-fuer-Exadata.pdf * https://www.slideshare.net/GarethChapman1/oracle-orachk-an-overview-guide-to-oracle-stack-health-checks * https://prashantatridba.files.wordpress.com/2017/05/database-support-tools_webcast_ppt.pdf