# Sync new entries in Oracle DB using sql\_last\_value - Not fetching the new entries

**URL:** <https://discuss.elastic.co/t/sync-new-entries-in-oracle-db-using-sql-last-value-not-fetching-the-new-entries/53271>\
**Category:** Logstash\
**Created:** [June 20, 2016, 6:39am UTC](https://discuss.elastic.co/t/sync-new-entries-in-oracle-db-using-sql-last-value-not-fetching-the-new-entries/53271 "2016-06-20T06:39:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SKumarMN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skumarmn/32/27537_2.png) [@SKumarMN](https://discuss.elastic.co/u/SKumarMN)\
**Post date:** [June 20, 2016, 6:39am UTC](https://discuss.elastic.co/t/sync-new-entries-in-oracle-db-using-sql-last-value-not-fetching-the-new-entries/53271/1 "2016-06-20T06:39:00Z")

</div>

input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:oracle:thin:@host:port/service"  
jdbc\_user =\> "user"  
jdbc\_password =\> "pass"  
jdbc\_validate\_connection =\> "true"  
jdbc\_driver\_library =\> "C:\logstash\lib\ojdbc7.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver"  
statement =\> "select \* from bugDB where product\_id=01 and status \<=30 where upd\_date \> :sql\_last\_value"  
schedule =\> "\*/5 \* \* \* \*"

}  
}

I have the configuration as above. The issue i am facing is after the first run, as I have scheduled the job to run in every 5 mins, the **updated records in DB are not being fetched**. the data type of **upd\_date field is "DATE"**. How to get the recently updated records and keep DB and ES sync

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 22, 2016, 5:40am UTC](https://discuss.elastic.co/t/sync-new-entries-in-oracle-db-using-sql-last-value-not-fetching-the-new-entries/53271/2 "2016-06-22T05:40:12Z")

</div>

How do you know that no records are being fetched, i.e. how are you observing Logstash's behavior? What exact queries are Logstash making, and are they returning data as you'd expect when run from elsewhere? You may have to increase the log level to have the queries logged.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:51am UTC](https://discuss.elastic.co/t/sync-new-entries-in-oracle-db-using-sql-last-value-not-fetching-the-new-entries/53271/3 "2017-07-06T04:51:18Z")

</div>


