Try OpenEdge Now
skip to main content
Database Administration
Database Basics : Creating and Deleting Databases : Using the Schema Mover
 

Using the Schema Mover

In a converted database, it is possible to have user data in the schema area. Best practices advocate separating schema and user data. You can separate the schema and user data by using PROUTIL dump and load or bulkload qualifiers, Database Administration, the Data Dictionary, or ABL code. However, as long as schema remains in an area, the extents continue to hold disk space, even after the removal of data. To free this disk space, use the Schema Mover qualifier to PROUTIL to move the schema. Once the area's schema is moved the area can be truncated.
To move schema to a new area:
1. Truncate the database's BI file. PROUTIL will send an error message if you do not.
2. Back up the database.
Caution: PROUTIL with the MVSCH qualifier is a non-recoverable utility. If the execution fails, you cannot connect to the database, and must restore a backup.
3. Execute the MVSCH command.
Enter the MVSCH command as shown, to begin the schema move, where dbname is the name of the converted database:
proutil dbname -C mvsch
As shown in the figure that follows, after you convert your database to OpenEdge Release 11, Area 6 (NewDB.db) contains both the database's schema and data. When you initiate the schema move by entering the syntax shown in Step 3 above, PROUTIL finds the next unused data area (starting at Area 7) and creates the target data area and the target data area's extent. After creating the target data area, PROUTIL moves the schema from NewDB.db to NewDB_7.d1. All the schema records and indexes are deleted from NewDB.db. PROUTIL opens the .d1 files of the NewDB.db and NewDB_7.d1 and then updates and switches the master and area blocks. After the switch, the areas and their extents are renamed. Now that the schema is gone from the "Old Default Area," you can truncate it and recover any unused space.
Figure 1. How the Schema Mover works
Note: Data in the "Old Default Area" that is not moved prior to area truncation will be lost.