Building saveqmgr -------- -------- Sample makefiles are included: makefile.linux-- for building an Linux version of the executable (add -m31 for 64 bit linux on zSeries, see makefile) makefile.aix -- for building an AIX version of the executable. makefile.solaris -- for building a aSolaris version of the executable. makefile.hp -- for building a HP/UX version of the executable. makefile.windows -- for building a Windows version of the executable. makefile.win64 -- for building a Windows 64-bit version of the executable. makefile.hpnss - for building a Tandem NSK version of the executable. makefile.compaqtru64unix - for building an Compaq Tru64 Unix version of the executable (Thanks to Ralph Beckers for support) Descrip.mms -- for building an OpenVMS version of the executable using MMS. Make_savqmgr.com -- for building an OpenVMS version of the executable without MMS. makefile.os400 is no longer included in this package. See the AS400READ.ME file in ms03_iseries.zip for details. Edit the makefile for your platform (ie makefile.windows) and ensure the variables point to the correct directories, etc. On UNIX, issue: "make -f makefile.xxx", where xxx is the extension for the platform you are compiling on. To recompile on Windows or Win-64, issue: "nmake -f makefile.windows" or "nmake -f makefile.win64" Hints: ------ You can use the -c flag together with sed to customize your output file. Suppose you want to delete all lines that contain the attribute NPMCLASS, try running: ./saveqmgr.linux -c | sed 's/^ *NPMCLASS.*/* skipping npmclass/' > saveqmgr.tst If you want to change all local queues to a maxdepth of 640000, try: ./saveqmgr.linux -c | sed 's/^ *MAXDEPTH.*/ MAXDEPTH(640000) +/' > saveqmgr.tst You get the idea... You can automate the savings of all your qmgrs on a machine with this (for linux): dspmq | grep 'STATUS(Running)' | sed 's/QMNAME(\(.*\)) *STATUS.*/\1/' | xargs -i ./saveqmgr.linux -f {}.mqsc -m {} With V6 of MQ, you can create a SERVICE object to automatically run saveqmgr when the qmgr itself starts: DEFINE SERVICE ('Ms03') DESCR('Run saveqmgr when qmgr starts') STARTCMD('c:\ms03\saveqmgr.exe') + STARTARG('-m +QMNAME+ -f c:\temp\+QMNAME+.mqsc -o') STDOUT('c:\temp\ms03.stdout') + STDERR('c:\temp\ms03.stderr') CONTROL(STARTONLY) SERVTYPE(COMMAND) REPLACE Here's a little script to delete all the queues that begin with AMQ (even the PERMDYN ones): export QM=WBRK_QM ./saveqmgr.linux -m$QM -1 -p -c | grep \(\'AMQ | gawk '{print "delete ql",$3}' | runmqsc $QM A script to authorize "phred" to get from all non-SYSTEM queues: ./saveqmgr.linux -m$QM -1 -s -c | egrep '^DEFINE QLOCAL|QREMOTE|QMODEL|QALIAS' | awk '{print $3}' | \ sed -e "s/('\(.*\)')/\1/" | xargs -i -t setmqaut -m $QM -t q -p phred -n {} +get If you use GNU diff with the '-F' option on saveqmgr, you can get good detail about changed objects from yesterday: diff -c -F DEFINE /tmp/wschutz.yesterday /tmp/wschutz.today
MS03 is a command line program and can be invoked with a -? flag to display which parameters it will accept: ./saveqmgr.-? where is a platform specific extension, ie .exe for windows, .solaris for solaris, etc. Usage is: --help | -h | -? : gives help (this) --localQMgr | -m lqmgr : is the name of the local qmgr to connect (MQCONN) --remoteQmgr | -r rqmgr : is the name of the remote qmgr (XMITQ name) --outputFile | -f [file] : allows the output file to be named, if -f is not specified, the output file defaults to SAVEQMGR.MQSC if -f is specified without a filename, it is named \"qmgrname\".MQSC. --outputFileNoHeader | -F [file] : behaves the same as -f except no header line is created in the output file (and CURDEPTH, ALTDATE and ALTTIME are not reported) --replaceOutput | -o : specifies to replace (overwrite) the output file if the -o flag is not specified, then the default is to append if the file exists (on iSeries, *REPLACE,*APPEND must be specified after the -o flag) --stdout | -c : directs output to STDOUT and overrides use of -f flag --noSyncPoint | -np : forces all puts and gets to specify NO_SYNCPOINT --noSubscriptions | -ns : suppress creation of subscriptions --noSystemObjects | -s [list] : suppress creation of objects that begin with \"SYSTEM*\" list is a comma separated selection from QMGR,QUEUE,NAMELIST,CHANNEL,PROCESS,AUTHINFO,LISTENER,SERVICE,TOPIC,SUB,NONE Specifying NONE is equivalent to specifying -s without any options and will override all other choices This is an inclusion list, System objects of the types listed *will* be reported in the output file. --qm : A shortcut option that is exactly equivlaent to --noSystemObjects QMGR. The ALTER QMGR command will be produced, all other system objects will be skipped. --resetChannels | -R [flags] : create RESET CHANNEL commands flags can be any combination of the follow to create RESET for that channel type: s (SENDER) v (SERVER) r (RECEIVER) q (REQUESTER) c (CLUSSDR) d (CLUSRCVR) the default is to create RESET commands for all the above channel types --permDyn | -p : Create 'local queue' definitions from PERMDYN queues. --ignoreErrors | -i : Ignore 'pcf' error codes 'damaged object' 'unknown object'. Sets RetCode to WARNING if this error encountered. --quiet | -q : Quiet mode, do not issue warning about unknown PCF attributes --oneLine | -1 : generate entire DEFINE command on one line (which does NOT include ALTDATE etc) --twoLines | -2 : on a 2nd line, generate the DEFINE as a comment (which DOES include ALTDATE etc) --saveSecurity | -z [file] : create 'security definitions (like amqoamd -s)' in file 'file'(only >=V6) if not specified, defaults to \"qmgrname\".AUT --saveSecurityNoHeader | -Z [file]: same as -z only without the header line --commandServerQ | -cs [queue]: the name of the Command Server Input queue, defaults to SYSTEM.ADMIN.COMMAND.QUEUE --version | -v version : determines which version of MQSC to generate and can be '2','5','51','52','53','6', or '7' The default is to generate mqsc at the version of the connected queue manager See "Notes on the '-v' flag" in this document before using this flag. The Client version of this program supports these additional flags: If either the -a or -x switch is used, then MQCONNX will be used for the client connection --hostname | -a host : is the address of the host for a client connection (default is "localhost") --channel | -x channel : is the SVRCONN name for a client connection (default is "SYSTEM.DEF.SVRCONN") --sslCipher | -C cipher spec : indicates to use an SSL cipher spec for this client connection --keyRepos | -k key repository : name of key respository directory if using SSL for client connection --channelExitX | -eX channel exit: X = 'y' for security, 's' for send, 'r' for receive --channelDataX | -dX channel exit data: X = 'y' for security, 's' for send, 'r' for receive.
Comments
Post a Comment