External Database Maintenance
317
n
ov
do
cx (e
n)
16
Ap
ril 20
10
BACKUP DATABASE DIRECTORY
‘\\\\
IP_address_of_remote_machine
\
\backup_directory\\custom_directory
’ TRANSACTION LOG TRUNCATE
In the query,
\\\\
IP_address_of_the_remote_machine
\
\backup_directory
\\ is
the shared network location on the remote machine and
custom_directory_name
is a
name that you specify for a directory to be newly created and into which the database files
are to be backed up.
For example, execute the following query to back up the database to the
dbbackup
directory:
BACKUP DATABASE DIRECTORY
‘\\\\
shared_network_location_on_remote_machine
\\dbbackup’ TRANSACTION
LOG TRUNCATE
You must manually archive the complete path of the database backup location that you
specify in the query because you need to specify it if you want to change the database
backup location at a later time.
4b
Click
Execute SQL Statement(s)
.
5
To schedule the backup to run at a specific time every day or on specific days of a month:
1. Execute the following query by specifying it in the
SQL Statements
section:
CREATE EVENT
backup_schedule_name
SCHEDULE
START TIME
specify_the_schedule
HANDLER
BEGIN
BACKUP DATABASE DIRECTORY
‘\\\\
IP_address_of_remote_machine
\
\backup_directory\\custom_directory
’
TRANSACTION LOG TRUNCATE
END;
In the query,
\\\\
IP_address_of_the_remote_machine
\
\backup_directory
\\ is
the shared network location on the remote machine and
custom_directory_name
is a
name that you specify for a directory to be newly created and into which the database files
are to be backed up.
While creating a database backup event, use the following guidelines:
The backup schedule name must be unique.
You must manually archive the backup schedule that you specify in the query
because you need to specify it if you want to change the database schedule at a later
time.
2. Click
Execute SQL Statement(s)
.
Examples:
To back up the database at a 1:00 a.m. every day to the
dbbackup
directory on Windows,
execute the following query:
CREATE EVENT ZENDBbackup
SCHEDULE
START TIME '1:00 AM' EVERY 24 HOURS