I have a TFS 2018 running in a machine.
My log files are huge so I am deciding how to deal with it.
I found how I can use Management studio and use the shrink log files option.
(Log into Microsoft SQL Server Management Studio > Right click on your database >
Right click on the database > Select Tasks > Shrink > Files.)
Then If I select File Type: "Log", It will shrink the log files for the selected database (Collection).
But what kind of info does this delete? Does it delete sensible/important information?
Is there an option to delete this file(s) but leaving the log file for the last 15 days for example? So it would delete everything older than 15 days.
Related
I have Visual studio 2019 database Project which has gone out of sync, because of direct updates on the DB.
How do I refresh my visual Studio 2019 Database Project from Source Database ? Did not any option to Refresh/Regenerate.
There's a "Schema Compare" command under the Tools Menu -> "SQL Server" -> "New Schema Comparison". Use that to compare your live database (source) against your project. I'd suggest that you use the options to ignore things that don't matter to you. I'll typically ignore users, permissions, comments, whitespace, and such, but you do get a little choice of what to pull over from the results. Just be careful that what you pull over doesn't overwrite changes you want to keep. You may have to do some manual editing for those cases.
Slight difficulty with Team Foundation Server 2008 databases (using Sql Server 2005).
Team System reported running out of disk space so I added another data file to each and every Team System database (on another fixed drive) to increase the disk space available. I did it as follows for each TFS database:
Add another file, type=Data, size etc = defaults, path to new drive.
Change the original data file to stop further expansion (Autogrowth=none).
Restart Sql Server.
That is the documented method for adding further space to a Sql Server 2005 database. However now I find I can check out files, but not check in. In Visual Studio, Source Control Explorer displays projects and can be expanded to show folders and files as normal, but When I rt-click on a checked-out file and select 'check in', nothing happens and the file remains checked out, and then Visual Studio has to be terminated using Task Manager.
There don't seem to be any related errors in the server Event Log.
What have I missed or done wrong?
You need to use the 'Database Mirroring' feature to add a database file for a mirrored database that has different drives and/or paths.
Firstly, check this MSDN article for the detailed steps on how to "Configure SQL Server Mirroring for the TFS Data-Tier Server": https://msdn.microsoft.com/en-us/library/aa980629(v=vs.90).aspx
Secondly, follow steps in this article about how to "Fail Over to a Mirrored Data-Tier Server if the Principal Server is Unavailable": https://msdn.microsoft.com/en-us/library/aa980528(v=vs.90).aspx
"clean the TFS cache", posted by TfsAgent, actually solved the problem. Nothing to do with adding extra database files after all - that was a coincidence.
Today team reports an error of TFS 2012:
TF30042: The database is full. Contact your Team Foundation Server administrator
Event Log from data base server:
MSSQLSERVER: Could not allocate space for object 'dbo.tbl_NotificationQueue'.'PK_tbl_NotificationQueue' in database 'Tfs_Real-Time collection' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
MSSQLServerOLAPService: An error occurred while writing a trace event to the file, \?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Log\FlightRecorderCurrent.trc.
The C driver is no space available to use.
Could anyone give some suggestions?
Option 1: Clean the drive to free up space. Delete transaction logs, look for extraneous test case attachments, build drops checked into source that sort of thing.
Option 2: Get a bigger hard drive.
In my case the table "tbl_JobHistory" had become much too large (>7.5GB). As a result, the 10GB of the SQL-Express database were fully utilized.
With Microsoft SQL Server Management Studio you can easily view the largest tables: "Reports" > "Standard Reports" > "Disk Usage by Top Tables".
I deleted the data in "tbl_JobHistory" and then shrinked the database.
Screenshot
I want to know how to view a list of all files that was committed by a user in their last commit. Not all files committed by them just the ones which were committed in the last batch. For example, suppose I just committed 10 files in TFS and now I want to view the list of just those 10 files.
How do I do that?
Thanks,
-R
In visual studio 2010 you can also go to file, source control, changesets and search for changesets from this windows. You have the option of applying filter on changesets by users, or by date or by change set ids. Get the results and you can double click to see the files that are part of the changesets displayed in a new window.
Or you install Team Foundation Sidekicks and go over the shelveset sidekick menu and get this screen
Ok got it.
Open any single file that you remember being part of the changeset in Visual Studio. Right click the file, go to source control and click on view history. Select the version you committed and right click then select view changeset details.
-R
Can anyone tell me how to revert (roll back) a checkin in TFS 2010?
You have two options for rolling back (reverting) a changeset in Team Foundation Server 2010 Version Control. First option is using the User Interface (if you have the latest version of the TFS 2010 Power Tools installed).
The other option is using the TFS 2010 version control command-line application:
tf.exe rollback
I have information about both approaches on my blog post.
For Team Foundation Server 2012, 2013, or Visual Studio Online, rollback is now built-in directly to Source Control Explorer and when you are opening a changeset's details in the Team Explorer Window. You do not need to install any release of the Power Tools for this functionality when using Visual Studio 2012 or later. There is a great MSDN article discussing details about rolling back a changeset now available here: http://msdn.microsoft.com/en-us/library/ms194956(v=vs.110).aspx
For 2010, use the rollback command from the command line. There is not integrated support in the IDE for this, as of yet.
Rollback command
Basically, the way that it works is that it creates an "anti-delta" to negate the impacted changeset. You can accomplish the same thing manually by doing a Get Specific Version, adding a space to the file so it looks like it changed, and checking it in. I still go the latter route to back out a change if I need to for a single file, as I find it quicker to do.
Without using power tools or command line:
ensure Tools->Options->Source Control->Visual Studio Team Foundation Server UNCHECK Get latest version of item on check out
View the history of project folder in Source Control Explorer and right click on the changeset to roll back to and choose Get This Version
Check out for edit on the project folder in the Source Control Explorer (this should keep your local version you just got from the history)
Check in pending changes on the project folder in the Source Control Explorer
if visual studio asks you to resolve conflicts, choose keep local and attempt check in of pending changes on the project folder in Source Control Explorer again
Rolling back changes for another user
If you are attempting to rollback changes for another user, make sure you get latest on the files you are attempting to rollback; otherwise you will see the error:
"No changes to roll back."
You can rollback a changeset (in TFS2010) through command line doing:
Open CMD or Visual Studio Command Prompt
Change directory to your workspace folder. Example: cd C:\myWorkspace
Run following tf command (where 123 is changeset number)
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" rollback /changeset:123 /recursive
Go to Pending Changes window to check files marked with edit,rollback and do a Check In.
Note: you must use tf.exe full path even in Visual Studio Command Prompt to avoid "Unable to determine the workspace" error. More info here
Rollback reference (TFS 2010)
https://msdn.microsoft.com/en-us/library/dd380776(v=vs.100).aspx
right click file in Visual Studio and Source Control/View History
then select last changeset, right click and click Rollback
After rollback done, you should check in again.
There is no undo option in TFS (up untill 2008, I haven't used 2010 yet).
There are some command line power tools you can use to rollback changes that may help:
http://msdn.microsoft.com/en-us/library/ms194956%28VS.80%29.aspx
HTH