Restoring a database from a backup file in the Orixa Server Program
Full restoration of your database should almost never be necessary due to a database error. However it is often done if a system is being upgraded. To do this, follow the steps detailed below
Because your App and the Orixa Database Utility both connect to the database it is not possible to "restore" from either program. A simple mechanism has been added to the Orixa Server to enable a basic, full Restoration to be undertaken.
For an introduction to use of the OrxServer Program, please consult this link:
You can write your own RESTORE DATABASE script in the "Execute Scripts" page of the Orixa Server, You would do this if you wish to customize the RESTORE process, for example only restoring certain data-tables.
The simplified Restore process described below assumes that the Backup File being used in the restoration is saved in the "Backup" Store / Folder of the computer on which the Orixa Server program is running.
Restore Database Window
Steps in the Restore Process:
- Click the "Stop Server" button to "close" the server so that users cannot connect to it.
- Click the "Restore Database" button, you will be required to log-in with the database password before you can access this screen.
- A window opens, a list of all possible Backup files is shown. Click on the one you wish to use. This is usually the most recent backup.
- Click the appropriate button to restore either the Main database or the "SystemsDB". Note that the default name for the Main Orixa database "Data" is used in the Restoration process. If your Main database has a different name, write it in the "Main of Main Database" field before you click the button.
During the Restoration process you will be prompted to ask whether you wish to PUBLISH the restored database. Only say yes to this if you are using a multi-site Orixa system. - Once Restoration is complete you can exit by clicking "Close"
Running other Restore, Repair and Alter Scripts in the Orixa Server
Execute Script Page
The Green "Execute Scripts" tab contains features to allow Administrators of an Orixa System to run server-side scripts. You have to stop the server before you can access this screen, and you will be required to log-in with the database password before you can access this screen.
- "Selected Database" list. Server-side scripts can be run against the "Configuration" of the database, or against specific databases.
- The Execute script button. It will light up as "enabled" once a script is present in the window.
- Add SQL from Template. Click here to see a short list of optional SQL templates which can be pasted directly into the Script-window.
- The Script-window. Write any SQL you wish to run here.
Select Database |
Selected Database Click on the drop-down to show the list of databases on your system. Usually Server-side scripts run against the "Configuration", but in some cases you may want to select other database names. |
Database Specific Scripts |
"Data" Database Selected The Administrator would then write SQL to target that specific database, and the tables, views and other schema elements specific to it. From the "Configuration" database it is not possible to access schema elements of the other databases. |
Add SQL from Template |
Add SQL from Template Click on one of the choices from this short list and a brief SQL statement will be copied into the window, as shown. Square brackets in this template-script show locations where you must change the script to make it work for your database. For example by changing the text [TableName] to the name of an actual table in your database. |
Trouble-shooting
Most issues and problems that occur when working with the OrxServer relate to App's not connecting. This is usually because Registry Settings are not correct. You can copy Registry Settings from one computer when your App is working to another where it is not, if you have 2 or more systems.
Common reasons for failure to connect
- The Database Password is not correct. This is stored in an encrypted form in the Registry. It can be reset (if it is wrong) using the SysMgt Utility.
- The character-set of the "Ini" file does not match the character-set of the database being accessed by the OrxServer. If your database contains "ANSI" characters (the western alphabet A to Z), this line should read:
ANSI Character Set=1
If your database uses "Unicode" characters (other scripts such as Greek, Tamil, Russian etc.) this line should read:
ANSI Character Set=0. - Any other Registry Setting for the user does not match the value used by OrxServer (and detailed in the "Ini" file). If your user cannot connect, cross-check that other settings such as the Port and IP Address match those saved for the OrxServer.
- The OrxServer.ini file contains a setting which is incorrect, or blocks access for the user. For example, if the OrxServer has been set with an IP Address or Port which does not exist then connection will fail. Note that the OrxServer.Ini file includes an "Server Authorized Addresses" setting. This must contain either "*" (which corresponds to "all") or a list of the IP Addresses of the authorized users. If it is blank, or contains IP Addresses which do not include the address of the current user connection will fail. When The Orixa Installer sets up the "Ini" file it should always be correct, but it can be edited accidentally, and these settings entered wrongly.
- The OrxServer operates on a "port" of the server computer. If this Port is already in use by another program (including another OrxServer instance) then the OrxServer will not connect and a "port unavailable" error will occur.
- The OrxServer requires a temporary folder to store files it uses during database operation. If this is set to a folder that does not exist the server will not start.