How to rebuild a corrupt NDPS Manager database using PAGen3.exe

  • 7004851
  • 11-Nov-2009
  • 26-Apr-2012

Environment

Novell iPrint for NetWare

Situation

Errors returned when attempting to load NDPSM.NLM
NDPS Manager database corruption suspected.
How to rebuild a corrupt NDPS Manager database using PAGen3.exe.
How to recover from a corrupt PSM database.

Resolution

There are multiple reasons NDPSM will fail to load.  The main reasons are:
  • Corrupt NDPS Manager Database
  • NDPS NLM problems
  • NDS problems
If the first reason is suspected, then loading a backup copy of the database or recreating the NDPS Manager database will cause the corruption to be gone.  

Advantages of restoring a backup copy of the database:
  • Fast and easy
  • Printer Driver Profile data and associations will stay intact
Disadvantages of restoring a backup copy of the database:
  • The corruption may have existed prior to the earliest copy of the database.
  • Many changes (new printer agents created) may have occurred since the last *good* copy of the database.
Advantages of creating a new Print Manager database using PAGen
  • Guaranteed non-corrupt copy of the Print Manager database (psmdb.dat).
  • Like the restore option, eDirectory objects are not deleted or recreated.
Disadvantages of creating a new Print Manager database using PAGen
  • Significant understanding of the tool is required.
  • Printer Driver Profile data and associations will be lost. (see Additional Information below)
  • PAGen does not support public access printers. (see Additional Information below)
  • PAGen does not support the old Novell gateway. (see Additional Information below)
Preliminary Steps:

Identify Correct .PSM Directory
Before recovering from NDPS Manager database corruption, identify the .PSM directory that is associated to the NDPS Manager object in eDirectory.   There are several ways to accomplish this:

1.  View .PSM Directory through Windows Explorer:
Using Windows Explorer, browse to the location of the NDPS Manager database files.
The location will be [VOL]\NDPS\XXXXXXXX.PSM.  There is a .PSM directory for every Manager ever created on that server.  Therefore, you may need to examine the contents of the .PSM directory to confirm that you are viewing the correct Manager database.  There will be a .PA sub-directory for every printer agent on that NDPS Manager database.  Also, viewing the creation date of the .PSM directory may help you determine which .PSM directory is correct.

2.  View .PSM path through Server Console:
If the Manager is able to load, then you can determine the exact .PSM directory by:
  1. Go to the NDPS Manager screen on the server console
  2. Hit ENTER on NDPS Manager Status and Control
  3. Hit ENTER on Database Options
  4. Hit ENTER on Examine Database
  5. Make note of the database location

3.  View .PSM path through ConsoleOne:
  1. Launch ConsoleOne.exe
  2. Open the Properties of the NDPS Manager object
  3. Click the "Other" tab
  4. View the "Database Dir Path" and "Database Volume"

Option 1: Recover database from backup
NDPSM.NLM routinely creates backup copies of the Print Manager database file (psmdb.dat).   Various copies of those .dat files are stored up to 40 days.  They exist in the VOL:\NDPS\XXXXXXXX.PSM directory.   The pattern of these files are:
  • PSMDBSAV is of 1AM that morning.
  • PSMDBSV1 is a copy from 10 days ago.
  • PSMDBSV2 is a copy from 20 days ago.
  • PSMDBSV3 is a copy from 30 days ago.
  • PSMDBSV4 is a copy from 40 days ago.
To recover from NDPS Manager database corruption:
  1. Ensure that NDPSM.NLM is unloaded
  2. Using Windows Explorer, browse to the .PSM directory.  (Read the "Identify Correct .PSM Directory" note above)
  3. Move the suspected corrupt PSMDB.DAT files to a safe location.
  4. Choose which backup file (.DAT) you would like to use.
  5. Rename the backup pair .DAT file to PSMDB.DAT.
  6. Load NDPSM
This will load the PSM database from X days ago.  The assumption is that the backup copy does not have the corruption.

Option 2: Use the Printer Agent Generator Tool (PAGen) to create a fresh database
If the server is running NDPSM.NLM dated 10MAR2004 or later AND a PADBTXT.CSV exists on the server, then you can use PAGen to create a fresh database with all of the original printer agents.  Download the Printer Agent Generator tool (PAGen3.exe) and read the associated documentation.  Also, the steps below will be helpful in guiding you through the process of:
  • deleting the corrupt PSM database
  • Using PAGen to auto-creating a fresh PSM database with all of the original printer agents and associate those printer agents to the existing NDS printer objects.
  1. Download PAGen by going to Novell's File Finder and searching for PAGen3.exe
  2. Unload NDPSM, if it is loaded.
  3. Using Windows Explorer, browse to the .PSM directory.  (Read the "Identify Correct .PSM Directory" note above)
  4. Copy PADBTXT.CSV to the root of C: on your workstation
  5. Copy PAGen3.EXE to the root of C: on your workstation
  6. Move all the contents of the XXXXXXXX.PSM directory to safe location, leaving the .PSM directory on the server empty.  NDPSM.NLM must be unloaded for the files to move.  If Windows still won't let you move the files, then:
    • Right-click the file that can't be moved, and choose properties.
    • Uncheck the "transactional" flag, and click OK.
  7. Load NDPSM.NLM. 
    • If the /dnsname switch was used with the previous Print Manager, be sure to include the /dnsname switch when loading now.
    • If you are unsure if the Print Manager was previously loaded with the /dnsname switch, view a workstation that has an iPrint printer installed.  What shows after the ipp:// ?   DNS name?  Or IP address? 
  8. After loading NDPSM, a new PSMDB.DAT will be created and the list of printer agents will be blank
  9. Ensure the NDPS Component is installed to the workstation.
    • Your workstation must have the Novell Client installed with the NDPS Component and a Primary connection to the NDPS Manager tree.  To confirm this:
      • Right-click the RED N
      • Choose "NetWare Connections..."
      • Under the Resource column, look for the tree where the NDPS Manager object resides with an asterisk (*) next to the name.
  10. Run the PAGen Associate Operation within a command prompt as follows:
pagen3 /psm=.nameofPSM.OU.OU.O /broker=.nameofbroker.OU.OU.O /tree=yourTreeName /operation=associate /CSVfile=padbtxt.csv

This operation will recreate all of the Printer Agents listed in the CSV and associate them to their corresponding NDS printer objects.  A PAGen log file will be created to the same directory which PAGen2.exe was executed.  The log file will show a summary of the operation and errors.

Additional Information

Public Access Printer Agents
If a Public Access printer agent is displayed in the CSV file (empty value in the "NDS Printer Object" column), PAGen will not execute.  PAGen will report:

Invalid NDS printer object name in row [x].

There are several ways to get around this condition.  One method is to comment (#) the row with the Public Access printer entry, then address those printers manually or use PAGen in the "create" mode with an NDS value populated.

Printer Agents configured for the Old Novell Gateway
Printer Agents using the Old Novell Port Handler Gateway will have incorrect Gateway Load String information.  The Old Novell Gateway shows NDPDS as the Gateway Load String.  This is insufficient to cause a Printer Agent to communicate with a physical printer on the network.  You will either need to manually create these Printer Agents or you can modify the Gateway Load String column (column 6 in the CSV file) to instruct the PA to load the new Novell Gateway (NDPSGW.NLM).  The format to use in this column is:

NDPSGW PORT=LPR HOSTADDRESS=[the ip address of your printer] PRINTERNAME=PASSTHROUGH
or
NDPSGW PORT=RAW HOSTADDRESS=[the ip address of your printer]

for example:

NDPSGW PORT=LPR HOSTADDRESS=232.73.158.151 PRINTERNAME=PASSTHROUGH
or
NDPSGW PORT=RAW HOSTADDRESS=232.73.158.151

Printer Driver Profiles not supported
Printer Driver Profile (PDP) data is stored in the psmdb.dat.  The printer agent association to those PDPs is also stored in the psmdb.dat.  The CSV file does not include that data.  Therefore, when recreating the Print Manager database file using PAGen, both the PDP data and associations will be lost.  
NOTE:  This limitation does not exists in the disaster recovery tool for iPrint on Linux.
 
New feature introduced with PAGen3 - validate:
PAGen version 3 introduce a new operation of validate.  When run in this mode, PAGen does not execute anything, but rather evaluates the driver paths listed in the CSV to check if they exist in Broker defined in the PAGen command switch.  Novell recommends you run in the validate operation prior to running in the associate or create mode.
 
Example syntax:
 
pagen3 /psm=.nameofPSM.OU.OU.O /broker=.nameofbroker.OU.OU.O /tree=yourTreeName /operation=validate /CSVfile=padbtxt.csv