# Billing Database and Log File Configuration

Billing Database, DB Log File and SQL Server management has to be incorporated into the IT Operations and Monitoring process of the individual companies. As the product process's lots of data, the DB size keeps growing and a poorly configured Database may grow its log size and occupy lots of disk space than necessary. Data is the integral part of the Usage Collection and Billing, so proper planning of the configuration, BCDR and monitoring is essential for a Enterprise grade production deployment.

## SQL Server Configuration:

It is important to have very good configuration with support for a good Disk IOPS for the SQL Server machine hosting Billing DB.&#x20;

Placing Billing DB and Log files on a SSD will improve performance and processing throughput tremendously or use RAID based drive configuration with good amount of h/w caching.

## Note: Billing DB Log file size grows really large over time. To contain the log file size growth set the DB recovery mode to Simple using the following SQL statements. (Consult with your DBA for any organizational policies related to backups before doing these on production database instances and adjust as appropriate)

USE \[CloudAssertBillingDb]&#x20;

ALTER DATABASE \[CloudAssertBillingDb] SET RECOVERY SIMPLE&#x20;

DBCC SHRINKDATABASE ('CloudAssertBillingDb', 0);&#x20;

DBCC SHRINKFILE('CloudAssertBillingDb', 200);

CHECKPOINT&#x20;

CHECKPOINT

### You can check file sizes using the following statements:

SELECT file\_id, name, type\_desc, physical\_name, size, max\_size FROM sys.database\_files ;

## Database Backups

It is important to setup periodic backup for the Billing database. Frequency ultimately depends on each organizations policies and SLAs, but at least once a day backup is recommended.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudassert.com/azure-stack-billing/2.1.11.22/installation/deployment/installation/billing-database-and-log-file-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
