The DB and LOG names are not in sysfiles.
Originally, I needed a duplicate of DB1, so I backed up DB1, restored it
with a new name of DB2. I guess this process doesn't insert DB2 names into
sysfiles.
Now, I need to shrink the log file with DBCC SHRINKFILE (DB2_LOG,10), but I
get the error message:
"Could not locate file 'DB2_Log' in sysfiles."
Thx,
Don
SQL 2000
Sysfiles table contains only information about the files that the
database has. It doesn't suppose to have any information about the
database's name. The log doesn't have any name, so it isn't stored
anywhere. When you want to shrink a file, you should issue dbcc
shrinkfile statement that uses the file's logical name. You can get
the file's logical name from sysfiles table. You should be connected
to the database that you want to shrink when you issue the dbcc
statement.
Adi
On Feb 5, 9:00 pm, donsql22222 <donsql22...@.discussions.microsoft.com>
wrote:
> The DB and LOG names are not in sysfiles.
> Originally, I needed a duplicate of DB1, so I backed up DB1, restored it
> with a new name of DB2. I guess this process doesn't insert DB2 names into
> sysfiles.
> Now, I need to shrink the log file with DBCC SHRINKFILE (DB2_LOG,10), but I
> get the error message:
> "Could not locate file 'DB2_Log' in sysfiles."
> Thx,
> Don
> SQL 2000
|||But, that's what I'm saying. The logical name is not in Sysfiles.
Don
"Adi" wrote:
> Sysfiles table contains only information about the files that the
> database has. It doesn't suppose to have any information about the
> database's name. The log doesn't have any name, so it isn't stored
> anywhere. When you want to shrink a file, you should issue dbcc
> shrinkfile statement that uses the file's logical name. You can get
> the file's logical name from sysfiles table. You should be connected
> to the database that you want to shrink when you issue the dbcc
> statement.
> Adi
> On Feb 5, 9:00 pm, donsql22222 <donsql22...@.discussions.microsoft.com>
> wrote:
>
>
|||You wrote about the database's name. The file's name is there. The
database can not function if the data in sysfiles is wrong. The
column name stores the file's name. Make sure that you are connected
to the database that you want to check/shrink.
Adi
On Feb 5, 9:45 pm, donsql22222 <donsql22...@.discussions.microsoft.com>
wrote:
> But, that's what I'm saying. The logical name is not in Sysfiles.
> Don
>
> "Adi" wrote:
>
>
> - Show quoted text -
|||DB1 sysfiles shows DB1_Data, and DB1_Log.
DB2 sysfiles shows DB1_Data, and DB1_Log.
Don
"Adi" wrote:
> You wrote about the database's name. The file's name is there. The
> database can not function if the data in sysfiles is wrong. The
> column name stores the file's name. Make sure that you are connected
> to the database that you want to check/shrink.
> Adi
> On Feb 5, 9:45 pm, donsql22222 <donsql22...@.discussions.microsoft.com>
> wrote:
>
>
|||Use this
use DB2
DBCC SHRINKFILE (DB1_LOG,shrink size in MBs)
manu jaidka
"donsql22222" wrote:
[vbcol=seagreen]
> DB1 sysfiles shows DB1_Data, and DB1_Log.
> DB2 sysfiles shows DB1_Data, and DB1_Log.
> Don
>
> "Adi" wrote:
|||That does not matter. Just do below
USE DB2
GO
DBCC SHRINKFILE('DB1_Log',size inmb)
GO
If you need to rename the logical ldf name, take a look into ALTER DATABASE
Thanks
Hari
"donsql22222" <donsql22222@.discussions.microsoft.com> wrote in message
news:9AC2BCA9-F39B-495D-80F7-62921BA70EC7@.microsoft.com...[vbcol=seagreen]
> DB1 sysfiles shows DB1_Data, and DB1_Log.
> DB2 sysfiles shows DB1_Data, and DB1_Log.
> Don
>
> "Adi" wrote:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment