This documentation provides instructions to rebuild the Sybase database by using the DBISQL utility. You can choose to rebuild and validate the database by using any other utility that is recommended in the Sybase SQL Anywhere documentation.
If your ZENworks database is an embedded or external Sybase database, you should rebuild the database so that it runs on the latest version of the Sybase database engine.
Make sure that you have archived your database credentials.
To archive the credentials of an external Sybase database, contact your database administrator.
To archive the credentials of an embedded or external OEM Sybase database, perform the following tasks on the database server:
Make sure that the database service is running.
On Windows: In the Windows Services, make sure that the status of Started.
isOn Linux: At the console prompt, enter /etc/init.d/sybase-asa status to verify the status of the database. If the database is not running, start the database service by running the /etc/init.d/./sybase-asa start command.
Obtain the Sybase database credentias by running the zman dgc command.
Provide the credentials of the ZENworks administrator when prompted.
Copy and save the database username and password in to a text file.
Stop the Novell ZENworks Embedded Datastore service, if it is running.
On Windows: Do the following:
From the Windows desktop
menu, click > .Double-click
> .Right-click the
service, then click , or select the service, then click on the toolbar.On Linux: At the console prompt, enter /etc/init.d/sybase-asa stop.
Stop all the ZENworks Services on the all the ZENworks Servers in the Management Zone.
On Windows: Do the following
Execute the following command at the server prompt:
novell-zenworks-configure -c Start
Specify the number next to the Stop action, then press Enter.
On Linux: Do the following:
Execute the following command at the server prompt:
/opt/novell/zenworks/bin/novell-zenworks-configure -c Start
Specify the number next to the Stop action, then press Enter.
At the console prompt, go to the Sybase database directory. By default, it is %ZENWORKS_HOME%\database on Windows, and /var/opt/novell/zenworks/database on Linux.
Take a reliable backup of the zenworks_zone_name.db and zenworks_zone_name.log files.
For detailed information on how to take an immediate backup of the files of the embedded Sybase database, see Section 28.3, Backing Up the Embedded Sybase SQL Anywhere Database. For detailed information on how to take an immediate backup of the files of the external Sybase database, see Section 29.1, Backing Up the External Sybase Database.
Start the Novell ZENworks Embedded Datastore service.
On Windows: Do the following:
From the Windows desktop
menu, click > .Double-click
> .Right-click the
service, then click , or select the service, then click on the toolbar.On Linux: At the console prompt, enter /etc/init.d/./sybase-asa start.
(Conditional) If your database is installed on Linux, run the following script file:
source /opt/novell/zenworks/share/sybase/bin32/sa_config.sh
Ensure that the database authentication has been set up by verifying that the database_authentication attribute in the saopts.sql file has been configured.
The saopts.sql file is located in the %ZENWORKS_HOME%\share\asa\scripts\ directory on Windows, and in the /opt/novell/zenworks/share/sybase/scripts/ directory on Linux. The database_authentication attribute is located in the following entry in the saopts.sql file:
if not exists( select * from SYS.SYSOPTION
where ucase( "option" ) = ucase( 'database_authentication' ) ) then
set option PUBLIC.database_authentication = <value>;
end if
go
If the value of set option PUBLIC.database_authentication is empty, continue with Step 8.a to launch the DBISQL utility and to configure the database authentication; else skip to Step 9.
Launch the DBISQL utility.
At the command prompt, go to the %ZENWORKS_HOME%\share\ASA\win32 directory on Windows or to the /opt/novell/zenworks/share/sybase/bin32s directory on Linux.
Enter the dbisql command.
In the
tab, specify the database credentials.Click the
tab, then specify the name of database service that is currently running.Click
.In the
section, specify the following query:
select setting
from sysoptions
where "option" like 'database%' >># output_filename
Click
.The results of the query are written to the output file that you specify in the query.
Copy the result of the query from the output file, and paste it as the value of the database_authentication attribute in the saopts.sql file. The saopts.sql file is located in the %zenworks_home%\share\asa\scripts\ directory on Windows, and in the /opt/novell/zenworks/share/sybase/scripts/ directory on Linux.
The database_authentication attribute is located in the following entry in the saopts.sql file:
if not exists( select * from SYS.SYSOPTION
where ucase( "option" ) = ucase( 'database_authentication' ) ) then
set option PUBLIC.database_authentication = <output_of_the_query_run_in_Step_8b>;
end if
go
Stop the Novell ZENworks Embedded Datastore service.
For the Embedded Database: Stop all the ZENworks services, including the Novell ZENworks Embedded Datastore service:
At the console prompt, run the novell-zenworks-configure -c Start command.
Type the option number corresponding to Stop.
Press Enter twice.
For the External Database: Stop the Novell ZENworks Embedded Datastore Service by stopping the Windows Services manager on Windows, or by running the /etc/init.d/sybase-asa stop command on Linux.
At the console prompt of the database server, run the following command to start the database service:
On Windows: dbeng10 %ZENWORKS_HOME%\database\zenworks_ZONE_NAME.db -n rebuild
On Linux: dbeng10 /var/opt/novell/zenworks/database/zenworks_ZONE_NAME.db -n rebuild
Create a temporary directory with the name as unload within c:\dbreload\ on Windows or within /tmp/dbreload/ on Linux.
Run the unload command.
At the command prompt, go to the %ZENWORKS_HOME%\share\ASA\win32 directory on Windows or to the /opt/novell/zenworks/share/sybase/bin32s directory on Linux.
Run the appropriate command:
On Windows: dbunload -c "UID=zenadmin;PWD=database_password;ENG=rebuild" -an c:\dbreload\unload\zenworks_<management_zone_name>.db
On Linux: dbunload -c "UID=zenadmin;PWD=database_password;ENG=rebuild" -an /tmp/dbreload/unload/zenworks_<management_zone_name>.db
After the database rebuild has been successfully completed, take a reliable backup of the newly built database. The database is located in the c:\dbreload\unload directory on Windows and in the /tmp/dbreload/unload directory on Linux.
If you encounter any issues during the rebuild process, contact Novell Support.
Stop the Novell ZENworks Embedded Datastore service by using the dbeng10 command:
On Windows: Right-click the
icon located in Windows taskbar, then click .On Linux: At the console prompt, enter q.
Overwrite the database and applicable log file in the database directory with the new ones located in the unload directory (zenworks_management_zone_name.*).
The unload directory is located in c:\dbreload\ on Windows or in /tmp/dbreload/ on Linux.
Start the Novell ZENworks Embedded Datastore service.
For the Embedded Database: Start all the ZENworks services, including the Novell ZENworks Embedded Datastore service:
At the console prompt, run the novell-zenworks-configure -c Start command.
Type the option number corresponding to Start.
Press Enter twice.
For the External Database: Start the Novell ZENworks Embedded Datastore service in the Services window on Windows, or run the /etc/init.d/sybase-asa start command on Linux.
Start all the ZENworks Services on the all the ZENworks Servers in the Management Zone.
On Windows: Do the following
Execute the following command at the server prompt:
novell-zenworks-configure -c Start
Specify the number next to the Start action, then press Enter.
On Linux: Do the following:
Execute the following command at the server prompt:
/opt/novell/zenworks/bin/novell-zenworks-configure -c Start
Specify the number next to the Start action, then press Enter.
Take a backup of the newly created database on a regular basis (daily or weekly).