Showing posts with label remember. Show all posts
Showing posts with label remember. Show all posts

Wednesday, March 28, 2012

How Can I reduce my transacion log file?

I Have a Database with a transaction log file 31 Gb, and I have problem to
backup it.
I want decresea it but don't remember How.
LorenaHi,
It seems you have set recovery model for this database to FULL. In this
recovery model all the activity inside the
database is logged. So you have schedule a transaction log backup to clear
of the trasnaction logs. THis backup can
be used when a recovery is needed.
Show to set to simple
ALTER database <dbname> set recovery SIMPLE
How to clear the existing logs and shrink the file:-
Since the file is really huge, I recomment you to set the database to single
user model before doing the below steps.
-- Setting database single user.
Alter database <dbname> set single_user with rollback immediate
-- Truncate the transaction log
BACKUP log <dbname> with truncate_only
-- shrink the transacton log file
DBCC SHRINKFILE('logical_ldf_name',truncateon
ly)
After doing the above steps execute the below command to see the transaction
log size and usage.
DBCC SQLPERF(LOGSPACE)
-- Now set the database multi user
Alter database <dbname> set multi_user
Thanks
Hari
MCDBA
"Lorena" <Lorena@.discussions.microsoft.com> wrote in message
news:6B7189C4-2904-4000-BD28-1A89C8BA9866@.microsoft.com...
> I Have a Database with a transaction log file 31 Gb, and I have problem
to backup it.
> I want decresea it but don't remember How.
> Lorena

How Can I reduce my transacion log file?

I Have a Database with a transaction log file 31 Gb, and I have problem to backup it.
I want decresea it but don't remember How.
Lorena
Hi,
It seems you have set recovery model for this database to FULL. In this
recovery model all the activity inside the
database is logged. So you have schedule a transaction log backup to clear
of the trasnaction logs. THis backup can
be used when a recovery is needed.
Show to set to simple
ALTER database <dbname> set recovery SIMPLE
How to clear the existing logs and shrink the file:-
Since the file is really huge, I recomment you to set the database to single
user model before doing the below steps.
-- Setting database single user.
Alter database <dbname> set single_user with rollback immediate
-- Truncate the transaction log
BACKUP log <dbname> with truncate_only
-- shrink the transacton log file
DBCC SHRINKFILE('logical_ldf_name',truncateonly)
After doing the above steps execute the below command to see the transaction
log size and usage.
DBCC SQLPERF(LOGSPACE)
-- Now set the database multi user
Alter database <dbname> set multi_user
Thanks
Hari
MCDBA
"Lorena" <Lorena@.discussions.microsoft.com> wrote in message
news:6B7189C4-2904-4000-BD28-1A89C8BA9866@.microsoft.com...
> I Have a Database with a transaction log file 31 Gb, and I have problem
to backup it.
> I want decresea it but don't remember How.
> Lorena

Friday, March 23, 2012

How can I obtain the tine via Query Analyzer?

I know that that is a stupid thing but I can't remember it.
thanks thousandsIf you meant, time, then:
SELECT CURRENT_TIMESTAMP
or
SELECT GETDATE()
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:0B99C351-23F4-42CC-8B7B-F7B671B84569@.microsoft.com...
I know that that is a stupid thing but I can't remember it.
thanks thousands|||Cheers,
"Narayana Vyas Kondreddi" wrote:

> If you meant, time, then:
> SELECT CURRENT_TIMESTAMP
> or
> SELECT GETDATE()
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Enric" <Enric@.discussions.microsoft.com> wrote in message
> news:0B99C351-23F4-42CC-8B7B-F7B671B84569@.microsoft.com...
> I know that that is a stupid thing but I can't remember it.
> thanks thousands
>
>|||Hi Enric
Vyas answered the question, but this is just an extension for the answer you
might be interested in it:
SELECT CONVERT(varchar(8),getdate(),108)
this will give you present time
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"Enric" wrote:
> Cheers,
> "Narayana Vyas Kondreddi" wrote:
>