all groups > sql server programming > october 2003 >
You're in the

sql server programming

group:

sp_helpdb & sysaltfiles


sp_helpdb & sysaltfiles Anand
10/28/2003 9:53:12 PM
sql server programming:
Hi all,
This is with reference with to my previous post with
same subject.

Hello All,
My database name is hriscomp.
I wanted to increase the FILEGROWTH parameter of the
database using EM. It failed saying that :
Error 5041: MODIFY FILE failed. File 'comp_Data' does not
exist (Eventhough the property of the database
shows 'comp_Data'
and 'comp_Log' as the Logical Name).
Then I tried using ALTER DATABASE hriscomp MODIFY FILE
(Name=comp_Data, FILEGROWTH=50%)

But If I try ALTER DATABASE hriscomp MODIFY FILE
(Name=hriscomp_Data, FILEGROWTH=50%), it works.

Then I queried the following,

sp_helpdb hriscomp
name fileName
filegroup Growth
comp_Data d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Data.MDF PRIMARY 30%
comp_Log d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Log.LDF NULL 10%

SELECT * FROM sysfiles1

status fileid name filename
32770 1 comp_Data d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Data.MDF

32834 2 comp_Log d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Log.LDF







SELECT * FROM sysFiles

status name filename
1081346 comp_Data d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Data.MDF

1081410 comp_Log d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Log.LDF



master.dbo.sysaltfiles WHERE DBID=7

Growth dbid name filename
30 7 hriscomp_Data d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Data.MDF
10 7 hriscomp_Log d:\apps\Microsoft SQL
Server\MSSQL\data\hriscomp_Log.LDF


If you note that sysaltfiles system table different name
than other system tables. Can anyone tell me how it could
have happened? And how to deal with this problem?

Thanks in advance

Re: sp_helpdb & sysaltfiles Anand
10/28/2003 10:50:16 PM
Hi,
I restarted SQL Server also, but it did not help. Also
I tried using QA(I have mentioned in the post), but it
fails.

Thanks
anand

[quoted text, click to view]
Re: sp_helpdb & sysaltfiles Anand
10/29/2003 12:23:39 AM
Hi,
Yea it is true, but this statement fails:

ALTER DATABASE hriscomp MODIFY FILE
(Name=comp_Data, FILEGROWTH=50%)

Note: I am using Name='comp_Data'.
sp_helpdb hrisComp and
other system tables except sysaltfiles gave the logical
name has 'comp_Data'.
So naturally we tend to use the above Alter Database
statement with 'comp_data' instead of 'hriscomp_data'

Regards
Anand

[quoted text, click to view]
Re: sp_helpdb & sysaltfiles Uri Dimant
10/29/2003 8:38:28 AM
Anand
Try stop and start EM but I'd recommend you to use QA rather than EM.

[quoted text, click to view]

Re: sp_helpdb & sysaltfiles Uri Dimant
10/29/2003 9:40:12 AM
Anand
You said :
"But If I try ALTER DATABASE hriscomp MODIFY FILE
(Name=hriscomp_Data, FILEGROWTH=50%), it works."





[quoted text, click to view]

Re: sp_helpdb & sysaltfiles Pozolotin Andrew
10/29/2003 3:23:08 PM
Anand,
try to change Logical Name to other

alter database hriscomp
modify file (
name=comp_Data, newname=newcomp_Data)

I hope this will correct you DB

Andrew

[quoted text, click to view]

AddThis Social Bookmark Button