While integrating Spectrum with eHealth we might come across the below errors in the stdout.log;
(ERROR) - Error occurred while applying schema change Name: 9203 (Product version: 9.2.0) - Adding machine_id, machine_name, and auth_id to server table. com.aprisma.spectrum.app.web.db.schemachange.FatalSchemaChangeException: com.aprisma.spectrum.app.web.db.schemachange.SchemaChangeException: Error occurred applying schema change using a Statement java.sql.SQLException: Error on rename of '.\eh_integ\server' to '.\eh_integ\#sql2-2948-f1' (errno: -1) aused by: java.sql.SQLException: Error on rename of '.\eh_integ\server' to '.\eh_integ\#sql2-2948-f1' (errno: -1) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2690) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:783) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:626) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java :261) at com.aprisma.spectrum.app.ehealth.schemachange.AddMachineIDNameAuthIDToServer .doSchemaChange(AddMachineIDNameAuthIDToServer.java:69) at com.aprisma.spectrum.app.web.db.schemachange.RuntimeStatementSchemaChange.do SchemaChange(RuntimeStatementSchemaChange.java:76)
The error reflects that there is an issue with applying the schema changes in the eh_integ database.
Please drop and create the eh_integ database using the below commands:
Ex: mysql> show create table element_info\G *************************** 1. row *************************** Table: element_info Create Table: CREATE TABLE 'element_info' ( 'element_key' int(10) unsigned NOT NULL, 'ip_address' varchar(48) DEFAULT NULL, 'mac_address' varchar(24) DEFAULT NULL, 'element_name' varchar(255) DEFAULT NULL, 'element_alias' varchar(255) DEFAULT NULL, 'sys_name' varchar(255) DEFAULT NULL, 'hostname' varchar(255) DEFAULT NULL, 'sys_oid' int(11) unsigned DEFAULT '0', 'if_ip_address' varchar(48) DEFAULT NULL, 'if_desc' varchar(255) DEFAULT NULL, 'if_index' int(11) unsigned DEFAULT '0', 'if_alias' varchar(255) DEFAULT NULL, 'if_name' varchar(255) DEFAULT NULL, 'fr_circuit_if_index' int(11) unsigned DEFAULT '0', 'fr_circuit_dlci' int(11) unsigned DEFAULT '0', 'atm_vpl_vpi' int(11) unsigned DEFAULT '0', 'atm_vcl_vpi' int(11) unsigned DEFAULT '0', 'atm_vcl_vci' int(11) unsigned DEFAULT '0', 'ta_report_url' varchar(1024) DEFAULT NULL, 'element_type' int(10) unsigned DEFAULT NULL, 'index1' int(10) unsigned DEFAULT NULL, 'index2' int(10) unsigned DEFAULT NULL, 'parent_element_id' int(10) unsigned DEFAULT NULL, 'parent_machine_id' int(10) unsigned DEFAULT NULL, PRIMARY KEY ('element_key') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.00 sec)
mysql> drop table <tablename>
On the OC server -> bash -l -> cd mysql/bin -> ./mysql -uroot -proot eh_integ <tablename>.sql
On the OC server -> bash -l -> cd mysql/bin -> ./mysqlcheck -uroot -proot eh-integ