The problem with makeing structure changes while users are in the database is that you could wind up corrupting your database in such a way it can not be recovered. When you make structure changes, you have to manipulate the #1 file, and if it gets scrambeled in the process, you are hosed. You always want to have a backup of it before you start. With users in the db, you can't get a good backup of it.
I always run with staticdb on to remove the temptation of making structure changes while people are in the db. The scenario I described earlier about getting corruption from adding a row to the database is easy to recover from. Any times I have seen corruption occure to the system tables comes from making structure changes to the database. When your system tables get corruption, there is quite ofter other corruption in the #1 file you may not see. Perminant structure changes should be done in single user mode. You should back up the database before you make the changes and just for good luck, keep a backup of the #1 file after you make the changes. As long as you have a copy of the #1 file since the last structure changes were made, you can almost always recover your data if things get messed up. As long as you don't pack, reload, or make structure changes, the locations of the beginning of the tables in the #2 file don't change. The #1 file keeps track of the beginning row pointer, ending row peointer, and row counts for every table. As long as you don't have broken pointers in your tables you can recover all of your data from an older #1 file. The ending pointers and row counts will be off, but as long as you can find the beginning of the table, you can unload the data. Troy -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Atrix Wolfe Sent: Friday, June 20, 2003 12:41 PM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Alter Table (was SYS_TABLES TABLE) is there any risk of corrupting a database/table doing something like: alter mytable add amount currency while users are using the system? ----- Original Message ----- From: "Troy Sosamon" <[EMAIL PROTECTED]> To: "RBASE-L Mailing List" <[EMAIL PROTECTED]> Sent: Friday, June 20, 2003 11:31 AM Subject: [RBASE-L] - RE: SYS_TABLES TABLE > When you unload the schema for your database, it will be a very small file > and you can edit it with just about anything. > > connect mydatabase > out mydb.sch > unload schema > out screen > > The file won't be over 500 k. > > You unload just the data to a seperate file. > > On a big database, I would write a program that would unload the data for > each table to seperate file. This keeps everything managable and you can > edit the files if you need to. On the really large tables, you might even > want to put them in multiple files. I would try to keep the files below 100 > megs each. > > Troy > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rommel > Relosa > Sent: Friday, June 20, 2003 11:53 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: SYS_TABLES TABLE > > > No, it wouldn't since the data file will be 700 MB instead of 780 MB, and at > the time, I don't have a text editor that can load such a beast. > > > And, I do have RScope, Troy. :) > > I've used it to rebuild the database structure pointer-by-pointer to correct > a corruption problem on the SYS_COLUMNS table. Never again would I modify > an unused table when 30 users are hitting the database at the same time. > Hard lesson to learn, but, with RScope my colleagues and I were able to > recover the structure of the database and had very minimal (if any) data > loss. > > > 'Tis why I recommended it to Dan a few posts back. > > > > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Troy > Sosamon > Sent: Friday, June 20, 2003 10:41 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: SYS_TABLES TABLE > > > Yes it would, because you could edit the structure file and not have to edit > the data file. > > You would just need to delete out the occurance on the weird table. > Now when you re-build the database, you run the structure file first and it > will build the db w/o the weird table. Now when you run the data file to > load all of the data back in the tables everything will run fine and when it > trys to load the weird table, it won't be in the database so it will spit > out some errors, but should load everything else fine. You don't care about > those errors because you didn't want that table any way. > > Personally I would not use the method on a large database. I would be too > afraid of loosing rows. > I would use R:scope and fix the database with that. If your #2 file is 1.7 > gigs it will take forever to do this anyway, and I am certain you could > justify the $130 for R:scope. > > Troy > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rommel > Relosa > Sent: Friday, June 20, 2003 11:32 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: SYS_TABLES TABLE > > > With a #2 file running at 1.7 GB, I don't it would matter if I unloaded the > structure separately. > > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Troy > Sosamon > Sent: Friday, June 20, 2003 10:25 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: SYS_TABLES TABLE > > > That is why I always do it in 2 parts, an schema file and then the data > file. > > Troy > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Rommel > Relosa > Sent: Friday, June 20, 2003 11:15 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: SYS_TABLES TABLE > > > UltraEdit... > > Thanks, Dennis. Every one I tried just couldn't load the 780 MB file. > > > Rommel > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dennis > McGrath > Sent: Friday, June 20, 2003 6:23 AM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: SYS_TABLES TABLE > > > For Editing really huge unload files, try UltraEdit. Awesome! I've > done files larger than a gig. It just won't choke. > > Dennis McGrath > > --- Rommel Relosa <[EMAIL PROTECTED]> wrote: > > Dan, > > > > If you don't have RScope (yet <g>), you can try this to remove the > > funky > > table. > > > > CONNECT <DBNAME> > > OUTPUT UNLOAD.DAT > > UNLOAD ALL > > OUTPUT SCREEN > > > > > > Now, if the file is not too big, use a text editor and look for the > > CREATE > > TABLE `funkyname` entries and remove it. > > > > Then, look for the section with LOAD funkyname and delete the "load" > > entries. > > > > Rename the database (back up purposes, in case reload fails <g>) then > > issue: > > > > INPUT UNLOAD.DAT > > > > This will rebuild the database without the table with the funkyname. > > > > > > > > > > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dan > > Goldberg > > Sent: Thursday, June 19, 2003 1:51 PM > > To: RBASE-L Mailing List > > Subject: [RBASE-L] - SYS_TABLES TABLE > > > > > > Does anybody know how to edit the sys_tables table?? > > > > I have a table that has a funky name that I can not get a rid off. > > > > > > Dan Goldberg > > >

