H2 database migration from 1.4.192 to 2.1.210 - h2
I have migrated my h2db.mv.db from 1.4.192 to 2.1.210. All works well application started with the new version of h2(smoothly) but suddenly what I see in my application that h2 database have dropped some tables on its own(runtime). I am not sure why it is happening, but below are some tables which were there before the migration and dropped randomly. Not sure why it is happening
create table if not exists alerting_criteria_violations(id identity, timestamp bigint not null, meta " + H2Schema.BINARY_COLUMN_64K, alerting_incident_id bigint not null, foreign key(alerting_incident_id) references alerting_incidents(id) on delete cascade);
create table if not exists config(data " + H2Schema.BINARY_COLUMN_64K + ");
create table if not exists user_alert_messengers(id bigint, user_id bigint, data " + H2Schema.BINARY_COLUMN_64K + ",foreign key (user_id) references users(id) on delete cascade);
create table if not exists user_alert_services(id bigint, user_id bigint, data " + H2Schema.BINARY_COLUMN_64K + ", foreign key (user_id) references users(id) on delete cascade);
create table if not exists user_permissions(user_id bigint, group_id bigint, server_id bigint, permissions smallint,
foreign key (user_id) references users(id) on delete cascade,
foreign key (group_id) references informix_server_groups(id) on delete cascade, foreign key (server_id) references informix_servers(id) on delete cascade);
H2Schema.BINARY_COLUMN_64K = binary(65536)
Earlier my jdbc URL have trace level 4 but now I have changed it to 3 to see the debug logs.
Trace logs for h2db as below
2022-06-23 08:43:23 database: disconnecting session #3
2022-06-23 08:43:23 database: closing /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db
2022-06-23 08:43:23 lock: 2 shared read unlock SYS
2022-06-23 08:43:23 lock: 1 shared read unlock SYS
2022-06-23 08:43:23 database: closed
2022-06-23 08:43:23 database: disconnected session #3
2022-06-23 08:43:23 database: opening /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db (build 210)
2022-06-23 08:43:23 lock: 1 exclusive requesting for SYS
2022-06-23 08:43:23 lock: 1 exclusive added for SYS
2022-06-23 08:43:23 lock: 1 exclusive requesting for INFORMIX_SERVER_GROUPS
2022-06-23 08:43:23 lock: 1 exclusive added for INFORMIX_SERVER_GROUPS
2022-06-23 08:43:23 lock: 1 exclusive requesting for SYSTEM_REPORTS
2022-06-23 08:43:23 lock: 1 exclusive added for SYSTEM_REPORTS
2022-06-23 08:43:23 lock: 1 exclusive requesting for ALERTING_INCIDENTS
2022-06-23 08:43:23 lock: 1 exclusive added for ALERTING_INCIDENTS
2022-06-23 08:43:23 lock: 1 exclusive requesting for USERS
2022-06-23 08:43:23 lock: 1 exclusive added for USERS
2022-06-23 08:43:23 lock: 1 exclusive requesting for SENSOR_TYPES
2022-06-23 08:43:23 lock: 1 exclusive added for SENSOR_TYPES
2022-06-23 08:43:23 lock: 1 exclusive requesting for ALERTING_CRITERIA_VIOLATIONS
2022-06-23 08:43:23 lock: 1 exclusive added for ALERTING_CRITERIA_VIOLATIONS
2022-06-23 08:43:23 lock: 1 exclusive requesting for USER_PERMISSIONS
2022-06-23 08:43:23 lock: 1 exclusive added for USER_PERMISSIONS
2022-06-23 08:43:23 lock: 1 exclusive requesting for USER_ALERT_MESSENGERS
2022-06-23 08:43:23 lock: 1 exclusive added for USER_ALERT_MESSENGERS
2022-06-23 08:43:23 lock: 1 exclusive requesting for DASHBOARDS
2022-06-23 08:43:23 lock: 1 exclusive added for DASHBOARDS
2022-06-23 08:43:23 lock: 1 exclusive requesting for USER_ALERT_SERVICES
2022-06-23 08:43:23 lock: 1 exclusive added for USER_ALERT_SERVICES
2022-06-23 08:43:23 lock: 1 exclusive requesting for INFORMIX_SERVERS
2022-06-23 08:43:23 lock: 1 exclusive added for INFORMIX_SERVERS
2022-06-23 08:43:23 lock: 1 exclusive unlock SYS
2022-06-23 08:43:23 lock: 1 exclusive unlock INFORMIX_SERVER_GROUPS
2022-06-23 08:43:23 lock: 1 exclusive unlock SYSTEM_REPORTS
2022-06-23 08:43:23 lock: 1 exclusive unlock ALERTING_INCIDENTS
2022-06-23 08:43:23 lock: 1 exclusive unlock USERS
2022-06-23 08:43:23 lock: 1 exclusive unlock SENSOR_TYPES
2022-06-23 08:43:23 lock: 1 exclusive unlock ALERTING_CRITERIA_VIOLATIONS
2022-06-23 08:43:23 lock: 1 exclusive unlock USER_PERMISSIONS
**2022-06-23 08:43:23 lock: 1 exclusive unlock USER_ALERT_MESSENGERS**
2022-06-23 08:43:23 lock: 1 exclusive unlock DASHBOARDS
2022-06-23 08:43:23 lock: 1 exclusive unlock USER_ALERT_SERVICES
2022-06-23 08:43:23 lock: 1 exclusive unlock INFORMIX_SERVERS
2022-06-23 08:43:23 database: opened /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db
2022-06-23 08:43:23 database: connecting session #3 to /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db
2022-06-23 08:43:23 jdbc[3]:
/*SQL */SET TRACE_LEVEL_FILE 3;
2022-06-23 08:43:23 jdbc[3]:
/**/Connection conn2679 = DriverManager.getConnection("jdbc:h2:file:./h2db;TRACE_LEVEL_FILE=3", "", "");
2022-06-23 08:43:23 jdbc[3]:
/**/PreparedStatement prep947 = conn2679.prepareStatement("update informix_servers set alias = ?, hostname = ?, service_name = ?, port = ?, monitor_user = ?, monitor_password = ?, admin_user = ?, admin_password = ?, group_id = ?, profile = ?, alerts = ?, properties = ?, agent_config = ?, password_secret_Key = ?, server_type = ? where id = 11");
2022-06-23 08:43:23 jdbc[3]: Table : potential plan item cost 10,390 index PUBLIC.INFORMIX_SERVERS.tableScan
2022-06-23 08:43:23 jdbc[3]: Table : potential plan item cost 230 index PUBLIC.PRIMARY_KEY_3
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setString(1, "FUN1");
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setString(2, "localhost");
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setString(3, null);
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setObject(4, x);
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setString(5, "informix");
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setString(6, "47E8rRcSCgt12fTZ3b60sZrLVx911PoDS7YrFYHU43QiR3t/1A==");
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setString(7, "informix");
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setString(8, "z+owAPTcqQE7qx1sX5Ij2qDXiQl2QdNeEXTQJ0Pz61iPvb61FQ==");
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setLong(9, 0L);
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setBytes(10, org.h2.util.StringUtils.convertHexToBytes("ae0200000473656e736f727300a0020000033000610000000274797065001700000068615f7472616e73616374696f6e5f6c6174656e6379001272756e496e74657276616c000f000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000100033100550000000274797065000b00000068615f6c616774696d65001272756e496e74657276616c003c000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c65640001000332005e0000000274797065001400000068615f6c6f676963616c5f6c6f675f72617465001272756e496e74657276616c000f000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c65640001000333005f0000000274797065001500000068615f636f6e6e656374696f6e5f737461747573001272756e496e74657276616c003c000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000100033400650000000274797065001b00000068615f617070726f78696d6174655f6c6f675f6261636b6c6f67001272756e496e74657276616c000f000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000100033500580000000274797065000e00000068615f6170706c795f72617465001272756e496e74657276616c0005000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000000033600560000000274797065000c00000068615f776f726b6c6f6164001272756e496e74657276616c003c000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c65640001000000"));
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setBytes(11, org.h2.util.StringUtils.convertHexToBytes("2100000004616c657274730005000000000464697361626c656400050000000000"));
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setBytes(12, org.h2.util.StringUtils.convertHexToBytes("0500000000"));
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setBytes(13, org.h2.util.StringUtils.convertHexToBytes("50000000127265706f7369746f72795365727665724964000100000000000000026461746162617365000600000068716d6f6e000a6167656e74436f6e6e656374696f6e50726f706572746965730000"));
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setObject(14, x);
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.setObject(15, x);
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.executeUpdate();
2022-06-23 08:43:23 lock: 3 shared write requesting for INFORMIX_SERVERS
2022-06-23 08:43:23 lock: 3 shared write ok INFORMIX_SERVERS
2022-06-23 08:43:23 jdbc[3]:
/*SQL l:284 #:1 t:1*/update informix_servers set alias = ?, hostname = ?, service_name = ?, port = ?, monitor_user = ?, monitor_password = ?, admin_user = ?, admin_password = ?, group_id = ?, profile = ?, alerts = ?, properties = ?, agent_config = ?, password_secret_Key = ?, server_type = ? where id = 11 {1: 'FUN1', 2: 'localhost', 3: NULL, 4: 6090, 5: 'informix', 6: '47E8rRcSCgt12fTZ3b60sZrLVx911PoDS7YrFYHU43QiR3t/1A==', 7: 'informix', 8: 'z+owAPTcqQE7qx1sX5Ij2qDXiQl2QdNeEXTQJ0Pz61iPvb61FQ==', 9: CAST(0 AS BIGINT), 10: X'ae0200000473656e736f727300a0020000033000610000000274797065001700000068615f7472616e73616374696f6e5f6c6174656e6379001272756e496e74657276616c000f000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000100033100550000000274797065000b00000068615f6c616774696d65001272756e496e74657276616c003c000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c65640001000332005e0000000274797065001400000068615f6c6f676963616c5f6c6f675f72617465001272756e496e74657276616c000f000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c65640001000333005f0000000274797065001500000068615f636f6e6e656374696f6e5f737461747573001272756e496e74657276616c003c000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000100033400650000000274797065001b00000068615f617070726f78696d6174655f6c6f675f6261636b6c6f67001272756e496e74657276616c000f000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000100033500580000000274797065000e00000068615f6170706c795f72617465001272756e496e74657276616c0005000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c6564000000033600560000000274797065000c00000068615f776f726b6c6f6164001272756e496e74657276616c003c000000000000001064617461526574656e74696f6e496e74657276616c001e0000000864697361626c65640001000000', 11: X'2100000004616c657274730005000000000464697361626c656400050000000000', 12: X'0500000000', 13: X'50000000127265706f7369746f72795365727665724964000100000000000000026461746162617365000600000068716d6f6e000a6167656e74436f6e6e656374696f6e50726f706572746965730000', 14: CAST(X'aced00057372001f6a617661782e63727970746f2e737065632e5365637265744b6579537065635b470b66e230614d0200024c0009616c676f726974686d7400124c6a6176612f6c616e672f537472696e673b5b00036b65797400025b427870740003414553757200025b42acf317f8060854e0020000787000000010150d49c6152ac53bf23ea2daff16dbda' AS JAVA_OBJECT), 15: X'2b000000027365727665725479706500090000005374616e6461726400086973526561644f6e6c79000000'};
2022-06-23 08:43:23 lock: 3 shared write unlock INFORMIX_SERVERS
2022-06-23 08:43:23 jdbc[3]:
/**/prep947.close();
2022-06-23 08:43:23 jdbc[3]:
/**/conn2679.close();
2022-06-23 08:43:23 lock: 3 shared read unlock SYS
2022-06-23 08:43:23 database: disconnecting session #3
2022-06-23 08:43:23 database: closing /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db
2022-06-23 08:43:23 lock: 2 shared read unlock SYS
2022-06-23 08:43:23 lock: 1 shared read unlock SYS
2022-06-23 08:43:24 database: closed
2022-06-23 08:43:24 database: disconnected session #3
2022-06-23 08:43:29 database: opening /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db (build 210)
2022-06-23 08:43:29 lock: 1 exclusive requesting for SYS
2022-06-23 08:43:29 lock: 1 exclusive added for SYS
2022-06-23 08:43:29 lock: 1 exclusive requesting for INFORMIX_SERVER_GROUPS
2022-06-23 08:43:29 lock: 1 exclusive added for INFORMIX_SERVER_GROUPS
2022-06-23 08:43:29 lock: 1 exclusive requesting for INFORMIX_SERVERS
2022-06-23 08:43:29 lock: 1 exclusive added for INFORMIX_SERVERS
2022-06-23 08:43:29 lock: 1 exclusive requesting for SYSTEM_REPORTS
2022-06-23 08:43:29 lock: 1 exclusive added for SYSTEM_REPORTS
2022-06-23 08:43:29 lock: 1 exclusive requesting for ALERTING_INCIDENTS
2022-06-23 08:43:29 lock: 1 exclusive added for ALERTING_INCIDENTS
2022-06-23 08:43:29 lock: 1 exclusive requesting for USERS
2022-06-23 08:43:29 lock: 1 exclusive added for USERS
2022-06-23 08:43:29 lock: 1 exclusive requesting for SENSOR_TYPES
2022-06-23 08:43:29 lock: 1 exclusive added for SENSOR_TYPES
2022-06-23 08:43:29 lock: 1 exclusive unlock SYS
2022-06-23 08:43:29 lock: 1 exclusive unlock INFORMIX_SERVER_GROUPS
2022-06-23 08:43:29 lock: 1 exclusive unlock INFORMIX_SERVERS
2022-06-23 08:43:29 lock: 1 exclusive unlock SYSTEM_REPORTS
2022-06-23 08:43:29 lock: 1 exclusive unlock ALERTING_INCIDENTS
2022-06-23 08:43:29 lock: 1 exclusive unlock USERS
2022-06-23 08:43:29 lock: 1 exclusive unlock SENSOR_TYPES
2022-06-23 08:43:29 database: opened /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db
2022-06-23 08:43:29 database: connecting session #3 to /Volumes/Macintosh HD - Data/Projects/informixhq-server/server/h2db
2022-06-23 08:43:29 jdbc[3]:
/*SQL */SET TRACE_LEVEL_FILE 3;
2022-06-23 08:43:29 jdbc[3]:
/**/Connection conn2680 = DriverManager.getConnection("jdbc:h2:file:./h2db;TRACE_LEVEL_FILE=3", "", "");
2022-06-23 08:43:29 jdbc[3]:
/**/Statement stat1734 = conn2680.createStatement();
2022-06-23 08:43:29 jdbc[3]:
/**/ResultSet rs1747 = stat1734.executeQuery("select a.id, a.when_created, a.state, b.meta, a.informix_server_id, c.alias from alerting_incidents a join alerting_criteria_violations b on a.id = b.alerting_incident_id, informix_servers c where a.informix_server_id = c.id and a.informix_server_id = 11 order by a.when_created desc ");
2022-06-23 08:43:29 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "ALERTING_CRITERIA_VIOLATIONS" not found; SQL statement:
select a.id, a.when_created, a.state, b.meta, a.informix_server_id, c.alias from alerting_incidents a join alerting_criteria_violations b on a.id = b.alerting_incident_id, informix_servers c where a.informix_server_id = c.id and a.informix_server_id = 11 order by a.when_created desc [42102-210]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:521)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:496)
at org.h2.message.DbException.get(DbException.java:227)
at org.h2.message.DbException.get(DbException.java:203)
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8410)
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8381)
at org.h2.command.Parser.readTableOrView(Parser.java:8370)
at org.h2.command.Parser.readTablePrimary(Parser.java:1866)
at org.h2.command.Parser.readTableReference(Parser.java:2342)
at org.h2.command.Parser.readTableReference(Parser.java:2377)
at org.h2.command.Parser.parseSelectFromPart(Parser.java:2793)
at org.h2.command.Parser.parseSelect(Parser.java:2900)
at org.h2.command.Parser.parseQueryPrimary(Parser.java:2783)
at org.h2.command.Parser.parseQueryTerm(Parser.java:2650)
at org.h2.command.Parser.parseQueryExpressionBody(Parser.java:2629)
at org.h2.command.Parser.parseQueryExpressionBodyAndEndOfQuery(Parser.java:2622)
at org.h2.command.Parser.parseQueryExpression(Parser.java:2615)
at org.h2.command.Parser.parseQuery(Parser.java:2576)
at org.h2.command.Parser.parsePrepared(Parser.java:707)
at org.h2.command.Parser.parse(Parser.java:674)
at org.h2.command.Parser.parse(Parser.java:644)
at org.h2.command.Parser.prepareCommand(Parser.java:551)
at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:615)
at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:553)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:92)
at com.informix.hq.server.rest.api.alert.AlertingIncidentsResource.getIncidents(AlertingIncidentsResource.java:108)
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036)
at java.lang.Thread.run(Thread.java:748)
2022-06-23 08:43:29 jdbc[3]:
/**/stat1734.close();
2022-06-23 08:43:29 jdbc[3]:
/**/conn2680.close();
As you can see there is no table with name "USER_ALERT_MESSENGERS"
Related
How do i get only PID of postgres.exe from the first row of output
I am using this command- tasklist /FI "ImageName eq postgres.exe" this is the output I am getting- Image Name PID Session Name Session# Mem Usage ========================= ======== ================ =========== ============ postgres.exe 2300 Services 0 19,752 K postgres.exe 2932 Services 0 6,324 K postgres.exe 2992 Services 0 8,660 K postgres.exe 3000 Services 0 8,256 K postgres.exe 3008 Services 0 11,128 K postgres.exe 3016 Services 0 8,120 K postgres.exe 3024 Services 0 7,756 K postgres.exe 3032 Services 0 7,732 K postgres.exe 1684 Services 0 20,732 K
To answer the comment and question. (Get-Process postgres)[0].ID Get-Process get's all running processes with name postgres [0] grabs the first row .ID grabs the PID property
Need to subtract immediate line time deference in a log file in bash?
I have a log file which is genarated from a backup restoring process. I want know whether is there any slowness compared to the previous times. so i need to the time deference for each an individual restore module time . here is my log file. 2019-10-26 08:06:56 6503 6501 Begin restore logical log 2290281 (Storage Manager copy ID: 1 1571839465). 2019-10-26 08:14:05 6503 6501 Completed restore logical log 2290281. 2019-10-26 08:14:09 6503 6501 Begin restore logical log 2290282 (Storage Manager copy ID: 1 1571839691). 2019-10-26 08:21:09 6503 6501 Completed restore logical log 2290282. 2019-10-26 08:21:13 6503 6501 Begin restore logical log 2290283 (Storage Manager copy ID: 1 1571839892). so my expectation is showing simply below result deference between (2019-10-26 08:14:05) and (2019-10-26 08:06:56) deference between (2019-10-26 08:21:09) and (2019-10-26 08:14:09) so my expected output is 7 minutes and 11 seconds 7 minutes and 00 seconds
You can use bash/date for the simple date math. PREV= DELTA=0 while read dt tm data ; do CURR=$(date '+%s' -d "$dt $tm"); [ "$PREV" ] && DELTA=$((CURR-PREV)); PREV=$CURR ; echo "$DELTA sec $dt $tm $data" ; done < logfile Additional formatting can be added to the echo echo "$((DELTA/60)) min and $((DELTA%60)) sec $dt $tm $data" ; Output: 0 min and 0 sec 2019-10-26 08:06:56 6503 6501 Begin restore logical log 2290281 (Storage Manager copy ID: 1 1571839465). 7 min and 9 sec 2019-10-26 08:14:05 6503 6501 Completed restore logical log 2290281. 0 min and 4 sec 2019-10-26 08:14:09 6503 6501 Begin restore logical log 2290282 (Storage Manager copy ID: 1 1571839691). 7 min and 0 sec 2019-10-26 08:21:09 6503 6501 Completed restore logical log 2290282.
Weird output of pg_stat_activity
I have troubles with the output of this simple query: select pid, state from pg_stat_activity where datname = 'My_DB_name' while running it different ways: In IDE Via running psql in terminal In bash script: QUERY="copy (select pid, state from pg_stat_activity where datname = 'My_DB_name') to stdout with csv" psql -h host -U user -d database -t -c "$QUERY" >> result 1 and 2 return results as I need them: 1: pid state ------ ----------------------------- 23126 idle 25573 active 2642 active 20420 idle 23391 idle 5339 idle 7710 idle 1558 idle 12506 idle 2862 active 716 active 9834 idle in transaction (aborted) 2: pid | state -------+------------------------------- 23126 | idle 25573 | idle 2642 | active 20420 | idle 23391 | idle 5339 | active 7710 | idle 1558 | idle 12506 | idle 2211 | active 716 | active 9834 | idle in transaction (aborted) 3 is weird - it doesnt give me any state name except 'active' 23126, 25573, 2642, 20420, 23391, 5339, 7710, 1558, 12506, 1660,active 716,active 1927,active 9834, What am I missing? How to get all the state names via bash script?
pg_stat_activity is a catalog view that will show different content depending on whether you're logged in as a superuser, or as a non-privileged user. From your output, it looks like you're logged in as superuser in #1 and #2, but as a normal user in #3.
How to connect Database and run query inside a shell script?
I am trying to connect to DB from a shell script, but I am getting below errors for this. Database output: ERROR: ORA-12154: TNS:could not resolve the connect identifier specified SP2-0306: Invalid option. Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where ::= [/][#] | / SP2-0306: Invalid option. Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where ::= [/][#] | / Trail code: #!/bin/bash LogDirectory='/users/users-06/p6***8/scripts/dir' ORACLE_HOME=/tools/ver/oracle-10.2.0.1-64 export ORACLE_HOME DBUSER='p6*02*1' DBUSERPASSWORD='R****07' DB='O**XDA3' var=`$ORACLE_HOME/bin/sqlplus -S ${DBUSER}/${DBUSERPASSWORD}#${DB} << EOD spool ${LogDirectory}/query.txt set linesize 32767 set feedback off set heading off SELECT * FROM Omi.ESP_FEED_REQUEST WHERE FEED_NAME='PSAR_TRANSACTION_FEED' AND REQUEST_ID='3694707322503' AND AS_OF='04-Jan-2017' ORDER BY 1 DESC; spool off exit; EOD` echo $var > ${LogDirectory}/DB_output.txt Could you please suggest me how I will get the sql output in "var" variable, please? Thanks a lot !
The output of your query is getting spooled at below path {LogDirectory}/query.txt var will only have a status of code 1 or 0 . If the statement is executed successfully then var status will be 0 else 1.
It's working fine here: #!/bin/bash LogDirectory='/home/oracle' ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 export ORACLE_HOME DBUSER='scott' DBUSERPASSWORD='scott' DB='db11g' var=`$ORACLE_HOME/bin/sqlplus -S ${DBUSER}/${DBUSERPASSWORD}#${DB} << EOD spool ${LogDirectory}/query.txt set linesize 32767 set feedback off set heading off select 5 from dual; exit; EOD` echo "Database output: ${var}" $ ./stack.sh Database output: 5 Is your database up and running? check: ps -ef | grep pmon This will show a process if it's running. When it's not you get the error you're getting: SQL> shu immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining, Oracle Database Vault and Real Application Testing options $ ./stack.sh Database output: ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]] where <logon> ::= <username>[/<password>][#<connect_identifier>] <proxy> ::= <proxyuser>[<username>][/<password>][#<connect_identifier>] SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]] where <logon> ::= <username>[/<password>][#<connect_identifier>] <proxy> ::= <proxyuser>[<username>][/<password>][#<connect_identifier>] SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus edit for XING: I changed the code to: select * from t1; $ ./stack.sh Database output: A B and select * from user_tables $ ./stack.sh Database output: DEPT USERS VALID 10 1 255 65536 1048576 1 2147483645 YES N 4 5 0 0 0 20 0 0 1 1 N ENABLED 4 07-OCT-14 NO N N NO DEFAULT DEFAULT DEFAULT DISABLED YES NO DISABLED YES DISABLED DISABLED NO NO YES DEFAULT SALGRADE USERS VALID 10 1 255 65536 1048576 1 2147483645 YES N 5 5 0 0 0 10 0 0 1 1 N ENABLED 5 07-OCT-14 NO N N NO DEFAULT DEFAULT DEFAULT DISABLED YES NO DISABLED YES DISABLED DISABLED NO NO YES DE
echo "SELECT * FROM Omi.ESP_FEED_REQUEST WHERE FEED_NAME='PSAR_TRANSACTION_FEED' AND REQUEST_ID='3694707322503' AND AS_OF='04-Jan-2017' ORDER BY 1 DESC;" | sqlplus -s $DBUSER#$DB/$DBUSERPASSWORD >> dboutput.txt
Iteration of batch script based on search string
I've a Program2.bat having Oracle query, which generates a file log.txt having content-structure either like: SQL> SELECT SID, SERIAL#, STATUS, USERNAME, LOGON_TIME FROM GV$SESSION WHERE USERNAME = 'DBADMIN' and status in ('ACTIVE','INACTIVE','KILLED') ; no rows selected SQL> spool off; OR like: SQL> SELECT SID, SERIAL#, STATUS, USERNAME, LOGON_TIME FROM GV$SESSION WHERE USERNAME = 'DBADMIN' and status in ('ACTIVE','INACTIVE','KILLED') ; SID SERIAL# STATUS USERNAME LOGON_TI ---------- ---------- ---------- ---------- ------------- 2388 54 Active DBADMIN 28-FEB-14 2391 37 Active DBADMIN 17-FEB-14 2395 111 Inactive DBADMIN 28-FEB-14 2780 325 Killed DBADMIN 26-FEB-14 2790 111 Killed DBADMIN 8-FEB-14 5 rows selected. SQL> spool off I'm trying to achieve following things: Action-1: Call Program2.bat, which will generate log.txt Action-2: Search for the string "no rows selected" in log.txt Action-3: If string found then call program1.bat Action-4: If string not found then do below: call program2.bat again and Do Action-2 again at an interval of 5 mins (means keep searching for string "no rows selected" in log.txt on an interval of 5 mins untill string "no rows selected" got found ). #echo off setlocal Call Program2.bat >nul findstr /c:"no rows selected" log.txt && ( call program1.bat ) || ( call program2.bat ) How Point-2 of Action-4 can be achieved in above script or do we have any other way to achieve all in the easiest way?