cancel
Showing results for 
Search instead for 
Did you mean: 

Daily backup: how to detect non used libraries.

Former Member
0 Kudos

Hi,

We use a CL program with a list of SAVLIB commands to save all production librarires every day. The problem is that this CL has been mantained for several years and probably most of the saved libraries are not used anymore. I'm only responsible of the SAP backup lines.

How can I detect what libraries are not used now ? I've tried to look at the file attributes in this libraries but the backup itself mantains this fields.

Of course, I know that our functional people must know what is in use and what is obsolete, but in some cases the people that mantains applications has changed...

Any idea will be appreciated !!

Regards,

Joan B. Altadill

CELSA SAP Admin

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Joan,

I use a tool, that "sums up" the field ODUDAT of each obejct in the lib. On my systems, this works fine - at least I do believe that ... (dspobjd => *outfile)

Is this field update on your objects as well?

Regards

Volker

Former Member
0 Kudos

I use this method in iSeries Navigator, Run an SQL script:

<begin copy>


/*---   Display the objects in the library to an outfile.  Change the value of {sourcelib} to the desired library.   ---*/

CL:     DSPOBJD OBJ(sourcelib/*ALL) OBJTYPE(*FILE) DETAIL(*SERVICE) OUTPUT(*OUTFILE) OUTFILE(QTEMP/DSPOBJDTMP)  ;



/*---   List the objects in ascending order by LastUsedDate   ---*/

SELECT      ( Char(Date(Now())) CONCAT '  '  CONCAT  Char( Time(Now())) ) DataPulled,
     (CASE      WHEN ODCDAT = ' ' 
          THEN     ' '
          ELSE     (CASE      WHEN ODCCEN in ( '0' , ' ' ) 
                    THEN       '19' 
                         CONCAT SUBSTR(ODCDAT, 5, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODCDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODCDAT, 3, 2 ) 
                    ELSE     '20' 
                         CONCAT SUBSTR(ODCDAT, 5,2 )  
                         CONCAT '-' 
                         CONCAT SUBSTR( ODCDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODCDAT, 3, 2 ) 
               END )
     END) CreationDate,

     (CASE      WHEN ODUDAT = ' ' 
          THEN     ' '
          ELSE     (CASE      WHEN ODUCEN in ( '0' , ' ' ) 
                    THEN       '19' 
                         CONCAT SUBSTR(ODUDAT, 5, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODUDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODUDAT, 3, 2 ) 
                    ELSE     '20' 
                         CONCAT SUBSTR(ODUDAT, 5,2 )  
                         CONCAT '-' 
                         CONCAT SUBSTR( ODUDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODUDAT, 3, 2 ) 
               END )
     END) LastUsedDate,
     (CASE      WHEN ODSDAT = ' ' 
          THEN     ' '
          ELSE     (CASE      WHEN ODSCEN in ( '0' , ' ' ) 
                    THEN       '19' 
                         CONCAT SUBSTR(ODSDAT, 5, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODSDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODSDAT, 3, 2 ) 
                    ELSE     '20' 
                         CONCAT SUBSTR(ODSDAT, 5,2 )  
                         CONCAT '-' 
                         CONCAT SUBSTR( ODSDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODSDAT, 3, 2 ) 
               END )
     END) SavedDate,

(CASE      WHEN ODRDAT = ' ' 
          THEN     ' '
          ELSE     (CASE      WHEN ODRCEN in ( '0' , ' ' ) 
                    THEN       '19' 
                         CONCAT SUBSTR(ODRDAT, 5, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODRDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODRDAT, 3, 2 ) 
                    ELSE     '20' 
                         CONCAT SUBSTR(ODRDAT, 5,2 )  
                         CONCAT '-' 
                         CONCAT SUBSTR( ODRDAT, 1, 2 ) 
                         CONCAT '-' 
                         CONCAT SUBSTR( ODRDAT, 3, 2 ) 
               END )
     END) RestoreDate,
     ODCRTU CreatedBy,
     ODLBNM LibraryName,
     ODOBNM ObjectName,
     ODOBTP ObjectType,
     ODOBAT ObjectAttribute,
     ODSRCL SourceLibrary,
     ODSRCF SourceFile,
     ODSRCM SourceMember,
     (Case      When ODOBSZ = 9999999999 Then (ODSIZU * ODBPUN)
           Else ODOBSZ
     End) ObjectSize,
     ODOBTX ObjectText

FROM QTEMP.DSPOBJDTMP

Order BY LastUsedDate  ;

<end copy>

Copy/paste the code into the session, change the value of , and then Ctl+R to run all of the statements.

You can then view the results and determine if the objects haven't been used recently.

Hope this helps!

Robert

P.S. This forum doesn't show neatly formatted code as I have it in my script, but it does work.

Message was edited by: Robert Clay

added code tags

Former Member
0 Kudos

Hi Joan,

Perhaps is too late for an answer, but perhaps it would help to you.

Have a look to the commands GO BACKUP, CHGBCKUP and RUNBCKUP. With command CHGBCKUP, you can set, that you only want save change objects.

Regards

Eduardo Barrios

Compañía Cervecera de Canarias S.A.

Tfno. 922 568 246

Fax. 922 670 600

Correo ebarrios@ccc.es

Former Member
0 Kudos

Hi Joan,

Our approach is more political than technical...

First, consult the folks who should know the libraries most. WRKOBJLCK may confirm that nobody is accessing them.

Second, email everyone (IT and key business users/supervisors/managers) that those libraries will be backuped and deleted in a week or so, and "for any concern, please reply ASAP".

Third, backup (to SAVF or tapes) and delete/rename those objects, and send another email notifying it.

Last, clean up after 2 weeks or so, and keep the tape for at least a few months.

Good luck,

Victor Lin

Former Member
0 Kudos

Since you are saving at the library level and it's an 'all or nothing' for the library, you're going to have to look at the "last used date" for every object in the library.

I'd really push back to the development area to identify libraries no longer needed.

Technically, you should most likely backup the library because if it exists, it must be of importance and being used, otherwise it has no business taking up space on the box.

Doreen