2012年2月17日星期五

disable log file

Hi all,
I want to distribute the mdf file with my program, but i always have
problems with the transaction log file when i try to attach
the database on some other server.
Is it possible to disable the log for the database, so the attach manager
wouldn't complain about a missing log file?
Thanks for your help,
J.Hi
No, you can't disable it. When don't you ship the LDF file too?
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Jozza" <hmm@.hmm.com> wrote in message
news:%nDSe.68$h6.18283@.news.siol.net...
> Hi all,
> I want to distribute the mdf file with my program, but i always have
> problems with the transaction log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
> wouldn't complain about a missing log file?
> Thanks for your help,
> J.
>|||Jozza
Lookup sp_attach_single_file_db system stored procedure in the BOL.
"Jozza" <hmm@.hmm.com> wrote in message
news:%nDSe.68$h6.18283@.news.siol.net...
> Hi all,
> I want to distribute the mdf file with my program, but i always have
> problems with the transaction log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
> wouldn't complain about a missing log file?
> Thanks for your help,
> J.
>|||As stated, you can't disable logging. You should be able to attach only the
mdf file if:
The database only has one single log file.
If you properly detached the database.
If above holds, you should be able to attach only the mdf file using sp_atta
ch_single_file_db. If
you can't, you should open a case with MS.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jozza" <hmm@.hmm.com> wrote in message news:%nDSe.68$h6.18283@.news.siol.net...d">
> Hi all,
> I want to distribute the mdf file with my program, but i always have probl
ems with the transaction
> log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
wouldn't complain about
> a missing log file?
> Thanks for your help,
> J.
>|||Ok, i agree with all of you, but,
when attaching the database file, the attach manager displays the previous
path of the log file, that is, the path on my computer,
which i don't want my customer to see at all. I'm using (DbaMgr2K - i don't
know about the original sql manager though).
The path to the log file is saved to the mdf and points to the physical
unexisting directory on the client's computer, and i when distribute both
mdf and log file, they are copied to the installed directory, attach manager
searches for the log in the wrong (previously saved) directory. How do i fix
that?
J.
"Jozza" <hmm@.hmm.com> wrote in message
news:%nDSe.68$h6.18283@.news.siol.net...
> Hi all,
> I want to distribute the mdf file with my program, but i always have
> problems with the transaction log file when i try to attach
> the database on some other server.
> Is it possible to disable the log for the database, so the attach manager
> wouldn't complain about a missing log file?
> Thanks for your help,
> J.
>|||Consider executing sp_attach_db rather than a GUI:
EXEC sp_attach_db 'MyDatabase',
'C:\MyInstallFolder\MyDatabase.mdf'',
'C:\MyInstallFolder\MyDatabase_Log.ldf''
Hope this helps.
Dan Guzman
SQL Server MVP
"Jozza" <hmm@.hmm.com> wrote in message
news:s0ESe.69$h6.17942@.news.siol.net...
> Ok, i agree with all of you, but,
> when attaching the database file, the attach manager displays the previous
> path of the log file, that is, the path on my computer,
> which i don't want my customer to see at all. I'm using (DbaMgr2K - i
> don't know about the original sql manager though).
> The path to the log file is saved to the mdf and points to the physical
> unexisting directory on the client's computer, and i when distribute both
> mdf and log file, they are copied to the installed directory, attach
> manager searches for the log in the wrong (previously saved) directory.
> How do i fix that?
> J.
> "Jozza" <hmm@.hmm.com> wrote in message
> news:%nDSe.68$h6.18283@.news.siol.net...
>

没有评论:

发表评论