Showing posts with label ldf. Show all posts
Showing posts with label ldf. Show all posts

Friday, February 24, 2012

"Ldf" file lose, and "Mdf" file is ok, can I still Attach database?

"Ldf" file lose, and "Mdf" file is ok, can I still Attach database?Colin
Have you last backup of your database?
sp_attach_single_file_db [ @.dbname = ] 'dbname'
, [ @.physname = ] 'physical_name'
"Colin Chen" <colin08@.21cn.com> wrote in message
news:#B206UYvDHA.1876@.TK2MSFTNGP09.phx.gbl...
> Help!!!
>|||Use sp_attach_single_file_db
It will create a new log...
In the future, start doing some database backups as well...You'll be better
off..
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Colin Chen" <colin08@.21cn.com> wrote in message
news:#B206UYvDHA.1876@.TK2MSFTNGP09.phx.gbl...
> Help!!!
>|||Just to add to the other posts:
SQL Server documentation states that you should be able to use
sp_attach_single_file_db and only attach the mdf file if the database
consists of only one data and one log file. And if you also really did
detach he database first. So, assuming that you didn't actually detached the
database first, there's a risk that you won't be able to attach it. In that
case, be prepared to open a case with Microsoft Support or do a restore from
the latest clean backup.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Colin Chen" <colin08@.21cn.com> wrote in message
news:%23B206UYvDHA.1876@.TK2MSFTNGP09.phx.gbl...
> Help!!!
>

Thursday, February 9, 2012

"backup log {Database_Name} with no_log" issue

I issue the "backup log {Database_Name} with no_log" and
also "Dump transaction {Datebase_Name} with no_log". The
LDF file still got the same size. Any idea?It's usually best to leave the size of the .ldf file as is after backing up
a log because this saves sql server from having to go through the effort of
manually growing it whilst the database is in operation. This is because
having to grow the log file during operation slows down the performance of
SQL Server. This is why most production environments leave the .ldf file as
it is & simply truncate the "logical" log records from the file. There are
also other factors that come into play when considering recovery times as
well.
So, backing up a log & shrinking a .ldf file aren't two things you should
expect to happen automatically.
If you really want to shrink the .ldf file for some reason, there is a good
article on the topic in SQL Server Books Online here:
http://msdn.microsoft.com/library/en-us/architec/8_ar_da2_1uzr.asp
HTH
Regards,
Greg Linwood
SQL Server MVP
"KL" <anonymous@.discussions.microsoft.com> wrote in message
news:034801c3c744$e685fc70$a101280a@.phx.gbl...
> I issue the "backup log {Database_Name} with no_log" and
> also "Dump transaction {Datebase_Name} with no_log". The
> LDF file still got the same size. Any idea?
>|||Just to add to Greg's comments you should note that backingup a log file
will not shrink it. That will only happen with a DBCC SHRINKDATABASE or
SHRINKFILE command. It may not be able to actually shrink until the backup
is completed but that alone does not shrink the log file.
--
Andrew J. Kelly SQL MVP
"Greg Linwood" <g_linwoodQhotmail.com> wrote in message
news:%23LGr8z2xDHA.1616@.TK2MSFTNGP11.phx.gbl...
> It's usually best to leave the size of the .ldf file as is after backing
up
> a log because this saves sql server from having to go through the effort
of
> manually growing it whilst the database is in operation. This is because
> having to grow the log file during operation slows down the performance of
> SQL Server. This is why most production environments leave the .ldf file
as
> it is & simply truncate the "logical" log records from the file. There are
> also other factors that come into play when considering recovery times as
> well.
> So, backing up a log & shrinking a .ldf file aren't two things you should
> expect to happen automatically.
> If you really want to shrink the .ldf file for some reason, there is a
good
> article on the topic in SQL Server Books Online here:
> http://msdn.microsoft.com/library/en-us/architec/8_ar_da2_1uzr.asp
> HTH
> Regards,
> Greg Linwood
> SQL Server MVP
> "KL" <anonymous@.discussions.microsoft.com> wrote in message
> news:034801c3c744$e685fc70$a101280a@.phx.gbl...
> > I issue the "backup log {Database_Name} with no_log" and
> > also "Dump transaction {Datebase_Name} with no_log". The
> > LDF file still got the same size. Any idea?
> >
>