# Internal database size

**URL:** <https://forum.inductiveautomation.com/t/internal-database-size/14183>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [May 2, 2017, 11:45am UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183 "2017-05-02T11:45:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cristihcd](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@cristihcd](https://forum.inductiveautomation.com/u/cristihcd)\
**Post date:** [May 2, 2017, 11:45am UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183/1 "2017-05-02T11:45:54Z")

</div>

Hi,

Using Ignition 7.9.2, a gateway backup has 118 MB, of which the database backup (.idb) has 114MB.

The project\_resources table in this database takes 97% of this space.

Looking at the largest rows in this table by blob size, they are mostly old/deleted windows, which no longer appear in the designer.

An export from the designer for all windows takes 11MB.

We took a look at this database because the internal db backups were taking longer and longer, blocking the gateway.

My question is, how do we compact/clean the project\_resources table and if it is advisable.

Thanks!

---

<div class="post-metadata">

**Author:** ![cristihcd](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@cristihcd](https://forum.inductiveautomation.com/u/cristihcd)\
**Post date:** [May 2, 2017, 1:10pm UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183/2 "2017-05-02T13:10:47Z")

</div>

Backing up the internal DB takes one minute:

`Created auto-backup of internal database "config.idb" in 57 seconds`

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [May 2, 2017, 1:33pm UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183/3 "2017-05-02T13:33:06Z")

</div>

The internal db needs to hold on to some older versions of windows (well, actually all project resources), whether deleted or not, for rollback. These older versions should be getting pruned on a regular basis, but if you think there’s a bug in the pruning the best bet is to contact support and forward them your gateway backup so we can look at it and see what’s going on.

---

<div class="post-metadata">

**Author:** ![cristihcd](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@cristihcd](https://forum.inductiveautomation.com/u/cristihcd)\
**Post date:** [May 2, 2017, 1:59pm UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183/4 "2017-05-02T13:59:06Z")

</div>

Hello Kathy,

Our problem comes from this:

```auto
...
INFO | jvm 1 | 2017/05/02 16:01:16 | E [T.P.Config] [13:01:16]: Error storing tag values. tag-provider=default
INFO | jvm 1 | 2017/05/02 16:01:16 | simpleorm.utils.SException$Jdbc: Opening com.inductiveautomation.ignition.gateway.localdb.sqlite.SingleConnectionDatasource@29369965
INFO | jvm 1 | 2017/05/02 16:01:16 | at simpleorm.sessionjdbc.SSessionJdbc.innerOpen(SSessionJdbc.java:113)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.localdb.persistence.PersistenceSession.initialize(PersistenceSession.java:28)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.localdb.PersistenceInterfaceImpl.getSession(PersistenceInterfaceImpl.java:69)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.localdb.PersistenceInterfaceImpl.getSession(PersistenceInterfaceImpl.java:46)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.sqltags.tagproviders.internal.InternalTagStore.openIfNot(InternalTagStore.java:1300)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.sqltags.tagproviders.internal.InternalTagStore.internalStoreTagValues(InternalTagStore.java:1339)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.sqltags.tagproviders.internal.InternalTagStore.storeTagValues(InternalTagStore.java:1248)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.sqltags.providers.AbstractStoreBasedTagProvider.tagValuesChanged(AbstractStoreBasedTagProvider.java:2449)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.sqltags.scanclasses.SimpleExecutableScanClass$ScanClassTagEvaluationContext.processAndReset(SimpleExecutableScanClass.java:1131)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.sqltags.scanclasses.SimpleExecutableScanClass.run(SimpleExecutableScanClass.java:920)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$SelfSchedulingRunner.run(BasicExecutionEngine.java:511)
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$TrackedTask.run(BasicExecutionEngine.java:593)
INFO | jvm 1 | 2017/05/02 16:01:16 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
INFO | jvm 1 | 2017/05/02 16:01:16 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
INFO | jvm 1 | 2017/05/02 16:01:16 | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
INFO | jvm 1 | 2017/05/02 16:01:16 | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
INFO | jvm 1 | 2017/05/02 16:01:16 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
INFO | jvm 1 | 2017/05/02 16:01:16 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
INFO | jvm 1 | 2017/05/02 16:01:16 | at java.lang.Thread.run(Thread.java:745)
INFO | jvm 1 | 2017/05/02 16:01:16 | Caused by: java.sql.SQLException: Connection is locked. Datasource only allows one connection at a time. More information was logged to the gateway console.
INFO | jvm 1 | 2017/05/02 16:01:16 | at com.inductiveautomation.ignition.gateway.localdb.sqlite.SingleConnectionDatasource.getConnection(SingleConnectionDatasource.java:58)
INFO | jvm 1 | 2017/05/02 16:01:16 | at simpleorm.sessionjdbc.SSessionJdbc.innerOpen(SSessionJdbc.java:111)
INFO | jvm 1 | 2017/05/02 16:01:16 | ... 18 common frames omitted
INFO | jvm 1 | 2017/05/02 16:01:25 | E [c.i.i.g.l.s.SingleConnectionDatasource] [13:01:25]: The following stack successfully received a connection. A new attempt was blocked for over 30000 ms 
INFO | jvm 1 | 2017/05/02 16:01:25 | java.lang.Throwable: null

...

```

In practice the designer loses connection with the gateway 10-20 times per day, for ~30 seconds.

The project is quite stable (as in the number of windows created/deleted) for about 2 months.

If you suggest I can send a gateway backup to support.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [May 2, 2017, 3:49pm UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183/5 "2017-05-02T15:49:49Z")

</div>

Yes, please contact support with this.

---

<div class="post-metadata">

**Author:** ![cristihcd](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@cristihcd](https://forum.inductiveautomation.com/u/cristihcd)\
**Post date:** [May 5, 2017, 7:45am UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183/6 "2017-05-05T07:45:49Z")

</div>

We ended up modifying the following parameters in gateway.xml:

```auto
<entry key="localdb.autobackup.delay">120</entry>
<entry key="localdb.autobackup.count">5</entry>

```

This reduced the interval to 2 hours.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 25, 2024, 1:16pm UTC](https://forum.inductiveautomation.com/t/internal-database-size/14183/7 "2024-03-25T13:16:47Z")

</div>

Split this topic on March 25, 2024, 1:16pm UTC

4 posts were split to a new topic: [Store Production Data in Internal Database?](https://forum.inductiveautomation.com/t/store-production-data-in-internal-database/87832)
