Solved

as400 i5 restore data library with no logical files to system with logical files

Posted on 2008-10-27
6
2,140 Views
Last Modified: 2013-12-06
General scenario:

*  I have two as400 i5 systems with identical data library structure and physical files.
*  Development system has new logical files against the physical files.
*  Production system does not have those new logical files.
*  I need to restore (refresh) from production data library to same development library.

*  Specific scenario 1:  the new logical files on the development system are in the same library as the physical files on the development (and corresponding) library in production

*  Specific scenario 2:  the new logical files on the development system are in a different library than the physical files on the development (and corresponding) library in production

Additional information:
*  I am not the as400 i5 systems manager but I was notified that the most recent restore from production to development of the data library failed because the new logical files in development were in a different library than the physical files
*  The new development logical files were deleted from development and the restore was successfully performed.
*  The new logical files have been recreated on the development system so that they now reside in the same library as the physical files

Special information:
*  The new logical files were created automatically by the i5 os as a result of SQL "create index" commands.
*  They are not like old-fashioned logical files in that they do not have DDS source files.
*  I have found that they could have DDL source files, but they do not at this time.

Questions:
*  The as400 i5 systems manager is capable but relatively new to the as400 i5.  He did not have detailed information about the problem.  What might have been the problem?
*  Was the problem related to the fact that the development logical files in question where in a different library than the physical files, and the restore of just the data library failed because of that?
*  Will placing the new logical files on the development system in the same library as the physical files fix the problem?
*  Is the problem actually that logical files exist on the development system and not on the production system?
*  If restoring just a data library from production to development, must any logical files on the development system have to already exist in the production library being restored?
*  Will the development logical files that do not exist in production be wiped out upon restore from production to development?
*  How does the fact that these new logical files are not traditional DDS logical files fit into the scenario in general.

I know that some of the questions above may be redundant or inter-related, but I am trying to nail down just what I need to do to ensure that development library restore/refresh from production does not prohibit logical file creations in development.
Also, my question applies to traditional logical files as well as new DDL logical files.  The answer may be the same or not.  I apologize for the broad nature of this question.  I am hoping that there is a general answer that applies to all logical files regardless of type.

Thank you for any and all help, as we are about to restore/refresh from production to development again very soon and I need some guidance in this area.
0
Comment
Question by:richard_crist
6 Comments
 
LVL 4

Expert Comment

by:LewisPower
ID: 22813486
Hi Richard,

The logical files are linked to the physical files (database relation). When you do the restore, the physical file need to exist before the logical files could be restored, that doesn't matter if they are in the same library or not. That's why you don't see your logical files.

So what you could do (because I don't think you'll change the name of all your logicial files to be sure they will be restored after the physical files) is to do the restore twice. The first time, the system will do the physical files and the second will do the logical.

Lewis

PS I know you had a couple of questions, but this answer could you make understand the logic behind that and might answer to almost everything. Let me know if you still need help !
0
 
LVL 3

Author Comment

by:richard_crist
ID: 22813904
Lewis,

I think your comment answers my general question.  Let me paraphrase to see if I understand what you mean.

Since my logical files are named alphabetically before my physical files (FL* versus FP*) the first restore will get the physical files and the second time will populate or verify the logical files.  This is true and will work ok even if the logical files are not in the same library.

Is my understanding correct?

Also, what about the logical files in development but not in production and production is restored to development?  And are the new-fangled DDL SQL-based logical files any different when it comes to restoring?

Thank you for your help!  :)


0
 
LVL 4

Expert Comment

by:LewisPower
ID: 22814401
Richard,

As fas as I know, it will work. If your file named ABCDP and the logical file is ABCDL1 by example, the logical name is before the physical. So when you do a restore, the system try to restore ABCDL1 first. And a logical file is a logical file. It could be done from DDS or SQL, doesn't matter.

For you development environment. You will not be able to restore a file if you still have logical ones attached to you physical. You have to delete these links first. If you goal is just to 'refresh' data in your physical file, you might consider restoring to another library (a temp library) and than copy the data from this temp file to the real one. If you have too many files, than you should consider what would be the easiest way of doing it. Refreshing everything and than recompile the logical files or restoring in one lib than copy...

Lewis
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 34

Accepted Solution

by:
Gary Patterson earned 300 total points
ID: 22816262
The rules or restoring depend on a number of factors, so it is best that you refer to the Backup and Recovery Guide for your OS version to investigate your particular scenario, but in general, assuming all of the objects are at the same level, and have the same creation dates, then you just basically need to restore physicals first and then logicals.  For the best, easiest to manage, least error-prone results, related physicals and logicals should be created in the same library  

When you are doing a backup specifically for this type of restore, It works the best if you back up everything together at once (SAVOBJ or SAVLIB), saving access paths to avoid a big rebuild at restore time, then just restore the objects at once using a single command if possible (to the same library or you can specify another library).

If the logicals exist in the same library as the physicals, and are being restored with the same restore command, then the system will restore them in the correct order (physicals then logicals).  If the physicals and logicals were saved srom the same library, and you restore them to a DIFFERENT library on another machine, they will "find" each other if you restore physicals first and logicals second, or restore them both using the same RST* command.

If the physical and logicals exist in different libraries, or if you are restoring using two different commands, then you need to take steps to make sure that the physicals are restored first.

The basic rule is to restore in this order when restoring database-related objects:

Journals
Journal receivers
Physical files
Logical files

Because of this, and because of the fact that when SAVLIB(*NONSYS) saves libraries in alphabetical order, if any of these objects are stored in different libraries, it is a "best practice" to adopt a naming standard that puts the libraries in the proper order:

PRODDBJ - Journals
PRODDBR - Receivers
PRODDBT - Tables (Physicals)
PRODDBX - IndeXes (Logicals)

It is very common (most shops) to store physicals and logicals together in a single library.  Sometimes, you may create a view, a multi-format logical, or a join logical over physical files (tables) in different libraries.  If so, put the logical in the last library alphabetically, or create a "last-place" library for these special logicals:

PROXDBX - Cross-library logicals

Answers to your specific questions:

Q:  The as400 i5 systems manager is capable but relatively new to the as400 i5.  He did not have detailed information about the problem.  What might have been the problem?
A: Most likely he attempted to restore logicals before the depended-upon physicals were restored.  The restore job log would provide specific, detailed diagnostics of the problems that occurred in the restore process, so the real answer is "see the joblog".
 
Q:  Was the problem related to the fact that the development logical files in question where in a different library than the physical files, and the restore of just the data library failed because of that?
A: Probably.  Again, the real answer to this lies in the restore joblog.

Q:  Will placing the new logical files on the development system in the same library as the physical files fix the problem?
A: Probably.  That is the least-error-prone configuration.

Q:  Is the problem actually that logical files exist on the development system and not on the production system?
A:   No.  You can restore logicals that don't exist on one system from another.

Q:  If restoring just a data library from production to development, must any logical files on the development system have to already exist in the production library being restored?
A: No.

Q:  Will the development logical files that do not exist in production be wiped out upon restore from production to development?
A:  No.  Objects in the target library that do not exist on the backup media are not altered or deleted.
 
The i5/OS Backup and Recovery Guide is a great resource for questions like this.  Anyone responsible for or interested in System i backup and recovery should read it.:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books/sc415304.pdf

- Gary Patterson
0
 
LVL 14

Assisted Solution

by:daveslater
daveslater earned 200 total points
ID: 22821405
what I would do is:
clear the test physical files to save disk.
Restore the live Physical files  on to Test in a new library
issue a a CRTDUPOBJ command on the logical files in the original test library to the newly restored library.

The OS will create the index on correct physical - assuming the logical file / SQL table View are in the same library as the physical file.

rename/delete the original data library, then rename the newly restored library.


Example

Lib1 is the data library
Save Lib1 from ptoduction
clear Lib1 on development
Restore Lib1 to Lib1New
CRTDUPOBJ OBJ(MYLFs) FROMLIB(LIB1) OBJTYPE(*FILE) TOLIB(LIB2)    
delete lib1
rename lib1New to LIb1


Dave
0
 
LVL 3

Author Closing Comment

by:richard_crist
ID: 31510329
I split points between Gary and Dave.  Gary gave detailed answers with reference to the manual.  Dave gave answer that we can implement right now while we move to the information from Gary.  I will pass this information on to the i5 systems manager for review.  It will probably help quite a bit.  Thank you!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now