Page 1 of 1

How to determine if Reorg Required

Posted: Tue Sep 24, 2013 1:51 pm
by Michael.Duraj
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.

Re: How to determine if Reorg Required

Posted: Tue Sep 24, 2013 2:18 pm
by allistar
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.

Re: How to determine if Reorg Required

Posted: Tue Sep 24, 2013 6:36 pm
by Michael.Duraj
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

Re: How to determine if Reorg Required

Posted: Wed Sep 25, 2013 9:20 am
by allistar
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.

Re: How to determine if Reorg Required

Posted: Wed Sep 25, 2013 10:40 am
by JohnP
Doesn't your initiateReorgAllSchemas batch file detect and do any reorgs? Why not just run that?

Re: How to determine if Reorg Required

Posted: Wed Sep 25, 2013 4:46 pm
by Michael.Duraj
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.

Re: How to determine if Reorg Required

Posted: Wed Sep 25, 2013 5:20 pm
by JohnP
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.