> For the complete documentation index, see [llms.txt](https://www.neptune.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.neptune.tech/advanced-suite/system-administration.md).

# System administration

Database monitoring and Database log setup for Dynamics 365 Finance and Operations, inside D365.

Advanced Suite adds tools for system administrators that otherwise need SQL Server Management Studio or direct access to the database server — which a cloud environment of Dynamics 365 Finance and Operations does not give you.

## See it in action

A four-minute walkthrough: a slow morning in D365, the batch job behind 230 million page reads found in Database active sessions, its statement in the expensive queries, a blocking chain down to the root blocker and its locks, and the indexes as Microsoft recommends to watch them today.

{% embed url="<https://980223628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBT7AhPDmzqW9GObzesdP%2Fuploads%2Fgit-blob-9a1300d527f820a8715a618c369a29306acde155%2Fadvanced-database-monitoring-demo.mp4?alt=media>" %}
Advanced database monitoring demo (4 min, Full HD)
{% endembed %}

{% file src="/files/WEyclxiel0s9EJKcCdL5" %}
Download the video (MP4, 13 MB)
{% endfile %}

## Database monitoring

The monitoring forms are under **System administration › Inquiries › Database**.

| Form                                                                                                            | Shows                                                                                         | License                      |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ---------------------------- |
| [Database active sessions](/advanced-suite/system-administration/database-activity-monitoring.md)               | All sessions working in the database right now — user, program, CPU, memory, I/O, batch tasks | Free                         |
| [Database blocking sessions](/advanced-suite/system-administration/database-blocking-monitoring.md)             | Sessions that block other sessions, as a chain, with the SQL text and wait times              | Advanced database monitoring |
| [Database blocking tree](/advanced-suite/system-administration/database-blocking-tree.md)                       | Blocking chains as a tree down to the root blocker, with the blocking and blocked SQL         | Advanced database monitoring |
| [Database recent expensive queries](/advanced-suite/system-administration/database-recent-expensive-queries.md) | The queries that used the most CPU, time and I/O in the last 4 hours (Activity Monitor)       | Advanced database monitoring |
| [Database locks](/advanced-suite/system-administration/database-locks.md)                                       | Every lock held in the D365 database, with the session and statement that holds it            | Advanced database monitoring |
| [Database index fragmentation](/advanced-suite/system-administration/database-index-fragmentation.md)           | Fragmentation of the indexes of 1,000 pages or more                                           | Advanced database monitoring |
| [Database index usage](/advanced-suite/system-administration/database-index-usage.md)                           | Seeks, scans and updates of every index, with its size and settings — finds unused indexes    | Advanced database monitoring |

* **Free** forms are available with Advanced Suite, no license needed.
* **Advanced database monitoring** forms need that Advanced Suite license; without it they do not open. See [Activate license](/advanced-suite/getting-started/activate-a-license.md) for importing a license.
* All forms open empty and read the database only when you select **Refresh**, so opening a form puts no load on the database. Refresh again to see the current state — each refresh is a snapshot.

Each form can be switched on or off in **System administration › Setup › License configuration**, under **Advanced Suite › System administration › Database monitoring**.

### Which form to use

* **The system is slow for everyone** — start with **Database recent expensive queries** to find the queries that load the database, then **Database active sessions** to find who runs them.
* **Users or batch jobs hang** — open **Database blocking sessions** (or **Database blocking tree** for the whole chain) to see which session blocks them, then **Database locks** to see what that session has locked.
* **One batch job takes too long** — find its session in **Database active sessions** (**Session batch tasks** shows the batch tasks of a session).
* **Queries got slower over time** — check **Database index usage** for indexes that are maintained but never read, and **Database index fragmentation** for large indexes that need a rebuild.

## Database log

[Easy setup of Database log](/advanced-suite/system-administration/easy-setup-of-database-log.md) — set up the Database log for many tables and fields at once.
