Professional Documents
Culture Documents
Using Microsoft® SQL Server: With HP Web Jetadmin
Using Microsoft® SQL Server: With HP Web Jetadmin
CONTENTS
Overview..............................................................................................................................2
Introduction ...........................................................................................................................2
Migrating an existing HP Web Jetadmin database......................................................................2
Using local SQL Server database .............................................................................................3
Installing SQL Server ...........................................................................................................3
Creating a named instance ..................................................................................................4
Configuring HP Web Jetadmin to use the new database...........................................................5
Using remote SQL Server database...........................................................................................6
Named or default instance ...................................................................................................6
Configuring HP Web Jetadmin to use the new database...........................................................7
Migrating the HP Web Jetadmin database.................................................................................9
Preferred method ................................................................................................................9
Alternate method ................................................................................................................9
Troubleshooting ...................................................................................................................11
Database failover—SQL mirroring ..........................................................................................12
Performance settings.............................................................................................................13
Backup of HP Web Jetadmin configured for a remote database..................................................13
Summary ............................................................................................................................14
Appendix A—Installing the database connectivity module license ...............................................15
License process.................................................................................................................15
OVERVIEW
HP Web Jetadmin 10.x installs and uses by default a
database running under Microsoft SQL Express.
However, it may be more convenient for HP Web
Jetadmin to use SQL Server 2005/2008 for
performance benefits, and to avoid the SQL Express 4
GB database limitation. Fortunately, an existing
installation of Web Jetadmin 10.1 or greater can be
configured to use SQL Server instead of SQL Express as
long as SQL Server resides on the same machine. With
the addition of an optional database connectivity
module license, HP Web Jetadmin 10.2 SR1 or greater
can be configured to use an instance of SQL Server that
resides on a remote machine. This document will
describe how to create a named instance on an
installation of SQL Server, how to configure HP Web
Jetadmin to use that instance, and how to migrate an
HP Web Jetadmin database from SQL Express to SQL
Server if required.
2
run on the remote HP Web Jetadmin installation to ensure the settings directory and database are
properly backed up.
HP Web Jetadmin offers a backup.bat script that backs up the database as well as the Settings
directory files in the file structure. It resides under the following directory:
DRIVE:\Program Files\Hewlett-Packard\Web Jetadmin 10\bin\WJABackupRestore\backup.bat
It may be necessary to assign Network Service write permissions in the directory where the database
is being saved. Using Windows Explorer, right-click the directory where the database will be saved,
and ensure the Network Service account has write permissions (see Figure 1).
Microsoft Windows Vista® requires that scripts requiring administrative access and run from the
Command Prompt must be executed using Run as administrator. Since a backup and restore script
starts and stops the HP Web Jetadmin service, administrative access is required. Click Start,
Programs, Accessories, Command Prompt, and choose Run as administrator. When Command
Prompt launches, run the backup script.
The backup script saves the HP Web Jetadmin database in the same directory as the backup script.
3
If the SQL Express installer returns an error,
HP Web Jetadmin posts an error. For example, if
the HPWJA instance is disabled or cannot be
started, an error occurs.
NOTE Do not disable the old SQL Express
instance under Services or remove it
under Add/Remove Programs. The
HP Web Jetadmin installer expects the
old SQL Express instance to be present
when performing an upgrade and fails if
it cannot find the instance.
Once HP Web Jetadmin and SQL Server are
successfully installed on the same machine,
perform the following steps to instruct HP Web
Jetadmin to use SQL Server instead of SQL Figure 2—Create named instance
Express.
4
Once the installer has completed and a named instance has been created, it is time to create a new
database for HP Web Jetadmin to use. To create a new database, launch the SQL Server
Management Studio and open the named instance (HPWJA_FULL) that was just created. Right-click the
Databases folder, select New Database, and enter the database name to be “HPWJA” (see Figure 5).
For SQL Server on the same machine as HP Web Jetadmin, the database MUST be named “HPWJA”.
Make sure the database is allowed to grow to at least 4 GB.
The administrator who installed SQL Server automatically has database owner (dbo) rights on the
database. Those same administrator credentials are used by HP Web Jetadmin to access the
database. Now SQL Server is prepared for HP Web Jetadmin’s use. The next step involves instructing
HP Web Jetadmin to use this new database.
4 GB minimum.
Assign rights to the database appropriately so
that the account that HP Web Jetadmin uses to
access the database has database owner (dbo)
6
rights.
Now SQL Server is prepared for HP Web Jetadmin to begin using it. The next step involves instructing
HP Web Jetadmin to use this new database.
7
<ipmc:configuration xmlns:ipmc="www.hp.com/schemas/imaging/ipmc/config/2004/02/24">
<property name="DatabaseConnectionFactory.CommandTimeoutInSeconds">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>120</value>
</property>
<property name="DatabaseConnectionFactory.MachineName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert machine name here</value>
</property>
<property name="DatabaseConnectionFactory.UserName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert username here</value>
</property>
<property name="DatabaseConnectionFactory.PlainTextPassword">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert plain text password here</value>
</property>
<property name="DatabaseConnectionFactory.InstanceName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert named instance here</value>
</property>
<property name="DatabaseConnectionFactory.CatalogName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert database name here</value>
</property>
</ipmc:configuration>
Figure 9—Configuration file for remote SQL Server using named instance
Cut and paste the contents of the following example into the configuration file if using a default
instance, replacing the database and account credentials with the proper ones.
<ipmc:configuration xmlns:ipmc="www.hp.com/schemas/imaging/ipmc/config/2004/02/24">
<property name="DatabaseConnectionFactory.CommandTimeoutInSeconds">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>120</value>
</property>
<property name="DatabaseConnectionFactory.MachineName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert machine name here</value>
</property>
<property name="DatabaseConnectionFactory.UserName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert username here</value>
</property>
<property name="DatabaseConnectionFactory.PlainTextPassword">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert plain text password here</value>
</property>
<property name="DatabaseConnectionFactory.DefaultInstance">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value></value>
</property>
<property name="DatabaseConnectionFactory.CatalogName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>insert database name here</value>
</property>
</ipmc:configuration>
Figure 10—Configuration file for remote SQL Server using default instance
8
Stop and restart the HP Web Jetadmin Service (HPWJA Service) under Administrative Tools, Services.
Launch HP Web Jetadmin to validate that the new blank database is now in use (All Devices should
display zero devices).
NOTE Once the HP Web Jetadmin service is restarted, the plain text password in the configuration
file is hashed (grayed), and the heading of the password section is changed from
“PlainTextPassword” to “Password”. If it is required to edit the password in the file, remember
to change the heading back to “PlainTextPassword” for that section. Otherwise, the service
will have difficulty connecting to the database. The password is also hashed when passed
over the network to login to the remote SQL database. However, certificates are not used to
provide the strongest level of security. Future versions of HP Web Jetadmin may eventually
use certificates to provide the strongest level of security possible.
Preferred method
The easiest and most common technique to migrate the existing HP Web Jetadmin database from the
old instance to the new one involves manually copying the database files from the old location to the
new location. Database files are located under the following directory:
DRIVE:\Program Files\Microsoft SQL Server\MSSQL.x\data (where x=1,2,3, and so on)
Directories are named MSSQL.1, MSSQL.2, and so on, depending upon how many instances are
installed under SQL Server. Locate the one that contains the database files for HP Web Jetadmin
named HPJWJA.mdf and HPJWJA_log.ldf. These files need to be copied to the same location under
the MSSQL.1, MSSQL.2, and other directories for the new instance.
Stop the HP Web Jetadmin service before copying the files. Backup the current blank database files
as a precaution. It is very likely that the previous database files have to be detached from the old
instance before copying to the new instance. Stopping the SQL Server service should allow the files to
be copied.
Once the files have been copied, start the HP Web Jetadmin service and use a client to verify success.
Verify that All Devices contains the number of devices HP Web Jetadmin contained before the
migration.
Remember, if the goal is to migrate the HP Web Jetadmin settings and database from a remote HP
Web Jetadmin installation, the Settings directory must be migrated in addition to the database to
provide a matching set. Performing the alternate method below on the remote HP Web Jetadmin
installation ensures both the Settings directory and database are properly migrated.
Alternate method
If the HP Web Jetadmin database has been backed up using the backup.bat script prior to pointing to
the new instance and database, it may be preferable to run a SQL script to restore it rather than
copying the database files as described above. However, simply running the HP Web Jetadmin
restore.bat script also restores the settings directory containing many HP Web Jetadmin files,
including the old DatabaseSettings.config.xml file before the changes were made to point to a new
instance. Therefore, this document will discuss using SQL Server Management Studio Express to
restore the database from the HPWJA_DB_BACKUP.dat file that was created using the HP Web
Jetadmin backup.bat script.
9
To restore the database using this method, stop the HP Web Jetadmin service under Administrative
Tools, Services. Start SQL Server Management Studio Express and connect to the new HPWJA_FULL
SQL instance (or whatever name was chosen for the new instance). Locate the database catalogue
named HPWJA listed in the navigation tree under Databases. Using the right-click menu, run Tasks,
Restore, Database. This launches a dialogue for selecting From Device as the source of restore data.
Use the dialogue launched through the … button to navigate to the file HPWJA_DB_BACKUP.dat that
was created by the backup.bat script. After the file is selected in the Restore Database dialogue,
select the Restore box in the listing of “…backup sets to restore”. At this point there is a backup.dat
file identified that will be used to restore data from the original database instance to the new one.
The file HPWJA_DB_BACKUP.dat also contains the paths to key database files on the old SQL
database instance. These file paths need to be changed. In the case of the initial HP Web Jetadmin
SQL database instance, the path could be “…\MSSQL.1\Data\...” In the case of the newer SQL
database created in this procedure, the path could be “…\MSSQL.2\Data\...” The path should be
set to the latter in the SQL Restore Database dialogue. To perform this operation, change the settings
page from General to Options, check the box labeled Overwrite the existing database and set the
paths listed under “Restore the database file as…” Remember, these should be changed from the old
SQL instance file paths to the new ones. In this example the following new paths are used:
DRIVE:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\HPWJA.mdf
DRIVE:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Data\HPWJA_log.ldf
Click OK within the Restore
dialogue and watch the
results. The restore runs for
some time depending on the
amount of data within the
backup file but should
complete with a 100%
indication. When the restore
is complete, start the
HP Web Jetadmin service
and then use a client to verify
success. Verify that All Figure 11—Overwriting the database
Devices contains the number
of devices HP Web Jetadmin
contained when it was
originally backed up.
NOTE IMPORTANT! The SQL Server Express
database instance that was originally created
by HP Web Jetadmin should be left in place.
At this time, HP Web Jetadmin installation and
upgrade facilities require that the initial,
default instance of the HP Web Jetadmin SQL
database be left in place. Errors will occur if
the instance is removed or if the Windows
service for this SQL instance has been
stopped. If the catalogue is consuming large
amounts of disk space on the system hosting
this instance, it can be removed and recreated
using the SQL Server Management Studio
features.
Figure 12—Setting the backup source
10
TROUBLESHOOTING
Use the following troubleshooting steps if HP Web Jetadmin is unable to start up after attempting to
connect to a new database or the original database continues to appear upon startup.
1. For remote SQL Server databases, a license must be installed in HP Web Jetadmin (see
“Appendix A”). Even though the license may have been installed previously, it may need to be re-
installed after an HP Web Jetadmin upgrade to a new version. It is also possible that while
License Manager displays the license as being installed, it is not being recognized in HP Web
Jetadmin. A more reliable method for ensuring the license is installed is to check under Help,
About, Details in HP Web Jetadmin.
2. A trace log file may exist to provide some helpful details as to why the HP Web Jetadmin service
cannot connect to the database. A series of log files exist under:
DRIVE:\Documents and Settings\NetworkService\Local Settings\Application Data\Hewlett-
Packard\HPWebJetadmin\WjaService\tracing
The files named HPWJAService-xxx.itl (where xxx represents a series of numbers) may contain
helpful troubleshooting information.
3. Double-check the contents of the configuration file that was edited. Ensure it does not contain
extraneous carriage returns in the middle of tags and extra spaces or typos in the configuration
parameters.
4. Fully qualify the server name in the configuration file if name resolution issues are present or use
the IP address instead of the hostname.
5. If the user password was edited in the configuration because it had changed, remember to
change the heading back to “PlainTextPassword” for that section.
6. Verify that the HP Web Jetadmin service was restarted after making edits to the configuration file.
7. It is imperative to open the existing DatabaseSettings.config.xml file and copy/paste the new
contents as they are displayed in this paper to maintain the user rights. The file must have
read/write rights for Network Service in order for HP Web Jetadmin to be able to use it. If a new
file is created instead of opening the existing file, the new file assumes the user’s rights. If this
happens, HP Web Jetadmin does not attempt to use the new database and defaults to the old
one. Ensure that Network Service has read/write rights.
8. For remote SQL Server databases, the instance must be configured for Mixed Mode so a user
name and password can be used for SQL Authentication.
9. Confirm that the user HP Web Jetadmin is using to connect to the database has database owner
(dbo) rights on the database. Executing the following SQL Server script in SQL Management
Studio is one way to determine the login name of the dbo:
USE master;
SELECT SUSER_SNAME(sid)
FROM master..sysdatabases
WHERE name = 'Web Jetadmin database name'
GO
/* Result
sa
*/
11
DATABASE FAILOVER—SQL MIRRORING
HP Web Jetadmin supports a mirrored configuration for SQL Server 2005/2008 by allowing
parameters to be added to the DatabaseSettings.config.xml file. However, a clustered configuration
for SQL is not supported at this time. The mirrored configuration is only supported if the remote
database option has been licensed.
The following parameters can be added to the DatabaseSettings.config.xml file to support failover for
mirrored SQL configurations:
• DatabaseConnectionFactory.FailoverPartner.MachineName—the mirror partner for the database
• DatabaseConnectionFactory.FailoverPartner.InstanceName—the instance name of the mirror
partner database
• DatabaseConnectionFactory.FailoverPartner.DefaultInstance—forces the default instance of the
mirror partner database to be used
<ipmc:configuration xmlns:ipmc="www.hp.com/schemas/imaging/ipmc/config/2004/02/24">
<property name="DatabaseConnectionFactory.FailoverPartner.MachineName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>db2.SomeDomain.com</value>
</property>
<property name="DatabaseConnectionFactory.FailoverPartner.InstanceName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>HPWJA_MY_INSTANCE</value>
</property>
<property name="DatabaseConnectionFactory.CatalogName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>HPWJA</value>
</property>
<property name="DatabaseConnectionFactory.InstanceName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>HPWJA_MY_INSTANCE</value>
</property>
<property name="DatabaseConnectionFactory.MachineName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>db1.SomeDomain.com</value>
</property>
<property name="DatabaseConnectionFactory.PlainTextPassword">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>MyPassword</value>
</property>
<property name="DatabaseConnectionFactory.UserName">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>MyDBUser</value>
</property>
<property name="DatabaseConnectionFactory.CommandTimeoutInSeconds">
<type>HP.Imaging.Wjp.Sdk.Core.Framework.ConfigurationItemString</type>
<value>120</value>
</property>
</ipmc:configuration>
Figure 13—Example DatabaseSettings.config.xml file for using a mirrored database
12
While HP Web Jetadmin supports database mirroring, the behavior of the HP Web Jetadmin service
and connected clients may vary when a failover occurs on the database. The HP Web Jetadmin
service may sometimes stop as Microsoft fails over to the alternate database. When a failure occurs
with the database connection, Microsoft switches the HP Web Jetadmin database connection to the
alternate database and reports the failed database transaction to HP Web Jetadmin with an
exception. Depending upon where HP Web Jetadmin accesses the database, the exception may
cause the HP Web Jetadmin service and attached clients to fail.
It is recommended to configure the HP Web Jetadmin service to automatically restart after an
abnormal termination (such as a failover) so that there is no manual intervention required to get the
service back up and running again on the new primary database. The service and clients still fail, but
only temporarily as the service should be up and running again on its own, and the clients can be
restarted.
When a failover happens, further connection attempts go to the failover partner. If those are
successful the service continues to run. If they are not successful the service shuts down. On restart, the
service should function normally if the failover partner node is available. Otherwise it waits for a
database connection to succeed before the service comes up all the way.
PERFORMANCE SETTINGS
Other properties that can be set in the DatabaseSettings.config.xml file include:
• DatabaseConnectionFactory.MinimumPoolSize—Sets the minimum number of connections to keep
open to the database. Default is 0.
• DatabaseConnectionFactory.MaximumPoolSize—Sets the maximum number of connections to
allow to be opened to the database. Default is 100.
• DatabaseConnectionFactory.CommandTimeoutInSeconds—How long to wait for results to start
being returned in a query. Default is 120.
These settings can be used to improve performance when reading from and writing to the database.
13
database. For example, the HP Web Jetadmin backup.bat file runs a SQL script on the same
machine to backup the database as such:
%OSQL% -S localhost\HPWJA -E -i osql_backup.sql > osql_backup.log
This line could easily be changed to run the script on the remote SQL server:
%OSQL% -H wksta_server -S SQL_server\Instance -U user -P password -i osql_backup.sql >
osql_backup.log
The SQL script backs up a database named HPWJA to DRIVE:\
BACKUP DATABASE HPWJA TO DISK =
'DRIVE:\HPWJA_DB_BACKUP\HPWJA_DB_BACKUP.dat'
This script could be changed to backup any database name to a shared UNC path:
BACKUP DATABASE database_name TO DISK = '\\WJA
_server\shared_directory\HPWJA_DB_BACKUP\HPWJA_DB_BACKUP.dat'
The backup.bat file creates a temporary directory to write the .dat file then removes it once the .dat
file is copied to the Program Files location. Since the backup.bat file looks for the .dat file under this
temporary directory, and it is impossible to share out this temporary directory since it doesn’t always
exist, an additional permanent directory could be created and shared. The SQL script could be
modified by adding an additional line to the backup.bat file to copy the .dat file from this shared
directory to the HP Web Jetadmin temporary directory. Now, the backup.bat script is never disrupted
and can continue from that point.
SUMMARY
An existing installation of Web Jetadmin can be configured to use SQL Server instead of SQL Express
for its database. For example, it may be more convenient for HP Web Jetadmin to use SQL Server
since it may already be installed, or to avoid the SQL Express 4 GB database limitation.
14
APPENDIX A—INSTALLING THE DATABASE CONNECTIVITY
MODULE LICENSE
A database connectivity module license must be installed in HP Web Jetadmin to unlock the ability to
attach to a remote SQL Server database. The licenses are node-locked to an IP address, requiring a
separate license for each HP Web Jetadmin server. An order number should have been supplied
when requesting a license from HP. This order number is used to generate the actual licenses by
following the licensing process below. License versions must match the appropriate HP Web Jetadmin
server version:
IMPORTANT! HP Web Jetadmin version 10.2 SR1 (10.2.62227) or above is required in order for the
license to install successfully.
License process
1. Browse to the Webware URL (www.webware.hp.com) and click
Generate New Licenses.
2. If you have a user ID (your registered email address) already for the
Webware site, enter the email address and password. Otherwise,
create a new account and proceed.
3. Type the order number provided to you for the database connectivity
module under Order Number and click Next. Figure 14
15
12. Restart the HP Web Jetadmin service (HPWJA Service).
© 2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without
notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying
such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be
liable for technical or editorial errors or omissions contained herein.
Microsoft, Windows, and Windows Vista are registered trademarks of Microsoft Corporation in the United States
and/or other countries.
c01763040ENW, Rev.2, April 2011