...
- Configure the external database to be used by TeamCity (see the database-specific sections below).
- Run the TeamCity server for the first time.
- Select an external database to be used and specify the database connection settings.
If required, you can later manually modify your database connection settings.
Note that TeamCity creates its own database schema on the first start and actively modifies it during the upgrade. The schema is not changed when TeamCity is working normally.
The user account used by TeamCity should have permissions to create new, modify and delete existing tables in its schema, in addition to usual read/write permissions on all tables. - You may also need to download the JDBC driver for your database.
Anchor database_driver database_driver
Due to licensing terms, TeamCity does not bundle driver jars for external databases. You will need to download the Java JDBC driver and put the appropriateAnchor Database Driver Installation Database Driver Installation .jar
files (see driver-specific sections below) from it into the<
TeamCity Data Directory
>/lib/jdbc
directory.
Please note that the.jar
files should be compiled for the Java version not greater than the one used to run TeamCity, otherwise you might see "Unsupported major.minor version" errors related to the database driver classes.
...
- Create a new database. As the primary collation, it is recommended to use the collation corresponding to your locale. We also suggest using the case-sensitive collation (collation name ending with '_CS_AS'), which is mandatory for the certain functionality (like using non-Windows build agents).
- Create TeamCity user and ensure that this user is the owner of the database (grant the user
dbo
rights). This requirement is necessary because the user needs to have ability to modify the database schema.
If you're going to use SSL connections, ensure that the version of MS SQL server and the version of java (on the TeamCity side) are compatible. We recommend using the latest update of SQL server:- SQL Server 2012 and later - all versions
- SQL Server 2008R2 - Service Pack 2 or Service Pack 1 cumulative update 6
- SQL Server 2008 - Service Pack 3 cumulative update 4
- SQL Server 2005 - only with JDK 6 update 27 or lower on the TeamCity side
See details on compatibility issues.
- Allocate sufficient transaction log space. The requirements vary depending on how intensively the server will be used. It's recommended to setup not less then 1Gb.
- Make sure SQL Server Browser is running
- Make sure TCP/IP protocol is enabled for SQL Server instance
Make sure that the "no count" setting is disabled: the enabled "no count" setting prevents TeamCity from starting queued builds. Disable the setting in the database defaults as follows:Anchor NoCount NoCount - In MS SQL Server Management Studio, connect to your database server.
- Right-click the server instance in Object Explorer.
- Choose Properties.
- Select the Connections tab.
- In the Default Connection Options frame, "no count" must be unchecked.
It is recommended to monitor the database performance regularly. For example,
...
It is recommended to monitor the database performance regularly. For example, perform reindexing once every several months.
...
- Download the MS
sqljdbc_4.2.x
package (.exe
or .tar.gz
depending on your TeamCity server platform) from the Microsoft Download Center. - Unpack the downloaded package into a temporary directory.
- Copy the
sqljdbc42.jar
from the just downloaded package into theTeamCity Data Directory
/lib/jdbc
directory. The Integrated security setup will need additional steps, see below. - Proceed with the TeamCity setup.
...
To specify additional settings, change <
TeamCity Data Directory
>\config\database.properties
file while TeamCity server is not running:
If you use a named instance, you need to manually modify the <
TeamCity Data Directory
>\config\database.properties
file and specify the instance name in the connection URL as follows:
...
- Determine the bitness of TeamCity server Java/JVM in use. You might want to use JVM with the same bitness as Windows. Note that you will need to perform manual switch to 64-bit JVM as by default 32 bit JVM is bundled.
- Copy the
<sql_jdbc_home>/enu/auth/x86/sqljdbc_auth.dll
(in case of 32-bit Java) or<sql_jdbc_home>/enu/auth/x64/sqljdbc_auth.dll
(in case of 64-bit Java) file into a directory and specify the directory in "-Djava.library.path=DIRECTORY_WITH_DLL
" TeamCity server JVM option. Reportedly, as an alternative to adding the JVM option, you can also copy the .dll
into Windows/System32 directory and ensure that there are no othersqljdbc_auth.dll
files in your system (in the PATH-listed directories). In the
<TeamCity Data Directory>\config\database.properties
file, specify the connection URL (with no user names or passwords) as follows:Code Block connectionUrl=jdbc:sqlserver://<host>:1433;databaseName=<database name>;integratedSecurity=true
More details about setting up integrated security for MS SQL native JDBC driver can be found in Microsoft documentation for MS SQL 2005 and MS SQL 2008.
...