Deleting extra tempdb log and data files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sean Lambert

    Deleting extra tempdb log and data files

    We had someone create an extra data file and log file for tempdb. So
    we currently have two data files and two log files. Is it possible to
    delete the newly created data and log files? If I just delete the
    physical files, I assume they'll get created as soon as SQL Server
    gets started back up. Any help would be great, since a single data
    and log file for tempdb is my goal.

    Thanks much.


    sean
  • Greg D. Moore \(Strider\)

    #2
    Re: Deleting extra tempdb log and data files


    "Sean Lambert" <slambert007@ya hoo.com> wrote in message
    news:279f38c0.0 309241527.1e7b2 546@posting.goo gle.com...[color=blue]
    > We had someone create an extra data file and log file for tempdb. So
    > we currently have two data files and two log files. Is it possible to
    > delete the newly created data and log files? If I just delete the
    > physical files, I assume they'll get created as soon as SQL Server
    > gets started back up. Any help would be great, since a single data
    > and log file for tempdb is my goal.[/color]

    You should be able to simply shut down SQL Server, delete them (back them up
    just in case :-) and start it back.

    (assuming SQL 2000).

    If not, I'd probably try starting SQL Server in single user mode and
    removing them there.

    But, again, back up everything etc.

    [color=blue]
    >
    > Thanks much.
    >
    >
    > sean[/color]


    Comment

    • Simon Hayes

      #3
      Re: Deleting extra tempdb log and data files

      slambert007@yah oo.com (Sean Lambert) wrote in message news:<279f38c0. 0309241527.1e7b 2546@posting.go ogle.com>...[color=blue]
      > We had someone create an extra data file and log file for tempdb. So
      > we currently have two data files and two log files. Is it possible to
      > delete the newly created data and log files? If I just delete the
      > physical files, I assume they'll get created as soon as SQL Server
      > gets started back up. Any help would be great, since a single data
      > and log file for tempdb is my goal.
      >
      > Thanks much.
      >
      >
      > sean[/color]

      Assuming you have SQL2000, then this covers it:

      Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows 11, Surface, and more.


      In summary, use DBCC SHRINKFILE with EMPTYFILE to remove any data on
      the files, then ALTER DATABASE ... REMOVE FILE.

      Simon

      Comment

      • Sean Lambert

        #4
        Re: Deleting extra tempdb log and data files

        I'm using SQL7. Sorry...I should have mentioned that initially. Thanks!



        sean

        sql@hayes.ch (Simon Hayes) wrote in message news:<60cd0137. 0309250040.1a18 13d6@posting.go ogle.com>...[color=blue]
        > slambert007@yah oo.com (Sean Lambert) wrote in message news:<279f38c0. 0309241527.1e7b 2546@posting.go ogle.com>...[color=green]
        > > We had someone create an extra data file and log file for tempdb. So
        > > we currently have two data files and two log files. Is it possible to
        > > delete the newly created data and log files? If I just delete the
        > > physical files, I assume they'll get created as soon as SQL Server
        > > gets started back up. Any help would be great, since a single data
        > > and log file for tempdb is my goal.
        > >
        > > Thanks much.
        > >
        > >
        > > sean[/color]
        >
        > Assuming you have SQL2000, then this covers it:
        >
        > http://support.microsoft.com/?kbid=814576
        >
        > In summary, use DBCC SHRINKFILE with EMPTYFILE to remove any data on
        > the files, then ALTER DATABASE ... REMOVE FILE.
        >
        > Simon[/color]

        Comment

        Working...