Db2

Db2

Connect with Db2, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Understanding Backup Image File Name Format

    Posted Mon August 07, 2023 10:13 AM

    >>> In a DB2 host, backup image files are stored in format, " SAMPLE.0.db2inst1.DBPART000.20230723133415.001 " ( example ).

    1.  What is the significance or meaning of each of the elements constituting the name of this file. I mean the first element " SAMPLE " specifies the name of the database, similarly the third element " db2inst1 " specifies the name of the instance. What do the other elements mean? Major doubt is on the second and fourth elements ( 0 and DBPART000 in this example ).

    2. For the same file format , the last option( 001 in our case ) signifies the session number. Is this limited to only 3 digits? If the number of sessions are like 1000 or even greater, what would be displayed here?

    3. While restoring a database from the backup images using "db2 restore database <SourceDB> from <FileDirectory> taken at <BackupTimeStamp> into <TargetDB>" command. Does it always look for Backup files in the above format in example? When I had renamed the Backup or Log Files, the restore didn't work. Is this the only allowed file format while restoring?



    ------------------------------
    Yateesh Thota
    ------------------------------


  • 2.  RE: Understanding Backup Image File Name Format

    Posted Mon August 07, 2023 11:03 AM

    Please review:

    https://www.ibm.com/docs/en/db2/11.5?topic=recovery-backup



    ------------------------------
    Jan Nelken
    ------------------------------



  • 3.  RE: Understanding Backup Image File Name Format

    Posted Mon August 07, 2023 10:46 PM

    Thank you very much for early reply.



    ------------------------------
    Yateesh Thota
    ------------------------------



  • 4.  RE: Understanding Backup Image File Name Format

    Posted Thu August 10, 2023 08:07 AM
    • Database Name (SAMPLE): As you've correctly identified, the first element, "SAMPLE" in our example, represents the name of the database being backed up.

    • Backup Mode (0): The second element, which is "0" in our example, denotes the backup mode. A value of "0" typically represents an offline backup, while a value of "1" would signify an online backup. Offline backups are taken when the database is deactivated and no applications are connected. Online backups, on the other hand, are taken while the database is active and operational.

    • Instance Name (db2inst1): The third element, "db2inst1" in our example, specifies the name of the DB2 instance under which the database runs.

    • Database Partition (DBPART000): DB2 supports database partitioning (DPF or MPP), which allows data to be divided across multiple servers or storage systems. "DBPART000" in our example refers to the specific partition number of the database. For a non-partitioned database, this would typically be "DBPART000", but in partitioned environments, you might see "DBPART001", "DBPART002", and so on.

    • Timestamp (20230723133415): The timestamp, "20230723133415" in our example, indicates when the backup was taken. This is formatted as YYYYMMDDHHMMSS.

    1. Session Number (001):
    • The last component, "001" in our example, does indeed represent the session number. It's essentially a sequence number for backup operations.

    • While traditionally represented with three digits, if the number of sessions surpasses 999, DB2 does extend to accommodate more. So, a session number of 1000 would be displayed as "1000".

    1. Restoring and Filename Format:
    • Yes, when executing a restore command, DB2 expects backup files to be in the standard naming convention it uses for its backup images. The naming convention assists DB2 in quickly identifying the necessary files.

    • If you rename a backup or log file, DB2 won't be able to locate it during the restore process. Hence, it's generally not recommended to rename backup or log files unless there's a specific use case and you're sure about what you're doing.

    • If you have a genuine need to rename these files, you would typically have to specify the exact filename or provide additional parameters when performing the restore operation to ensure DB2 can locate the files.



    ------------------------------
    Youssef Sbai Idrissi
    Software Engineer
    ------------------------------



  • 5.  RE: Understanding Backup Image File Name Format

    Posted Thu August 10, 2023 10:36 AM

    Hi Yussef!
    You copied and pasted here as a reply part of page from the link I posted here 2 days ago. Any specific reasons?



    ------------------------------
    Jan Nelken
    ------------------------------