GMS SonicWALL GMS Maintenance Procedures SonicWALL GMS Maintenance Procedures This document outlines the server maintenance and database backup procedures for SonicWALL Global Management System (GMS) deployments. This TechNote includes the following subsections: Server Maintenance Procedures o Shutting Down GMS Servers on page 1 o Starting Up GMS Servers on page 1 o Taking GMS Servers Offline for Maintenance on page 2 o Bringing GMS Servers Online after Maintenance on page 2 Database Maintenance Procedures o Database Backup on page 3 o Sample Database Backup Setup for the SQL Server on page 3 o Restoring the Database Using the Database and Transaction Log Dumps on page 4 o Creating a Database Maintenance Plan for SQL Server on page 4 o Reducing the Size of the sgmsdb File and the Corresponding Log File on page 9 Server Maintenance Procedures This section describes rebooting procedures for SonicWALL GMS servers. Shutting Down GMS Servers The following procedures should be executed in order when shutting down the SonicWALL GMS server: 1. Shut down the GMS Console and any redundant consoles. 2. Shut down the GMS Agent(s) / Summarizer(s). 3. Shut down the database server. Starting Up GMS Servers The following procedures should be executed in order when starting up the SonicWALL GMS server: 1. Start up the database server. 2. Start up the GMS Agent(s) / Summarizer(s). 3. Start up the GMS Console and any redundant consoles.
Taking GMS Servers Offline for Maintenance Note: This section applies only to the SonicWALL GMS installations in a distributed environment. To shut down the SonicWALL GMS Service for maintenance, perform the following steps: 1. On the SonicWALL GMS Console, manually stop the following services: SGMS Monitoring Manager SGMS SNMP Manager SGMS Scheduler SGMS Syslog Collector SGMS Viewpoint Scheduler SGMS Viewpoint Summarizer SGMS Update Manager SGMS Web Server 2. On all SonicWALL GMS Agent servers, manually stop the SGMS Scheduler. Bringing GMS Servers Online after Maintenance After you finish the maintenance, perform the following steps: 1. Start up the database server. 2. Run one of the following SQL commands to prevent the GMS automatic failover/recovery process from being activated: For SQL Server: For Oracle: osql -U <Dbuserid> -P <Dbpassword> -q "exit(update sgmsdb.dbo.schedulers set synctime = getdate())" a. Execute the command: sqlplus <Dbuserid>/<Dbpassword>@<ORACLE_SID> b. Press the Enter or Return key on your keyboard. c. At the SQL prompt execute the command: update schedulers set synctime = sysdate; d. Execute the command: commit; e. Execute the command: exit; 3. Start up the GMS Agent(s) / Summarizer(s). 4. Start up the GMS Console and any redundant consoles. 2
Database Maintenance Procedures The following section describes database backup procedures and provides a sample database maintenance plan. Database Backup Schedule the regular database backup during a time when there is minimal activity on your SonicWALL GMS Server. The early hours of the day, for example, 2 a.m. are recommended. Verify that the backup operation schedule does not conflict with the operations of the GMS Scheduler. Note: You do not need to stop GMS services for a database backup. The raw SYSLOG data is additionally stored in separate databases and named in the following format: sgmsvp_yyyy_mm_dd. Sample Database Backup Setup for the SQL Server This section provides an overview of regular database backup planning. The frequency of backups can be changed to accommodate your business needs. The following figure provides an example of a database backup schedule. The clock is represented in 24-hour format and the backup events are numbered, corresponding to the description list below the figure. Figure 1. The database backup schedule Hour: 0 06:00 12:00 18:00 23:50 Event: 1, 2, 3 4, 5 6, 7 8, 9 10, 11 The following list provides a description of the events in Figure 1: 1. A job is scheduled to dump the SGMSDB database with the following options: Database Complete Overwrite existing media 2. A job is scheduled to dump the SGMSDB transaction log with the Overwrite existing media option. 3. A copy is made of the database dump created in step 1 to any backup media using the file backup tools. 4. A job is scheduled to dump the SGMSDB transaction log with the Append to existing media option. 5. A copy is made of the transaction log created in step 4 to the backup media using the file backup tools. Steps 4 through 5 are repeated every six hours according to a predetermined schedule. 6. A job is scheduled to dump the SGMSDB transaction log with the Append to existing media option. 7. A copy is made of the transaction log created in step 6 to the backup media using the file backup tools. 8. A job is scheduled to dump the SGMSDB transaction log with the Append to existing media option. 9. A copy is made of the transaction log created in step 8 to the backup media using the file backup tools. 10. A job is scheduled to dump the SGMSDB transaction log with the Append to existing media option. 11. A copy is made of the transaction log created in step 10 to the backup media using the file backup tools. 3
Restoring the Database Using the Database and Transaction Log Dumps This section describes how to restore a database using the database and transaction log dumps. The following example of restoring a database server uses the sample database backup schedule outlined in Figure 1 of the previous section, and assumes that the database server crashed at 12:30 in the afternoon. To restore the database: 1. Rebuild the server. 2. Install the MS SQL Server. 3. Restore the database file using the backup media mentioned in step 3 of the database backup schedule in the previous section. 4. Restore the transaction log file backed up to the backup media at 12:00. This log file is the last back up file created before the server crashed. 5. In the SQL Server Enterprise Manager, restore the database using the database dump. 6. Use the transaction log to restore the database. All transactions until 12:00 are restored. Note: The transaction log dump is incremental. Database transactions that occurred after the last transaction log was created will be lost. To minimize this loss, decrease the frequency of transaction log dumps. Creating a Database Maintenance Plan for SQL Server Note: The following database maintenance instructions are designed for small to medium size GMS installations. To create a database maintenance plan: 1. Start the SQL Server Enterprise Manager. 2. Right-click on Management > SQL Server Agent and click on Start if the agent is not running. 3. If you want your database maintenance to be performed automatically in the future, set the SQL Server Agent service to Automatic. 4
4. Right click on Management > Database Maintenance Plan and select New Maintenance Plan. The Database Maintenance Plan Wizard displays. Note: Choose the default options in the screens not shown in the following screenshots. 5. To start creating a maintenance plan, click Next. 6. Select the rawsyslogdb, sgmsdb, and sgmsdb_archive databases, and click Next. 5
7. Click the Remove unused space from database files checkbox and click Next. Note: This example represents a small system with 50 MB GMS database capacity. Adjust the MB number according to your system needs. 8. Click the Back up the database as part of the maintenance plan and the Verify the integrity of the backup when complete checkboxes, choose Disk as a location to store backup files, and click Next. 6
9. On the Specify Backup Disk Directory page, use the default directory to store the backup file or specify a custom directory. Optionally configure database subdirectories, removing older files, and the backup file extension. Click Next. 10. Click the Back up the transaction log as part of the maintenance plan and the Verify the integrity of the backup when complete checkboxes, choose Disk as the location to store the backup file, and click Next. 7
11. Click the Use the default backup directory and the Remove files older than checkboxes, and click Next. 12. Click Finish to complete the database maintenance plan. 13. Right-click on each job in SQL Server Agent > Jobs and click Start job. You can verify successful job executions by right-clicking on the selected job and clicking View Job History. 8
Reducing the Size of the sgmsdb File and the Corresponding Log File To reduce the size of the existing sgmsdb file and the corresponding log file: 1. Open the SQL Query Analyzer. 2. Execute the following command: sp_helpdb sgmsdb Note the size of the database and the log file. 3. Execute the following command: dbcc shrinkdatabase(sgmsdb, 0) 4. For each of the jobs that you created using the wizard, right-click on Management > SQL Server Agent >Jobs and select Start Job. 5. To make sure that the size of the log reduced, execute the following command in the SQL Query Analyzer: sp_helpdb sgmsdb 6. If the size of the log was not reduced, execute the following command: dump tran sgmsdb with truncate_only 7. Repeat steps 1 through 6 for new databases. Note: Consult your SQL Server documentation for detailed database maintenance instructions. Note 2: This document is specific to the SQL 2000 server whereby the SQL configurations are specific to that server. The configuration processes for SQL 2005 are significantly different. Document created: 11/21/06 Last updated: 5/22/07 9