Cloud Control – target/agent cleanup

Se você não conseguir remover um target/agent via console, vá direto no repositório (logue via sysman) e execute:

SQL> select target_name,target_type from mgmt_targets where target_name like ‘FLUIGDB%’;

TARGET_NAME
——————————————————————————–
TARGET_TYPE
—————————————————————-
FLUIGDB-02.cp.totvs.com.br/server
oracle_si_server_map

FLUIGDB-02.cp.totvs.com.br
host

FLUIGDB-02.cp.totvs.com.br:3872
oracle_emd
SQL> exec mgmt_admin.delete_target(‘FLUIGDB-02.cp.totvs.com.br/server’,’oracle_si_server_map’);

PL/SQL procedure successfully completed.

SQL> exec mgmt_admin.delete_target(‘FLUIGDB-02.cp.totvs.com.br’,’host’);

PL/SQL procedure successfully completed.

 

agent cleanup:

SQL> exec mgmt_admin.cleanup_agent(‘FLUIGDB-02.cp.totvs.com.br:3872’);

PL/SQL procedure successfully completed.

SQL>

ADR – Purging Trace Files

adrci> help purge

  Usage: PURGE [[-i <id1> | <id1> <id2>] |
               [-age <mins> [-type ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP]]]:

  Purpose: Purge the diagnostic data in the current ADR home. If no
           option is specified, the default purging policy will be used.

  Options:
    [-i id1 | id1 id2]: Users can input a single incident ID, or a
    range of incidents to purge.

    [-age <mins>]: Users can specify the purging policy either to all
    the diagnostic data or the specified type. The data older than <mins>
    ago will be purged

    [-type ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP]: Users can specify what type of
    data to be purged.

  Examples:
    purge
    purge -i 123 456
    purge -age 60 -type incident

adrci>

So to purge all diagnostic information, including trace files, older than 1 month you would issue the following

adrci> purge -age 43200

Reference:

https://oracle-base.com/articles/11g/automatic-diagnostics-repository-11gr1

ADR Different Methods to Create IPS Package

1. invoke adrci utility: adrci

2. show homes available: show home

3. set homepath <home>

4. SHOW INCIDENT

5. IPS CREATE PACKAGE INCIDENT incident_number

6. IPS GENERATE PACKAGE package_number IN path

Diagnostic Information to Support [Video] (Doc ID 443529.1)
ADR Different Methods to Create IPS Package (Doc ID 738732.1)

NOTE:422893.1 – Understanding Automatic Diagnostic Repository.
NOTE:745960.1 – How to Unpack a Package in to ADR

 

gathering statistics

— gather stale statistics

EXEC DBMS_STATS.gather_database_stats(options=>’GATHER STALE’, cascade => TRUE);

— change stale percentage: (default 10%)

EXEC DBMS_STATS.set_database_prefs(‘STALE_PERCENT’, ‘5’);

— gather statistics if empty

EXEC DBMS_STATS.gather_database_stats(options=>’GATHER EMPTY’, cascade => TRUE);

— gather full db stats

EXEC DBMS_STATS.gather_database_stats(estimate_percent => dbms_stats.auto_sample_size, cascade => TRUE);

— gather dict stats

EXEC DBMS_STATS.gather_dictionary_stats;

— gather system stats
EXEC DBMS_STATS.gather_system_stats(‘interval’, interval => 180);

— gather system stats @exadata

EXEC DBMS_STATS.gather_system_stats(‘EXADATA’);

— gather fixed obj stats:

EXEC DBMS_STATS.gather_fixed_objects_stats;

— gather table stats

EXEC DBMS_STATS.gather_table_stats(‘MXMCORP’, ‘CT2000_TTAT_LOG’, estimate_percent => dbms_stats.auto_sample_size, cascade => TRUE);

— gather index stats

EXEC DBMS_STATS.gather_index_stats(‘MXMCORP’, ‘CT2000_TTAT_LOG_IDX1’, estimate_percent => dbms_stats.auto_sample_size);

— table stats lock

BEGIN
DBMS_STATS.LOCK_TABLE_STATS(‘OE’,’ORDERS’);
END;
/

BEGIN
DBMS_STATS.LOCK_SCHEMA_STATS(‘HR’);
END;
/

— table stats unlock

BEGIN
DBMS_STATS.UNLOCK_TABLE_STATS(‘OE’,’ORDERS’);
END;
/

reference:

http://www.oracle.com/technetwork/database/bi-datawarehousing/twp-bp-for-stats-gather-12c-1967354.pdf

https://blogs.oracle.com/optimizer/entry/fixed_objects_statistics_and_why

 

exachk – bundle patch failed

Exachk reporta o erro “Verify bundle patch version installed patches bundle patch version registered in database” para uma base instalada via dbca.

Solução encontrada no blog oficial da Oracle: blog.oracle.com: https://blogs.oracle.com/UPGRADE/entry/dbca_12c_and_datapatch_pl

O Oracle MOS note 2084676.1 também documenta a solução:

1) DBCA doesnot execute datapatch in Oracle 12.1.0.X. The solution is to apply the SQL changes manually after creating a new Database .

After creating a new database make sure to run:

cd $ORACLE_HOME/OPatch
./datapatch -verbose

and also check DBA_REGISTRY_SQLPATCH view:

select PATCH_ID, PATCH_UID, VERSION, STATUS, DESCRIPTION
from DBA_REGISTRY_SQLPATCH
order by BUNDLE_SERIES;