The GET_SYSTEM_INFO procedure returns information about the data server, including information about the system, the current instance, installed data server products, environment variables, available CPUs, and other system information.
>>-GET_SYSTEM_INFO--(--major_version--,--minor_version--,--requested_locale--,--> >--xml_input--,--xml_filter--,--xml_output--,--xml_message--)--><
The schema is SYSPROC.
Currently, the only supported value for requested_locale is en_US.
db2 "call sysproc.get_system_info(null,null,null,null,null,?,?)"
Value of output parameters -------------------------- Parameter Name : MAJOR_VERSION Parameter Value : 1 Parameter Name : MINOR_VERSION Parameter Value : 0 Parameter Name : XML_OUTPUT Parameter Value : - Parameter Name : XML_MESSAGE Parameter Value : - Return Status = 0
Example 2: Return system information.
db2 "call sysproc.get_system_info(1,0,'en_US',null,null,?,?)"
Value of output parameters -------------------------- Parameter Name : MAJOR_VERSION Parameter Value : 1 Parameter Name : MINOR_VERSION Parameter Value : 0 Parameter Name : XML_OUTPUT Parameter Value : x'3C3F786D6C20766572..... Parameter Name : XML_MESSAGE Parameter Value : - Return Status = 0
<plist version="1.0"> <dict><key>Document Type Name</key><string>Data Server System Output</string> <key>Document Type Major Version</key><integer>1</integer> <key>Document Type Minor Version</key><integer>0</integer> <key>Data Server Product Name</key><string>QDB2/AIX64</string> <key>Data Server Product Version</key><string>9.7.0.0</string> <key>Data Server Major Version</key><integer>9</integer> <key>Data Server Minor Version</key><integer>7</integer> <key>Data Server Platform</key><string>AIX 64BIT</string> <key>Document Locale</key><string>en_US</string> <key>Instance Information</key> <dict> <key>Display Name</key><string>Instance Information</string> <key>Instance Name</key> <dict> <key>Display Name</key><string>Instance Name</string> <key>Value</key><string>myinstance</string> <key>Hint</key><string></string> </dict> <key>Partitionable State</key> <dict> <key>Display Name</key><string>Partitionable State</string> <key>Value</key><integer>0</integer> <key>Hint</key><string></string> </dict> <key>Number of Database Partitions</key> <dict> <key>Display Name</key><string>Number of Database Partitions</string> <key>Value</key><integer>1</integer> <key>Hint</key><string></string> </dict> . . . </dict> <key>Product Information</key> <dict> <key>Display Name</key><string>Product Information</string> . . . <key>DB2_ENTERPRISE_SERVER_EDITION</key> <dict> <key>Display Name</key><string>DB2_ENTERPRISE_SERVER_EDITION</string> <key>Product short name</key> <dict> <key>Display Name</key><string>Product short name</string> <key>Value</key><string>ESE</string> <key>Hint</key><string></string> </dict> <key>Licence</key> <dict> <key>Display Name</key><string>Licence</string> <key>Value</key><string>Y</string> <key>Hint</key><string></string> </dict> <key>Product Release</key> <dict> <key>Display Name</key><string>Product Release</string> <key>Value</key><string>9.7</string> <key>Hint</key><string></string> </dict> <key>Licence type</key> <dict> <key>Display Name</key><string>Licence type</string> <key>Value</key><string>DEVELOPER</string> <key>Hint</key><string></string> </dict> <key>Hint</key><string></string> </dict> . . . <key>Operating System Information</key> <dict> <key>Display Name</key><string>Operating System Information</string> <key>Name</key> <dict> <key>Display Name</key><string>Name</string> <key>Value</key><string>AIX</string> <key>Hint</key><string></string> </dict> <key>Version</key> <dict> <key>Display Name</key><string>Version</string> <key>Value</key><string>5</string> <key>Hint</key><string></string> </dict> <key>Release</key> <dict> <key>Display Name</key><string>Release</string> <key>Value</key><string>3</string> <key>Hint</key><string></string> </dict> <key>Hostname</key> <dict> <key>Display Name</key><string>Hostname</string> <key>Value</key><string>achilles</string> <key>Hint</key><string></string> </dict> . . . </dict> <key>Workload Management Configuration</key> <dict> <key>Display Name</key><string>Workload Management Configuration</string> <key>Service Class Information</key> <dict> <key>Display Name</key><string>Service Class Information</string> <key>1</key> <dict> <key>Display Name</key><string>1</string> <key>Service Class Name</key> <dict> <key>Display Name</key><string>Service Class Name</string> <key>Value</key><string>SYSDEFAULTSYSTEMCLASS</string> <key>Hint</key><string></string> </dict> <key>Parent Identifier</key> <dict> <key>Display Name</key><string>Parent Identifier</string> <key>Value</key><integer>0</integer> <key>Hint</key><string></string> </dict> <key>Parent Class Name</key> <dict> <key>Display Name</key><string>Parent Class Name</string> <key>Value</key><string></string> <key>Hint</key><string></string> </dict> <key>Creation Time</key> <dict> <key>Display Name</key><string>Creation Time</string> <key>Value</key><string>2008-04-21-15.14.32.956930</string> <key>Hint</key><string></string> </dict> <key>Alter Time</key> <dict> <key>Display Name</key><string>Alter Time</string> <key>Value</key><string>2008-04-21-15.14.32.956930</string> <key>Hint</key><string></string> </dict> <key>Enabled</key> <dict> <key>Display Name</key><string>Enabled</string> <key>Value</key><string>Y</string> <key>Hint</key><string></string> </dict> <key>Agent Priority</key> <dict> <key>Display Name</key><string>Agent Priority</string> <key>Value</key><integer>-32768</integer> <key>Hint</key><string></string> </dict> <key>Prefetcher Priority</key> <dict> <key>Display Name</key><string>Prefetcher Priority</string> <key>Value</key><string> </string> <key>Hint</key><string></string> </dict> . . . </dict> . . . <key>Workload Information</key> <dict> <key>Display Name</key><string>Workload Information</string> <key>1</key> <dict> <key>Display Name</key><string>1</string> <key>Workload Name</key> <dict> <key>Display Name</key><string>Workload Name</string> <key>Value</key><string>SYSDEFAULTUSERWORKLOAD</string> <key>Hint</key><string></string> </dict> <key>Evaluation Order</key> <dict> <key>Display Name</key><string>Evaluation Order</string> <key>Value</key><integer>1</integer> <key>Hint</key><string></string> </dict> <key>Creation Time</key> <dict> <key>Display Name</key><string>Creation Time</string> <key>Value</key><string>2008-04-21-15.14.32.955296</string> <key>Hint</key><string></string> </dict> <key>Alter Time</key> <dict> <key>Display Name</key><string>Alter Time</string> <key>Value</key><string>2008-04-21-15.14.32.955296</string> <key>Hint</key><string></string> </dict> <key>Enabled</key> <dict> <key>Display Name</key><string>Enabled</string> <key>Value</key><string>Y</string> <key>Hint</key><string></string> </dict> <key>Allow Access</key> <dict> <key>Display Name</key><string>Allow Access</string> <key>Value</key><string>Y</string> <key>Hint</key><string></string> </dict> <key>Service Class Name</key> <dict> <key>Display Name</key><string>Service Class Name</string> <key>Value</key><string>SYSDEFAULTSUBCLASS</string> <key>Hint</key><string></string> </dict> <key>Parent Service Class Name</key> <dict> <key>Display Name</key><string>Parent Service Class Name</string> <key>Value</key><string>SYSDEFAULTUSERCLASS</string> <key>Hint</key><string></string> </dict> . . . </dict> <key>Hint</key><string></string> </dict> </dict> </dict></dict></dict></plist>
db2 "call sysproc. get_system_info(1,0,'ja_JP',null,null,?,?)"
Value of output parameters -------------------------- Parameter Name : MAJOR_VERSION Parameter Value : 1 Parameter Name : MINOR_VERSION Parameter Value : 0 Parameter Name : XML_OUTPUT Parameter Value : x'3C3F786D6C20766572..... Parameter Name : XML_MESSAGE Parameter Value : - Return Status = 0 SQL20461W The procedure "SYSPROC.GET_SYSTEM_INFO" returned output in the alternate locale, "en_US", instead of the locale, "ja_JP", specified in parameter "3". SQLSTATE=01H57The XML output document will contain the same content that is shown for Example 2.
Example 4: Call the procedure from a function.
EXEC SQL BEGIN DECLARE SECTION; sqlint16 getSysInfMaj; sqlint16 getSysInfMin; SQL TYPE IS BLOB(2M) xmlOutput; SQL TYPE IS BLOB(2K) xmlOutMessage; EXEC SQL END DECLARE SECTION; getSysInfMaj = 1; getSysInfMin = 0; EXEC SQL CALL SYSPROC.GET_SYSTEM_INFO( :getSysInfMaj, :getSysInfMin, 'en_US', null, null, :xmlOutput, :xmlOutMessage );