Support for DB2 databases?

sphericus

Joined: 2005-11-06
Posts: 55
Posted: Sun, 2007-06-17 16:20
valiant wrote:
g2 doesn't alter / specify tablespaces. if it changed, then it must have happened in your db2 v8 -> v9 migration.
and yes, the above error looks like it doesn't use your 32k pagesize tablespace anymore.

Just did some checking.

It seems that the primary site, in its original form on db2 v8 only used the 32k table spaces for the tables that were infact bigger than the 4k tablespace.

Admittedly I was a bit careless, as when I had created the 32k TS, I did not remove the default 4k tablespace from the database.

Since g2 does not specify the TS's on creation, everything makes sense now. I'll try to find a way to change the tablespace on those tables. Does g2, have an import export feature? As restoring a db2 backup doesn't allow me to change the tablespaces. And with the amount of tables and the presence of bit DATA, I'm not sure of the best ways to resolve this issue.

Hopefully if Larry or 73blazer read this they may have good some recommendations. As, anyone else that used the instructions for pre-FP9 and did not delete the 4k TS before installing g2, I assume will have this problem.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-06-17 17:28

- logging during installation / upgrade is done to a log file in your g2data/ folder.
- when running g2 (main.php), enable logged / immediate / buffered debug mode: FAQ: How to set/use Gallery in debug mode?
- if debug mode is disabled, at least set display_errors in config.php to 1 (is 0 by default).
- FAQ: What is the webserver error log?

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Larry Menard
Larry Menard's picture

Joined: 2005-10-01
Posts: 757
Posted: Mon, 2007-06-18 02:02

db2 error: [54010: [IBM][CLI Driver][DB2/LINUX] SQL0670N The row length of
the table exceeded a limit of "4005" bytes. (Table space "USERSPACE1".)
SQLSTATE=54010 SQLCODE=-670] in EXECUTE("ALTER TABLE g2_Schema ADD COLUMN
g_createSql VARCHAR(10000)")

I would try something like:

db2 rename table g2_schema to g2_schema_bak
db2 create table g2_schema like g2_schema_bak in <32k tsname>
db2 alter table g2_schema add primary key (g_name)
db2 insert into g2_schema select * from g2_schema_bak
db2 runstats on table xxxx.g2_schema with distribution and indexes all
db2 drop table g2_schema_bak

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-06-18 13:04

But the above doesn't change the default tablespace. Future upgrades will still trigger this problem unless the default tablespace is changed to a pagesize of 32k.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Larry Menard
Larry Menard's picture

Joined: 2005-10-01
Posts: 757
Posted: Mon, 2007-06-18 14:01

Yeah, DB2's default behaviour is to use the tablespace with the smallest pagesize that will fit the table at creation time. To make sure you always use the 32k tablespace, you'd have to either:

- create the database in such a way that all tablespaces are 32k in size (I'm pretty sure this can be done starting in DB2 v9, but I don't have a DB2 env in front of me right now... I'll look it up tonight)

- delete the default 4k USERSPACE1 tablespace before using the database

- Would it be that difficult to make G2 specify the tablespace in each CREATE TABLE statement, at least for DB2? The SQL syntax is simple, just add "IN <tablespace>", as in "CREATE TABLE G2_Schema IN tbspc32k".

 
Larry Menard
Larry Menard's picture

Joined: 2005-10-01
Posts: 757
Posted: Tue, 2007-06-19 12:25

Sorry I forgot to look into this last night.

The answer to this problem is already in the codex doc.

Since G2 now requires DB2 to create a database with all tablespaces and bufferpools having 32k pagesize, it is now mandatory to use the CREATE DATABASE command that has the PAGESIZE 32K parameter. Do not use the other set of commands.

Technically it should be possible to use the other set of commands as long as you add "db2 drop tablespace USERSPACE1", but it's much simpler to just use the single integrated command.

I would recommend removing that other set of commands from the codex doc, along with any other reference to DB2 V8.

Hope that helps.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2007-06-19 12:38

you know more about this stuff. please change the codex page as you see fit.
thanks!

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Larry Menard
Larry Menard's picture

Joined: 2005-10-01
Posts: 757
Posted: Tue, 2007-06-19 13:00

OK, will do... just wanted to make sure you are ok with that change.

 
sphericus

Joined: 2005-11-06
Posts: 55
Posted: Thu, 2008-01-03 15:16

Hi.

I noticed in your SVN log that you recently started deploying use of "Truncate TABLE" but was not able to for DB2, due to the fact that DB2 has no truncate table command.

I am not sure if you are aware, of this command, but it is something we use often.

ALTER TABLE <table> not logged initially with empty table

I am now also told, although we haven't used this new set of code in production yet, that "not logged initially" is no longer required, and can be removed.
The main issue was that, with nli, errors before the next commit would change the state of the table to something less than savory. Of which you can solve by performing commits right after the alter table. With recent changes it seems that you can forego the nli altogether however.

Hope it helps.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2008-01-03 18:23

@sphericus:

thanks for keeping an eye on our use of DB2!

we're using TRUNCATE TABLE only outside of transactions for now since most RDBMS can't handle TRUNCATE in transaction bodies anyway.
we keep using DELETE FROM ... when we need to truncate a table within a transaction.

given these requirements, i guess we can use your ALTER TABLE ... query without a commit. the query would be fired outside of a transaction body.

could you please file a bug at http://sf.net/projects/gallery/ -> trackers -> bugs, such that we don't forget about updating DB2Storage accordingly?
it's gonna be a low priority bug since it's just about improving performance and it makes the code a little uglier (gotta copy some code to Db2Storage.class).

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
sphericus

Joined: 2005-11-06
Posts: 55
Posted: Sat, 2008-12-06 00:35

Hi Again!

How have you been? I got a bit busy, and never did get around to filing that bug report. Before I do so, just wondering if it is still something that needs to be done?

Yesterday I decided to hide a few albums, with a "few" photos in them.

However, now any user that logs into gallery fails, due to this problem.

db2 error: [54001: [IBM][CLI Driver][DB2/NT] SQL0101N The statement is too long or too complex. SQLSTATE=54001 SQLCODE=-101] in EXECUTE(" SELECT iam0.g_itemId, COUNT(iam1.g_itemId) FROM g2_ItemAttributesMap AS iam0, g2_ItemAttributesMap AS iam1, g2_AccessSubscriberMap WHERE iam0.g_itemId IN (7,61,841,26041) AND G2_LIKE(iam1.g_parentSequence, RTRIM(CHAR(iam0.g_parentSequence)) || RTRIM(CHAR(iam0.g_itemId)) || RTRIM(CHAR('/%'))) = 1 AND iam1.g_itemId = g2_AccessSubscriberMap.g_itemId AND g2_AccessSubscriberMap.g_accessListId IN (14,64,1021,2561,5483,5486,6049,18187,19542,21953,21954,21955,21956,22101,22102,22103,22104,22105,22106,22107,22108,22109,22368,22369,22370,22488,25003,25004,25005,25006,25023,25024,25025,25026,26042,26043,26044,28721,28722,28723,29021,29022,29023,30001,30002,30003,31000,31001,31002,31003,31004,31005,31006,31007,31008,31009,31010,31011,31012,31013,31020,31021,31022,31023,31024,31025,31026,31027,31028,31029,31030,31031,31032,31033,31034,31035,31036,31037,31038,31039,31040,31041,31042,31043,31044,31045,31046,31047,31048,31049,31050,31051,31052,31053,31054,31055,31056,31057,31058,31059,31060,31061,31062,31063,31064,31065,31066,31067,31068,31069,31070,31071,31072,31073,31074,31075,31076,31077,31078,31079,31080,31081,31082,31083,31084,31085,31086,31087,31088,31089,31090,31091,31092,31093,31094,31095,31096,31097,31098,31099,31100,31101,31102,31103,31104,31105,31106,31107,31108,31109,31110,31111,31112,31113,31114,31115,31116,31117,31118,31119,31120,31121,31122,31123,31124,31125,31126,31127,31128,31129,31130,31131,31132,31133,31134,31135,31136,31137,31138,31139,31140,31141,31142,31143,31144,31145,31146,31147,31148,31149,31150,31151,31152,31153,31154,31155,31156,31157,31158,31159,31160,31161,31162,31163,31164,31165,31166,31167,31168,31169,31170,31171,31172,31173,31174,31175,31176,31177,31178,31179,31180,31181,31182,31183,31184,31185,31186,31187,31188,31189,31190,31191,31192,31193,31194,31195,31196,31197,31198,31199,31200,31201,31202,31203,31204,31205,31206,31207,31208,31209,31210,31211,31212,31213,31214,31215,31216,31217,31218,31219,31220,31221,31222,31223,31224,31225,31226,31227,31228,31229,31230,31231,31232,31233,31234,31235,31236,31237,31238,31239,31240,31241,31242,31243,31244,31245,31246,31247,31248,31249,31250,31251,31252,31253,31254,31255,31256,31257,31258,31259,31260,31261,31262,31263,31264,31265,31266,31267,31268,31269,31270,31271,31272,31273,31274,31275,31276,31277,31278,31279,31280,31281,31282,31283,31284,31285,31286,31287,31288,31289,31290,31291,31292,31293,31294,31295,31296,31297,31298,31299,31300,31301,31302,31303,31304,31305,31306,31307,31308,31309,31310,31311,31312,31313,31314,31315,31316,31317,31318,31319,31320,31321,31322,31323,31324,31325,31326,31327,31328,31329,31330,31331,31332,31333,31334,31335,31336,31337,31338,31339,31340,31341,31342,31343,31344,31345,31346,31347,31348,31349,31350,31351,31352,31353,31354,31355,31356,31357,31358,31359,31360,31361,31362,31363,31364,31365,31366,31367,31368,31369,31370,31371,31372,31373,31374,31375,31376,31377,31378,31379,31380,31381,31382,31383,31384,31385,31386,31387,31388,31389,31390,31391,31392,31393,31394,31395,31396,31397,31398,31399,31400,31401,31402,31403,31404,31405,31406,31407,31408,31409,31410,31411,31412,31413,31414,31415,31416,31417,31418,31419,31420,31421,31422,31423,31424,31425,31426,31427,31428,31429,31430,31431,31432,31433,31434,31435,31436,31437,31438,31439,31440,31441,31442,31443,31444,31445,31446,31447,31448,31449,31450,31451,31452,31453,31454,31455,31456,31457,31458,31459,31460,31461,31462,31463,31464,31465,31466,31467,31468,31469,31470,31471,31472,31473,31474,31475,31476,31477,31478,31479,31480,31481,31482,31483,31484,31485,31486,31487,31488,31489,31490,31491,31492,31493,31494,31495,31496,31497,31498,31499,31500,31501,31502,31503,31504,31505,31506,31507,31508,31509,31510,31511,31512,31513,31514,31515,31516,31517,31518,31519,31520,31521,31522,31523,31524,31525,31526,31527,31528,31529,31530,31531,31532,31533,31534,31535,31536,31537,31538,31539,31540,31541,31542,31543,31544,31545,31546,31547,31548,31549,31550,31551,31552,31553,31554,31555,31556,31557,31558,31559,31560,31561,31562,31563,31564,31565,31566,31567,31568,31569,31570,31571,31572,31573,31574,31575,31576,31577,31578,31579,31580,31581,31582,31583,31584,31585,31586,31587,31588,31589,31590,31591,31592,31593,31594,31595,31596,31597,31598,31599,31600,31601,31602,31603,31604,31605,31606,31607,31608,31609,31610,31611,31612,31613,31614,31615,31616,31617,31618,31619,31620,31621,31622,31623,31624,31625,31626,31627,31628,31629,31630,31631,31632,31633,31634,31635,31636,31637,31638,31639,31640,31641,31642,31643,31644,31645,31646,31647,31648,31649,31650,31651,31652,31653,31654,31655,31656,31657,31658,31659,31660,31661,31662,31663,31664,31665,31666,31667,31668,31669,31670,31671,31672,31673,31674,31675,31676,31677,31678,31679,31680,31681,31682,31683,31684,31685,31686,31687,31688,31689,31690,31691,31692,31693,31694,31695,31696,31697,31698,31699,31700,31701,31702,31703,31704,31705,31706,31707,31708,31709,31710,31711,31712,31713,31714,31715,31716,31717,31718,31719,31720,31721,31722,31723,31724,31725,31726,31727,31728,31729,31730,31731,31732,31733,31734,31735,31736,31737,31738,31739,31740,31741,31742,31743,31744,31745,31746,31747,31748,31749,31750,31751,31752,31753,31754,31755,31756,31757,31758,31759,31760,31761,31762,31763,31764,31765,31766,31767,31768,31769,31770,31771,31772,31773,31774,31775,31776,31777,31778,31779,31780,31781,31782,31783,31784,31785,31786,31787,31788,31789,31790,31791,31792,31793,31794,31795,31796,31797,31798,31799,31800,31801,31802,31803,31804,31805,31806,31807,31808,31809,31810,31811,31812,31813,31814,31815,31816,31817,31818,31819,31820,31821,31822,31823,31824,31825,31826,31827,31828,31829,31830,31831,31832,31833,31834,31835,31836,31837,31838,31839,31840,31841,31842,31843,31844,31845,31846,31847,31848,31849,31850,31851,31852,31853,31854,31855,31856,31857,31858,31859,31860,31861,31862,31863,31864,31865,31866,31867,31868,31869,31870,31871,31872,31873,31874,31875,31876,31877,31878,31879,31880,31881,31882,31883,31884,31885,31886,31887,31888,31889,31890,31891,31892,31893,31894,31895,31896,31897,31898,31899,31900,31901,31902,31903,31904,31905,31906,31907,31908,31909,31910,31911,31912,31913,31914,31915,31916,31917,31918,31919,31920,31921,31922,31923,31924,31925,31926,31927,31928,31929,31930,31931,31932,31933,31934,31935,31936,31937,31938,31939,31940,31941,31942,31943,31944,31945,31946,31947,31948,31949,31950,31951,31952,31953,31954,31955,31956,31957,31958,31959,31960,31961,31962,31963,31964,31965,31966,31967,31968,31969,31970,31971,31972,31973,31974,31975,31976,31977,31978,31979,31980,31981,31982,31983,31984,31985,31986,31987,31988,31989,31990,31991,31992,31993,31994,31995,31996,31997,31998,31999,32000,32001,32002,32003,32004,32005,32006,32007,32008,32009,32010,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32032,32033,32034,32035,32036,32037,32038,32039,32040,32041,32042,32043,32044,32045,32046,32047,32048,32049,32050,32051,32052,32053,32054,32055,32056,32057,32058,32059,32060,32061,32062,32063,32064,32065,32066,32067,32068,32069,32070,32071,32072,32073,32074,32075,32076,32077,32078,32079,32080,32081,32082,32083,32084,32085,32086,32087,32088,32089,32090,32091,32092,32093,32094,32095,32096,32097,32098,32099,32100,32101,32102,32103,32104,32105,32106,32107,32108,32109,32110,32111,32112,32113,32114,32115,32116,32117,32118,32119,32120,32121,32122,32123,32124,32125,32126,32127,32128,32129,32130,32131,32132,32133,32134,32135,32136,32137,32138,32139,32140,32141,32142,32143,32144,32145,32146,32147,32148,32149,32150,32151,32152,32153,32154,32155,32156,32157,32158,32159,32160,32161,32162,32163,32164,32165,32166,32167,32168,32169,32170,32171,32172,32173,32174,32175,32176,32177,32178,32179,32180,32181,32182,32183,32184,32185,32186,32187,32188,32189,32190,32191,32192,32193,32194,32195,32196,32197,32198,32199,32200,32201,32202,32203,32204,32205,32206,32207,32208,32209,32210,32211,32212,32213,32214,32215,32216,32217,32218,32219,32220,32221,32222,32223,32224,32225,32226,32227,32228,32229,32230,32231,32232,32233,32234,32235,32236,32237,32238,32239,32240,32241,32242,32243,32244,32245,32246,32247,32248,32249,32250,32251,32252,32253,32254,32255,32256,32257,32258,32259,32260,32261,32262,32263,32264,32265,32266,32267,32268,32269,32270,32271,32272,32273,32274,32275,32276,32277,32278,32279,32280,32281,32282,32283,32284,32285,32286,32287,32288,32289,32290,32291,32292,32293,32294,32295,32296,32297,32298,32299,32300,32301,32302,32303,32304,32305,32306,32307,32308,32309,32310,32311,32312,32313,32314,32315,32316,32317,32318,32319,32320,32321,32322,32323,32324,32325,32326,32327,32328,32329,32330,32331,32332,32333,32334,32335,32336,32337,32338,32339,32340,32341,32342,32343,32344,32345,32346,32347,32348,32349,32350,32351,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32362,32363,32364,32365,32366,32367,32368,32369,32370,32371,32372,32373,32374,32375,32376,32377,32378,32379,32380,32381,32382,32383,32384,32385,32386,32387,32388,32389,32390,32391,32392,32393,32394,32395,32396,32397,32398,32399,32400,32401,32402,32403,32404,32405,32406,32407,32408,32409,32410,32411,32412,32413,32414,32415,32416,32417,32418,32419,32420,32421,32422,32423,32424,32425,32426,32427,32428,32429,32430,32431,32432,32433,32434,32435,32436,32437,32438,32439,32440,32441,32442,32443,32444,32445,32446,32447,32448,32449,32450,32451,32452,32453,32454,32455,32456,32457,32458,32459,32460,32461,32462,32463,32464,32465,32466,32467,32468,32469,32470,32471,32472,32473,32474,32475,32476,32477,32478,32479,32480,32481,32482,32483,32484,32485,32486,32487,32488,32489,32490,32491,32492,32493,32494,32495,32496,32497,32498,32499,32500,32501,32502,32503,32504,32505,32506,32507,32508,32509,32510,32511,32512,32513,32514,32515,32516,32517,32518,32519,32520,32521,32522,32523,32524,32525,32526,32527,32528,32529,32530,32531,32532,32533,32534,32535,32536,32537,32538,32539,32540,32541,32542,32543,32544,32545,32546,32547,32548,32549,32550,32551,32552,32553,32554,32555,32556,32557,32558,32559,32560,32561,32562,32563,32564,32565,32566,32567,32568,32569,32570,32571,32572,32573,32574,32575,32576,32577,32578,32579,32580,32581,32582,32583,32584,32585,32586,32587,32588,32589,32590,32591,32592,32593,32594,32595,32596,32597,32598,32599,32600,32601,32602,32603,32604,32605,32606,32607,32608,32609,32610,32611,32612,32613,32614,32615,32616,32617,32618,32619,32620,32621,32622,32623,32624,32625,32626,32627,32628,32629,32630,32631,32632,32633,32634,32635,32636,32637,32638,32639,32640,32641,32642,32643,32644,32645,32646,32647,32648,32649,32650,32651,32652,32653,32654,32655,32656,32657,32658,32659,32660,32661,32662,32663,32664,32665,32666,32667,32668,32669,32670,32671,32672,32673,32674,32675,32676,32677,32678,32679,32680,32681,32682,32683,32684,32685,32686,32687,32688,32689,32690,32691,32692,32693,32694,32695,32696,32697,32698,32699,32700,32701,32702,32703,32704,32705,32706,32707,32708,32709,32710,32711,32712,32713,32714,32715,32716,32717,32718,32719,32720,32721,32722,32723,32724,32725,32726,32727,32728,32729,32730,32731,32732,32733,32734,32735,32736,32737,32738,32739,32740,32741,32742,32743,32744,32745,32746,32747,32748,32749,32750,32751,32752,32753,32754,32755,32756,32757,32758,32759,32760,32761,32762,32763,32764,32765,32766,32767,32768,32769,32770,32771,32772,32773,32774,32775,32776,32777,32778,32779,32780,32781,32782,32783,32784,32785,32786,32787,32788,32789,32790,32791,32792,32793,32794,32795,32796,32797,32798,32799,32800,32801,32802,32803,32804,32805,32806,32807,32808,32809,32810,32811,32812,32813,32814,32815,32816,32817,32818,32819,32820,32821,32822,32823,32824,32825,32826,32827,32828,32829,32830,32831,32832,32833,32834,32835,32836,32837,32838,32839,32840,32841,32842,32843,32844,32845,32846,32847,32848,32849,32850,32851,32852,32853,32854,32855,32856,32857,32858,32859,32860,32861,32862,32863,32864,32865,32866,32867,32868,32869,32870,32871,32872,32873,32874,32875,32876,32877,32878,32879,32880,32881,32882,32883,32884,32885,32886,32887,32888,32889,32890,32891,32892,32893,32894,32895,32896,32897,32898,32899,32900,32901,32902,32903,32904,32905,32906,32907,32908,32909,32910,32911,32912,32913,32914,32915,32916,32917,32918,32919,32920,32921,32922,32923,32924,32925,32926,32927,32928,32929,32930,32931,32932,32933,32934,32935,32936,32937,32938,32939,32940,32941,32942,32943,32944,32945,32946,32947,32948,32949,32950,32951,32952,32953,32954,32955,32956,32957,32958,32959,32960,32961,32962,32963,32964,32965,32966,32967,32968,32969,32970,32971,32972,32973,32974,32975,32976,32977,32978,32979,32980,32981,32982,32983,32984,32985,32986,32987,32988,32989,32990,32991,32992,32993,32994,32995,32996,32997,32998,32999,33000,33001,33002,33003,33004,33005,33006,33007,33008,33009,33010,33011,33012,33013,33014,33015,33016,33017,33018,33019,33020,33021,33022,33023,33024,33025,33026,33027,33028,33029,33030,33031,33032,33033,33034,33035,33036,33037,33038,33039,33040,33041,33042,33043,33044,33045,33046,33047,33048,33049,33050,33051,33052,33053,33054,33055,33056,33057,33058,33059,33060,33061,33062,33063,33064,33065,33066,33067,33068,33069,33070,33071,33072,33073,33074,33075,33076,33077,33078,33079,33080,33081,33082,33083,33084,33085,33086,33087,33088,33089,33090,33091,33092,33093,33094,33095,33096,33097,33098,33099,33100,33101,33102,33103,33104,33105,33106,33107,33108,33109,33110,33111,33112,33113,33114,33115,33116,33117,33118,33119,33120,33121,33122,33123,33124,33125,33126,33127,33128,33129,33130,33131,33132,33133,33134,33135,33136,33137,33138,33139,33140,33141,33142,33143,33144,33145,33146,33147,33148,33149,33150,33151,33152,33153,33154,33155,33156,33157,33158,33159,33160,33161,33162,33163,33164,33165,33166,33167,33168,33169,33170,33171,33172,33173,33174,33175,33176,33177,33178,33179,33180,33181,33182,33183,33184,33185,33186,33187,33188,33189,33190,33191,33192,33193,33194,33195,33196,33197,33198,33199) GROUP BY iam0.g_itemId ") 

I did all the usual things first, I updated to latest SVN code, and cleared caches etc.

After all of that I tried disabling the image block plugin, in the hopes it would make the problem go away.

Thusly, now I have two issues I hope someone will be able to help me fix.

Firstly, I need to a way to unhide those albums, so gallery will work again.
Secondly, I am happy to help you fix the error, but I am not sure what you are doing at all.

Regards,
Sphericus

 
sphericus

Joined: 2005-11-06
Posts: 55
Posted: Tue, 2009-01-06 07:25

Hi!

Just wondering if anyone has had a chance to look at this issue?

Since, it is quite problematic as you can imagine.

Regards,
Sphericus