dbupdate [-<option> . . .]
Updates the structure of an existing database, or creates a database structure from scratch.
Options
-s <string>
Schema description
-d <string>
Initial data
-config <string>
Configuration file specifying the schema and the data, configurations, icons and string files to import
-yes
Do not ask for confirmation
-timeout <time-span; e.g. 4:30 for 4 hours and 30 minutes, 2.06:00 for 2 days and 6 hours>
Database commands execution time-out
-nocompute
When importing a new schema do not compute newly added automatically computed attributes. WARNING: this might cause problems using the system with the new schema.
-noinit
When importing a new schema do not initialize new attributes that have an initialization XSLT. WARNING: this might cause problems using the system with the new schema.
-recycle <string>
IIS application pools to recycle after having sucessfully updated the database. It is a comma-separated list of application pool names in the format 'server name'/'pool name' or just 'pool name' (local server)
Examples
•Import modified schema gn4.xsd in database.
srv4 dbupdate -s "..\config\schemas\gn4.xsd" -d ""
Then, perform IISRESET, or recycle the application pool, to update the server cache
•Load files specified in the Editorial_UpdateConfig.xml.
srv4 dbupdate -config ..\config\Editorial_UpdateConfig.xml -yes
Fixes in version 1.6
•Attempts to use srv4 dbupdate or srv4 dbschema to upgrade systems with old (before December 2011) schemas that did not yet contain the descName attribute failed with an error 147: The object type 'user' does not contain the required attribute 'descName'. Now fixed.
Fixes in version 1.5
•The -timeout option was ignored when creating indexes (there was an hardcoded timeout of 300 seconds). Available also in 1.4.1514.1.
•Updating the schema ('srv4 dbupdate' or 'srv4 dbschema') that modifies the key definition of an object type adding one or more non-string attributes or uses an "xs:init" block to re-compute the keys of the object of the type that is changing key definition, messed-up the key digest values of all the deleted object of the type that is changing key definition - basically computing them as they were non-deleted. This resulted in the upgrade operation failing with a 'duplicate key' exception if there were multiple deleted objects with the same values for the old key fields, and could cause problems attempting to spike or un-spike objects even if the upgrade completed successfully.
•Updating the schema ('srv4 dbupdate' or 'srv4 dbschema') failed with an error Object(s) with id XXXXX have been deleted (ERR0229) when then new schema added an automatically compute attribute to an object type that had at least a deleted object in the database. The bug has been introduced by the fix for ticket #GN4-521 (available also in 1.4.1514.1).
•Database upgrade fails with error 'The object type 'object' does not contain the required attribute 'modifiedDate''. In other words, attempts to upgrade the database structure and the schema from versions 43 or earlier to version 48 or later failed with the error The object type 'object' does not contain the required attribute 'modifiedDate'. Now fixed.
Changes in version 1.4.
•The command srv4 dbupdate must import data files using the option SpikeChildren. Data files are now imported using the XmlImportOption "SpikeChildren" set to true. This prevents from letting "orphan" categories in the database after an upgrade.
•When importing a new schema on an existing database, using either "srv4 dbschema" or "srv4 dbupdate", srv4 will compute new automatically computed attributes, and initialize new attributes that have an initialization XSLT (see http://forum.teradp.com/topic.asp?whichpage=1&TOPIC_ID=509). Both these operations can be very time-consuming, and in some cases they can fail due to problems in the existing objects, so now the "dbschema" and "dbupdate" commands have two new options "-nocompute" and "-noinit" that disable the computation and the initialization respectively - e.g.
srv4 dbschema -in ..\config\schemas\gn4.xsd -nocompute
will import the "gn4.xsd" schema without computing new automatically computed attributes (if there are any in the schema).
"WARNING": use this options with caution, they can leave the database in a corrupted state.
See also