Tags: command, database, datatbase, db-name, db2, mysql, oracle, progress, query, rollforward, rundb2, sql, status, udb

Rollforward query status

On Database » DB2

5,217 words with 7 Comments; publish: Tue, 04 Dec 2007 23:18:00 GMT; (25046.88, « »)

Is it possible to run:

db2 rollforward datatbase db-name query status

command while rollforward is in progress? OS is NT and db is DB2 UDB V7 FP9

dollar

All Comments

Leave a comment...

  • 7 Comments
    • But when I run it it gives me the error message as:

      C:\PROGRA~1\SQLLIB\BIN>db2 rollforward database test user administrator using test query status

      SQL1035N The database is currently in use. SQLSTATE=57019

      what I am doing wrong here...

      dollar

      === Original Words ===

      cchattoraj

      Yes

      #2; Tue, 11 Dec 2007 17:52:00 GMT
    • Here's an excerpt :

      A database rollforward operation runs offline. The database is not available for use until the rollforward operation completes successfully, and the operation cannot complete unless the STOP option was specified when the utility was invoked.

      A table space rollforward operation can run offline. The database is not available for use until the rollforward operation completes successfully. This occurs if the end of the logs is reached, or if the STOP option was specified when the utility was invoked.

      You can perform an online rollforward operation on table spaces, as long as SYSCATSPACE is not included. When you perform an online rollforward operation on a table space, the table space is not available for use, but the other table spaces in the database are available.

      So for the database and offline rollforward of a tablespace, the answer is no, but for an online rollforward of a tablespace, the answer is yes. I thought it could be done since in my mind it should be reading the logctl.lfh file/s, however, it looks like it holds an exclusive lock on the database for db and offline rfwds. The other reason I thought it could be done was because it's supposed to give the names of the log files it is done with and the one's that it needs. Sorry about my previous post.

      #3; Tue, 11 Dec 2007 17:53:00 GMT
    • Actually I made use of the following command to get the required informaiton (rollforward command with query status did not work)

      db2 get snapshot for database test

      This command gave the output like this regarding rollforward operation along with other information:

      Database status = Rollforward

      Rollforward type = Database

      Rollforward last committed timestamp = 12-14-2003 00:06:20

      Rollforward log file being processed = 892702

      Rollforward status = Redo

      and thats exactly what I needed. All thanks to IBM folks and thanks cchattoraj for your time.

      dollar

      === Original Words ===

      cchattoraj

      Here's an excerpt :

      A database rollforward operation runs offline. The database is not available for use until the rollforward operation completes successfully, and the operation cannot complete unless the STOP option was specified when the utility was invoked.

      A table space rollforward operation can run offline. The database is not available for use until the rollforward operation completes successfully. This occurs if the end of the logs is reached, or if the STOP option was specified when the utility was invoked.

      You can perform an online rollforward operation on table spaces, as long as SYSCATSPACE is not included. When you perform an online rollforward operation on a table space, the table space is not available for use, but the other table spaces in the database are available.

      So for the database and offline rollforward of a tablespace, the answer is no, but for an online rollforward of a tablespace, the answer is yes. I thought it could be done since in my mind it should be reading the logctl.lfh file/s, however, it looks like it holds an exclusive lock on the database for db and offline rfwds. The other reason I thought it could be done was because it's supposed to give the names of the log files it is done with and the one's that it needs. Sorry about my previous post.

      #4; Tue, 11 Dec 2007 17:54:00 GMT
    • That is good to know. Is the system an MPP system?
      #5; Tue, 11 Dec 2007 17:55:00 GMT
    • No, the system is not MPP. We run DB2 UDB v7.2 FP 9 on windows system but database is around 300G and the number of files to apply were around 30,000. We were taking the backup image of our production system and restoring it on another slow machine. Rollforward was reading the logs currently being written out from our production system (overflow log path parameter). So the speed at which rollforward was processing the logs was much slower than the speed at which the new logs were generated.

      By looking at the snapshot output we were able to determine that we still has 20,000 logs to process and with new logs written it will never finish so we tricked the system by moving one of the log file temporarily and rollforward thought it's the end of logs and it stopped itself.

      dollar

      === Original Words ===

      cchattoraj

      That is good to know. Is the system an MPP system?

      #6; Tue, 11 Dec 2007 17:56:00 GMT
    • That must have been a tricky situation! I mean you could have been in the middle of a transaction and never realize it.

      I would be curious about what db2 would say on a db snapshot for an MPP system. Maybe someday I'll find out the way I don't want to.

      #7; Tue, 11 Dec 2007 17:57:00 GMT