bldmsf2000ddl assistance

Sort:
You are not authorized to post a reply.
Author
Messages
CindyW
Veteran Member
Posts: 169
Veteran Member
    We have a testing data area that has been updated with lots of patches, far beyond our production version. One or more of those patches required reorgs.  ( This was just a few months ago.)  Our users test the new patches as they can. 

    Recently, we needed a program tested for a certain scenario, and the data area was refreshed with data from Production.  Oops.  Now we have a data mismatch situation, for several tables.  We've dealt with this mismatch thing before, but not to this degree - not this many objects. BLDDBDICT won't create anything since it thinks all is okay, but VERIFYMSF2000 shows otherwise.  So I was reading in the KB - and there is a command that we've not used before - bldmsf2000ddl.   Looks like it creates the scripts to update the data objects, but how do I run this command to just see what it will do, rather that actually have it update the database?  We have some large tables, and I see that we might need to dump and reload those.  Just need to get a handle on how to use this thing.  Thanks.



    Roger French
    Veteran Member
    Posts: 545
    Veteran Member
      Just type bldmsf2000ddl and hit enter. You'll see all of the options.

      The command is used for updating and creating tables, and truncating tables. You will see that it actually is used to read from your data dictionary, and then build the SQL code to build the tables/indices/etc for your SQL database(s). I use it regularly to truncate entire productlines when copying and refreshing productline data. You can use it also on individual tables too.
      CindyW
      Veteran Member
      Posts: 169
      Veteran Member
        Yes, I know the options are listed with the command.  BUt I don't understand exactly what the options are doing.  For instance - the -S parameter....says "Generated DDL into files by Systemcode(s).(.ddl)

        I'm sure I should know what DDL means,, but I've never even seen that term before. I googled it...is it just another name for SQL? 

        Also, which parameter will give me the results of what would be done, without actually doing it?
         
        And lastly, if I need to KEEP all the data, is there a way to do that?  I can't refresh again from anywhere else because none of the other databases match the product line data structures in this one. 

        What I am trying to do is correct the errors that were returned in verifymsf2000 without losing my data.  I attached a screenshot of those results.  I thought that bldmsf2000ddl was the way to to that...but maybe not?
        John Henley
        Senior Member
        Posts: 3348
        Senior Member
          Cindy,
          DDL is "data definition language", which is the subset of SQL that defines the database schema.
          As to finding out which tables are missing, you may find out that you are missing an unimportant table that can simply be re-created.
          Or you may find that you are missing a very important table that invalidates your database integrity, renders the rest of the database useless, and would require that you do a complete refresh in order to have a valid database. An example would be (assuming you have HR, for instance) that you have EMPLOYEE but are missing PAEMPLOYEE.
          Usually, this is the result of restoring a physical database that doesn't match the version of your applications (e.g. 9.0.0 database with 9.0.1 applications, or even just a service pack difference).
          In other words, you really need to look at how the database was refreshed.
          Thanks for using the LawsonGuru.com forums!
          John
          John Henley
          Senior Member
          Posts: 3348
          Senior Member
            To answer you specific question, using the -U parameter is what actually connects to the database to make the changes.
            So if you leave off that parameter, it will just generate the DDL/SQL to create the table definition, but not actually create the table.
            Thanks for using the LawsonGuru.com forums!
            John
            John Henley
            Senior Member
            Posts: 3348
            Senior Member
              So, for a specific table, say "EMPLOYEE":

              bldmsf2000ddl -R prod HR EMPLOYEE
              will generate SQL to drop and create the table and indexes

              bldmsf2000ddl -RI prod HR EMPLOYEE
              will generate SQL to drop and create the indexes

              bldmsf2000ddl -RT prod HR EMPLOYEE
              will generate SQL to drop and create the table without the indexes


              bldmsf2000ddl -UR prod HR EMPLOYEE 
              will generate SQL to drop and create the table and indexes  -- AND ACTUALLY make the changes in the database (in other words, you will LOSE YOUR DATA IN THAT TABLE).

              If all you want to do is capture the SQL, you can output the command output to a file using the > (>) like this:
              bldmsf2000ddl -R prod HR EMPLOYEE >create_employee.sql
              will generate SQL to drop and create the table and indexes 
              Thanks for using the LawsonGuru.com forums!
              John
              CindyW
              Veteran Member
              Posts: 169
              Veteran Member
                Taken care of. Thanks all.
                Kwane McNeal
                Veteran Member
                Posts: 479
                Veteran Member
                  John,
                  I walked Cindy through the processes for each table, since I'm familiar with their setup.

                  Kwane
                  CindyW
                  Veteran Member
                  Posts: 169
                  Veteran Member
                    Yep...for which I am extremely grateful!    I would have never figured all that out.
                    You are not authorized to post a reply.