5 Replies Latest reply: Jun 27, 2014 10:22 AM by Winter Zhang RSS

    db_verify on multiple files

    user8852304

      I tried to check out a few database files from the directory by running the db_verify utility like this:


           # db_verify -o ./mypath/*


      Got the message that all the files are normal. Although clearly present in the catalog files that are not database files

      (for example db.h header file from source code of BDB).


          BDB5105 Verification of db.h succeeded.


      If I run separately for each file, it returns the expected result.


          # db_verify -o ./mypath/db.h

          db_verify: BDB0522 Page 0: metadata page corrupted

          db_verify: BDB0523 Page 0: could not check metadata page

          db_verify: ./mypath/db.h: BDB0090 DB_VERIFY_BAD: Database verification failed

          BDB5105 Verification of ./mypath/db.h failed.

       

      Is it a bug, or need to another way to check DB files via db_verify utility?

       

      Thanks in advance.

        • 1. Re: db_verify on multiple files
          Winter Zhang

          Hi,

           

          Could you tell us the version you are using and the platform that you are running db_verify on ? We fixed some bugs in db_verify during the past several releases, so the issue is probably fixed if you are using an old version.

           

          Regards,

          Winter, Oracle Berkeley DB

          • 2. Re: db_verify on multiple files
            user8852304

             

             

            I'm using version 6.0.20. But in the version 6.0.30 observed the same behavior. Target system QNX 6.5.0

             

            • 3. Re: db_verify on multiple files
              Winter Zhang

              Hi,

               

              I can not reproduce the case you mentioned, but as I check the output and the code, I see there is a bug in the code when verifying multiple files. We will look into the issue carefully and fix it, and thanks for reporting the issue.

               

              About the case you see message of 'success', what I can guess is that, the first file of  './mypath/* ' expanded by shell is a valid database file.  The bug in db_verify always checks the first file, although it looks like checking each file by looking at the message. If you run command like 'db_verify -o ./mypath/*.h', you will see all files fail, and the first file occurs again and again in the error message.


              As the issue does not happen when verifying single file, I suggest not verifying multiple files for a single command if you need the correct behavior from db_verify.


              Regards,

              Winter, Oracle Berkeley DB



              • 4. Re: db_verify on multiple files
                user8852304

                In my case, listing normal database files along with the incorrect (*.h) file. Apparently the first check returns success (good database file), and the following was already at the *.h file, but due to an error returns success.


                If you use the option './mypath/*', then all lines with the text "success" different, ie for each line corresponds different filename in the directory (no duplicates names in result message).
                And if you specify as. './mypath/*.h', then the files are the same, just like you said.


                I'll wait for fixes, and as a temporary solution will check each file separately.


                Thanks for the quick reply.

                • 5. Re: db_verify on multiple files
                  Winter Zhang

                  Hi,

                   

                  We've committed a fix into all the branches we maintain. So the issue will be fixed in next patch release for all current supported branches. But if you need it currently, please just send a mail to me and specify the version that you are using, and I will send the diff file back.

                   

                  My address is winter.zhang@oracle.com

                   

                  Regards,

                  Winter, Oracle Berkeley DB