I am not able to run ALTER
queries on my Oracle database through Logstash. Below is the snippet from the config file:
input {
jdbc {
jdbc_validate_connection => true
jdbc_driver_library => "ojdbc7.jar"
jdbc_driver_class => "Java::oracle.jdbc.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@<hostname>:<port>/<SID>"
jdbc_user => "username"
jdbc_password => "password"
schedule => "48 11 * * thu"
statement => "ALTER INDEX <tablename> REBUILD ONLINE"
}
}
Getting error:
Exception when executing JDBC query {:exception=>Java::JavaSql::SQLRecoverableException, :message=>"Closed Connection"}
The same config is working fine if I run a select
query and I am able to see the logs in Kibana. Also, I am able to execute the ALTER
query through SQL Developer tool with same user that I am passing here. So this means there's no access related issues.
Is this even possible to run ALTER
queries through Logstash? Not sure what I am missing here. Any help on this is appreciated. Thanks in advance.