Skip to main content link. Accesskey S
  • HCL Logo
  • HCL Notes and Domino wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Lotus Notes > Notes client provisioning and install > Example CL script to end your Domino server, rename the log files and submit fixup, compact and updall against system databases
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

IBM i: Adding or removing a system environment variable to be used by the Domino server

Process to add or remove a system environment variable that is affecting the operation of the Domino server.

Example CL script to end your Domino server, rename the log files and submit fixup, compact and updall against system databases

Example CL script to end your Domino server, rename the log files and submit fixup, compact and updall against system databases
Community articleExample CL script to end your Domino server, rename the log files and submit fixup, compact and updall against system databases
Added by ~Yoshi Reresamaroden | Edited by IBM contributor~Yoshi Reresamaroden on September 16, 2010 | Version 5
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
Example CL script to end your Domino server, rename the log files and submit fixup, compact and updall against system databases
Tags: fixup, updall, compact, IBM i, iseries, maintenance

This document contains an example IBM i CL program that will perform the following steps:

 

  1. Disable compact_filter notes.ini parameter to prevent its interference with the compact to be ran.

        2.  End the Domino server

              a.  If Domino server cannot be ended in 12 minutes an error will be posted and maintenance tasks will be aborted.

  1. Rename the current log.nsf and domlog.nsf file. 
  1. Submit a job to run fixup  –j on an indirect file named adminfiles.ind 
  1. Submit a job to run compact –c on an indirect file named adminfiles.ind 
  1. Submit a job to run updall  –r on an indirect file named adminfiles.ind 
  1. Submit a job to start the Domino server

 

In order to use the script you will need the following items:

  1. An indirect file.  For information on using and creating indirect files refer to the Domino wiki article “Using indirect files to run maintenance tasks”. 
  1. A job queue to be used by your maintenance jobs.                                                                                                                                                                For example: CRTJOBQ JOBQ(MYLIB/DOMMAINT) TEXT('Job queue to be used for Domino Maintenance')                                                                        
  1. A subsystem job queue entry configured to only allow one job to run at a time.  This is to prevent multiple maintenance tasks from running on the same database at the same time.  Here is an example of adding the job queue entry to the QBATCH subsystem:

               ADDJOBQE SBSD(QBATCH) JOBQ(MYLIB/DOMMAINT) MAXACT(1) SEQNBR(60)

 

To run the script, call the program passing the server name and subsystem name.  For example:

            CALL   MYLIB/Program_Name   PARM(‘Server_Name’  ‘Subsystem_Name’)

  

Example Script:

PGM        PARM(&SERVERNAME &SUBSYSTEM)

DCL        VAR(&SERVERNAME) TYPE(*CHAR)
DCL        VAR(&SUBSYSTEM) TYPE(*CHAR) LEN(10)
DCL        VAR(&DATETIME) TYPE(*CHAR) LEN(17)
DCL        VAR(&DATE) TYPE(*CHAR) LEN(8)
DCL        VAR(&NEWOBJ) TYPE(*CHAR) LEN(18)
DCL        VAR(&NEWOBJ2) TYPE(*CHAR) LEN(21)
DCL        VAR(&COUNT) TYPE(*DEC) LEN(2 0)
DCL        VAR(&ERRCOD) TYPE(*CHAR) LEN(4) VALUE(X'00000000')
DCL        VAR(&CHARCOUNT) TYPE(*CHAR) LEN(2)
CHGVAR     VAR(&COUNT) VALUE(1)

/* Disable Compact_Filter to allow compact to run on desired databases.  A configuration document is recommended way to automatically enable this setting if it is desired. */

SBMDOMCMD  CMD('set config compact_filter=') SERVER(&SERVERNAME)
MONMSG     MSGID(CPF0000)

DLYJOB     DLY(5)

/* End the Domino Server and Subsystem */

ENDDOMSVR  SERVER(&SERVERNAME)
MONMSG     MSGID(LNT0000 CPF0000)
ENDSBS     SBS(&SUBSYSTEM)
MONMSG     MSGID(CPF0000)

/* Attempt to allocate Domino Server subsystem Description in order to verify Domino server ended successfully */

ALCOBJ     OBJ((QUSRNOTES/&SUBSYSTEM *SBSD *EXCL)) WAIT(660) 
/* Verify server is ended Note that wait time should be higher than the server shutdown timeout defined in the server document */

MONMSG     MSGID(CPF1002) EXEC(DO)
ENDDOMSVR  SERVER(&SERVERNAME) OPTION(*IMMED)
MONMSG     MSGID(LNT0000 CPF0000)

/*Try again for subsystem */
ALCOBJ     OBJ((QUSRNOTES/&SUBSYSTEM *SBSD *EXCL)) WAIT(60)
MONMSG     MSGID(CPF1202) EXEC(DO)
SNDPGMMSG  MSG('Unable to End Domino server - Domino maintenance tasks cancelled')
GOTO       CMDLBL(END)
ENDDO /* END OF SECOND MONMSG(CPF1202 */
ENDDO   /*END OF FIRST MONMSG(CPF1202) */
MONMSG     MSGID(CPF0000)

/* Rename log.nsf and domlog.nsf */

SETDOMENV  SERVER(&SERVERNAME) /* Set current path to data directory */
CALL       PGM(QWCCVTDT) PARM('*CURRENT' ' ' '*YYMD' &DATETIME &ERRCOD) /* Get current systemdate and time in YYYYMMDD */
CHGVAR     VAR(&DATE) VALUE(%SST(&DATETIME 1 8)) /* Get just the date portion */
CHGVAR     VAR(&NEWOBJ) VALUE('log' *CAT &DATE *CAT '.NSF')
CHGVAR     VAR(&NEWOBJ2) VALUE('domlog' *CAT &DATE *CAT '.NSF')

RENAMELOG:
RNM        OBJ(log.nsf) NEWOBJ(&NEWOBJ)  /* Rename the current log */
MONMSG     MSGID(CPFA0A0) EXEC(DO) /* Check to see if object already exists */
CHGVAR     VAR(&COUNT) VALUE(&COUNT + 1)
CHGVAR     VAR(&CHARCOUNT) VALUE(&COUNT)
CHGVAR     VAR(&NEWOBJ) VALUE('log' *CAT &DATE *CAT '_' *CAT &CHARCOUNT *CAT '.NSF')
GOTO RENAMELOG
ENDDO

RENAMEDLOG:
RNM        OBJ(domlog.nsf) NEWOBJ(&NEWOBJ2) /* Rename the current domlog.nsf */
MONMSG     MSGID(CPFA0A9) /* Object does not exist */
MONMSG     MSGID(CPFA0A0) EXEC(DO) /* Check to see if object already exists */
CHGVAR     VAR(&COUNT) VALUE(&COUNT + 1)
CHGVAR     VAR(&CHARCOUNT) VALUE(&COUNT)
CHGVAR     VAR(&NEWOBJ2) VALUE('domlog' *CAT &DATE *CAT '_' *CAT &CHARCOUNT *CAT '.NSF')
GOTO RENAMEDLOG
ENDDO

/* Submit jobs to run maintenance on indirect file this syntax allows you to define a particular job queue to use rather than the default of QBATCH as the functionality to select the job queue is not available until 8.5.2 */

SBMJOB     CMD(RUNDOMCMD SERVER(&SERVERNAME) CMD(CALL PGM(FIXUP) PARM('-j' 'adminfiles.ind')) +
BATCH(*NO)) JOB(FIXUP) JOBQ(MYLIB/DOMMAINT) ALWMLTTHD(*YES) /* Submit fixup task */
MONMSG     MSGID(CPF0000)

SBMJOB     CMD(RUNDOMCMD SERVER(&SERVERNAME) CMD(CALL PGM(COMPACT) PARM('-c' 'adminfiles.ind')) + 
BATCH(*NO) JOBQ(MYLIB/DOMMAINT)) JOB(COMPACT) ALWMLTTHD(*YES) 
/* Submit compact task The -i (ignore errors) parameter is optional. */
MONMSG     MSGID(CPF0000)

SBMJOB     CMD(RUNDOMCMD SERVER(&SERVERNAME) CMD(CALL PGM(UPDALL) PARM('adminfiles.ind' '-r')) +
BATCH(*NO)) JOB(UPDALL) JOBQ(MYLIB/DOMMAINT) ALWMLTTHD(*YES) /* Submit updall task */
MONMSG     MSGID(CPF0000)

SBMJOB     CMD(STRDOMSVR SERVER(&SERVERNAME)) JOB(STRDOMSVR) JOBQ(MYLIB/DOMMAINT) /*Submit job to restart the server */
MONMSG     MSGID(CPF0000)

END:
DLCOBJ     OBJ((QUSRNOTES/&SUBSYSTEM *SBSD *EXCL))  /*Release lock on subsystem in order to allow server to restart */
MONMSG     MSGID(CPF0000)

ENDPGM
 
 
For information on Domino maintenance tasks refer to the Maintenance Tasks article at http://www-10.lotus.com/ldd/dominowiki.nsf/dx/maintenance-tasks

  • Actions Show Menu▼


expanded Attachments (1)
collapsed Attachments (1)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated OnDelete file
application/pdf 12 KB example script.pdf 9/16/10, 4:02 PM
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (5)Sep 16, 2010, 4:13:57 PM~Yoshi Reresamaroden  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL Software
  • Privacy
  • Accessibility