ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » How do you know if dmpmqcfg produces a complete backup file?

Post new topic  Reply to topic Goto page Previous  1, 2, 3, 4  Next
 How do you know if dmpmqcfg produces a complete backup file? « View previous topic :: View next topic » 
Author Message
tczielke
PostPosted: Mon Nov 09, 2015 11:39 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

I just tried a simple error test with dmpmqcfg where I PUT disabled the SYSTEM.ADMIN.COMMAND.QUEUE (in a sandbox environment where this would not matter) and then ran the program and checked the return code status. It reported a zero (successful) return code, eventhough no output was created. So it looks like the return code reporting for dmpmcfg is not very reliable, so I would definitely not trust the return code for any type of assurance that it ran successfully.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Nov 09, 2015 11:47 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9392
Location: US: west coast, almost. Otherwise, enroute.

Any hint of problem in output?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
tczielke
PostPosted: Mon Nov 09, 2015 11:51 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

No, nothing was written to standard error or standard out and a zero return code was returned from the dmpmqcfg program. Not very good error reporting, for sure.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 09, 2015 2:18 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20695
Location: LI,NY

I usually try runmqsc display qmstatus first. It that returns fine, go for dmpmqcfg...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Mon Nov 09, 2015 4:26 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

fjb_saper wrote:
I usually try runmqsc display qmstatus first. It that returns fine, go for dmpmqcfg...


But you are still left wondering if dmpmqcfg actually worked 100%.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Mon Nov 09, 2015 4:32 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

I submitted an RFE:

Please vote by clicking on the below link.

http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=79539


Enhance MQ's dmpmqcfg command to allow us to determine whether it's output is complete

Description:
Currently there is no way to tell if the output of dmpmqcfg is complete. The output (if piped to a file) ends unceremoniously. You are left wondering if the last entry you are looking at is in fact the last entry the queue manager intended to provide. You also have no idea if the entries that are complete up to that point.

Please add a footer to confirm the end of the dmpmqcfg output. The footer should also give an indication of the number of records contained in the output. According this thread on mqseries.net, the dmpmqcfg command apparently exits with a zero completion code even if it does not get valid any response from the queue manager. That should be corrected as well. http://www.mqseries.net/phpBB2/viewtopic.php?t=71374&start=15

Use case:
I am writing a script to call dmpmqcfg in MQ Client mode to connect to all my QMs and take backups. This will be scheduled and run on its own. I am struggling to determine in a scripted and automated fashion, did the command actual work. We need the ability to check the results of dmpmqcfg and have some assurance the thing ran to completion and the output is correct and complete.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 09, 2015 8:51 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20695
Location: LI,NY

So voted !
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Wed Nov 11, 2015 11:23 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9392
Location: US: west coast, almost. Otherwise, enroute.

On a similar thread on the U of Vienna post site, I posted this:

Quote:
I would expect (hope) that the utility to return a non-zero return-code in situations where it would be impossible to produce results, for example: failure to connect to named qmgr, invalid -switch settings, missing parameters
.

https://listserv.meduniwien.ac.at/cgi-bin/wa?A2=ind1511&L=mqser-l&F=&S=&X=90D66B1C5563D98169&Y=brucelerner%40charter.net&P=15088
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Nov 11, 2015 12:39 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I agree that this is a good idea, and I'll go vote for the RFE.

But again, you know that the output file is complete when dmpmqcfg finishes executing. it won't write to the file any more, so the file is complete.

If the data in the file is not complete is an entirely separate question. The footer helps with that, in that it will tell you how many objects were produced.

But if you're not asking for system objects, and you haven't defined any non-system objects, then you will get zeros. This is the same result as if dmpmqcfg couldn't do the things it tried to do.

So you still have to know what you are expecting to get in order to tell if your output is complete. Much less if it's correct.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Nov 11, 2015 1:51 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

mqjeff wrote:
So you still have to know what you are expecting to get in order to tell if your output is complete. Much less if it's correct.


If I had something to compare to that was the authoritative source of what I should expect to see in the dmpmqcfg output, and I could do that validation in an automated scripted manner, I might ask myself, Why am I even bothering with dmpmqcfg? I'll just use my authoritative source to reconstruct the queue manager.

I think a header / footer upgrade with better exit code error handling would give us the ability to confirm in an automated fashion we have a dmpmqcfg output file that is complete in that it represents what the QM intended to convey to you per the command issued to it.

Using DataPower secure-backups as an example, that produces a set of files. If any of those files is missing or incomplete, the whole backup is useless. But they also provide a human readable file that lists the files you should expect to have, along with a byte count for each file. Not infallible, but something to check against to give yourself some assurance the backup file(s) you have are whole.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Wed Nov 11, 2015 4:26 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2491
Location: Melbourne, Australia

Here is a simple UNIX MQ backup script that detects errors by grepping for AMQ messages. It's not terribly robust and I'm not sure if this covers all failure cases.
Code:
dmpmqcfg -m $QMGR -x object -t all -o mqsc >$QMGR-object.txt 2>&1
dmpmqcfg -m $QMGR -x authrec -t all -o mqsc >$QMGR-authrec.txt 2>&1
dmpmqcfg -m $QMGR -x chlauth -t all -o mqsc >$QMGR-chlauth.txt 2>&1
dmpmqcfg -m $QMGR -x sub -t all -o mqsc >$QMGR-sub.txt 2>&1
grep ^AMQ *.txt

_________________
Glenn
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Nov 11, 2015 6:56 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9392
Location: US: west coast, almost. Otherwise, enroute.

Interesting (odd) that dmpmqcfg doc https://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.adm.doc/q083160_.htm identifies no return codes whatsoever.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
rammer
PostPosted: Thu Nov 12, 2015 1:51 am    Post subject: Reply with quote

Partisan

Joined: 02 May 2002
Posts: 359
Location: England

So what could be possible would be to do a dmpmqcfg, then pipe it in to a runmqsc -v command and if it says 560 commands were successfull for example and no failures or something like that, it would give some peace of mind that it has carried out a decent backup?
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Nov 12, 2015 4:50 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

rammer wrote:
So what could be possible would be to do a dmpmqcfg, then pipe it in to a runmqsc -v command and if it says 560 commands were successfull for example and no failures or something like that, it would give some peace of mind that it has carried out a decent backup?


Interesting idea. But notice the way the dmpmqcfg output ends today...it just ends with no indication that the last record shown is the last record intended.

If 560 commands were successful with that runmqsc -v verification, I would smile, than frown and wonder, Are there really only 560 objects that need to be recreated? Or are there 561 and for some reason the dmpmqcfg output was truncated.

If we had a footer that confirmed how many records were written that matched a header indicating that is how many were going to be written, we would know 560 is the number. And then running it thru runmqsc -v would confirm each record was viable.


I get it, you can never be 1000% sure the output is complete and acurate. Eventually you just have to trust the software. But currently the lack of exit codes and the lack of a header/footer summary makes it tough to determine in a scripted and automated fashion that the output is very likely complete.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Thu Nov 12, 2015 3:22 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2491
Location: Melbourne, Australia

[quote="PeterPotkay"]
rammer wrote:
... Are there really only 560 objects that need to be recreated? Or are there 561 and for some reason the dmpmqcfg output was truncated. ...


If you are concerned about all objects being dumped, you would need to keep a history of past successful dumps and do a delta every time it runs.
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3, 4  Next Page 2 of 4

MQSeries.net Forum Index » General IBM MQ Support » How do you know if dmpmqcfg produces a complete backup file?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.