Automating packdisk and checktable?

Database

Automating packdisk and checktable?

Automating packdisk and checktable?

Is there a way to use k shell to automate packdisk and checktable functions? If so can someone point me in the right direction for a template script?

Thanks
3 REPLIES

Re: Automating packdisk and checktable?

yes thers a way in which you can automate.
have u heard of CNSRUN utility.
if no u can get it from the documents and then create a batch file and schedule it ...

regards
TD_DBA

Re: Automating packdisk and checktable?

As an example, to run packdisk, first you need to decide what is the criteria on which u need to pick the tables to pack .

The below command will list tables occupying more than 100 cylinders with an FSP of 50, and if packed to an FSP of 25 , returning at the least 10 cylinders
cnsrun -utility ferret -commands '{ENABLE SCRIPTMODE} {SHOWF -a -c 100 -d 25 -m 50 -r 10} {Y} {QUIT}' -debug 1 > ferr.op

you can then use this output, do some shell greek and generate a packdisk script which looks like this ...

ENABLE SCRIPTMODE
SHOWS
SCOPE TABLE "MYDB1.TABL1" 0
PACKDISK FSP = 25
Y
SCOPE TABLE "MYDB2.TAB2" 0
PACKDISK FSP = 25
Y
...

SCOPE TABLE ALL
SHOWS
QUIT

And run packdisk using the above script.

cnsrun -utility ferret -file packDiskScrip.txt -debug 1

By reducing the number of table you actually run packdisk on, you end up reducing the runtime as well as resource usage ...

Re: Automating packdisk and checktable?

Where do I download the  GSCTOOLS ?