Friday, February 24, 2012

Adding files and filegroups

Does SQL Server keep track of when new files and
filegroups are added or removed from a database, e.g., in
the form of a timestamp in the catalog? and how can a user
access this information?
Thank-you, Howardsp_helpdb will tell you more about the databases
sp_helpfilegroups returns the names and attributes of filegroups associated
with the current database
sysfiles : Contains one row for each file in a database. This system table
is a virtual table; it cannot be updated or modified directly.
Regards,
Dandy Weyn
MCSE, MCSA, MCDBA, MCT
www.dandyman.net
"Howard" <anonymous@.discussions.microsoft.com> wrote in message
news:07bc01c3d14e$04b438c0$a601280a@.phx.gbl...
> Does SQL Server keep track of when new files and
> filegroups are added or removed from a database, e.g., in
> the form of a timestamp in the catalog? and how can a user
> access this information?
> Thank-you, Howard|||I would assume this info would be in sysfiles or sysfilegroups. It's not
there, so I don't think it's possible to get from SQL Server.
But...
you CAN find the time a file was added.
Create date is kept by the OS for a file. Something like this would work:
xp_getfiledetails 'c:\temp\authors.txt'
But that would be the create date from an OS perspective. You would end up
with wrong info if for example you restored the database and overwrote
files, since they would then have new create dates...
or you could create your own polling program that periodically looks at the
relevant system tables mentioned above...
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Howard" <anonymous@.discussions.microsoft.com> wrote in message
news:07bc01c3d14e$04b438c0$a601280a@.phx.gbl...
> Does SQL Server keep track of when new files and
> filegroups are added or removed from a database, e.g., in
> the form of a timestamp in the catalog? and how can a user
> access this information?
> Thank-you, Howard|||This is essentially what I found; but it falls short of
what I need. Basically, I would like some sort of
notification (short of polling) since changes in the
file/filegroup structure would impact the usefullness of
component backup images that I may be keeping.
Thanks, Howard
>--Original Message--
>I would assume this info would be in sysfiles or
sysfilegroups. It's not
>there, so I don't think it's possible to get from SQL
Server.
>But...
>you CAN find the time a file was added.
>Create date is kept by the OS for a file. Something like
this would work:
>xp_getfiledetails 'c:\temp\authors.txt'
>But that would be the create date from an OS perspective.
You would end up
>with wrong info if for example you restored the database
and overwrote
>files, since they would then have new create dates...
>or you could create your own polling program that
periodically looks at the
>relevant system tables mentioned above...
>--
>Brian Moran
>Principal Mentor
>Solid Quality Learning
>SQL Server MVP
>http://www.solidqualitylearning.com
>
>"Howard" <anonymous@.discussions.microsoft.com> wrote in
message
>news:07bc01c3d14e$04b438c0$a601280a@.phx.gbl...
>> Does SQL Server keep track of when new files and
>> filegroups are added or removed from a database, e.g.,
in
>> the form of a timestamp in the catalog? and how can a
user
>> access this information?
>> Thank-you, Howard
>
>.
>

No comments:

Post a Comment