SQL Server Performance

unable to delete mdf and ldf

Discussion in 'General DBA Questions' started by aaronsandy, Mar 1, 2005.

  1. aaronsandy New Member

    I have restored some databases to c:data folder from f:ackup folder.Now when I am trying to delete the mdf and ldf files from C:data ,i m getting message "it is being used by another person or program.I am wondering which program/person is using this.
  2. sundeip New Member

    Hi,

    Did u change the Physical Path while restroing ? ,
    Look into Master..sysdatabases , if This file is present there.

    Thanks
    Sandy



    Thanks,

    Sandy

  3. gkrishn New Member

    Please forget about back nd restore .Its becos database in online, sqlserver has a hold on all online databases. make DB offline and try to delete , u wil b able to .<br /><br />try with pubs or nortwind database.<br /><br /><br />Donno y u want to delete same datafiles after restore [<img src='/community/emoticons/emotion-1.gif' alt=':)' />]
  4. mmarovic Active Member

    Do you want to delete db files of just restored db?
  5. Luis Martin Moderator

    Did you restore over same database?


    Luis Martin
    Moderator
    SQL-Server-Performance.com

    One of the symptoms of an approaching nervous breakdown is the belief that one's work is terribly important
    Bertrand Russell


    All postings are provided “AS IS” with no warranties for accuracy.



  6. aaronsandy New Member

    When i restored the database from backup by a script , it has added the aadb37_data.mdf to a previously existing database named a.
    strange.then it has added the msdbdata to a database m.why is it so.
    here is the scene from sysdatabase
    m200x0105000000000005150000008DB55F506A0A4FFAEBB1B368F401000002410905200642005-03-01 17:42:40.6271900-01-01 00:00:00.000080C:Datamsdbdata.mdf539
    msdb40x0102410905200642000-08-06 01:40:56.8101900-01-01 00:00:00.000080C:program FilesMSSQLserver2datamsdbdata.mdf539
  7. gkrishn New Member

    Not clear .Please do reserch on topic BACKUP,RESTORE, RESTORE WITH MOVE etc...

    GO for scripts only if you are good in these concepts.

    thnx
  8. satya Moderator

    Without stopping SQLServer services you cannot delete any of the data or log files for a database.
    As referred review contents from booksonline.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

Share This Page