Tempdb file remove problem

Hi All. I am trying to remove one of the tempdb logical file
alter database tempdb remove file tempdev2
and have the following error:
The file "H:\tempdb2.mdf" has been modified in the system catalog. The new path will be used the next time the database is started.
Msg 5042, Level 16, State 1, Line 1
The file 'tempdev2' cannot be removed because it is not empty.
then i run
USE tempdb;
GO
DBCC SHRINKFILE('tempdev2', EMPTYFILE)
and another error comes up:
Msg 8985, Level 16, State 1, Line 1
Could not locate file 'tempdev2' for database 'tempdb' in sys.database_files. The file either does not exist, or was dropped.
then I see in sys.database_files ,, I see
file_id file_guid type type_desc data_space_id name physical_name state state_desc size max_size growth is_media_read_only is_read_only is_sparse is_percent_growth is_name_reserved create_lsn drop_lsn read_only_lsn read_write_lsn differential_base_lsn differential_base_guid differential_base_time redo_start_lsn redo_start_fork_guid redo_target_lsn redo_target_fork_guid backup_lsn
1 NULL 0 ROWS 1 tempdev d:\databases\tempdb\tempdb.mdf 0 ONLINE 52008 -1 10 0 0 0 1 0 NULL NULL NULL NULL 27000000012600037 245940A4-BFC3-4F98-98B8-E56FFD49AE02 2014-07-12
14:00:05.247 NULL NULL NULL NULL NULL
2 NULL 1 LOG 0 templog d:\databases\tempdb\tempdb.ldf 0 ONLINE 3688 -1 10 0 0 0 1 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
3 997529E5-AD3D-4605-9CC0-5DAB53C91DFD 0 ROWS 1 tempdev2 H:\tempdb2.mdf 0 ONLINE 1748360 -1 128 0 0 0 0 0 3515000000034000001 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
any one can help? am I afraid next time DB restart, the DB instance can't be start up.

First step you might have tried Empty the file, then remove the file...
-- First empty the data fileUSE tempdb
GO
DBCC SHRINKFILE (tempdev2, EMPTYFILE); -- to empty "tempdev12" data file
GOIf nothing is working then you have to restart the instance and try.. If you restart then you will come to how many files are there and then you can follow the corrects steps and then you can fix the issue.
Note : Also we no need to restart the MS SQL Services after adding a new file to tempdb.but we have to restart after removing the tempdb files, Because tempdb space addition of removeal of the files comes under tempdb reconfig that requires
a service restart.
Raju Rasagounder Sr MSSQL DBA

Similar Messages

  • Need help! Issue getting TempDB files removed

    I'm currently running SQL 2012 and having some issues altering the TempDB to remove two additional mdf data files from the filegroup.
    The tempdb currently has two additional mdf data files, tempdev1, tempdev2
    I'm running the following command
    ALTER DATABASE tempdb
    REMOVE FILE tempdev2
    And while I expect to see the message
    Msg 5042, Level 16, State 1, Line
    1
    The file ‘tempdev2′ cannot
    be removed because it is not empty.
    I am NOT seeing anything to the likes
    below...which concerns me as I don't think i'm ready to restart my instance and have the desired changes in play
    The file “D:\tempdb\tempdev2.mdf”
    has been modified in the systemcatalog. The
    new path will
    be used the next time the database isstarted.

    It seems some activities are going on that is using your TempDB.
    Restart the SQL services this will create your new Tempdb & all files become clear. After that run your both commands, It should work.
    USE tempdb;
    GO
    DBCC SHRINKFILE('tempdev1', EMPTYFILE)
    GO
    USE master;
    GO
    ALTER DATABASE tempdb
    REMOVE FILE tempdev1;
    Just to add, only 1 mdf can have per database, rest of this all other data files will be ndf.
    Regards,
    Rohit Garg
    (My Blog)
    This posting is provided with no warranties and confers no rights.
    Please remember to click Mark as Answerand
    Vote as Helpfulon posts that help you. This can be beneficial to other community members reading the thread.

  • Unable to remove TempDB files SQL 2012

    Hi Experts,
    We have a problem with removing the extra created TempDB files on de SQL 2012 server. We tried several things:
    Restart services;
    Rename *.ndb files
    We use the following query in the SQL management studio:
    USE tempdb;
    GO
    DBCC SHRINKFILE('tempdev4', EMPTYFILE)
    GO
    USE master;
    GO
    ALTER DATABASE tempdb
    REMOVE FILE tempdev4;
    The error returned is:
    DBCC SHRINKFILE: Page 5:40 could not be moved because it is a work table page.
    Msg 2555, Level 16, State 1, Line 1
    Cannot move all contents of file "tempdev4" to other places to complete the emptyfile operation.
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    Msg 5042, Level 16, State 1, Line 1
    The file 'tempdev4' cannot be removed because it is not empty.
    It looks like the TempDB is still in use. If the services are stopped and the query is fired right after starting we receive the same error. Any suggestions are welcome.
    Regards,

    I would try to restart SQL Server in single-user mode, add -m to the startup options in the SQL Server Configuration Manager. You may still fail to remove the file if there is a process which eagerly connects directly and start to do work.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Error when opening itunes : iTunes has stopped working ''A problem caused the program to stop working correctly''. When I repaired damaged files the problem still exists and also after uninstalling and redownloading and installing itunes. I have windows 8

    Error when opening iTunes : iTunes has stopped working '' A problem caused the program to stop working correctly''.
    When I repaired damaged files the problem still exists and also after uninstalling, redownloading and reinstalling iTunes.
    My pc is working with windos 8.
    Is there a solution?

    Hey there Rodney274,
    It sounds like you are getting an error from iTunes when you launch it. I would try the troubleshooting in this article named:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Start with troubleshooting for 3rd party plug ins section, then the rest of the article if needed:
    Start iTunes in Safe Mode
    Open iTunes in Safe Mode to isolate any interference from plug-ins or scripts not manufactured by Apple.
    Hold down Shift–Control while opening iTunes. You should see a dialog that says "iTunes is running in safe mode" before iTunes finishes starting up.
    Click Continue.
    See if the issue you're experiencing persists in Safe Mode.
    If you have the same issue while iTunes is in Safe Mode, proceed to the "Create a new user account" section. If you don't experience the same issue, follow these steps to remove third-party plug-ins.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • Route Pattern CSV File Removes "0" from Called Party Prefix Digits Field

    I want to upload over 350 route patterns using BAT Tool in CUCM 9.1. All patterns must have their Called Party Prefix Digits (Outgoing Calls) Field containing 10 numbers with the number "0" at the begining. The Problem is the CSV file removes the leading "0" form the digits. I tried to make the cell type in Excel as "Text" and it worked and the "0" is kept normally, but when I save and close the file then open it again, the cell is defaulted to "General" type and the "0" is disappeared again! Changing the CSV file format to any other one and uploading it to CUCM system generates an error stating that the file format is not supported.
    Attached is a sample entry of the CSV file. I want to preserve the whole number "0541234567" in "PREFIX_DIGITS_CALLED_PARTY" Field.
    Anyone can help me how to upload this big number of route patterns while preserving the number "0" at the begining?

    Make sure you change the csv file when using Excel to "Text" on the cell where the string starts with 0, otherwise Excel assumes this is a number and strips it.
    HTH, please rate all useful posts!
    Chris

  • SQL 2012 Cluster- How to or Steps to Move Tempdb Files from Local drive to Shared volume

    Hi..
     I did Installation of SQL Server 2012 Cluster. During this setup I installed Tempdb Files on Local drive. Now I want to move this tempdb files from local drive to Shared Drive . When I am trying to move I am getting below error.
    Does any one can help me or provide the steps to move this tempdb files from local drive to Shared Drive ?
    Msg 5184, Level 16, State 1, Line 1
    Cannot use file 'Z:\Tempdb\tempdb.mdf' for clustered server. Only formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource
    of the Sql Server does not have a dependency on it.
    Thanks 
    Regards..
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    Hi,
    The error message may be thrown out when you attempt to create a database on another shared cluster drive when the SQL Server resource is not dependent on that disk.
    Check if you are in the scenario which mentioned in the following article:
    How to create databases or change disk file locations on a shared cluster drive on which SQL Server was not originally installed
    http://support.microsoft.com/kb/295732/en-nz
    Here is a thread with similar issue:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c9f80af7-5b51-4c43-a2a0-f9c7d97aa41d/sql-disk-dependency-problem-on-sql-2008-cluster-including-errors
    Hope it helps.
    Tracy Cai
    TechNet Community Support

  • Help with add file name problem with Photoshop CS4

    Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
    Script follows:
    // this script is another variation of the script addTimeStamp.js that is installed with PS7
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.INCHES;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "Lower© ";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = " ";
    // Set font size in Points
    myTextRef.size = 10;
    //Set font - use GetFontName.jsx to get exact name
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 0;
    newColor.rgb.green = 0;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 10, 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    you might want to try the scripting forum howard:
    http://www.adobeforums.com/webx?13@@.ef7f2cb

  • SOMEONE PLEASE HELP WITH MISSING FILES XP PROBLEM

    i recently purchased an ipod touch, and all i want to do is get some music on it, and update the firmware, but i cant use itunes, cuz im getting 'there are some files missing' problem.
    I swear to god, if i dont get this fixed by the end of the week, im gonna post the latest video on youtube... on how to smash up apple products.
    Ive been trying NOT to buy apple products since the first dawn of time, but i do actually like the ipod touch. But, low and behold... the very reason why i never buy apple products has been confirmed!
    can someone PLEASE tell me if there is a solid fix for this? i have literally tried EVERYTHING before you ask. im at my wits end.
    Using XP home, all updates installed... latest itunes,

    It will probably help if you'll post the exact error message and when it's occurring. Otherwise we'll just be guessing, not that someone here might not have a good guess. I'm going to guess that this thread might help:
    http://discussions.apple.com/thread.jspa?messageID=11161893&#11161893
    Regards.

  • File sharing problems and horror story (nearly)

    I use Leopard on a MacBook Pro, a MacBook and a iMac G4 800 MHz (unsupported model).
    I have on the iMac and the MacBook Pro many users (the same ont he two machines) and I always use Fast User Switching.
    I have had very few problems with Leopard until now; I like it even if there are some glitches or some new features which are not my cup of tea (hierarchical menus missing from the dock, stacks useless when there are many items, FireWall impossibilities (?) to open specific ports, Back to my Mac working on a Lan but not from outside until now, problems with a few apps (Parallels networking erratic), ...
    Now about File Sharing.
    Let say my main account is user1 (Administrator), and I have another user2 also administrator, plus user3, user4 standard users.
    On the iMac I activate File Sharing.
    On the MacBookPro, as user1, if I connect to the iMac Server (using afp://IPaddress_of_theiMac/) I do NOT get the dialog
    "Enter your user name and password to access file server YYY
    Connect to server as Guest or as Registered User"
    but I directly get the dialog
    "Select the volumes you want to mount on YYY"
    From this, if I select user1 it mounts with full read/write permissions which is normal. It appears that I am connected with my Apple account user1&mac.com (same as mentionned in the Account panel of System Preferences).
    On the other hand, if I try to connect to the user2 account, I only get limited access although in the File Sharing Preferences, user1/iMac is mentionned with full Read/Write preferences for the Home Folder of user2.
    What is very surprising is that if I log on the MacBook Pro as user2, or user 3 or user4, then connect to the iMac, I first get the dialog to enter a user name and a password. This gives me access with the correct full permissions on user1/iMac or user2/iMac using the corresponding user name/password pair; this is the usual behaviour which is missing when trying to connect from user1/MacBook Pro.
    Now for the Horror Story!
    Trying to understand what was going on with the permissions of the user2/iMac account, I logged in to the iMac as user1, went to the Users folder and from there had a look on the informations about user2 home folder. In the lower part of the pannel, Sharing & Permissions says "You have no access" (which is normal) and this is followed by a table where users and permissions are listed. It seems user1 has Read and Write access in contradiction with the preceding phrase...
    Anyway, I tried to modify these authorizations for user2 by clicking on the lock of the Information pannel and entering name and password of the administrator. Didn't go farther than that. By mistake, I hit Command-Delete and user2 was GONE from the list AND NOT ONLY from the list in the Information window! Using Fast User Switching and going to user2, nothing left on the Desktop and NO Home anymore.
    In the System Preferences/Accounts panel, user2 was still mentionned.
    In the Users folder, no user2 folder anymore.
    Using once again Fast User Switching, I logged as user2 and got by magic an all new Home. Nothing left in Documents, Library or other user1 folders. Standard settings for icons, dock, etc.
    My first move has been to use a very recent backup to restore everything (Thank you Mike Bombich from Copy Cloner!).
    Once everything was back to normal, I had a look at the Trash from user1 and guess what, the Home folder of user2 was there, complete.
    So now I am left with two questions
    why is it I do not have the same dialogs when connecting from all the accounts although as far as I can see, configurations are the same?
    why is it possible, from an Information pannel to delete the account of another user?
    Thank you all for comments!

    For the file sharing problems, answer is found in
    http://docs.info.apple.com/article.html?artnum=306723

  • File path problem

    I have looked an read through almost all the file path problem post possible and I am still having issues maybe one of you guys can help me, here are my files
    I am doing this as an example so that I can apply it to all of my file problems....
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Attachments:
    pathexample.zip ‏122 KB

    First of all, to troubleshoot the problem it would help to put some filepath indicators at each point so that you can see what is going on. Also, in your exe having an error dialog "Simple Error Handler.vi" to let you know what LabVIEW didn't like in the exe.
    Now, when you run a top level ("Main.vi") and use the "Current VI's Path " in the development mode it returns <Filepath>\"Current path"\Main.vi. So stripping once will get you to  <Filepath>\"Current path" .    Now if you make it into an exe the "Current VI's Path" returns <Filepath>\"Current path"\"Name.exe"\Main.vi so you are "nested" one deeper.
    I use the following construct to determine whether the vi is being used as in the development environment or as an exe, the parse the path accordingly, although in this instance it is used to supply different directory names to a little more complex file system.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • File Info problems in Photoshop CC & CS5.1 on OS X 10.8

    I have recently upgraded my Macs, running OS X Mountain Lion, from Photoshop CS5.1 to Photoshop CC for two reasons:
    1. Because it most the most cost efficeint way to obtain the latest Camera Raw plugins that are no longer supported in CS5.1
    2. Because I began experiencing issues on two Macs where initially only in Bridge, was I no longer able to input any File Info dialogue.
    I make extensive use of File Info templates, which are then applied to batches of files in Bridge before individual files, or groups of files requiring the identical metadata are modified.
    After a time, once the overall batch of File Info templates had been applied to files I discovered that I was unable to edit them further. Even after Repairing Permissions in Disk Utility it usually took a reboot to fix the problem, although the problem was always solved.
    However there came a point a few weeks ago when I was unable write any further metadata to File Info, in Bridge or Photoshop, no matter what I did. Again this issue happened on two Macs so I'm guessing that it is not a machine issue.
    As I needed the latest Camera RAW plugins as well I decided to upgrade to Photoshop CC, which I have to say I have been very pleased with - until now. The dreaded File Info problem has now occurred again, although currently only in Photoshop, not Bridge. When I try to add or modify any information in File Info in Photoshop CC the dialogue box just closes!
    Clearly it is not just a Photoshop CC issue although I never had the problem prior to CS5.1 and I leapfrogged CS6 and I find it hard to believe that it is a machine issue. Could it be a conflict with the OS or with Extensis Suitcase Fusion 4?
    Has anyone else encountered this problem?

    Curt, Thanks for your rapid response.
    To answer your questions. I thought that, initially, the problem might be a permissions problem but it occurs on both boot drives and also when the same files are copied to Firewire external drives - on both Macs, but different external drives in each case. I followed your link but there was nothing there that I didn't already know or hadn't already tried, thanks.
    One computer is a 24" iMac and the other is a 15" MacBook Pro. I've also tried to replicate the problem on four PowerMac G5s running OS X 10.5.8 with Photoshop/Bridge CS4, with the same drives plugged in, but have experienced no problems at all. It's quite bizarre.
    Also, looking deeper into the conundrum, I find that I can't input any numbers, only letters! Using the keyboard all numbers, whether on the main or auxiliary keypads, cause the File Info dialogue box to either jump to a new tab or close. Using Shift on the numbered keys works perfectly however!
    It just goes on getting better...

  • File transfer problem

    I have a 2009 intel iMAC running 10.6.8.  Several months ago it developed a file transfer problem.  When transferring files to an external server via ethernet cable, most of the time it will only let me transfer one file at a time whether is a small word document or a large video file that is several gigabytes.   Even with transferring just one file, the elapsed time bar will not indicate the file has completely transferred.  It stays open and appears as if it is still trying to transfer even though the file size transferred is equal to the size of the file.  Plus the only way I can close the the transfer bar is to relaunch finder.  Then when I go to the folder it was transferring it to, the entire file will be there.
    Suggestions?

    Have you tried restarting the external drive and the computer?

  • 10.8 Server file sharing problem

    We have a new Mac mini with 10.8 and OS X Server app. The mini has direct attached storage and will be used mainly for File Sharing. There is a repeatable problem/bug with case sensitive folder names and file sharing. For example a folder named "Editorial" is inacessible via "Connect to Server" from a client on the LAN. The same folder with the same permissions, same everthing, except it is named "editorial" works perfectly. Change the uppercase E to a lowercase e and it works. The drive is formatted with normal HFS+. It is Not HFS+ case-sensitive. I have Xserves running 10.4, 10.5, and 10.6 for file sharing and none have this problem.
    Has anyone else experieced this? Is there a fix? Other than making everything lowercase.

    Simon Slavin United Kingdom
    If you have a problem please start a thread of your own.  Don't get us confused between solving two different problems.
    Simon,
    The subject of this thread is dealing with:
    "Server 10.8 file sharing problem"
    Specifically for direct attached storage file sharing permissions issue.
    Client computers having issues with folder permissions
    These are exactly my issues as well. I was hoping to try a solution here or maybe proffer a solution if found elsewhere.  I did not realize each problem should be opened as a separate discussion....
    Sulking back into the shadow...

  • File sharing problems with my Media Player, an A C Ryan

    I have a media player, an A C Ryan, hooked up to my wifi at home and it normally accesses all my hard disks that is plugged and shared on my iMac. I had no problems when the iMac was on Snow Leopard. Under Network/Workgroup in the AC Ryan's menu, I can see and access all the files on the hard disks.
    The moment I upgraded to Lion, all such access was lost. The AC Ryan cannot connect to the hard disks any more via the wifi network. it's as though file sharing has stopped completely. I checked the file sharing settings on the iMac and nothing has changed i.e. the disks were shared as usual. After struggling with many possible solutions and failing (I checked out a lot of forums), I reintalled Snow Leopard and the problems were immediately solved.
    Is there something seriously wrong with Lion's file-sharing? Has this been fixed in 10.7.2? My friend who has a similar setup (his media player is the WD Live) has exactly the same file sharing problem with Lion.
    I would appreciate any feedback. Thanks!

    I believe that NTFS-3G has issues with Lion.
    I use Paragon NTFS and have had no issues at all. I am pretty sure that NTFS-3G will get updated, but you need to check their site to find out when.

  • Dynamic html file generation problem

    I have a HTML file(abc.html) which is used when user clicks on a particular link in my web application. Web application has been developed in java. Now due to certain law changes , user wants to add some notices to existing HTML file(abc.html). So when he clicks on the old link, he gets abc.html with those notices appended to it. All the notices are different HTML files.
    So it looks like simple file append problem. But if it will modify my original file permanently, then it is not helping my purpose.
    So my doubt is , how I can append different notices html files to abc.html file and still keep my abc.html file as it is because the changes are based on user conditions. So if X is affected with new laws, he will see abc.html along with notices , if Y is not affected, then he will see abc.html only.

    The best solution would depend on the implementation details of your current web app, but, likely, the easiest way is to convert your html files to jsps. The jsp can then conditionally include relevant disclaimer fragments.

Maybe you are looking for

  • IE + SVG = "Cannot display XML page" ?

    Dear friends,    I am from Taiwan.  I have a question about SVG display on IE.     I have a very simply SVG file as the following code.  I installed Ferdora R12 with apache web server (192.168.0.8) inside my company. I installed Tomcat 6.0 on my PC(1

  • Error in 29 step of SAP Netweaver 4.0 Portal for java on windown7 ultimate.

    Dear All, Im facing problem while installing "SAP Netweaver Portal Server 4.0" for java on my OS "windows7 ultimate" laptop. Im getting error in 29th step while configuring J2EE engine. Can someone help, i will be highly obliged. INFO 2010-01-27 18:5

  • Expose's not showing up all the windows ....

    Hello, I just realized that my «All windows» function in Expose, just show up «all windows of THE application» and not «all windows of ALL THE applications». Anyboby knows about this and what could be the problem ?? Thanks in advance. Robert Lespéran

  • Loading with sqlloader utility

    i'm running sql loader utility to append rows into an oracle table; my control card has the following fields: jobid position(01:05) char, jobnm position(06:25) char, create_date position(26:35) date "yyyy-mm-dd" the problem is that create_date may or

  • How do i get response notification to my email

    before this change in discussions i would get notice that a message was added to my topic if i subscribe i get the whole forum emails how do i get in each topic a notice sorry but this is so inconvenient