How to determine if Reorg Required

Forums for specific tips, techniques and example code
Michael.Duraj
Posts: 30
Joined: Fri Jun 17, 2011 12:55 pm

How to determine if Reorg Required

Postby Michael.Duraj » Tue Sep 24, 2013 1:51 pm

Occasionally consultants, clients use jadLoad.exe to import a patch sometimes they forget to change Load Style: -> Current Schema version.
This can leave the system in a state where a reorg is required.

Is there a Jade utility that I can use that will show me if any of my schemas require a reorg?

Edit: I would like not to have to copy the system across and crack it and bring up a developement front end to see if any schemas are in need of a re-org.
Ideally a jade utility that can interrigate the status of a LIVE system.

allistar
Posts: 156
Joined: Fri Aug 14, 2009 11:02 am
Location: Mount Maunganui, Tauranga

Re: How to determine if Reorg Required

Postby allistar » Tue Sep 24, 2013 2:18 pm

The Schema class has a property on it called "needsReorg". You could write a script that iterates all schemas and checks this flag, returning a particular result is any are set to true.

Michael.Duraj
Posts: 30
Joined: Fri Jun 17, 2011 12:55 pm

Re: How to determine if Reorg Required

Postby Michael.Duraj » Tue Sep 24, 2013 6:36 pm

Cheers Allistar, was hoping for something like jdbUtil to be able to detect and do a reorg.
Occasionally a consultant will use jadLoad and and unknowingly leave the DB requiring a reorg. In this case when the Consultant realises they use the batch file below;

Script

Code: Select all

vars schema : Schema; begin foreach schema in Schema.instances do write schema.name & ".needsReorg = " & schema.needsReorg.String; endforeach; end;
ReOrg via batch file - Search and Replace <JadeDir>

Code: Select all

C:\<JadeDir>\Bin\jadclient path=C:\<JadeDir>\System ini=<JadeDir>\jadegt.ini server=singleUser schema=RootSchema app=JadeReorgApp endJade action=initiateReorgAllSchemas Pause

allistar
Posts: 156
Joined: Fri Aug 14, 2009 11:02 am
Location: Mount Maunganui, Tauranga

Re: How to determine if Reorg Required

Postby allistar » Wed Sep 25, 2013 9:20 am

It's possible that you can call that JADE method from a batch file (by defining an app that runs that method) that returns a particular exit code if any schema needs reorg). The batch file would detect that particular exit code and invoke jadloadb as required. This would allow the process to be automated.

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: How to determine if Reorg Required

Postby JohnP » Wed Sep 25, 2013 10:40 am

Doesn't your initiateReorgAllSchemas batch file detect and do any reorgs? Why not just run that?

Michael.Duraj
Posts: 30
Joined: Fri Jun 17, 2011 12:55 pm

Re: How to determine if Reorg Required

Postby Michael.Duraj » Wed Sep 25, 2013 4:46 pm

Doesn't your initiateReorgAllSchemas batch file detect and do any reorgs? Why not just run that?
I had a live system using RPS to synch to a secondary server, my Data Pump had halted with "Schema is in reorg transition"
I suspected someone ran a jadLoad and left the primary and therfore the secondary system in need of a reorg.

When a consulatant does this they tend not to realise, so I was after a passive way to detect the case that one of my schemas needed a reorg.
We would of run the batch file after hours.. but I wondered is there a Jade utility that can show me that I really need to reorg, if that was the case I would know that someone has ran a jadload incorrectly.

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: How to determine if Reorg Required

Postby JohnP » Wed Sep 25, 2013 5:20 pm

Oh. Based on your previous reply "Cheers Allistar, was hoping for something like jdbUtil to be able to detect and do a reorg" I thought you wanted something to go ahead and do it.

In that case, an app that displays the number of schemas needing reorg sounds like the best solution to me.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 9 guests