Hi,
I deleted a database but the mdf and the log files still exists on disk, I
tried to deleted but they are locked.
What can I do?
Can I delete the entries on sysaltfiles table, delete mdf and log files and
reboot the sql server?
Thanks in advance
Pedro
I suggest you check to ensure the files are not being used by other
databases. Check the output of the following:
EXEC sp_MSforeachdb 'USE [?] EXEC sp_helpfile'
Hope this helps.
Dan Guzman
SQL Server MVP
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:14719753-DEEF-4AAF-A18D-157526941F14@.microsoft.com...
> Hi,
> I deleted a database but the mdf and the log files still exists on disk, I
> tried to deleted but they are locked.
> What can I do?
> Can I delete the entries on sysaltfiles table, delete mdf and log files
> and
> reboot the sql server?
> Thanks in advance
> Pedro
>
|||Hi Dan,
I can't define the database on USE statment because that database (DR2006)
was deleted.
At deletion time I had a disabled job for that database, maybe this was the
cause for problem?
"Dan Guzman" wrote:
> I suggest you check to ensure the files are not being used by other
> databases. Check the output of the following:
> EXEC sp_MSforeachdb 'USE [?] EXEC sp_helpfile'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:14719753-DEEF-4AAF-A18D-157526941F14@.microsoft.com...
>
>
|||What version of SQL Server?
First check the system tables. Does the database exist in sysdatabases? Any reference to the
database in sysaltfiles?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...[vbcol=seagreen]
> Hi Dan,
> I can't define the database on USE statment because that database (DR2006)
> was deleted.
> At deletion time I had a disabled job for that database, maybe this was the
> cause for problem?
> "Dan Guzman" wrote:
|||Hi Tibor,
I am using SQL Server 2000 SP4.
No, does not exist any reference in sysdatabases.
Pedro
"Tibor Karaszi" wrote:
> What version of SQL Server?
> First check the system tables. Does the database exist in sysdatabases? Any reference to the
> database in sysaltfiles?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...
>
|||What about sysaltfiles?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:21004A82-C7FC-45A0-882E-8B0F2C3B7853@.microsoft.com...[vbcol=seagreen]
> Hi Tibor,
> I am using SQL Server 2000 SP4.
> No, does not exist any reference in sysdatabases.
> Pedro
> "Tibor Karaszi" wrote:
|||I think this is the problem.
sysaltfiles have entries for that database, i didn't find any other entry
anywhere for that database.
Pedro
"Tibor Karaszi" wrote:
> What about sysaltfiles?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:21004A82-C7FC-45A0-882E-8B0F2C3B7853@.microsoft.com...
>
|||Hmm, so below query returns a number of rows?
select * from master..sysaltfiles sa
WHERE NOT EXISTS(SELECT * FROM master..sysdatabases sd WHERE sa.dbid = sd.dbid)
If so, I really don't know. I haven't come across that before. Maybe open a ticket with MS Support,
just to be certain you do the right thing here.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:8AA0D07C-FBC3-4A2A-8B32-C191F4014FE1@.microsoft.com...[vbcol=seagreen]
>I think this is the problem.
> sysaltfiles have entries for that database, i didn't find any other entry
> anywhere for that database.
> Pedro
> "Tibor Karaszi" wrote:
|||No, it returns 0 rows
"Tibor Karaszi" wrote:
> Hmm, so below query returns a number of rows?
> select * from master..sysaltfiles sa
> WHERE NOT EXISTS(SELECT * FROM master..sysdatabases sd WHERE sa.dbid = sd.dbid)
>
> If so, I really don't know. I haven't come across that before. Maybe open a ticket with MS Support,
> just to be certain you do the right thing here.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:8AA0D07C-FBC3-4A2A-8B32-C191F4014FE1@.microsoft.com...
>
|||Pedro,
The command I posted will not try to USE your deleted database. It will
list all files used by any database. After running it, check the file list
to ensure the files you are trying to delete are not used by other
databases.
Hope this helps.
Dan Guzman
SQL Server MVP
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...[vbcol=seagreen]
> Hi Dan,
> I can't define the database on USE statment because that database (DR2006)
> was deleted.
> At deletion time I had a disabled job for that database, maybe this was
> the
> cause for problem?
> "Dan Guzman" wrote:
Showing posts with label docan. Show all posts
Showing posts with label docan. Show all posts
Friday, March 9, 2012
deleted db but mdf file still exists on disk
Hi,
I deleted a database but the mdf and the log files still exists on disk, I
tried to deleted but they are locked.
What can I do?
Can I delete the entries on sysaltfiles table, delete mdf and log files and
reboot the sql server?
Thanks in advance
PedroI suggest you check to ensure the files are not being used by other
databases. Check the output of the following:
EXEC sp_MSforeachdb 'USE [?] EXEC sp_helpfile'
Hope this helps.
Dan Guzman
SQL Server MVP
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:14719753-DEEF-4AAF-A18D-157526941F14@.microsoft.com...
> Hi,
> I deleted a database but the mdf and the log files still exists on disk, I
> tried to deleted but they are locked.
> What can I do?
> Can I delete the entries on sysaltfiles table, delete mdf and log files
> and
> reboot the sql server?
> Thanks in advance
> Pedro
>|||Hi Dan,
I can't define the database on USE statment because that database (DR2006)
was deleted.
At deletion time I had a disabled job for that database, maybe this was the
cause for problem?
"Dan Guzman" wrote:
> I suggest you check to ensure the files are not being used by other
> databases. Check the output of the following:
> EXEC sp_MSforeachdb 'USE [?] EXEC sp_helpfile'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:14719753-DEEF-4AAF-A18D-157526941F14@.microsoft.com...
>
>|||What version of SQL Server?
First check the system tables. Does the database exist in sysdatabases? Any
reference to the
database in sysaltfiles?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...[vbcol=seagreen]
> Hi Dan,
> I can't define the database on USE statment because that database (DR2006)
> was deleted.
> At deletion time I had a disabled job for that database, maybe this was th
e
> cause for problem?
> "Dan Guzman" wrote:
>|||Hi Tibor,
I am using SQL Server 2000 SP4.
No, does not exist any reference in sysdatabases.
Pedro
"Tibor Karaszi" wrote:
> What version of SQL Server?
> First check the system tables. Does the database exist in sysdatabases? An
y reference to the
> database in sysaltfiles?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...
>|||What about sysaltfiles?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:21004A82-C7FC-45A0-882E-8B0F2C3B7853@.microsoft.com...[vbcol=seagreen]
> Hi Tibor,
> I am using SQL Server 2000 SP4.
> No, does not exist any reference in sysdatabases.
> Pedro
> "Tibor Karaszi" wrote:
>|||I think this is the problem.
sysaltfiles have entries for that database, i didn't find any other entry
anywhere for that database.
Pedro
"Tibor Karaszi" wrote:
> What about sysaltfiles?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:21004A82-C7FC-45A0-882E-8B0F2C3B7853@.microsoft.com...
>|||Hmm, so below query returns a number of rows?
select * from master..sysaltfiles sa
WHERE NOT EXISTS(SELECT * FROM master..sysdatabases sd WHERE sa.dbid = sd.db
id)
If so, I really don't know. I haven't come across that before. Maybe open a
ticket with MS Support,
just to be certain you do the right thing here.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:8AA0D07C-FBC3-4A2A-8B32-C191F4014FE1@.microsoft.com...[vbcol=seagreen]
>I think this is the problem.
> sysaltfiles have entries for that database, i didn't find any other entry
> anywhere for that database.
> Pedro
> "Tibor Karaszi" wrote:
>|||No, it returns 0 rows
"Tibor Karaszi" wrote:
> Hmm, so below query returns a number of rows?
> select * from master..sysaltfiles sa
> WHERE NOT EXISTS(SELECT * FROM master..sysdatabases sd WHERE sa.dbid = sd.
dbid)
>
> If so, I really don't know. I haven't come across that before. Maybe open
a ticket with MS Support,
> just to be certain you do the right thing here.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:8AA0D07C-FBC3-4A2A-8B32-C191F4014FE1@.microsoft.com...
>|||Pedro,
The command I posted will not try to USE your deleted database. It will
list all files used by any database. After running it, check the file list
to ensure the files you are trying to delete are not used by other
databases.
Hope this helps.
Dan Guzman
SQL Server MVP
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...[vbcol=seagreen]
> Hi Dan,
> I can't define the database on USE statment because that database (DR2006)
> was deleted.
> At deletion time I had a disabled job for that database, maybe this was
> the
> cause for problem?
> "Dan Guzman" wrote:
>
I deleted a database but the mdf and the log files still exists on disk, I
tried to deleted but they are locked.
What can I do?
Can I delete the entries on sysaltfiles table, delete mdf and log files and
reboot the sql server?
Thanks in advance
PedroI suggest you check to ensure the files are not being used by other
databases. Check the output of the following:
EXEC sp_MSforeachdb 'USE [?] EXEC sp_helpfile'
Hope this helps.
Dan Guzman
SQL Server MVP
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:14719753-DEEF-4AAF-A18D-157526941F14@.microsoft.com...
> Hi,
> I deleted a database but the mdf and the log files still exists on disk, I
> tried to deleted but they are locked.
> What can I do?
> Can I delete the entries on sysaltfiles table, delete mdf and log files
> and
> reboot the sql server?
> Thanks in advance
> Pedro
>|||Hi Dan,
I can't define the database on USE statment because that database (DR2006)
was deleted.
At deletion time I had a disabled job for that database, maybe this was the
cause for problem?
"Dan Guzman" wrote:
> I suggest you check to ensure the files are not being used by other
> databases. Check the output of the following:
> EXEC sp_MSforeachdb 'USE [?] EXEC sp_helpfile'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:14719753-DEEF-4AAF-A18D-157526941F14@.microsoft.com...
>
>|||What version of SQL Server?
First check the system tables. Does the database exist in sysdatabases? Any
reference to the
database in sysaltfiles?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...[vbcol=seagreen]
> Hi Dan,
> I can't define the database on USE statment because that database (DR2006)
> was deleted.
> At deletion time I had a disabled job for that database, maybe this was th
e
> cause for problem?
> "Dan Guzman" wrote:
>|||Hi Tibor,
I am using SQL Server 2000 SP4.
No, does not exist any reference in sysdatabases.
Pedro
"Tibor Karaszi" wrote:
> What version of SQL Server?
> First check the system tables. Does the database exist in sysdatabases? An
y reference to the
> database in sysaltfiles?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...
>|||What about sysaltfiles?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:21004A82-C7FC-45A0-882E-8B0F2C3B7853@.microsoft.com...[vbcol=seagreen]
> Hi Tibor,
> I am using SQL Server 2000 SP4.
> No, does not exist any reference in sysdatabases.
> Pedro
> "Tibor Karaszi" wrote:
>|||I think this is the problem.
sysaltfiles have entries for that database, i didn't find any other entry
anywhere for that database.
Pedro
"Tibor Karaszi" wrote:
> What about sysaltfiles?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:21004A82-C7FC-45A0-882E-8B0F2C3B7853@.microsoft.com...
>|||Hmm, so below query returns a number of rows?
select * from master..sysaltfiles sa
WHERE NOT EXISTS(SELECT * FROM master..sysdatabases sd WHERE sa.dbid = sd.db
id)
If so, I really don't know. I haven't come across that before. Maybe open a
ticket with MS Support,
just to be certain you do the right thing here.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:8AA0D07C-FBC3-4A2A-8B32-C191F4014FE1@.microsoft.com...[vbcol=seagreen]
>I think this is the problem.
> sysaltfiles have entries for that database, i didn't find any other entry
> anywhere for that database.
> Pedro
> "Tibor Karaszi" wrote:
>|||No, it returns 0 rows
"Tibor Karaszi" wrote:
> Hmm, so below query returns a number of rows?
> select * from master..sysaltfiles sa
> WHERE NOT EXISTS(SELECT * FROM master..sysdatabases sd WHERE sa.dbid = sd.
dbid)
>
> If so, I really don't know. I haven't come across that before. Maybe open
a ticket with MS Support,
> just to be certain you do the right thing here.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Pedro" <Pedro@.discussions.microsoft.com> wrote in message
> news:8AA0D07C-FBC3-4A2A-8B32-C191F4014FE1@.microsoft.com...
>|||Pedro,
The command I posted will not try to USE your deleted database. It will
list all files used by any database. After running it, check the file list
to ensure the files you are trying to delete are not used by other
databases.
Hope this helps.
Dan Guzman
SQL Server MVP
"Pedro" <Pedro@.discussions.microsoft.com> wrote in message
news:1AD9CB8F-1303-4C5F-8A69-603DCA29847B@.microsoft.com...[vbcol=seagreen]
> Hi Dan,
> I can't define the database on USE statment because that database (DR2006)
> was deleted.
> At deletion time I had a disabled job for that database, maybe this was
> the
> cause for problem?
> "Dan Guzman" wrote:
>
Subscribe to:
Posts (Atom)