3.1 Backing Up the Embedded Sybase SQL Anywhere Database on a Windows or Linux Server

  1. Store the ZENworks administrator name and password by entering the following command at the command prompt:

    zman admin-store-credential administrator

    If you do not store the credentials, you must enter the ZENworks administrator name and password for each zman command.

  2. You can immediately back up the embedded Sybase SQL Anywhere database or schedule the backup to run at a specific time. To back up the embedded Sybase SQL Anywhere database immediately, continue with this step. To schedule the backup to run at a specific time, skip to Step 3.

    To immediately back up the embedded Sybase SQL Anywhere database to a directory on the database server by using the zman command line utility, enter the following command at the database server console prompt:

    zman database-backup complete_path_of_the_backup_directory_on_database_server

    For example, to back up the database to the c:\dbbackup directory on a Windows database server, execute zman database-backup c:\dbbackup. To back up the database to the /root/dbBackup directory on a Linux database server, execute zman database-backup /root/dbBackup.

    To manually back up the embedded Sybase SQL Anywhere database to a directory on the database server:

    1. Stop the ZENworks Services on all other ZENworks Servers in the Management Zone.

      • On Windows:

        1. Execute the following command at the server prompt:

          novell-zenworks-configure -c Start

        2. Enter the number next to the Stop action.

      • On Linux:

        1. Execute the following command at the server prompt:

          /opt/novell/zenworks/bin/novell-zenworks-configure -c Start

        2. Enter the number next to the Stop action.

    2. Manually copy zenworks_zone_name.db, zen_audit_zone_name.db, zenworks_zone_name.log,and zen_audit_zone_name.log from the database server to the new location where you want to back up the database.

      By default, the files are located in ZENworks_Installation_directory\Novell\Zenworks\Database on a Windows Sybase database server, and in /var/opt/novell/zenworks/database/ on a Linux Sybase database server.

    3. Start the ZENworks Services on all other ZENworks Servers in the Management Zone.

      • On Windows:

        1. Execute the following command at the server prompt:

          novell-zenworks-configure -c Start

        2. Enter the number next to the Start action.

      • On Linux:

        1. Execute the following command at the server prompt:

          /opt/novell/zenworks/bin/novell-zenworks-configure -c Start

        2. Enter the number next to the Start action.

  3. (Conditional) To schedule the backup to run at a specific time every day or on specific days of a month, you need to create a schedule file and run it.

    1. Create a schedule file with the Create event, backupschedule.sql, with the following contents:

      CREATE EVENT backup_schedule_name
      SCHEDULE
      specify_the_schedule   

      A sample schedule file to back up the database at a 11 P.M. everyday is as follows:

      CREATE EVENT ZENDBBackup
      SCHEDULE
      START TIME '11:00 PM' 
      EVERY 24 HOURS

      A sample schedule file to back up the database at 1:00 a.m. on the first, second, third, and fourth day of the month is as follows:

      CREATE EVENT ZENDBBackup1
      SCHEDULE
      START TIME '1:00 AM'
      ON (1,2,3,4)

      Sample schedule files are available in the ZENworks_Installation_directory:\Novell\Zenworks\share\zman\samples\database directory on a Windows server, and in the /opt/novell/zenworks/share/zman/samples/database directory on a Linux server.

    2. Enter the following command at the command prompt:

      zman database-backup complete_path_of_the_backup_directory complete_path_of_backUpSchedule.sql -d SQL_function_call

      For example, to back up the database to the c:\dbbackup\day_of_the_week directory on a Windows server as per the schedule in the c:\backupschedule.sql file, enter the following command:

      zman database-backup c:\dbbackup c:\backUpSchedule.sql -d "DAYNAME(now())"

      For more information about this command, view the zman man page (man zman) on the device, or see zman(1) in the ZENworks 11 SP4 Command Line Utilities Reference.

  4. Clear the credentials stored in Step 1 by entering the following command at the command prompt:

    zman admin-clear-credential

According to the backup schedule, the zenworks_zone_name.db database file and the zenworks_zone_name.log transaction log file are created in the database backup directory.

If you want to change the database backup location or the backup schedule at a later time, review the following sections: