Setting up the Inventory Database

The following sections contain detailed information to help you set up your Inventory database:


Optimizing the Performance of the Oracle Database

If you have an Inventory database on Oracle, you can improve the performance of the database when you generate the inventory reports or query the database.

You use the database buffer cache to store the most recently used data blocks. The database cache is determined as DB_BLOCK_BUFFERS * DB_BLOCK_SIZE. These parameters are specified in the INIT.ORA file in the ZENWORKS\DATABASE directory on the database server.

DB_BLOCK_BUFFERS specifies the number of database buffers. DB_BLOCK_SIZE specifies the size of each database buffer in bytes.

The size of each buffer in the buffer cache is equal to the size of the data block.

Oracle recommends that the database buffer cache for any Online Transaction Processing Application (OLTP) should have a hit ratio of about 90%, which is optimal.

The ZfD Inventory database on Oracle has an approximate 88% hit ratio with a database cache size of 24 MB for 128 MB RAM, which is about 20% of total memory.

If there is additional memory, you configure the database cache size by increasing the DB_BLOCK_BUFFERS parameter in the INIT.ORA file.


Organizing the Database Spaces for a Sybase Database on NetWare or Windows NT/2000 Servers (AlterDBSpace Tool)

If there are more volumes on the multiple physical disks of the database server, placing the Sybase database space files on separate volumes improves the performance while accessing the database.

When you install the Sybase database component of ZfD 3.2, the System Database file and the Database Spaces are installed in the volume on the database server you specify. On loading the Inventory database server, the System Database file (MGMTDB.DB) is loaded. This MGMTDB.DB file references the inventory information in the Database Spaces files. The Database Spaces files (MGMTDB1.DB, MGMTDB2.DB, MGMTDB3.DB, MGMTDB4.DB, MGMTDB5.DB, MGMTDB6.DB, MGMTDB7.DB, MGMTDB8.DB and MGMTDB9.DB) contain the inventory information.

The ALTERDB.PROPS file is installed on the database server in the PUBLIC\ZENWORKS\WMINV\PROPERTIES. You modify the sections in the file to specify the location of the Database Spaces on the volumes.

The contents of the ALTERDB.PROPS file is as follows:

#Database Space Properties

count=9

mgmtdb1=volume_location_of_mgmtdb1

mgmtdb2=volume_location_of_mgmtdb2

mgmtdb3=volume_location_of_mgmtdb3

mgmtdb4=volume_location_of_mgmtdb4

mgmtdb5=volume_location_of_mgmtdb5

mgmtdb6=volume_location_of_mgmtdb6

mgmtdb7=volume_location_of_mgmtdb7

mgmtdb1=volume_location_of_mgmtdb8

mgmtdb1=volume_location_of_mgmtdb9

.....

To organize the database spaces:

  1. Ensure that the database is not loaded.

  2. Ensure that the Inventory Service Manager is not running on the server.

  3. Manually move the Database Space files on the server volume.

    Move the Database Space files in the following way for better performance:

  4. Modify the location of the nine Database Space files in the ALTERDB.PROPS file.

    For example, enter mgmtdb3=SYS:\\ZENWORKS\\DATABASE

  5. Load the database. Enter mgmtdbs on NetWare servers. On Windows NT/2000 servers, run the database service.

    1. Stop the Naming server.

      On NetWare servers, at the inventory server prompt, to view the ID of the Naming server, enter JAVA -show.

      Enter JAVA -KILLid_of_the_naming_server.

      On Windows NT/2000, close the Naming server window.

    Ignore the error messages displayed on the console. These messages are displayed because the database space files are not loaded.

  6. Ensure that the Database Location policy has been configured.

  7. On the server console, run the AlterDBSpace service. Enter AlterDBSpace.

    On the inventory server, the AlterDBSpace tool runs as a service.

    You will see a message that the database is adjusted.

  8. Exit the database and then load the database.

    Ensure that while loading the database there are no errors. Errors indicate that the specified volume location of the database space files are incorrect or do not exist. Ensure that the path of the Database Spaces is correct in the ALTERDB.PROPS file and repeat the procedure to organize the Database Spaces.

    IMPORTANT:  If you place the Database Spaces in different volumes, the log file should be placed in the same volume as the System database file (MGMTDB.DB).


Using an Optimal Database Cache Size on the Inventory Database Server to Improve Performance

Improving the database cache size improves database performance.

You can improve the performance of the Inventory database maintained in Sybase on NetWare or Windows NT/2000 servers. The default database cache size is 16 MB; however, this database cache size may not be adequate for large databases with more than 10,000 workstations.

You should change the database cache size to an optimum size. We recommend a database cache size that is one-fourth of the database size. You must also consider server memory size while assigning a cache size. For example, if you have 128 MB RAM, then a cache size of 32 MB is recommended.

To change the database cache size on a NetWare server:

  1. Close all connections to the Inventory database.

  2. Quit the Sybase server.

  3. Open the MGMTDB.NCF file in the SYS:\SYSTEM directory.

  4. Modify the -c parameter.

    For example, -c 64M sets the cache size to 64 MB.

  5. Save the file.

  6. On the server console, load the Inventory database. Enter MGMTDBS.

To change the database cache size on a Windows NT/2000 server:

  1. Run the NTDBCONFIGURE.EXE file from PUBLIC\ZENWORKS.

  2. Modify the -c parameter.

  3. Save the file.

  4. Restart the server so that the Inventory database service (Adaptive Service Anywhere - ZENworks for Desktops 3) starts up.


Using the Inventory Database Service Configuration Tool for Windows NT/2000

The Inventory Database service configuration tool lets you modify the startup parameters to optimize the Sybase database on Windows NT/2000 servers.

To run this tool:

  1. Run NTDBCONFIG.EXE located in the ZENWORKS directory on the database server.

  2. Modify the parameters as per the Sybase specification.

    Ensure that you specify valid values for the parameters.

  3. Click OK.

  4. Restart the database service (ASA Adaptive Anywhere).


Sybase Database Startup Parameters

The parameters are as follows:


Deleting the Inventory Information from the Inventory Database

If you delete the Workstation object in ConsoleOne, the inventory information for that Workstation object is deleted from the Inventory database server it is attached to. Also, the inventory information is deleted from all the next-level servers for that particular Inventory database server.


Synchronizing the Inventory Database with eDirectory (NDS-DB Sync Tool)

ZfD provides a database sync tool to synchronize the Workstation objects stored in the Inventory database with the Workstation objects in eDirectory. This tool removes the workstations that do not exist in eDirectory from the Inventory database. The excess workstations in the Inventory database exist because these workstations may have been deleted from eDirectory; however, the corresponding workstations were not removed from the database.

Use this tool regularly to maintain the database in a consistent state with eDirectory. You must run this tool for each Inventory database.

HINT:  You must ensure that the Service Manager is loaded when you run the Inventory database sync tool.

To run this tool:

  1. Generate a lookup file in the NDS Lookup Phase.

    ZfD compares the list of workstations in the database with those in eDirectory and generates a lookup file. This file contains the list of workstations to remove from the database.

    The server property file contains the [NDSLookupForDB Service] section with the lookup filename in the ARGUMENTS parameter. The default lookup filename (WSDELETE.LOK) file is located in the PUBLIC\ZENWORKS\WMINV\LOG directory.

    The lookup filename in this section and the [DBDelete Service] section of the server property file should be the same.

    1. At the inventory server console prompt, enter:

      StartSer NDSLookupForDB

  2. Delete workstations in the lookup file from the Inventory database in the Database Delete Phase.

    1. In the [DBDelete Service] section of the properties file, specify the lookup filename.

    2. At the inventory server console, enter:

      StartSer DBDelete

    The WSDELETE.LOG log file located in the \PUBLIC\ZENWORKS\WMINV\LOGS directory contains the status of deletion. This file contains information as to whether the database was synchronized successfully with eDirectory.


Backing Up the Inventory Database

ZfD provides an option to back up the Inventory database from the server. We recommend that you back up the database on a weekly basis. However, if you are tracking the inventory of workstations frequently, increase the frequency of backup.

The following sections contain additional information to help you back up the Inventory database.


Backing Up the Inventory Database (Sybase)

You can back up the database files and the transaction log to the location relative to the SCANDIR path.

To use this tool:

To run the backup tool on NetWare or Windows NT/2000 servers,

  1. At the inventory server console, enter StartSer DBBACKUP.

    View the status of the backup in the backup log file.

    The database will be copied to SYS:\ZENWORKS\DATABASE\directory_you_specify.

To restore the database:

  1. If the Inventory database server is up, stop the Storer service. At the database server console, enter StopSer Storer.

  2. Exit the Sybase database.

    On NetWare servers: At the database server prompt, enter q to stop the Sybase database.

    On Windows NT/2000: Stop the Sybase service (Adaptive Service Anywhere - ZENworks for Desktops 3).

  3. Copy the backup files, overwriting the working database files.

  4. Restart the database server.

The backup tool creates a log file, BACSTATUS.TXT, located in the ZENWORKS\DATABASE directory on NetWare and Windows NT/2000 servers. The log records the status of the backup operation. Open this text file to view the status of the backup. This file increases in size for every backup operation. Remove the existing contents of the file if you do not require the details.


Backing Up the Inventory Database (Oracle)

ZfD provides an option to back up the Inventory database from the server. However, if you have a database backup and restore method such as Recovery Manager, we recommend that you continue to use your existing backup method.

To back up the database:

  1. If the Inventory database server is up, stop the Storer service. At the database server console, enter StopSer Storer.

  2. Load the Oracle Server Manager.

    On NetWare server with Oracle 8i, enter svrmgr31.

    On NetWare server with Oracle 8.0.4, enter svrmgr30.

    On Windows NT/2000 server with Oracle 8i Enterprise Edition, from the taskbar, click Start > Run > enter svrmgrl.

  3. Enter the following commands:

    set instance databaservername-databaseinstance-IPC, where databaseinstance refers to the database instance that you have set up earlier. See Loading the Inventory Database as a Separate Oracle Instance in Workstation Inventory in Deployment.

    For example, set instance austr-zfd3-ipc.

  4. Connect as an administrator. For example, if the administrator's internal name is internal, at the Server Manager prompt, enter connect internal/password.

    where password is the password created earlier. See Loading the Inventory Database as a Separate Oracle Instance in Workstation Inventory in Deployment.

    1. At the Server Manager prompt, enter select name from v$datafile;

      This displays the list of the datafiles that Workstation Inventory uses.

  5. Ensure that no other databases are mounted. At the prompt, enter shutdown normal.

  6. Disconnect and exit from the Server Manager. At the Server Manager prompt, enter disconnect;

    Enter exit;

  7. Copy the complete ZFD3\ORACLE directory to a backup volume or disk.

After the backup is done, ensure that the backup copy of the database matches the original copy. Perform database verification to verify the integrity of the backup.

To verify the database integrity on a NetWare server with Oracle 8i, enter load DBV81.NLM FILE=path_to_the_database_file BLOCKSIZE=4096

To verify the database integrity on a NetWare server with Oracle 8.0.4, enter load DBV80.NLM FILE=path_to_the_database_file BLOCKSIZE=4096.

To verify the database integrity on a Windows NT/2000 server with Oracle 8i, enter DBV.EXE FILE=path_to_the_database_file BLOCKSIZE=4096

Example: enter DBV.EXE FILE=d:\zfd3\oracle\database\cim1.ora BLOCKSIZE=4096

Also, run this command for the following files: CIM1.ORA, CIM2.ORA, CIM3.ORA, CIM4.ORA, CIM5.ORA, CIM6.ORA, CIM7.ORA, CIM8.ORA, CIM9.ORA, SYS1.ORA, and CTL1.ORA.

If the database backup is successful, ensure that there are no error messages on the verified pages. Ensure that the following displayed parameters display a zero value: TOTAL PAGES FAILING (DATA)=0, TOTAL PAGES FAILING (INDEX)=0, and TOTAL PAGES MARKED CORRUPT=0.

To restore the database:

  1. If the Inventory database server is up, stop the Storer service. At the database server console, enter StopSer Storer.

  2. Load the Oracle Server Manager.

    On a NetWare server with Oracle 8i, enter svrmgr31.

    On a NetWare server with Oracle 8.0.4, enter svrmgr30.

    On a Windows NT/2000 server with Oracle 8i Enterprise Edition, from the taskbar, click Start > Run > enter svrmgrl.

  3. Connect as an administrator. For example, if the administrator's internal name is internal, at the Server Manager prompt, enter connect internal/password_for_administrator.

  4. Ensure that no other databases are mounted. Enter shutdown normal.

  5. Disconnect and exit from the Server Manager. At the Server Manager prompt, enter disconnect;

    Enter exit;

  6. Copy the database from the backup location.

    If you copy the database to a different location than the earlier location, modify the location in the following files to specify the new path:

  7. Load the restored database.


Using the ZfD 3.2 Inventory Database on Oracle 8i for Linux and Solaris

Ensure that the following requirements are met:

Follow the instructions in these sections:


Starting the Inventory Database

Follow these steps:

  1. Log in to the Linux box as Oracle DBA user.

  2. Create a ZfD3 directory. Change to this directory.

  3. Extract the file from the \ZENWORKS\PRODUCTS\DATABASE
    \ORACLE directory into ZfD3 directory.

    On a Linux / Solaris(Intel) server, extract INVORACLE8IUNIXINTEL.TAR.GZ file.

    On a Sparc Solaris server, extract INVORACLE8ISPARCSOL.TAR.GZ file.

  4. Enter the following commands:

    On a Linux/Solaris(Intel) server, enter $ gunzip InvOracle8iUNIXintel.tar.gz

    Enter $ tar -xvf InvOracle8iUNIXintel.tar

    On a Sparc Solaris server server, enter $ gunzip InvOracle8iSparcSol.tar.gz

    Enter $ tar -xvf InvOracle8iSparcSol.tar

    This extracts the Inventory database in the home/ZfD3/zenworks directory, where home is the home directory of the Oracle user you logged in as.

  5. Edit the _START.SQL file in ZfD3/ZENWORKS directory. This file contains commands to start the Inventory database.

    If required, edit the file based on your Oracle settings. For example, if you are starting the Inventory database along with other Oracle databases, create a Oracle database instance for the Inventory database. Set the Oracle instance name in _START.SQL. Otherwise, shut down any existing databases.

  6. Ensure that Oracle is up and running.

    To run the Oracle Server Manager, enter $ svrmgr1

    This command loads the Oracle Server Manager.

  7. From the Server Manager, start the Inventory database.

    At the Server Manager prompt, enter the following commands:

    Type @$HOME/ZfD3/zenworks/_start

    This command starts the Oracle instance, mounts the Inventory database, and displays the following output information.

    ORACLE instance started.Total System Global Area ... Fixed Size ... Variable Size... Database Buffers... Redo Buffers... Database mounted. Database opened.

    While mounting the database, you may see the following error: End-of-file on communication channel. Resolve this error by creating a new control file and using it to open the Inventory database.

    To create a new control file:

    1. Open the ALTERCTRL.SQL file in the ZENWORKS directory.

    2. Ensure that the specified path settings in the file are correct.

    3. Run the Oracle Server Manager and connect as an Internal user.

    4. At the Server Manager prompt, run ALTERCTRLSQL.

      Type @$HOME/ZfD3/zenworks/alterctrl

    5. Start the Inventory database.


Initializing the Inventory Database

Before using the Inventory database, initialize the database. Initializing the Inventory database assigns a unique site ID and site name to the database. Using these details, the Inventory database can be identified at the enterprise level.

Follow these steps:

  1. Ensure that the Inventory database is mounted.

  2. Specify a site ID and site name that uniquely identify your Inventory database in the ZENworks tree.

    Open the _DBINIT.SQL file in the ZFD3/ZENWORKS directory. This file contains a dummy site ID and site name as:

    siteid:=255;

    siteName:='example-site';

    Change the site ID and site name variables with your site ID and site name and save the file.

    IMPORTANT:  Do not use an already existing site ID and site name.

  3. Run the Oracle Server Manager. At the Server Manager prompt, enter the following commands:

    1. Enter connect mw_dba/novell

    2. Enter @$HOME/ZfD3/zenworks/_dbinit

      This command initializes the database with the provided site ID and site name. To verify this, at the Server Manager prompt, enter select * from zenworks.site;

      While initializing the database, you may see the following error: Declare * ORA-06553: PlS-908: The stored format of SYS.STANDARD is not supported by this release.

      This error indicates that the Oracle version that is in use is later than 8.1.5.

      To correct this problem, upgrade the Inventory database to initialize the Inventory database.

      Follow the steps in Upgrading the ZfD 3.2 Inventory Database on Oracle 8.1. x .


Configuring the Inventory Database

Create an identity for the Oracle Inventory database server in the ZENWORKS tree. This makes the database available for access by the inventory components.

  1. Create a ZENworks Inventory Database object and a Database Location policy. In the policy, indicate the Oracle Inventory database server as the designated server for hosting Inventory database. See Configure the Policies for the Database in Workstation Inventory in Deployment. Ensure that you specify the IP address of the Oracle Inventory database server in the Database policy.


Upgrading the ZfD 3.2 Inventory Database on Oracle 8.1.x

When you are mounting ZfD 3.2 Inventory database on a server with Oracle 8.1.x, initializing the database using _dbinit.sql may be unsuccessful and you may see the following error message:

DECLARE * ORA-06553: PLS-908: The stored format of SYS.STANDARD is not supported by this release.

In this scenario, it is not possible to use the Inventory database. To resolve this problem, upgrade the Inventory database to the existing Oracle version.

  1. Configure and mount the Inventory database.

    On NetWare and Windows NT/2000 servers, follow the instructions in Configuring the Inventory Database for Oracle in Workstation Inventory in Deployment. Do not follow the last step in the procedure, which instructs you initialize the database on the server.

    On UNIX* servers, see Using the ZfD 3.2 Inventory Database on Oracle 8i for Linux and Solaris .

  2. Run the Oracle Server Manager.

    On a NetWare server: From the server prompt, enter load svrmgr31.nlm.

    On a Windows NT/2000 server: From the taskbar, click Start > Run. Enter svrmgrl.exe.

    On a UNIX server: Log in as an Oracle administrator. At the login prompt, run svrmgrl.

  3. At the Oracle Server Manager prompt:

    Enter connect internal/password where password is the Oracle internal user password. On NetWare or Windows NT/2000 servers, enter spool path\upgrade81X.log

    @%oracle_home%\rdbms\admin\u801050.sql

    On UNIX-based servers, enter the following commands: spool $HOME/upgrade81X.log
    @%oracle_home%\rdbms\admin\u801050.sql

    The upgrade tool starts upgrading the Inventory database. Wait until the upgrade tool completes the upgrade. The upgrade tool may take some time to complete.

  4. At the Oracle Server Manager prompt,

    1. Enter spool off

    2. Enter disconnect

    3. Enter exit

    The Inventory database will be upgraded to Oracle 8.1.x. The status of update is logged in the UPGRADE81X.LOGfile.

  5. Initialize the Inventory database.

  6. Update with the Oracle JDBC driver.

    The Oracle JDBC driver that is shipped as part of ZfD 3.2 is for Oracle 8i (8.1.5). If you are using a later version of Oracle, we recommend that you use the JDBC driver for the same version. Oracle JDBC driver is located on the server in the oracle_home/JDBC/LIB directory, where oracle_home is the directory where Oracle is installed. The name of the driver file is CLASSES111.ZIP. Alternatively, you can download the file from Oracle Web site. After you get the correct JDBC driver, update the file on ZfD 3.2 inventory servers and consoles.

Follow these steps:

  1. To update all ZfD 3.2 consoles, copy CLASSES111.ZIP to the \CONSOLEONE\1.2\CONSOLEONEEXT and CONSOLEONE\1.2\LIB\ZEN directories

  2. To update all inventory servers, copy CLASSES111.ZIP to the ZENWORKS\LIB directory.


Configuring the Sybase ODBC Driver for ZfD 3.2 Inventory Database

This section describes how to install and configure the Sybase ODBC driver in order to access the ZfD 3.2 Inventory database.

Sybase ODBC driver version 7.0.0.313 is available on the ZfD 3.2 Companion CD shipped with ZfD 3.2.

To configure Sybase ODBC driver for the ZfD 3.2 Inventory database:

  1. Ensure the following prerequisites are met:

  2. Install the Sybase ODBC Driver.

    1. Extract the files from \ODBC\SybaseODBC.zip from the ZfD 3.2 Companion CD to a drive.

    2. Copy the files from the directory where you have extracted the files to \PROGRAMFILES\SYBASE directory.

      \PROGRAM FILES\SYBASE\ADAPTIVE SERVER ANYWHERE 7.0\WIN32\DBCON7.DLL
      \PROGRAM FILES\SYBASE\ADAPTIVE SERVER ANYWHERE 7.0\WIN32\DBLGEN7.DLL
      \PROGRAM FILES\SYBASE\ADAPTIVE SERVER ANYWHERE 7.0\WIN32\DBODBC7.DLL
      \PROGRAM FILES\SYBASE\ADAPTIVE SERVER ANYWHERE 7.0\WIN32\DBODTR7.DLL
      \PROGRAM FILES\SYBASE\ADAPTIVE SERVER ANYWHERE 7.0\WIN32\DBPORT6.DLL

    3. Double-click the SYBASEODBC.REG file. The following message Information in SybaseODBC.reg has been successfully entered into the registry should be displayed.

      SYBASEODBC.REG contains the required registry settings for Sybase ODBC driver. Modifying this file may corrupt system registry settings, thus making your server unusable.

  3. Configure the Sybase ODBC driver

    1. From the ODBC Data Source Administrator, click Start > Settings > Control Panel > ODBC Data Sources.

    2. From the ODBC data Source Administrator, select User Data Sources > Sybase ODBC > click Configure.

      This will display the ODBC Configuration for Adaptive Server Anywhere dialog.

    3. Click the Login tab.

      Ensure that you have entered a user id and password as follows:

      User ID: mw_dba

      Password: novell

    4. Click the Database tab.

      Enter the following details.

      Server Name: IP address of the server on which Sybase is running.

      Database Name: Database Name: mgmtdb

    5. Click the Network tab > check the TCP/IP option.

    6. Specify the host name or IP Address of the server.

      The format should be host=IP_address where IP_address is the IP address or host name of the server on which Sybase is running.

    7. Click ODBC tab > Test Connection.

      The message Connection Successful should be displayed. This message indicates that the Sybase ODBC driver has been configured correctly. If there is an error message, repeat Step 3.