Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

File in use crashed the backup CPF3156 - How to find what held the file open

Posted on 2011-10-14
12
Medium Priority
?
2,171 Views
Last Modified: 2013-12-06
Hi,

See screenshot - a file was open and inuse while the backup was running and it failed.
As part of the backup we stop qinter and qbatch so no one can login.

Is there anyway of finding what held the file open during the backup.

Tks, Joe
error.png
0
Comment
Question by:joe90kane
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 13

Expert Comment

by:_b_h
ID: 36968023
Check the job log of the backup for more messages that might explain the problem. The object is in use and the job log may say what job had the object locked.

For example, CPF32B3 would say something like this:

Message . . . . :   Cannot allocate object for file QCMDSRC in BLIB.          
Cause . . . . . :   The save operation was not performed for member CALC file
  QCMDSRC in library BLIB type *FILE, because it is allocated by job          
  069856/QSECOFR/QPADEV000G. Recovery  . . . :   Try the request again when  
  the object is available.                                                  

If you need more help, post back the job log!
Barry
0
 
LVL 36

Expert Comment

by:Gary Patterson
ID: 36968608
If QINTER an QBATCH were down, perhaps there was a server job that allowed a client program (using ODBC or JDBC for example) to access the file.  If the job is QZDASOINIT or QZDASSINIT, then that is what happened.  You probably want to end these type of host server jobs (and other problem services like FTP) during your backups as well.

- Gary Patterson
0
 
LVL 27

Accepted Solution

by:
tliotta earned 1200 total points
ID: 36970130
And note that QZDASxINIT server jobs may hold locks even after the client has finished. There might have been nothing actually going on at the time of the backup.

Use ENDHOSTSVR *DATABASE to end inactive database server jobs before backups begin and to prevent new connection requests. Then use STRHOSTSVR *DATABASE when backups are done. If you use the ENDACTCNN(*DATABASE) parameter for ENDHOSTSVR, then active connections will also be ended.

Use ENDHOSTSVR *FILE if you also want to backup IFS directories.

For the question, it might not be possible to learn what held the lock. The system history log might tell you something about what jobs were running. If you have job accounting active, more job detail would be available. If the file is journaled or if it is enabled for object auditing, either the file's journal or the system audit journal might give answers.

There are numerous possibilities; but without knowing what is configured on the system, there's no way to know what's available to you. If a feature hasn't been enabled, it won't log its info.

Tom
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 36972797
What you can do (before starting the backup) is to claim the library by locking it exclusive.
 -  it will be locked and no program will be able to use it.
 - or if it returns with an error, one or more objects are in use.

When the library is in use, you can list what objects are invloved and whar jobs are locking these objects.
on that basis you can decide if you like to wait or kill the jobs.

0
 
LVL 1

Author Comment

by:joe90kane
ID: 36972896
tliotta - Your suggestion of ENDHOSTSVR *DATABASE how would I implement this? I have the backup setup through the i Series navigator.
0
 
LVL 16

Assisted Solution

by:theo kouwenhoven
theo kouwenhoven earned 800 total points
ID: 36973418
Hi Joe,

How do you stop your subsytems If QINTER, QBATCH and probably QCMN?
to do the backup the right way, I advice to write a CL program, to end the subsytems,
end the hostsrver, start the backup and at the end start everything again.

You can schedule that cl.

0
 
LVL 1

Author Comment

by:joe90kane
ID: 36978315
Hi murphey2,

I totally new to CL programming, would you be able to guide me through setting this up or if there is a built in backup program that supports ENDHOSTSVR & STRHOSTSVR

Thanks, Joe
0
 
LVL 16

Assisted Solution

by:theo kouwenhoven
theo kouwenhoven earned 800 total points
ID: 36978462
The easiest way to create CL's is via  PDM, cl is a language that is comparable with PC *.bat files, you can include a sequence of OS commands.
The big difference is that you can compile CL and you can prompt all commands.

You start your CL source with PGM and ends it with ENDPGM.

A CL to end the host server can look like this:

PGM

ENDHOSTSVR SERVER(*DATABASE) 

ENDPGM

Open in new window


(You can also decide to end subsystem QSERVER )

After typing the command ENDHOSTSVR you can press F4 for prompting and use F1 on every field for detailed help text. There is syntax checking per line and the logic will be checked during compilation :-)
(Yes that is why OS400 is so much better then everything else)

Backup on the iSeries,
You can write a CL to backup every library like:

SAVLIB LIB(MYLIB1)  DEV(TAP01)  ENDOPT(*LEAVE)            
SAVLIB LIB(MYLIB2)  DEV(TAP01)  ENDOPT(*LEAVE)            
SAVLIB LIB(MYLIB3)  DEV(TAP01)  ENDOPT(*REWIND)

or

SAVLIB LIB(MYLIB1 MYLIB2 MYLIB3)  DEV(TAP01)  ENDOPT(*REWIND)

or an other option is with the RUNBACKUP command,
here you can predefine daily, weekly and monthly backupjobs, that can bestarted with only one command.

Just chek that with GO BACKUP

The complete CL should do the following:

End subsystems QBATCH, QINTER and (eventually) QSERVER and QCMN
Start the backup
Start the subsystems

Be sure that this job in not running in one of the subsystems that you will end.
I advice to use QCTL or make your own subsystem QBACKUP

If you know what you like to do, one of us will help you with the CL...






             












0
 
LVL 36

Expert Comment

by:Gary Patterson
ID: 36980514
A "restricted state backup" is the simplest and safest way to do a backup.  Basically, you end the system down to "single user" mode (ENDSBS *ALL from the console), and then run your backup.  GO SAVE, Option 21 is a full system backup that ends the system to a restricted state before performing the backup.  Of course, this means that no other work will be allowed to run on the system for the duration of the backup, but it also ensures that things like object locks don't occur.

After the backup completes, you STRSBS QCTL (or whatever your controlling subsystem is), and the system restarts, typically ready for users.

AS/400 backup, as with any complex multi-user system backup process, has some complexities that it is important to understand if you are responsible.  A backup that you cannot restore from isn't very valuable.  It is really important that you take the time to either train yourself, get trained, or have an experienced AS/400 backup expert help you get your backups set up properly.

The Backup and Recovery Guide for your OS version is a great resource, and you should take the time to familiarize yourself with it's contents.  It will answer a lot of your Backup and Recovery related questions.

Here's a link to the V5R4 manual:  http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books/sc415304.pdf

- Gary Patterson
0
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 1200 total points
ID: 36981639
When someone is put in charge of maintaining backup procedures and has no experience with CL programming, the implication is that the site isn't particularly busy during off-hours. That isn't guaranteed, of course, but backup procedures can have a pretty complex relationship with applications that want to use files.

If the system is usually quiet during the backup timeframe, Gary's suggestion is probably a useful one. It tends to handle everything needed without extra programming. It's perhaps excessive in that it saves more than what's needed and in that it can use more media (more tapes or whatever). But it can also work when expertise doesn't exist yet.

Can you describe the general environment? How much DASD is in use? How much off-hours work does the system do? (Many hours of night jobs? Remote clients always doing work, e.g., SQL Server connections or web server?)

Tom
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 36981987
I agree, but most of the time (on production systems) you only like to backup the production files daily and not make a full backup of everything.
At the customer site I work now, all production files are backedup daily, all user libraries (program libraries) weekly and a total save monthly.. I think that's not too bad?

0
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 1200 total points
ID: 36983609
@Murph:

No, not bad at all -- it's what I prefer.

But then I'm comfortable with the exception-passing message model, the handling of server jobs and their connections and many other details of the system; I won't be climbing over obstacles that may arise from any one of the commands on any given night because I can code for them ahead of time. A new CL programmer whose job might be affected might instead choose to be conservative.

If the system is easily available for the processing and media is available for storage, I'm comfortable with it. It could even reduce the number of necessary decisions should a wide restore ever be needed. The point of backups is in the restores. Always having things in one package can be a blessing.

Tom
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question