Huge TeamCity Database - sql-server

We use TeamCity with a Microsoft SQL Server database which takes more than 31Go. What can we do to reduce its size and how could we troubleshoot it to prevent the database to grow even more ?
For information, we use TeamCity Professional version 2021.1.1 (build 92714) and below are our clean-up rules.

Related

Is it possible to test SQL AlwaysOn Availability Groups on a single developer workstation?

I have implemented executing sqlcmd.exe to run a script (provided by hosting & ops DBAs) that copies a newly created database in the C# app that creates the database to a second server in an AlwaysOn Availability Group. Unfortunately we have no AlwaysOn Availability support in our development or integration environments so I have only been able to test executing sqlcmd to run the script and handling the script failure. Is it at all possible for me to simulate the AlwaysOn Availability Group environment on my developer workstation if a create a second SQL Server instance. I am running SQL 2014 Developer Edition at the moment but should it be required, will be able to upgrade to SQL 2016 Developer Edition.
If this is not possible we will be forced to deploy without full end to end testing and have the first end to end tests happen in the production environment.
I have fairly good developer level SQL skills; in other words I'm very comfortable with stored procedures and such but have very little knowledge of the new and advanced features for actually administering SQL servers.
You can but you will either have to create VM (Virtual Machines) using VMWare software or VMs using Microsoft (MS) technology. There are other VM products but these two are used for the majority of virtualizations of the SQL Server/Microsoft stack. If you use MS technology you can download the software for usually up to 90 days (free) without activating the software. I would do it on an SSD so it finishes in a timely basis and you probably need 12-16GB of memory on the host, developer, machine.
There are detailed online instructions on creating VMs for SQL Server on clusters. The best ones have screen shots.

Fail restore a SQL Server database .BAK from Enterprise to Express (Error 909)

I need help. I recently download a sample SQL Server database from the internet (link: https://www.microsoft.com/en-us/download/details.aspx?id=18279).
When I tried to restore that database to my computer, the process was failed because my SQL Server is not in the same version with the database came from.
I currently using SQL Server 2014 Express Edition, and the data that I've download was from Enterprise Edition, so some of the features is not available in my current edition.
What should I do to restore that database successfully without installing the Enterprise Edition?
I need a sample of huge database (with millions of rows or more) for educational purpose, and I think this is the proper one.
Or maybe any of you can give me the similar database that compatible with Express Edition.
Thank you.
You can restore as long as the database doesn't have enterprise features and it doesn't exceed max size of express edition.You also have to ensure both are of same version .This can be checked by using
select ##version
if none of the above helps,you can generate scripts and run them

SQL Server parser for Azure

We have migrated our production environment to Azure (using SQL Azure instead of SQL Server)
Our local development environment uses SQL Server. We write change scripts when database changes need to occur during a release.
PROBLEM
The issue now is that some T-SQL commands/statements/keywords don't work when run on SQL Azure. This is constantly disrupting our release process.
Educating everyone to use a subset of T-SQL is happening, but these problems continue to crop up.
Is it not possible for us to parse our SQL scripts as 'Azure SQL compatible' in SQL Server using the parser before running them:
Thanks
If you use the new "SQL Server Database Project", there is a feature in Visual Studio that allows you to select the "Target Platform" to SQL Azure. This will allow you to build all your t-sql scripts and check them for SQL Azure compatibility. Any compatibility errors will throw errors and it can create a bacdac/dacpac/t-sql script that is compatible with SQL Azure.
In order to take advantage of this, you have to manage your code using the "SQL Server Database Project" projects in Visual Studio.
You are not going to like this answer .. but the best bet is to move your development environment to SQL Azure. We started in the same process but you will just have the constant battle. We used Redgates SQL Compare tools but I don't believe they will solve your problems, but maybe worth a shot as they are constantly getting better.
Even if you have multiple devs and they each need a SQL Database I would still recommend getting everyone to signed up with Azure and pay the cost under it. Thankfully the database are not that expensive to run, and you might get under the free tier structure. It is still cheaper for us to run the cost of the SQL Azure Dev boxes than it is to have the pain and waste of time at release.

Redistributable local database for windows desktop app

I am getting a little bit confused about the difference of the followings:
SQL Server Express
SQL Server Compact
localDB
My requirement is to develop a desktop application that will use basic RDBMS features. I need to package the application and allow the user to install a single distributed package. I don't want the user to install even SQL server express.
In this case, which DB I should use? SQLite is not considered as too much re-coding has to be done.
Thank you.
SQL Server Express is full featured DBMS, with some limitations in terms of database size and resources it is allowed to use. You can see it's limitations (relative to SQL Server) on microsofts site (Features Supported by the Editions of SQL Server 2012)
SQL Server CE is embedded database, meaning that it runs in user mode, it's easy to deploy (requires you to copy just few assemblies), lightweight but fast, can be run by a low privileged user. It's supported by NHibernate. However, has more limitations. To me most notable is that there are problems when you try to have multiple connections to same database. Although MS claims that this is supported, if you try this in Windows 2008 server, you will fail. And what's worse, such use scenario may lead to DB corruption. This means that you will effectively not be able to use some Management tool to update data while your service/website is running. Also, SQL Server Management studio doesn't support SQL CE anymore, so you will have to use a 3rd party tool, like Database.NET. It also does not support subqueries.
localDB, having not used it, sounds like a compromise. It's a standalone database which is executed in user mode (can be used by low privilege user), but must be installed so you will need administrative privileges for that part. Offers set of capabilities of SQL Server Express. It's much larger than SQL CE, and also requires to be installed (unlike CE which is just binary drop in). Shortest overview of this DBMS can be found here.

Is SQL Server Express good enough for a developer, or should they get Developer edition?

Just wondering if it's worth it for a developer to use SQL Server 2005/2008 Developer Edition instead of the bundled SQL Server Express edition that comes with Visual Studio. I'm talking about for initial development of a website, where you need to create SQL scripts to generate the tables and things like that. I know with Express it's easy to add an .mdf file to your project and program against that, but wouldn't it be better to install Developer edition and program against a "real" database that would mimic what you're going to be using in production? That way if you're using VS Professional and can create a "database project" you can include all of your creation scripts and run them in production to recreate the environment.
If you have access to it, you're better off using Developer Edition because it supports more features and larger databases. For example, if you want to restore a 50gb database from your production server onto your workstation to do testing, you'll need Developer Edition.
Another example is if you're working with Enterprise-only features like partitioning, compression or the Resource Governor. Those features aren't available in Express, but they are available in Developer Edition.
If it is good enough for production then how can it be insufficient in development. And SQL Express is quite capable of handling fair loads (the kind of loads that would have stressed serious hardware just a few years ago).
SQL Server Express does not require licensing but has a smaller set of features.
Developing against full SQL Server (and Developer Edition matches Enterprise Edition) always leaves the chance that you rely on some feature that is not in the production edition.
At the very least all your testing (including unit testing) should happen against the edition to be used in production.
In this question, since a "full" version is being targeted for production then developer edition should be a good match, just be careful of enterprise features if you will deploy against Standard.
Personally, I think your development environment should look like as much as you can to your production environment.
SQL Server Express edition
has many limitations like size of database, supports only one processor, etc. It is the "lite" version of SQL Server
SQL Server Developer edition
is basically Enterprise edition but it cannot be used for production.
Be aware that if the success of your backend database relies on the use of enterprise features for development, and you want the same features on production, this will require enterprise license.
It depends on what you are doing. In general, I would say it is fine. If you can get a copy of Developer, I would recommend that route, but a great majority of your work can be done in Express.
Express has basic Reporting, with Advanced Services. If you go beyond the basic Reporting in the product, you will have to move up. YOu also have Service Broker. But, you will not have Analysis Services (no data warehousing) or SSIS (no ETL). If you need either of these features, you have to go to Developer.
You will also not have some of the BI features, as the Express Manager is missing many of the bits in the full SQL Management Studio and BI Developer. If you need these, you will need SQL Server Developer.

Resources