Data backup with Orixa from quick-and-dirty to automated off-site backup Jobs 

When you use an Orixa App, all your key business data is stored in the Orixa databasep. This database is robust and reliable, but it is still sensible to backup data regularly. This backup process can and should include backup to off-site or cloud stores.
If your system is multi-office, there is already built in resilience, as if one office's database is lost or damaged all other offices contain a copy of the lost data. However, even in this situation it is still sensible to undertake regular backup of data.

Quick and dirty backup

Steps to run the "Maintenance BackupDatabase" procedure  

Open the DB Management Utility

  1. Click on the "Functions/Procedures" item, below the "SystemDB" heading.
  2. Click on the "Procedures" tab, and click on the "Maintenance_BackupDatabase" procedure title.
  3. Click on the tick-boxes to include the date in the backup name, and to choose whether to also backup the SystemDB database.
  4. Click the "Execute Procedure" button. The backup(s) will be created. This may take some time, depending on the size of your database.

Note that Orixa can undertake a backup at anytime, even while multiple users are accessing the database.  

Where are your backup files

Locating Backup files  

Once you have run the "Maintenance_BackupDatabase" procedure, your files will be in the "Backup" Store.

  1. In the DB Management Utility, click on either the "Orixa Database Treeview", or "Data" headings.
  2. Click on the "Local Stores" tab, and then click on the "Backup" store.
  3. The "Files in Store" grid should show the newly created backup files.

Automated Backup with a JOB

While it is useful from time-to-time to run a quick-and-dirty backup (for example during system development), once a system is in-use a backup JOB should be created. A JOB is a section of SQL code which is run by the server at times you select. See the article on JOBs elsewhere in the help.

Creating a JOB requires writing and running a CREATE JOB SQL script. Once the JOB has been created, it can be viewed in the DB Management Utility.

Viewing JOBs in the DB Management Utility  

  1. Click on the "Orixa Database Treeview" or "Data" headings.
  2. At the bottom of the screen, the "Jobs" grid will be visible (it will be empty if no JOBs exist). 

Create JOB Script  

On the same screen, the SQL DEFINITION for the job can be seen, as shown in the image above. Note that you can Copy (CTRL+C) SQL from this window for your own JOBs. The "USE" Keyword allows the JOB to work in the context of different databases in your system. The "CALL" Keyword allows the JOB to run any procedure which is available. Other standard SQL statements such as "EXECUTE IMMEDITATE" can also be used.

SQL For an automated backup job.

CREATE JOB "RegularBackupAndPruning"
RUN AS "System"
FROM DATE '2015-07-13' TO DATE '2025-11-15'
WEEKLY ON MON, TUE, WED, THU, FRI
BETWEEN TIME '11:16:26' AND TIME '11:26'
BEGIN
  USE SystemDB;
  CALL Maintenance_BackUpDatabase (true, true);
  CALL Maintenance_CopyBackupToRemoteStore();
END

Note that JOBs usually reference Procedures. The above JOB references 2 procedures, both of which must have been created in the "SystemDB" database for the JOB to run correctly.

Assistance with the "Create JOB" SQL

Jobs Grid Context Menu  

NOTE: If you right click on the "Jobs Grid" as shown in the image, a context menu appears which includes the "Create New Job" choice. This will guide you through the process of generating the SQL for a new JOB.