Wednesday, March 7, 2012

DB name not in sysfiles

This command:
dbcc shrinkfile(ABC2_Log,10)
yields:
"Could not locate file 'ABC2_Log' in sysfiles."
Initially, I had backed up ABC and restored it as ABC2. Sysfiles on DB ABC2
shows the name of the DB as "ABC". I think that might be the problem.
However, this command:
update sysfiles
set name = 'ABC2_Log' where name = 'ABC_Log
yields:
"Ad hoc updates to system catalogs are not enabled"
Not sure if my solution of modifing sysfiles is a correct one or not. Any
help or insight would be appreciated.
Bottom line is i really need to truncate the LOG file. It's almost filled up
the hard drive.
Don
SQL 2000Are you in the right database when you execute the command? Also, what version?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:29968CB2-A525-4507-8C65-3F5D23C49689@.microsoft.com...
> This command:
> dbcc shrinkfile(ABC2_Log,10)
> yields:
> "Could not locate file 'ABC2_Log' in sysfiles."
> Initially, I had backed up ABC and restored it as ABC2. Sysfiles on DB ABC2
> shows the name of the DB as "ABC". I think that might be the problem.
> However, this command:
> update sysfiles
> set name = 'ABC2_Log' where name = 'ABC_Log
> yields:
> "Ad hoc updates to system catalogs are not enabled"
> Not sure if my solution of modifing sysfiles is a correct one or not. Any
> help or insight would be appreciated.
> Bottom line is i really need to truncate the LOG file. It's almost filled up
> the hard drive.
> Don
> SQL 2000
>|||yes, I'm in the right DB. SQL 2000
Don
"Tibor Karaszi" wrote:
> Are you in the right database when you execute the command? Also, what version?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> news:29968CB2-A525-4507-8C65-3F5D23C49689@.microsoft.com...
> > This command:
> >
> > dbcc shrinkfile(ABC2_Log,10)
> >
> > yields:
> >
> > "Could not locate file 'ABC2_Log' in sysfiles."
> >
> > Initially, I had backed up ABC and restored it as ABC2. Sysfiles on DB ABC2
> > shows the name of the DB as "ABC". I think that might be the problem.
> >
> > However, this command:
> >
> > update sysfiles
> > set name = 'ABC2_Log' where name = 'ABC_Log
> >
> > yields:
> >
> > "Ad hoc updates to system catalogs are not enabled"
> >
> > Not sure if my solution of modifing sysfiles is a correct one or not. Any
> > help or insight would be appreciated.
> >
> > Bottom line is i really need to truncate the LOG file. It's almost filled up
> > the hard drive.
> >
> > Don
> > SQL 2000
> >
> >
>|||Compare the logical names in sysfiles to what you have in master..sysaltfiles.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:B2745B8E-813E-4150-8977-9A775EA677EA@.microsoft.com...
> yes, I'm in the right DB. SQL 2000
> Don
>
> "Tibor Karaszi" wrote:
>> Are you in the right database when you execute the command? Also, what version?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
>> news:29968CB2-A525-4507-8C65-3F5D23C49689@.microsoft.com...
>> > This command:
>> >
>> > dbcc shrinkfile(ABC2_Log,10)
>> >
>> > yields:
>> >
>> > "Could not locate file 'ABC2_Log' in sysfiles."
>> >
>> > Initially, I had backed up ABC and restored it as ABC2. Sysfiles on DB ABC2
>> > shows the name of the DB as "ABC". I think that might be the problem.
>> >
>> > However, this command:
>> >
>> > update sysfiles
>> > set name = 'ABC2_Log' where name = 'ABC_Log
>> >
>> > yields:
>> >
>> > "Ad hoc updates to system catalogs are not enabled"
>> >
>> > Not sure if my solution of modifing sysfiles is a correct one or not. Any
>> > help or insight would be appreciated.
>> >
>> > Bottom line is i really need to truncate the LOG file. It's almost filled up
>> > the hard drive.
>> >
>> > Don
>> > SQL 2000
>> >
>> >
>>|||master..sysaltfile
ABC_Data,C:\path\ABC_Data.MDF
ABC_Log,C:\path\ABC_Log.LDF
ABC_Data,C:\path\ABC2.mdf
ABC_Log,C:\path\ABC2_log.ldf
ABC..sysfiles
ABC_Data,C:\path\ABC_Data.MDF
ABC_Log ,C:\path\ABC_Log.LDF
ABC2..sysfiles
ABC_Data,C:\path\ABC2.mdf
ABC_Log,C:\path\ABC2_log.ldf
"Tibor Karaszi" wrote:
> Compare the logical names in sysfiles to what you have in master..sysaltfiles.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> news:B2745B8E-813E-4150-8977-9A775EA677EA@.microsoft.com...
> > yes, I'm in the right DB. SQL 2000
> >
> > Don
> >
> >
> > "Tibor Karaszi" wrote:
> >
> >> Are you in the right database when you execute the command? Also, what version?
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://sqlblog.com/blogs/tibor_karaszi
> >>
> >>
> >> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> >> news:29968CB2-A525-4507-8C65-3F5D23C49689@.microsoft.com...
> >> > This command:
> >> >
> >> > dbcc shrinkfile(ABC2_Log,10)
> >> >
> >> > yields:
> >> >
> >> > "Could not locate file 'ABC2_Log' in sysfiles."
> >> >
> >> > Initially, I had backed up ABC and restored it as ABC2. Sysfiles on DB ABC2
> >> > shows the name of the DB as "ABC". I think that might be the problem.
> >> >
> >> > However, this command:
> >> >
> >> > update sysfiles
> >> > set name = 'ABC2_Log' where name = 'ABC_Log
> >> >
> >> > yields:
> >> >
> >> > "Ad hoc updates to system catalogs are not enabled"
> >> >
> >> > Not sure if my solution of modifing sysfiles is a correct one or not. Any
> >> > help or insight would be appreciated.
> >> >
> >> > Bottom line is i really need to truncate the LOG file. It's almost filled up
> >> > the hard drive.
> >> >
> >> > Don
> >> > SQL 2000
> >> >
> >> >
> >>
> >>
>|||I'd use ALTER DATABASE to set a desired logical filenames, avoid duplication between databases (just
in case this is what confuses SQL Server) then try again.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:9310BC2F-3B76-40BA-99B9-E8B6FA5751ED@.microsoft.com...
> master..sysaltfile
> ABC_Data,C:\path\ABC_Data.MDF
> ABC_Log,C:\path\ABC_Log.LDF
> ABC_Data,C:\path\ABC2.mdf
> ABC_Log,C:\path\ABC2_log.ldf
> ABC..sysfiles
> ABC_Data,C:\path\ABC_Data.MDF
>
> ABC_Log ,C:\path\ABC_Log.LDF
>
> ABC2..sysfiles
> ABC_Data,C:\path\ABC2.mdf
>
> ABC_Log,C:\path\ABC2_log.ldf
>
>
> "Tibor Karaszi" wrote:
>> Compare the logical names in sysfiles to what you have in master..sysaltfiles.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
>> news:B2745B8E-813E-4150-8977-9A775EA677EA@.microsoft.com...
>> > yes, I'm in the right DB. SQL 2000
>> >
>> > Don
>> >
>> >
>> > "Tibor Karaszi" wrote:
>> >
>> >> Are you in the right database when you execute the command? Also, what version?
>> >>
>> >> --
>> >> Tibor Karaszi, SQL Server MVP
>> >> http://www.karaszi.com/sqlserver/default.asp
>> >> http://sqlblog.com/blogs/tibor_karaszi
>> >>
>> >>
>> >> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
>> >> news:29968CB2-A525-4507-8C65-3F5D23C49689@.microsoft.com...
>> >> > This command:
>> >> >
>> >> > dbcc shrinkfile(ABC2_Log,10)
>> >> >
>> >> > yields:
>> >> >
>> >> > "Could not locate file 'ABC2_Log' in sysfiles."
>> >> >
>> >> > Initially, I had backed up ABC and restored it as ABC2. Sysfiles on DB ABC2
>> >> > shows the name of the DB as "ABC". I think that might be the problem.
>> >> >
>> >> > However, this command:
>> >> >
>> >> > update sysfiles
>> >> > set name = 'ABC2_Log' where name = 'ABC_Log
>> >> >
>> >> > yields:
>> >> >
>> >> > "Ad hoc updates to system catalogs are not enabled"
>> >> >
>> >> > Not sure if my solution of modifing sysfiles is a correct one or not. Any
>> >> > help or insight would be appreciated.
>> >> >
>> >> > Bottom line is i really need to truncate the LOG file. It's almost filled up
>> >> > the hard drive.
>> >> >
>> >> > Don
>> >> > SQL 2000
>> >> >
>> >> >
>> >>
>> >>
>>|||Worked like a million!!
THANKS
Don
"Tibor Karaszi" wrote:
> I'd use ALTER DATABASE to set a desired logical filenames, avoid duplication between databases (just
> in case this is what confuses SQL Server) then try again.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> news:9310BC2F-3B76-40BA-99B9-E8B6FA5751ED@.microsoft.com...
> > master..sysaltfile
> > ABC_Data,C:\path\ABC_Data.MDF
> > ABC_Log,C:\path\ABC_Log.LDF
> > ABC_Data,C:\path\ABC2.mdf
> > ABC_Log,C:\path\ABC2_log.ldf
> >
> > ABC..sysfiles
> > ABC_Data,C:\path\ABC_Data.MDF
> >
> >
> > ABC_Log ,C:\path\ABC_Log.LDF
> >
> >
> >
> > ABC2..sysfiles
> > ABC_Data,C:\path\ABC2.mdf
> >
> >
> > ABC_Log,C:\path\ABC2_log.ldf
> >
> >
> >
> >
> > "Tibor Karaszi" wrote:
> >
> >> Compare the logical names in sysfiles to what you have in master..sysaltfiles.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://sqlblog.com/blogs/tibor_karaszi
> >>
> >>
> >> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> >> news:B2745B8E-813E-4150-8977-9A775EA677EA@.microsoft.com...
> >> > yes, I'm in the right DB. SQL 2000
> >> >
> >> > Don
> >> >
> >> >
> >> > "Tibor Karaszi" wrote:
> >> >
> >> >> Are you in the right database when you execute the command? Also, what version?
> >> >>
> >> >> --
> >> >> Tibor Karaszi, SQL Server MVP
> >> >> http://www.karaszi.com/sqlserver/default.asp
> >> >> http://sqlblog.com/blogs/tibor_karaszi
> >> >>
> >> >>
> >> >> "donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
> >> >> news:29968CB2-A525-4507-8C65-3F5D23C49689@.microsoft.com...
> >> >> > This command:
> >> >> >
> >> >> > dbcc shrinkfile(ABC2_Log,10)
> >> >> >
> >> >> > yields:
> >> >> >
> >> >> > "Could not locate file 'ABC2_Log' in sysfiles."
> >> >> >
> >> >> > Initially, I had backed up ABC and restored it as ABC2. Sysfiles on DB ABC2
> >> >> > shows the name of the DB as "ABC". I think that might be the problem.
> >> >> >
> >> >> > However, this command:
> >> >> >
> >> >> > update sysfiles
> >> >> > set name = 'ABC2_Log' where name = 'ABC_Log
> >> >> >
> >> >> > yields:
> >> >> >
> >> >> > "Ad hoc updates to system catalogs are not enabled"
> >> >> >
> >> >> > Not sure if my solution of modifing sysfiles is a correct one or not. Any
> >> >> > help or insight would be appreciated.
> >> >> >
> >> >> > Bottom line is i really need to truncate the LOG file. It's almost filled up
> >> >> > the hard drive.
> >> >> >
> >> >> > Don
> >> >> > SQL 2000
> >> >> >
> >> >> >
> >> >>
> >> >>
> >>
> >>
>

No comments:

Post a Comment