<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[database locked error]]></title><description><![CDATA[<p dir="auto">Hi there,</p>
<p dir="auto">I'm running version 1.2.13 on a windows 2008 x64 R2 with a built in database type.<br />
Bellow is a debug session result of the following command : netxmsd.exe -D4 &gt;c:\netxmsd.log<br />
Looking on the log file, there are several events like the one bellow.</p>
<pre><code>[17-Jul-2014 17:50:21.513] SQL query failed (Query = "UPDATE raw_dci_values SET raw_value=?,transformed_value=?,last_poll_time=? WHERE item_id=?"): database is locked
[17-Jul-2014 17:50:21.559] SQL query failed (Query = "INSERT INTO dct_column_names (column_id,column_name) VALUES (?,?)"): database is locked
[17-Jul-2014 17:50:33.915] SQL query failed (Query = "INSERT INTO event_log (event_id,event_code,event_timestamp,event_source,event_severity,event_message,root_event_id,user_tag) VALUES (8896895,29,1405630197,728,0,'Node up',0,'')"): database is locked
</code></pre>
<p dir="auto">I already tried to run a nxdbmgr -f unlock and that returns ok, but the problem persists.</p>
<p dir="auto">After sometime running, I see that some threads hangs up ... and that's when the mess starts.<br />
Running a nxadm -i and executing show watchdog I can see that both Syncer Thread and Pool Manager gets "Not Responding" after sometime. </p>
<pre><code>[17-Jul-2014 17:54:04.016] Thread "Syncer Thread" does not respond to watchdog thread
</code></pre>
<p dir="auto">I guess the problem is regarding unlock this database ...<br />
I also noticed a weird behaviour on the netxmsd daemon startup :</p>
<pre><code>[33mnetxmsd:[0m Using configuration file "C:\NetXMS\etc\netxmsd.conf"
[17-Jul-2014 17:49:43.823] Listening for client connections on TCP socket 0.0.0.0:4701
[17-Jul-2014 17:49:43.823] Listening for mobile device connections on TCP socket 0.0.0.0:4747
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=0000000004330DC0
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=0000000004330D60
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=0000000002ACB2B0
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=00000000047C5910
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=00000000047C59D0
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=00000000047C5A90
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=00000000047C5B50
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=00000000047C5C10
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=00000000047C5D90
[17-Jul-2014 17:49:48.799] New DB connection opened: handle=00000000047C5E50
[17-Jul-2014 17:49:48.815] New DB connection opened: handle=00000000047C5EB0
[17-Jul-2014 17:49:48.831] New DB connection opened: handle=00000000047C5FD0
[17-Jul-2014 17:49:48.831] New DB connection opened: handle=0000000004CA1C20
[17-Jul-2014 17:49:48.831] New DB connection opened: handle=0000000004CA1DA0
[17-Jul-2014 17:49:48.831] New DB connection opened: handle=0000000004CA1C80
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
[17-Jul-2014 17:49:48.831] Database Connection Pool exhausted, fallback connection used
</code></pre>
<p dir="auto">I need some help please ...</p>
]]></description><link>https://forum.netxms.org/topic/3272/database-locked-error</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 07:24:58 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/3272.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Jul 2014 21:03:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to database locked error on Wed, 23 Jul 2014 18:59:27 GMT]]></title><description><![CDATA[<p dir="auto">Awesome Alex.<br />
Thank you very much. I'll migrate and post back. But seems easy and I guess there won't be problems.</p>
<p dir="auto">Also Just an update, The problem is solved following the steps from this post. <a href="http://techblog.dorogin.com/2011/05/sqliteexception-database-disk-image-is.html" rel="nofollow ugc">http://techblog.dorogin.com/2011/05/sqliteexception-database-disk-image-is.html</a><br />
After re-creating my database that was 3.5GB, now it has 1.0Gb and pretty fast.<br />
I'll proceed with the database migration.</p>
<p dir="auto">Thanks again.</p>
]]></description><link>https://forum.netxms.org/post/14454</link><guid isPermaLink="true">https://forum.netxms.org/post/14454</guid><dc:creator><![CDATA[hadesfromhell]]></dc:creator><pubDate>Wed, 23 Jul 2014 18:59:27 GMT</pubDate></item><item><title><![CDATA[Reply to database locked error on Wed, 23 Jul 2014 15:51:46 GMT]]></title><description><![CDATA[<p dir="auto">To use "nxdbmgr migrate", you need to do a few preparation steps:</p>
<ol>
<li>Create a copy of existing netxmsd.conf, I'll name it "netxmsd_old.conf" in this example</li>
<li>Create new database</li>
<li>Init with initial schema: <code>nxdbmgr init /opt/netxms/share/netxms/sql/dbinit_pgsql.sql</code><br />
Please note, that there are different files for different database types, in this example - "dbinit_pgsql.sql" is for PostgreSQL.</li>
<li>Adjust "netxmsd.conf" - change DBDriver, DBName, etc. to match new database</li>
<li>(optional) run "nxdbmgr check" to verify connectivity to new database</li>
<li>run "nxdbmgr migrate netxmsd_old.conf". This will load data from old database (using credentials in netxmsd_old.conf) and migrate it into new one (as configured in netxmsd.conf)</li>
</ol>
]]></description><link>https://forum.netxms.org/post/14453</link><guid isPermaLink="true">https://forum.netxms.org/post/14453</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Wed, 23 Jul 2014 15:51:46 GMT</pubDate></item><item><title><![CDATA[Reply to database locked error on Wed, 23 Jul 2014 15:10:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi Alex,</p>
<p dir="auto">Thank you very much, that helped me a lot and it seems that the problem is solved, but in a different way.<br />
I could not run the command you gave me, it returns me incomplete or args missing. So I started exploring SQLite commands and I found an SQLite Explorer on this link : <a href="http://sourceforge.net/projects/sqlitebrowser/" rel="nofollow ugc">http://sourceforge.net/projects/sqlitebrowser/</a><br />
The main problem I believe that's the Event Monitor rows bellow :<br />
 </p>
<pre><code>23.07.2014 10:40:22	W2K8-NETXMS	Critical	SYS_DB_QUERY_FAILED	Database query failed (Query: INSERT INTO event_log (event_id,event_code,event_timestamp,event_source,event_severity,event_message,root_event_id,user_tag) VALUES (8918460,100002,1406122787,1425,1,'Memory Utilization is too high',0,''); Error: database is locked)
23.07.2014 10:40:31	W2K8-NETXMS	Critical	SYS_DB_QUERY_FAILED	Database query failed (Query: UPDATE raw_dci_values SET raw_value=?,transformed_value=?,last_poll_time=? WHERE item_id=?; Error: database is locked)
23.07.2014 10:40:31	W2K8-NETXMS	Critical	SYS_DB_QUERY_FAILED	Database query failed (Query: INSERT INTO dct_column_names (column_id,column_name) VALUES (?,?); Error: database is locked)
</code></pre>
<p dir="auto">So I decided to clean the event_log database running the following command : "delete from event_log" and after that, it's working back to normal. So far no "database locked errors."</p>
<p dir="auto">I also found this link very useful, where they talk about the only way to recover from a database lock events, is copying the database to another location. Which means that the lock is directly related to a process accessing the disk database file.<br />
Maybe the problem was related to the ammount of data stored on a single table as explained on the link bellow.<br />
<a href="http://sqlite.org/limits.html" rel="nofollow ugc">http://sqlite.org/limits.html</a></p>
<p dir="auto">I hope all this information that will remain on this forum can help someone else in the future, that's why I tried to put as much details as possible.</p>
<p dir="auto">Also thank you very much again Alex. I'll work now in migrating this DB to PostgreSQL. I'll apreciate if you can share more information on how to migrate the database. I tried to run "nxdbmgr migrate c:\file" and it starts and crashes when the new file gets around 9Mb...</p>
]]></description><link>https://forum.netxms.org/post/14452</link><guid isPermaLink="true">https://forum.netxms.org/post/14452</guid><dc:creator><![CDATA[hadesfromhell]]></dc:creator><pubDate>Wed, 23 Jul 2014 15:10:14 GMT</pubDate></item><item><title><![CDATA[Reply to database locked error on Tue, 22 Jul 2014 22:19:03 GMT]]></title><description><![CDATA[<p dir="auto">Hello.</p>
<p dir="auto">Bundled DB engine is SQLite. You can try to export/reimport db into a new file (run in cmd.exe): <code>echo ".dump" | sqlite3 c:\netxms\ database\netxms_db | sqlite3 c:\netxms\ database\netxms_db.new</code></p>
<p dir="auto">sqlite3.exe can be downloaded here: <a href="http://www.sqlite.org/2014/sqlite-shell-win32-x86-3080500.zip" rel="nofollow ugc">http://www.sqlite.org/2014/sqlite-shell-win32-x86-3080500.zip</a></p>
<p dir="auto">This should produce a clean copy of the database in file netxms_db.new. Move original netxms_db tor backup and rename netxms_db.new to netxms_db.</p>
<p dir="auto">I also highly recommend you to migrate to any other database engines, PostgreSQL is common and quite good choice - it's powerful, free and require just a little of the system resources in default configuration.</p>
<p dir="auto">nxdbmgr can be used for migration (so you don't have to dump data and reimport it manually).</p>
]]></description><link>https://forum.netxms.org/post/14440</link><guid isPermaLink="true">https://forum.netxms.org/post/14440</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Tue, 22 Jul 2014 22:19:03 GMT</pubDate></item><item><title><![CDATA[Reply to database locked error on Tue, 22 Jul 2014 19:35:04 GMT]]></title><description><![CDATA[<p dir="auto">Hi Victor,<br />
Thanks for the always fast answer.</p>
<p dir="auto">I'm using no 3rd party DB engine, on this install I selected builtin database ...<br />
On the NetXms folder /database there's a file called netxms_db.<br />
I already rebooted this server several times ..</p>
<p dir="auto">Is there any way to read this file ? is it mysql ? maybe edit it.</p>
<p dir="auto">Thanks !!!</p>
]]></description><link>https://forum.netxms.org/post/14439</link><guid isPermaLink="true">https://forum.netxms.org/post/14439</guid><dc:creator><![CDATA[hadesfromhell]]></dc:creator><pubDate>Tue, 22 Jul 2014 19:35:04 GMT</pubDate></item><item><title><![CDATA[Reply to database locked error on Fri, 18 Jul 2014 12:38:23 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">I would suggest a reboot for whole system if possible. Error message is from DB itself, not from NetXMS - so it's not that lock.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/14416</link><guid isPermaLink="true">https://forum.netxms.org/post/14416</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Fri, 18 Jul 2014 12:38:23 GMT</pubDate></item></channel></rss>