How to increase or decrease the BlackBerry Configuration Database transaction log size

Article ID: KB03968

Type: Support Content

Last Modified: 10-26-2012

 

Product(s) Affected:

  • BlackBerry Enterprise Server
CollapseEnvironment
  • BlackBerry Enterprise Server 3.6 to 5.0 SP3
  • Microsoft SQL Server 2000 to 2005
  • Microsoft SQL Server 2005 Express
  • Microsoft SQL Server Management Studio
  • Microsoft SQL Server Desktop Engine (MSDE)
  • DT 183866
CollapseOverview

Under certain conditions, it might be necessary to decrease and then increase the size of the BlackBerry Configuration Database transaction log. For example, an error message might appear stating that the BlackBerry Configuration Database transaction log is full. This is corrected by decreasing the transaction log size to free up disk space.

Note: If the BlackBerry Configuration Database is in a Microsoft SQL Server Mirroring Configuration, the functionality described is not available. For more information, contact Microsoft for best practices.


Decreasing the size of the BlackBerry Configuration Database transaction log

Note: Verify that the installer and any other applications are closed when decreasing the size of the BlackBerry Configuration Database transaction log.

To decrease the BlackBerry Configuration Database transaction log size, complete the steps that are appropriate to the database environment.

Microsoft SQL Server Desktop Engine (MSDE) 2000 and Microsoft SQL Server 2005 Express

  1. Open a command prompt.
  2. Type osql -E and press ENTER.
  3. Type the following commands in the specified order and press ENTER after each line:

    1> backup log <database_name> with truncate_only    where <database_name > is the name of the BlackBerry Configuration Database, for example BESMgmt.
    2> go

    1> dbcc shrinkdatabase (<database_name>, 1)
    2> go

    1> backup database <database_name> to disk = "C:\backup.bak"
    2>
    go

    1> quit

  4. Close the command prompt.

Microsoft SQL Server 2000

  1. Open the SQL Enterprise Manager.
  2. Expand the Microsoft SQL Servers > SQL Server Group > Server_Name > Databases where <Server_Name> is the name of the Microsoft SQL Server instance hosting the BlackBerry Configuration Database.
  3. Right-click the BlackBerry Configuration Database name and then select All Tasks > Shrink Database.
  4. Click OK.
  5. Click OK again when the process is complete.
  6. In the SQL Enterprise Manager, click Tools > SQL Query Analyzer.  
  7. In the SQL Query Analyzer (Query window), type the following:

    backup log <database_name> with truncate_only
  8. Press F5 to process the query.
  9. When the query is complete, close the SQL Query Analyzer.
  10. Right-click the BlackBerry Configuration Database name in the SQL Enterprise Manager, and then select All Tasks > Backup Database.
  11. Type a location for the backup files, and then click OK.
  12. Click OK when the process is complete.

Microsoft SQL Server 2005

  1. Open the Microsoft SQL Server Management Studio 2005.
  2. Expand the SQL Server InstanceDatabases
  3. Right-click the BlackBerry Configuration Database name and then select Tasks > Shrink > Database.
  4. Click OK.
  5. Click OK again when the process is complete.
  6. In the Microsoft SQL Server Management Studio 2005, click File > New > Query with Current Connection.
  7. In the SQL Query Analyzer (Query window), type the following:

    backup log <database_name> with truncate_only
  8. Press F5 to process the query.
  9. When the query is complete, close the SQL Query Analyzer.
  10. Right-click the BlackBerry Configuration Database name in the Microsoft SQL Server Management Studio 2005, and then select Tasks > Backup.
  11. Type a location for the backup files, and then click OK.
  12. Click OK when the process is complete.

Note: This process may require to be done numerous times before the Microsoft SQL Server actually removes all previous transactions in the .ldf file. 

Note:  after the database is shrunk, the data file of database should be re-indexed.  See the following article for further information:
http://technet.microsoft.com/en-us/library/ms188388.aspx


Increasing the size of the BlackBerry Configuration Database transaction log

The size of both the BlackBerry Configuration Database transaction log (.LDF file) and the BlackBerry Configuration Database itself (.MDF file) may be increased.

To increase the size of the BlackBerry Configuration Database in an MSDE 2000 or Microsoft SQL Server 2000 environment, complete the following steps:

  1. Open a command prompt.
  2. Type osql -E then press ENTER.
  3. Type the following commands in the specified order, and press ENTER after each command line:

    1> exec sp_helpdb <database_name>   where <database_name > is the name of the BlackBerry Configuration Database.

    Note: The BlackBerry Configuration Database name can be confirmed from the BlackBerry Server Configuration tool. This will display the logical file names used in the BlackBerry Configuration Database.

    2> go

    1> ALTER DATABASE BESMgmt MODIFY FILE(NAME='<logical_name_of_MDF_or_LDF_file>', SIZE=<size>MB)

    Note: Only include the logical file name. The entire path to the physical MDF or LDF file is not required.

    2> go

    1> quit

  4. Close the command prompt.

Note: ALTER DATABASE syntax examples

1> ALTER DATABASE BESMgmt MODIFY FILE(NAME=BESMgmt_log, SIZE=200MB)
1> ALTER DATABASE BESMgmt MODIFY FILE(NAME=BESMgmt_data, SIZE=150MB)

In the above syntax examples:

  • BESMgmt_log is the logical file name for BESMgmt.ldf file in the Microsoft SQL Server database.
  • BESMgmt_data is the logical file name for BESMgmt.mdf file in the Microsoft SQL Server database.

Increasing the size limitation for Microsoft SQL Server or MSDE

To increase the BlackBerry Configuration Database transaction log size, complete the appropriate steps for the database environment.

Microsoft SQL Server 2000

  1. In the SQL Enterprise Manager, go to Microsoft SQL Servers > SQL Server Group > SQL_server_name > Databases.
  2. Right-click the BlackBerry Configuration Database name, and then click Properties.
  3. On the Data Files and Transaction Log tabs, select the Automatically grow file check box.
  4. Under the Maximum file size section, do one of the following:
    • Select Unrestricted file growth to completely remove the size limitation.
    • In the Restrict file growth (MB) field, type a new size limit.
  5. Click Apply, and then click OK.

Microsoft SQL Server 2005

  1. Open Microsoft SQL Server Management Studio. If you are using Microsoft SQL Express, visit www.microsoft.com and search for Management Studio Express to download Microsoft SQL Server Management Studio Express.
  2. Right-click the BlackBerry Configuration Database name, and then select Properties.
  3. Select Files.
  4. Increase the value in the Initial Size column to a value greater than the default settings.
  5. Open the Autogrowth column for besmgmt.mdf.
  6. Select the Enable Autogrowth check box.
  7. Select the option for Unrestricted File Growth.
  8. Open the Autogrowth column for besmgmt.ldf.
  9. Select the Enable Autogrowth check box.
  10. Select the option for Unrestricted File Growth.
  11. Click OK to close the Properties window.

MSDE

  1. Open a command prompt on the computer hosting the MSDE Server.
  2. From the command prompt, type osql -E and press ENTER.
  3. Type the following commands in the specified order and press ENTER after each line:

    1> alter database <database> modify file (name=<database_name>, maxsize=UNLIMITED) 

    Where <database> is the logical file name (for example, BESMgmt) and <database_name> is the logical file name for BESMgmt_data or BESMgmt_log.

    1> quit

  4. Close the command prompt.
CollapseAdditional Information

For instructions on running Microsoft SQL Server maintenance jobs, see KB04426 .

For instructions on the autogrow and autoshrink setting available with Microsoft SQL Server, visit http://support.microsoft.com/ and read article KB315512 .

The BlackBerry Configuration Database transaction logs can be increased in size without taking the database offline, if using Microsoft SQL Server Management Studio.

Disclaimer

By downloading, accessing or otherwise using the Knowledge Base documents you agree:

   (a) that the terms of use for the documents found at www.blackberry.com/legal/knowledgebase apply to your use or reference to these documents; and

   (b) not to copy, distribute, disclose or reproduce, in full or in part any of the documents without the express written consent of RIM.


Visit the BlackBerry Technical Solution Center at www.blackberry.com/btsc.