How can I retrieve and update the main AR Server host name and port references for Smart IT on Database level? |
There are two places where the main AR Server host name and port settings are stored for Smart IT:
Note: This article does not cover retrieving/updating of the configured Remedy Application Service password for these connections, or Reporting Server related settings.
Retrieve current settings (note: make sure to adjust the Smart IT System Schema name to match that of your environment):
SELECT NAME, VALUE FROM SmartIT_System.CONFIGURATION_PARAMETER WHERE NAME IN ('connect.arsystem.hostName','connect.arsystem.port')
Update AR System Server Name: UPDATE SmartIT_System.CONFIGURATION_PARAMETER
SET VALUE = '<hostname>' WHERE NAME = 'connect.arsystem.hostName' Update AR System port number: UPDATE SmartIT_System.CONFIGURATION_PARAMETER SET VALUE = '<portnumber>' WHERE NAME = 'connect.arsystem.port'
Retrieve current settings for SQL Server DB:
DECLARE @SourceTableId1 NVARCHAR(255),
@SourceTableId2 NVARCHAR(255), @SourceTableId3 NVARCHAR(255), @sql NVARCHAR(MAX) SELECT @SourceTableId1 = viewName FROM arschema WHERE name = 'SMT:Administration: Application' SELECT @SourceTableId2 = viewName FROM arschema WHERE name = 'SMT:Administration: Application Tenant' SELECT @SourceTableId3 = viewName FROM arschema WHERE name = 'SMT:Administration: Data Stores' SET @sql = 'SELECT Data_Store_ID, Data_Store_Name AS Current_Host_Name, Port FROM ' + @SourceTableId3 + ' WHERE Data_Store_ID IN ( SELECT Data_Store_ID FROM ' + @SourceTableId2 + ' WHERE Mobile_Application_ID IN ( SELECT Mobile_Application_ID FROM ' + @SourceTableId1 + ' WHERE Mobile_Application_Name = ''MyIT-ITSM'' ) )' EXEC(@sql) SELECT viewName FROM arschema WHERE name = 'SMT:Administration: Data Stores' Example output of the above statements in MS SQL Server Management Studio:
Retrieve current settings for ORACLE DB:
DECLARE SourceTableId1 VARCHAR2(255); SourceTableId2 VARCHAR2(255); SourceTableId3 VARCHAR2(255); MyITITSM VARCHAR2(10) := 'MyIT-ITSM'; sql_stmt VARCHAR2(500); sql_result1 VARCHAR2(15); sql_result2 VARCHAR2(254); sql_result3 VARCHAR2(50); BEGIN SELECT VIEWNAME INTO SourceTableId1 FROM arschema WHERE name = 'SMT:Administration: Application'; SELECT VIEWNAME INTO SourceTableId2 FROM arschema WHERE name = 'SMT:Administration: Application Tenant'; SELECT VIEWNAME INTO SourceTableId3 FROM arschema WHERE name = 'SMT:Administration: Data Stores'; sql_stmt := 'SELECT DATA_STORE_ID, DATA_STORE_NAME, PORT FROM ' || SourceTableId3 || ' WHERE DATA_STORE_ID IN ( SELECT DATA_STORE_ID FROM ' || SourceTableId2 || ' WHERE MOBILE_APPLICATION_ID IN ( SELECT MOBILE_APPLICATION_ID FROM ' || SourceTableId1 || ' WHERE MOBILE_APPLICATION_NAME = ''' || MyITITSM || ''' ) )'; EXECUTE IMMEDIATE sql_stmt INTO sql_result1, sql_result2,sql_result3; DBMS_OUTPUT.put_line('=================================== Current Host Name: ' || sql_result2 || ' Port: ' || sql_result3 || ' =================================== DATA_STORE_ID : ' || sql_result1 || ' VIEWNAME : ' || SourceTableId3 ); END; Example output Oracle SQL Developer: Update AR System Server Name, Port for Smart IT Persistent Datastore in AR System DB First use the SQL for the specific database type provided above (SQL Server or ORACLE) that retrieves the current settings – the SQL will not only provide the current settings, but also the Database view name that corresponds with the 'SMT:Administration: Data Stores' form (where the actual connection information is stored), as well as the 'Data_Store_ID' (/request ID), of the request in that form that is selected as the current Smart IT persistent Data Store. Use this information in the queries below to update the connection information:
Example SQL to update AR Server Name: UPDATE <VIEWNAME> SET DATA_STORE_NAME='<new_hostname>' WHERE DATA_STORE_ID = '<DATA_STORE_ID>';
Example SQL to update AR Server port: UPDATE <VIEWNAME> SET PORT=<new_port> WHERE DATA_STORE_ID = '<DATA_STORE_ID>';
Based on the example outputs in the screenshots above, these queries would look like this on those example system (again, the view name and request id may be different on your system): UPDATE SMT_Administration__Data_S2181 SET DATA_STORE_NAME='<new_hostname>' WHERE DATA_STORE_ID = '000000000000001'; UPDATE SMT_Administration__Data_S2181 SET PORT=<new_port> WHERE DATA_STORE_ID = '000000000000001'; |