Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Oracle maintenance commands and cronjobs

The maintenance tools the ezoracle extension gives an Oracle DBA - the ext:ezoracle console commands (health, gather-stats, recompile, purge-recyclebin, sequence-sync, schema-diff, indexes, report, datapump…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/database-administrators/oracle-maintenance-commands.md

On this page

Oracle maintenance commands and cronjobs

This page is for Oracle database administrators who keep an Exponential schema healthy. The ezoracle extension ships console commands that wrap the usual Oracle maintenance, and cronjobs that run them on a schedule. This page answers: which commands exist, what each one does, how to schedule them and where they report. Source: the "Console commands" and "Cronjobs" sections of extension/ezoracle/INSTALL (version 2.3.7) and 9.6 Maintenance.

Contents

  1. How the commands behave
  2. The console commands
  3. Scripts in bin/php
  4. Cronjobs
  5. A routine for an Oracle site
  6. Checklist

How the commands behave

php bin/php/console ext:ezoracle:<command> [-s <siteaccess>] [options]

Every command has --help, prints one PASS, WARN, FAIL or INFO line per check, and ends with exit status 1 when a check failed, so it can guard a script. Commands that change something take --dry-run. V$ and DBA views need SELECT_CATALOG_ROLE; without it the affected checks say so.

The console commands

CommandWhat it does
healthConnection, versions, character set, invalid objects, tablespaces, sessions, blocking locks, recycle bin, sequences, statistics
gather-statsDBMS_STATS.GATHER_SCHEMA_STATS ([StatisticsSettings])
recompileDBMS_UTILITY.COMPILE_SCHEMA for invalid objects
purge-recyclebinPURGE RECYCLEBIN
sequence-syncSequences behind their tables' ids; --fix moves them
schema-diffThe database against share/db_schema.dba (--file=<dba>), with the upgrade SQL
indexesIndex report; --rebuild [--index=<name>] [--online]; --monitor-on, --monitor-off, --usage
report--sizes (tables with index and LOB space), --top-sql (from V$SQL)
datapump--export=<file.dmp> and --import=<file.dmp> through DBMS_DATAPUMP into the directory object of [DataPumpSettings] Directory (default DATA_PUMP_DIR; the user needs READ and WRITE on it); --table-exists-action, --remap-schema
ci-indexesLinguistic indexes for OracleCaseInsensitive (--create, --drop)

The server tools work as well: expdp <user>@<db> schemas=<user> directory=DATA_PUMP_DIR dumpfile=<file.dmp> and impdp for the restore (Backups per engine).

Scripts in bin/php

extension/ezoracle/bin/php/ holds the scripts behind the commands and a few more:

ScriptUse
ora-grant.phpPrints the grants for a new account (Setting up Oracle)
ora-update-seqs.phpMoves sequences from a login string, like sequence-sync --fix
mysql2oracle-schema.php, mysql2oracle-data.phpMove a MySQL site into Oracle; also ext:ezoracle:mysql2oracle-schema and -data (Moving a site to another engine)
ora-drop-schema.phpDrops the schema's objects; destructive, read its --help first
oracleclusterbinarypurge.phpPurges expired files of the DFS cluster when the Oracle backend is used (Clustering)

The extension's INSTALL also describes extension/ezoracle/bin/shell/ora-initialize.sh, an older automated initialization path. The current installers (exp:install --db=oracle, the wizard, the kickstarter) are the documented way for a new site.

Cronjobs

The extension adds cronjob parts in its own settings/cronjob.ini.append.php:

PartScripts
ezoraclestatistics, recycle bin, sequences, health
ezoraclehealthhealth alone
ezoracle_statistics, ezoracle_recyclebin, ezoracle_sequencesone job each

Each job does nothing until it is switched on in settings/override/ezoracle.ini.append.php:

[CronjobSettings]
GatherStatistics=enabled
HealthMonitor=enabled
HealthMailReceivers[]=[email protected]
PurgeRecycleBin=enabled
SequenceCheck=enabled
SequenceFix=disabled

and in the crontab, for example:

15 3 * * *  cd /path/to/installation && php runcronjobs.php -q -s <admin siteaccess> ezoracle
0 * * * *   cd /path/to/installation && php runcronjobs.php -q -s <admin siteaccess> ezoraclehealth

Reports go to var/log/ezoracle-<job>.log; the health monitor mails its report to HealthMailReceivers[] when a check warns or fails. Use a team address, not a personal one.

A routine for an Oracle site

WhenWhat
Hourlyezoraclehealth
Nightlyezoracle (statistics, recycle bin, sequence check)
After an upgradeschema-diff, recompile, sequence-sync
After an import or a restoresequence-sync --fix --dry-run, then without --dry-run
Monthlyreport --sizes, indexes --usage

Checklist

  • To do: SELECT_CATALOG_ROLE granted, so health and report see everything.
  • To do: Cron switches enabled in the override; both crontab lines installed.
  • To do: HealthMailReceivers[] is a team mailbox.
  • To do: Data Pump directory object exists and the account can read and write it.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x