DB Checker Utility

User's Guide

Version 2009.1 (9.0.1) October 2009/April 2010 DSPI2-PE-200004A-Updated

the valid signed license shall take precedence and govern the use of this software product. I-Export. I-Convert. The information and the software discussed in this document are subject to change without notice and are subject to applicable technical product descriptions. ISOGEN. FrameWorks. catalog. Box 240000 Huntsville. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE THE FINAL EVALUATION AS TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT.227-19 of the Federal Acquisition Regulations ("FAR") and its successors. Government Restricted Rights Legend Use. Including software. Intergraph Corporation P. Intergraph believes the information in this publication is accurate as of its publication date. PDS.Restricted Rights clause at 52. Unpublished . Users should verify for themselves that the data is accurate and suitable for their project work.rights reserved under the copyright laws of the United States. AL 35758 Terms of Use Use of this software product is subject to the End User License Agreement ("EULA") delivered with this software product unless the licensee has a valid signed license for this software product with Intergraph Corporation. and may not be provided or otherwise made available without proper authorization from Intergraph Corporation. IntelliShip. the Intergraph logo. Intergraph Corporation is not responsible for any error that may appear in this document. Trademarks Intergraph. AL 35813 Street address: 170 Graphics Drive. MARIAN. For units of the Department of Defense ("DoD"): This is "commercial computer software" as defined at DFARS 252. or disclosure by the government is subject to restrictions as set forth below. trade secret law. Subject to the terms contained within the applicable license agreement. No responsibility is assumed by Intergraph for the use or reliability of software on equipment that is not supplied by Intergraph or its affiliated companies. Microsoft and Windows are registered trademarks of Microsoft Corporation. and is unpublished and all rights are reserved under the copyright laws of the United States. this document or its contents shall be considered or deemed a modification or amendment of such warranties.Copyright Copyright © 2002-2009 Intergraph Corporation. The software discussed in this document is furnished under a license and may be used or copied only in accordance with the terms of this license. Inc.7202-3. Intergraph is not responsible for the accuracy of delivered data including. non-commercial use.S. . For civilian agencies: This was developed at private expense and is "restricted computer software" submitted with restricted rights in accordance with subparagraphs (a) through (d) of the Commercial Computer Software .227-7014 and the rights of the Government are as specified at DFARS 227. duplication. All Rights Reserved. Other brands and product names are trademarks of their respective owners. SmartSketch. Intergraph Corporation gives licensee permission to print a reasonable number of copies of the documentation as defined in the applicable license agreement and delivered with the software product for licensee's internal. but not limited to. reference and symbol data. SPOOLGEN. and international treaty. I-Sketch. and SupportModeler are trademarks or registered trademarks of Intergraph Corporation or its subsidiaries in the United States and other countries.O. may be used pursuant to applicable software license agreement. SmartMarine. If the licensee has a valid signed license for this software product with Intergraph Corporation. SmartPlant. and audiovisual displays. contains confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law. Warranties and Liabilities All warranties given by Intergraph Corporation about equipment or software are set forth in the EULA provided with the software or applicable license for the software product signed by Intergraph Corporation. SupportManager. and nothing stated in. U. or implied by. MicroStation is a registered trademark of Bentley Systems. INtools. Madison. file formats. The documentation may not be printed for resale or redistribution.

.......................................................................................................................................... 11 DBChecker Utility Window .... 12 Index ............................................................................................................................................................................................................................................................................................................ 13 DB Checker Utility User's Guide 3 ........ 12 Summary Dialog Box ................................................................................Contents DBChecker Utility ................ 8 Create a User Log File Without Implementing the Fixes ............................................................................................................................... 11 Check Results Dialog Box ...................................................................... 10 Windows and Dialog Boxes .................................................................................................... 8 Check the Database .......................................................... 5 Log File Descriptions............................................................................................... 9 Implement Fix Suggestions ................................................................................................................................................................................................................................................................................................................................................ 9 Exit the DBChecker Utility...................................................... 7 Start the DBChecker Utility ................................................

Contents 4 DB Checker Utility User's Guide .

This is because in certain cases. the changes are irreversible. that are extremely sensitive to the integrity and synchronization of the manipulated data. if you suspect that execution of certain SQL commands can damage valuable data. The utility allows you to inspect and maintain data integrity. rather than through the business objects wrapper and. In some cases. carried out via the program interface. It is also used to fix inconsistencies that can occur if enhanced data integrity rules or changes in the data model are applied to legacy data before and after an upgrade. Such operations involve record manipulation directly in the database. some changes may lead to unexpected results. Also. there are operations. The DBChecker Utility scripts are tested by our certification team. when running the Merger or Import utilities. As-Built and all existing projects are included in a single database check. In most cases. The DBChecker Utility allows you to troubleshoot these problems and fix them on the fly.SECTION 1 DBChecker Utility The DBChecker Utility is used for maintenance and troubleshooting of the SmartPlant Instrumentation database.INI file. If your database contains data that does not comply with the SmartPlant Instrumentation data model. You can either fix the problems on the fly or create a file that contains suggestions for fixing the selected problems. Then. The DBChecker Utility enables you to predict or fix problems in your database by running specific SQL commands without having to contact Intergraph Support. mass data transformation operations in SmartPlant Instrumentation require extensive changes that bypass the business object processing. DB Checker Utility User's Guide 5 . You can only perform a database check at the domain level. Ongoing improvements are made in the DBChecker Utility itself. the SQL commands delete data based on the known format of the SmartPlant Instrumentation data model and data. For example. The DBChecker Utility allows you to detect and fix this type of data integrity problem. for example. might cause data integrity problems. When running the DBChecker Utility. just like the enhancements and improvements in SmartPlant Instrumentation. we recommend that you back up your database before implementing fixes. therefore. This is usually done in order to significantly improve the performance of such data transformation operations. The DBChecker Utility displays defective rows and problem descriptions so that you can open SmartPlant Instrumentation and check the issues that the DBChecker Utility found. legacy data may have an allowed NULL value in a specific database column but an application improvement requires the column value to be NOT NULL. and the DBChecker Utility of a later version of SmartPlant Instrumentation can find data legacy problems that were not exposed in previous versions. The DBChecker Utility assists in preventing failure during such operations. but the tester or script designer might not be aware of all possible data set combinations that are likely to cause database problems. the software automatically connects to the Admin schema of the user database defined in the INTOOLS. Also. If the domain type is Owner operator. When you start the DBChecker Utility. and to troubleshoot and resolve various database problems. the DBChecker Utility allows you to select fixes that you want to implement. you can select a target domain and perform a database check for that domain.

You can specify another location as you require. The software performs the check by automatically comparing the database objects with the SmartPlant Instrumentation template database. the use frequency should be increased.TXT file. After checking. DBChecker Utility Use Frequency Factors It is possible to use The DBChecker Utility on a periodic basis to find problems in their early stages. especially in the Table mode — Run the DBChecker Utility before and after performing the activity. whose default location is the SmartPlant Instrumentation home folder. before they manifest themselves in application malfunctions. ƒ A customer decides to run the DBChecker Utility if SmartPlant Instrumentation users report problems that are hard to reproduce. via a data migration process. 6 DB Checker Utility User's Guide . Where problems occur. DBChecker Utility You can check the structures and definitions of your database objects to identify invalid or missing objects or data inconsistencies. before starting the initialization process. frequent or massive claim or merge operations in an Owner operator domain. or numerous import activities. the DBChecker Utility can also fix them. Activities that Require a Database Check ƒ A major upgrade of the SmartPlant Instrumentation database — Run the DBChecker Utility before and after the upgrade process to minimize the number of upgrade stops and problems during the process. the use frequency should be increased. Possible DBChecker Utility Use Scenarios ƒ Intergraph Support requests the DBChecker Utility to be used at customer's site. and the details to be sent to Intergraph Support for faster troubleshooting when database integrity can be a factor in the problem reported by the customer. or in the early versions of SmartPlant Instrumentation. ƒ The nature of operations — If the current database undergoes massive data transformation. After completion of the database check. Factors to be considered in the frequency of using the utility as a maintenance data validation tool are as follows: ƒ The origin of the database — If the database was created mostly by importing data from external files. ƒ Running the Merger Utility — Run the DBChecker Utility before and after performing the activity. the results are stored in the COMPLOG. and the SmartPlant Instrumentation System Administrator suspects there is a problem with the database integrity. ƒ Merging a large project with As-Built — Run the DBChecker Utility before performing the activity. the utility generates an error report and prompts you to correct the errors. ƒ Copying data from one lowest plant hierarchy item to another — Run the DBChecker Utility before performing the activity. and also to minimize downtime. ƒ Massive data import. The DBChecker Utility is used by the SmartPlant Instrumentation certification and development teams in the course of certifying a version release. ƒ Initializing a new domain using another domain as a source — Run the DBChecker Utility for the source domain.

but for which there is no pre-defined automatic solution. the RECREATE. the software appends new log data to the existing data. For details.TXT file. Before you run the DBChecker Utility.TXT file can also include the Special Operations section that contains the SQL commands that identified the problem. You can clear the log file manually. If no problems are found. some of the fixes that you selected might not be implemented successfully. This verification procedure generates a result log file COMPLOG. The records in the log file are separated by date and time of log data creation. If the software does not find any problems in the database.TXT file. the database platform information. ƒ Consistency of the version — Remaining on the same version of SmartPlant Instrumentation for a prolonged period of time should decrease the need for running the DBChecker Utility and. the issues identified in the Special Operations section are related to the engineering data inconsistencies that need to be resolved through the user operations in SmartPlant Instrumentation itself. the file only contains the time of the session. you can set the software to check all or only certain database objects. and the database name.TXT file only contains the time of the session and the database platform information.TXT and a suggested corrective action list in the log files RECREATE.TXT — Contains selected specific fix suggestions for the problems that you select in the Check Results dialog box. The Check Results dialog box only opens if the software finds a database problem. see the Help topic DBChecker Utility Window (on page 11). COMPLOG. DBChecker Utility ƒ The history of previous use of the DBChecker Utility and results — If the DBChecker Utility sessions do not indicate any issues with the database. When detecting a data integrity problem. the use frequency should be decreased. If you previously created the RECREATE_USER. Usually.TXT — Contains all fix suggestions for the database problems found during a database check.TXT file the SQL command or commands that have identified the problem. If you click Fix to fix the database problems on the fly.TXT and RECREATE_USER. The fix suggestions are represented as SQL commands.TXT — Contains all database problems the DBChecker Utility has found during a database check. DB Checker Utility User's Guide 7 . therefore. RECREATE_USER. The software creates this file after you click Fix or Create Log in the Check Results dialog box. The fix suggestions are represented as SQL commands. See Also Check Results Dialog Box (on page 11) Create a User Log File Without Implementing the Fixes (on page 9) Log File Descriptions The DBChecker utility generates and executes SQL commands for database verification. The software records information of such fixes in the RECREATE_USER. The software creates this file on completion of a database check. The COMPLOG. If you run another database check.TXT. RECREATE. the software overwrites the records that appear in the file. If you run another database check. the software overwrites the records that appear in the file. the DBChecker Utility writes to the COMPLOG. the use frequency should be decreased. The software creates this file on completion of a database check.

Under Output data file path. select Tables. Click Run to start the database check. depending on your database platform. Click Connect to connect to the Admin schema of your SmartPlant Instrumentation database. select a target domain. If needed. and then click OK. select Invalid objects and/or Disabled foreign keys. 2.exe. it is recommended to use Intergraph Support assistance when using the utility for the first time. 5. the software opens the Check Results dialog box. From the Domain box. 6. ƒ Click Browse to specify another path.TXT and RECREATE. the software creates the files COMPLOG. When checking reference data. the software checks existence of required rows in pertinent tables. Check the Database It is recommended that only trained users with advanced knowledge of SmartPlant Instrumentation and administration options should use the utility. DBChecker Utility Start the DBChecker Utility ƒ Do one of the following: ƒ In the SmartPlant Instrumentation home folder.TXT. 1. Specifying a different path prevents you from overwriting existing data in the files COMPLOG. If such knowledge is lacking. In the DBChecker Utility window. type checkdb. 3. Under Check tables and related items. 4. do one of the following: ƒ On Oracle. If database problems are found. If you choose to repair the database yourself. where you can analyze the problems and fix suggestions. under Check other database items.TXT. it is recommended that you run the DBChecker Utility once more to verify that all the problems have been fixed. 7. and then select a desired combination of the check boxes. If you previously ran the DBChecker Utility.TXT and RECREATE. ƒ On SQL Server. Initial records are rows in which all fields of primary keys are zeros. double-click checkdb. ƒ At the command line. and select all or specific problems which you want to fix on the fly or at a later stage. ƒ On completion of the database check. The default location is the SmartPlant Instrumentation home folder. select Disabled foreign keys. If you want to check reference data. you must select the Initial records check box. 8 DB Checker Utility User's Guide .exe. do one of the following: ƒ Accept the default path where the software creates the log files on completion of the database check. the software has already created the log files.

If your database contains data that does not comply with the SmartPlant Instrumentation data model. If you previously created the RECREATE_USER. for the problems for which you want to implement fix suggestions. You can clear the log file manually. The software creates the RECREATE_USER. It is highly recommended that you back up your database before implementing the fixes because in certain cases. The records in the log file are separated by date and time of log data creation. Create a User Log File Without Implementing the Fixes 1. the changes are irreversible. the SQL commands delete data based on the known format of the SmartPlant Instrumentation data model and data content. The Check Results dialog box only opens if the DBChecker Utility finds a problem during a database check. In most cases. 2. for the problems for which you want to record fix suggestions in a log file. Click Fix. some changes may lead to unexpected results. In the Check Results dialog box. 2.TXT file in the location you specified in the DBChecker Utility window. select the check boxes under the Include in Fix column. the software appends new log data to the existing data. See Also DBChecker Utility (on page 5) Create a User Log File Without Implementing the Fixes (on page 9) Check Results Dialog Box (on page 11) DB Checker Utility User's Guide 9 .TXT file. When contacting Intergraph Support. Implement Fix Suggestions 1. The Check Results dialog box only opens if the DBChecker Utility finds a problem during a database check. make sure you forward to Intergraph Support the three log files generated by the DBChecker Utility and await instructions on how to execute them. select the check boxes under the Include in Fix column. In the Check Results dialog box. DBChecker Utility ƒ If the DBChecker Utility generates corrective statements identical to the ones successfully used before to resolve the problem the user can execute them at their own discretion. The default location is the SmartPlant Instrumentation home folder. Click Create Log.

On completion of a database check. 10 DB Checker Utility User's Guide . the Check Results dialog box opens. Clicking Close in the Check Results dialog box closes the DBChecker Utility. or create a log file and then send the log file to Intergraph Support. click Close. Therefore. if the software has found a database problem. where you can either implement problem fixes on the fly. DBChecker Utility Exit the DBChecker Utility ƒ In the DBChecker Utility window. make sure you perform the operation that you require before clicking Close in the Check Results dialog box.

............. 12 DBChecker Utility Window The DBChecker Utility allows you to select all or specific database items and run a database check for a SmartPlant Instrumentation domain....................... Stored procedures — Allows you to check stored procedures. Selecting this check box enables you to include reference data in the database check...................... Primary keys — Allows you to check the primary keys...... Initial records — Allows you to check rows in which all fields of primary keys are zeros...... Connect — Connects to the Admin schema of the database... Domain — Allows you to select a target domain in your database after you click Connect.. Check other database items Invalid objects — Allows you to check invalid objects in Oracle.... Indexes — Allows you to check indexes.. Run — Starts checking the database............ 11 Check Results Dialog Box................... Output data file path — Allows you to specify a path where the software creates the log files that contain information about the database problems and problem fix suggestions.. Disabled foreign keys — Allows you to check disabled foreign keys in Oracle or SQL Server.. see Log File Descriptions (on page 7)............. Foreign keys — Allows you to check the foreign keys........ 11 Summary Dialog Box .............. Check tables and related items Tables — Allows you to check the database tables... Reference data — Allows you to check existence of required rows in pertinent tables.. Triggers — Allows you to check triggers...........SECTION 2 Windows and Dialog Boxes In This Section DBChecker Utility Window ...... DB Checker Utility User's Guide 11 .......... Selecting this check box enables you to select other check boxes....... For the log file details..... The default location of the log files is the SmartPlant Instrumentation home folder............

This dialog box can show specific settings that the software considers problematic. The software implements the fix after you click Fix.TXT file. Problem description — Displays a meaningful description of the problem that was found in the database. on completion of the current database check.TXT file in the location you specified in the DBChecker Utility window. the SQL command that found the problem. Close — Closes the DBChecker Utility. You can clear the log file manually. 12 DB Checker Utility User's Guide . the software appends new log data to the existing data. The records in the log file are separated by date and time of log data creation. The default location is the SmartPlant Instrumentation home folder. If you previously created the RECREATE_USER. Windows and Dialog Boxes Check Results Dialog Box Displays problems found in the database and allows you either to fix the problems on the fly. and the detailed description of the problem. in other cases. SQL that can fix the problem — Displays the SQL command that can fix the problem when you click Fix in the Check Results dialog box. the software displays the name of the problematic item.TXT file. you can click Create Log and record the fix suggestions in the RECREATE_USER. or send the log file to Intergraph Support. SQL that found the problem — Displays the SQL command that found the problem. Fix — Implements the fixes for the problems for which you selected the Include in Fix check box. Where possible. Create Log — Creates the RECREATE_USER. Details — Opens a dialog box that shows details of the affected rows. If you choose not to implement the fixes on the fly. or record the fix suggestions in a log file without implementing the fixes. See Also Create a User Log File Without Implementing the Fixes (on page 9) Summary Dialog Box Displays a summary of SQL commands that relate to the problem that the DBChecker Utility found. You can display a summary for each record that appears in the Problem Description column of the Check Results dialog box. and the SQL command that can fix the problem. Select all — Selects all the check boxes in the Include in Fix column. This summary includes the SQL command that found the problem. If you choose to create a log file. the SQL command that can fix the problem. Include in Fix — Enables the software to implement the fix for the problem that was found. the item ID in the database. you can implement the fixes manually later. This SQL command shows records that do not comply with SmartPlant Instrumentation database constraints.TXT file. Summary — Opens a dialog box that shows the problem description. The same SQL command appears automatically in the COMPLOG.

txt • 7 problems • 7. 8.txt • 7 checking • 8 recreate_user.txt • 7 implementing fixes • 9 objects available for checking • 11 S DBChecker Utility • 5 SQL commands • 12 DBChecker Utility Window • 11 fix suggestions • 12 problem descriptions • 12 E Start the DBChecker Utility • 8 errors • 7. 12 Check Results • 12 F DBChecker Utility • 11 fix suggestions • 7.db • 5 DB Checker Utility User's Guide 13 .Index A L activities that require database check • 5 Log File Descriptions • 7 log files • 7. 9 C creating without implementing fixes • 9 Check Results Dialog Box • 12 descriptions • 7 Check the Database • 8 checking the database • 5. 12 Windows and Dialog Boxes • 11 implementing • 9 log files • 7 SQL sentences • 12 I Implement Fix Suggestions • 9 in_templ. 11 O activities that require database check • 5 overview • 5 frequency factors • 5 objects available for checking • 11 P performing a check • 8 complog. 9. 9 database objects • 11 recreate. 9. 12 Create a User Log File Without detailed descriptions • 12 Implementing the Fixes • 9 fixing on the fly • 9 log files • 7 D R database • 8. 9 starting • 8 fixing on the fly • 9 Summary Dialog Box • 12 log files • 7 Exit the DBChecker Utility • 10 W exiting • 10 windows and dialog boxes • 11.