Hi All,
Recenty, I met with a serious problem. For some unknown reason, the
log file of one of our database is missing, only the data file left.
Can I just use the data file of the database to restore the database?
Thanks.
Dobby
Ps: I use SQL Server 2000Try sp_attach_single_file_db. More information in BOL.
Dmitrij
"Dobby Cai" wrote:
> Hi All,
> Recenty, I met with a serious problem. For some unknown reason, the
> log file of one of our database is missing, only the data file left.
> Can I just use the data file of the database to restore the database?
> Thanks.
> Dobby
> Ps: I use SQL Server 2000
>|||Hi Dobby
Can you connect to the database? If so you can use sp_helpfile to see where
the log is.
If the database is not attached, then if this was SQL 2005 you could use
"FOR ATTACH_REBUILD_LOG" option of CREATE DATABASE but this is SQL 2000!
For SQL 2000 and SQL 2005 you can also use sp_attach_single_file_db
John
"Dobby Cai" wrote:
> Hi All,
> Recenty, I met with a serious problem. For some unknown reason, the
> log file of one of our database is missing, only the data file left.
> Can I just use the data file of the database to restore the database?
> Thanks.
> Dobby
> Ps: I use SQL Server 2000
>|||On Oct 4, 2:33 pm, Dmitrij Siemieniako
<DmitrijSiemieni...@.discussions.microsoft.com> wrote:
> Try sp_attach_single_file_db. More information in BOL.
> Dmitrij
> "Dobby Cai" wrote:
> > Hi All,
> > Recenty, I met with a serious problem. For some unknown reason, the
> > log file of one of our database is missing, only the data file left.
> > Can I just use the data file of the database to restore the database?
> > Thanks.
> > Dobby
> > Ps: I use SQL Server 2000
use sp_attach_single_file_db option to attach the datafile which will
automatically creates your log file.
EXEC sp_attach_single_file_db @.dbname = 'pubs',
@.physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data
\pubs.mdf'
Thanks
Vijayasekar|||On Oct 4, 7:40 pm, vijay <vjsek...@.gmail.com> wrote:
> On Oct 4, 2:33 pm, Dmitrij Siemieniako
> <DmitrijSiemieni...@.discussions.microsoft.com> wrote:
> > Try sp_attach_single_file_db. More information in BOL.
> > Dmitrij
> > "Dobby Cai" wrote:
> > > Hi All,
> > > Recenty, I met with a serious problem. For some unknown reason, the
> > > log file of one of our database is missing, only the data file left.
> > > Can I just use the data file of the database to restore the database?
> > > Thanks.
> > > Dobby
> > > Ps: I use SQL Server 2000
> use sp_attach_single_file_db option to attach the datafile which will
> automatically creates your log file.
> EXEC sp_attach_single_file_db @.dbname = 'pubs',
> @.physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data
> \pubs.mdf'
> Thanks
> Vijayasekar
Thanks you for all, I will try this method.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment