Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Performance & Tuning (http://www.baanboard.com/baanboard/forumdisplay.php?f=61)
-   -   Help - Lost table data during reorganization (http://www.baanboard.com/baanboard/showthread.php?t=25852)

tuple9i 8th December 2005 21:06

Help - Lost table data during reorganization
 
Ran into a bit of a problem. I have been playing with the TTAAD4225M000 session to reorganize various tables. The first set were tables that showed chaining and then I went to another set of tables with empty_blocks=0. The first set of tables reorganized perfectly. Problem:

when I did the first table in the set that showed empty_blocks=0 (Number of never used blocks in the table), the reorg process appeared to go well. It produced the R.{tablename} file, reorged the table and the R.{tablename} file released. Well, when I checked the table, it appears that the data within the table is gone!

Initial Statistics:

TABLE_NAME INITIAL_EXTENT AVG_ROW_LEN CHAIN_CNT NUM_ROWS AVG_SPACE
--------------- -------------- ----------- ---------- ---------- ----------
TWHINH200750 65536 361 0 46340 739

After reorg:

TABLE_NAME INITIAL_EXTENT AVG_ROW_LEN CHAIN_CNT _ROWS AVG_SPACE
--------------- -------------- ----------- ---------- ---------- ----------
TWHINH200750 65536 0 0 0 0

The R.{tablename} file no longer exists. It dissappeared after the reorg process completed. Please note: there were no errors generated during the reorg process and the process was not interrupted.

Database: Oracle 8.1.7.4
BaaN: Porting set - 7.1d.03 (heavily modified)

Help! Luckily this is a test database/BaaN app, so I lost no production data, but I have planned on doing this in prod very soon.

Thanks for your input

dave_23 8th December 2005 21:38

It looks like you're looking at dba_tables/user_tables to determine
# of rows..

do
select count(*) from <tablename>;

to see if they are really there.. if they are, then just run
analyze table <tablename> estimate statistics;

Dave

tuple9i 8th December 2005 22:39

Worked like a charm
 
Thanks, worked like a charm. Appreciate the feedback.

dave_23 9th December 2005 01:34

Great news!

There's a "bug/design flaw" the oracle driver. Baan will automatically
estimate statistics for you on your tables after they are created (if you use 0214 in your ora_storage) but it's tied to index creation.

So, in your case, if you run reconfig without the "fast" option then Baan will create the table, create the indexes, generate statistics then load the data.. So your statistics are on a table with no data.

I logged a bug on this a year or so ago and i think it was fixed in Baan 5 and up, but it was too much for them to do it in Baan 4 (especally when there is an easy workaround)

Dave

tuple9i 12th December 2005 15:11

Thanks for the info. Good tip.


All times are GMT +2. The time now is 13:29.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com