DBC (Database Configuration) scripts are a powerful way to customize your system, such as adding new attributes to existing objects. In this post, we’ll walk through practical examples, including creating a custom attribute in the Asset object and generating DBC scripts from an autoscript
Example 1: Adding a Custom Attribute to the Asset Object
Suppose we want to add a Maintenance Cost attribute to the ASSET object. Here’s the step-by-step process:
1. Create a DBC Folder
Create a folder to store your DBC script:
2. Create the DBC File
Create a new DBC file aq_add_cost_to_asset.dbc in the folder:
Tip: You can also add other fields with different types, domains, default values, or lengths. Example:
3. Run the Script
Navigate to the internal tools folder and run the DBC script:
Check the log for details:
After successful execution, restart your application server.
2: Releasing as a Product Update
After testing your DBC script, you can release it as a product update.
1. Create Product XML
Create a product XML file aq_product1.xml:
2. Run the Database Update
Navigate to the tools folder and update the database:
Updatedb Lifecycle Notes:
-
Processes all scripts in the
tools\maximo\en\scriptfolder. -
Looks for product XML files in alphabetical order.
-
Handles dependencies specified with the
<DEPENDS>element.
Example 2: Generating automatic DBC from an Autoscript
You can automatically generate a DBC from an existing autoscript using geninsertdbc.bat. For example, to extract the CREATEPR autoscript:
Run the generated script:
The log output will show:
Conclusion
DBC scripts are essential for customizing Maximo without modifying the core database manually. Whether adding new attributes, updating tables, or generating scripts from autoscripts, this approach ensures your changes are structured, auditable, and maintainable.
No comments:
Post a Comment