Showing posts with label log. Show all posts
Showing posts with label log. Show all posts

Monday, March 26, 2012

How to release large unused/allocated space

Hi,

I have 6 filegroups that contain over 30 gigs of data. I manage the transaction log space efficiently by using a script and 'shrink database'. But, the allocated unused space of the data files are very large, over 30 gigs.

The configuration is standard for all files:

- Automatically grow file by percent

- Maximum file size - Unrestricted

How do I release the unused space?

Thanks,

- gshaf

Hi Gshaf,

You can issue the DBCC SHRINKDATABASE statement with TRUNCATEONLY. This will shrink the database the maximum amount possible, and release the space back to windows. If you want to control how much space in the db left for growth, you'll need to issue DBCC SHRINKFILE and specify the amount (MB) of space you want left:

DBCC SHRINKFILE(MyDataFileNameHere, 15000)

The above command will attempt to shrink the datafile "MyDataFileNameHere" to 15GB.

Cheers,

Rob

sql

How to release large unused/allocated space

Hi,

I have 6 filegroups that contain over 30 gigs of data. I manage the transaction log space efficiently by using a script and 'shrink database'. But, the allocated unused space of the data files are very large, over 30 gigs.

The configuration is standard for all files:

- Automatically grow file by percent

- Maximum file size - Unrestricted

How do I release the unused space?

Thanks,

- gshaf

Hi Gshaf,

You can issue the DBCC SHRINKDATABASE statement with TRUNCATEONLY. This will shrink the database the maximum amount possible, and release the space back to windows. If you want to control how much space in the db left for growth, you'll need to issue DBCC SHRINKFILE and specify the amount (MB) of space you want left:

DBCC SHRINKFILE(MyDataFileNameHere, 15000)

The above command will attempt to shrink the datafile "MyDataFileNameHere" to 15GB.

Cheers,

Rob

Friday, March 23, 2012

How to register an existing database

Hello,

I use SQL Server 2000 ( could be developer version )

Is there a way to re-register a database.

I have one .MDF file and a log file.

Every menu i have been thrue but no luck.

Is this possible or do i need to add a new database?

Thnaks,
Dennis1. Open Enterprise Manager
2. Open up the tree under your server until you see the "Databases" section.
3. Single click to select it.
4. Right-Click and select "All Tasks->Attach Database"
5. Select your mdf file.|||McMurdoStation,
you have saved me a lot of work.

Thanks a million,
Dennis

How to reduce the log file size.

Hi all,
How to reduce the physical file size of Transaction log in
SQL 7.0?>--Original Message--
>Hi all,
>How to reduce the physical file size of Transaction log
in
>SQL 7.0?
>.
>Ytan, this has happened to me. The hard drive on the SQL
box was full.|||Check out below KB articles:
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/default.aspx?scid=kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Ytan" <y24042003@.yahoo.com> wrote in message news:0fea01c38887$5bde8ca0$a401280a@.phx.gbl...
> Hi all,
> How to reduce the physical file size of Transaction log in
> SQL 7.0?sql

How to reduce the log file ?

Hi,
I found that there is a setting to set the maximum log file, however,
I haven't enable it. Therefore, current log file is 1G. How can I
reduce it to 500MB so that I can set the max. log file to 500MB.
Happy new year to all
Ivan
GinolaIn the future you might post something like this to the
public.SQLserver.server newsgroups. To reduce the log you have two options,
(1) if you do not require point in time recovery you can issue the command
"backup log dbname with truncate_only" Then issue a dbcc shrinkfile command
to shrink the log (see BOL for full syntax). Also, if you do not require
point in time recovery you might set your recovery mode to simple to avoid
the log from growing.
If you do require point in time recovery, setup regular log backups and
don't shrink your logfile unless you have to for space reasons. Having empty
space in the log file is better than having SQL Server reallocate more disk
space to the log during the production day.
HTH
Ray Higdon MCSE, MCDBA, CCNA
--
"Ginola" <ginola@.fake.email.com> wrote in message
news:3ff3933f.24975482@.msnews.microsoft.com...
quote:

> Hi,
> I found that there is a setting to set the maximum log file, however,
> I haven't enable it. Therefore, current log file is 1G. How can I
> reduce it to 500MB so that I can set the max. log file to 500MB.
> Happy new year to all
> Ivan
> Ginola
|||To shrink the transaction log, you merely need to back it up and execute
dbcc shrinkfile.
If you don't need the backup, do
backup tran <database_name> with no_log
go
dbcc shrinkfile (<database_name>,target size)
To shrink as far as possible, set target_size to 0.
For SQL 7, it is dump tran instead of backup tran and dbcc shrinkfile
(<database_name> )
Whatever you do, don't delete the transaction log. You were lucky that
there were no transactions running or recovering at the time, otherwise, you
would have wound up with a suspect database.
****************************************
***************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
Always keep your antivirus and Microsoft software
up to date with the latest definitions and product updates.
Be suspicious of every email attachment, I will never send
or post anything other than the text of a http:// link nor
post the link directly to a file for downloading.
This posting is provided "as is" with no warranties
and confers no rights.
****************************************
***************************
"Ginola" <ginola@.fake.email.com> wrote in message
news:3ff3933f.24975482@.msnews.microsoft.com...
quote:

> Hi,
> I found that there is a setting to set the maximum log file, however,
> I haven't enable it. Therefore, current log file is 1G. How can I
> reduce it to 500MB so that I can set the max. log file to 500MB.
> Happy new year to all
> Ivan
> Ginola
|||thanks for replying
On Fri, 2 Jan 2004 09:58:56 -0500, "Andy Svendsen"
<andymcdba1@.NOMORESPAM.yahoo.com> wrote:
quote:

>To shrink the transaction log, you merely need to back it up and execute
>dbcc shrinkfile.
>If you don't need the backup, do
>backup tran <database_name> with no_log
>go
>dbcc shrinkfile (<database_name>,target size)
>To shrink as far as possible, set target_size to 0.
>For SQL 7, it is dump tran instead of backup tran and dbcc shrinkfile
>(<database_name> )
>Whatever you do, don't delete the transaction log. You were lucky that
>there were no transactions running or recovering at the time, otherwise, yo
u
>would have wound up with a suspect database.

Ginola|||I am a beginner in SQL server and I am using SQL server 2000
where should I type
backup tran <database_name> with no_log
go
dbcc shrinkfile (<database_name>,target size)
To shrink the transaction log.
I know how to shrink the database ( because it has the option to
option when right click, but not the log file )
On Fri, 2 Jan 2004 09:58:56 -0500, "Andy Svendsen"
<andymcdba1@.NOMORESPAM.yahoo.com> wrote:
quote:

>To shrink the transaction log, you merely need to back it up and execute
>dbcc shrinkfile.
>If you don't need the backup, do
>backup tran <database_name> with no_log
>go
>dbcc shrinkfile (<database_name>,target size)
>To shrink as far as possible, set target_size to 0.
>For SQL 7, it is dump tran instead of backup tran and dbcc shrinkfile
>(<database_name> )
>Whatever you do, don't delete the transaction log. You were lucky that
>there were no transactions running or recovering at the time, otherwise, yo
u
>would have wound up with a suspect database.

Ginola|||Go to start/programs - microsoft SQL Server - Query Analyzer. You will
need to make a connection to the SQL Server you need to issue the
commands on.
HTH
Ray Higdon MCSE, MCDBA, CCNA
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||thanks, got it
On Sun, 04 Jan 2004 18:10:24 -0800, Ray Higdon
<rayhigdon@.higdonconsulting.com> wrote:
quote:

>Go to start/programs - microsoft SQL Server - Query Analyzer. You will
>need to make a connection to the SQL Server you need to issue the
>commands on.
>HTH
>Ray Higdon MCSE, MCDBA, CCNA
>*** Sent via Developersdex http://www.examnotes.net ***
>Don't just participate in USENET...get rewarded for it!

Ginola|||Hi,
I have tried
backup tran <database_name> with no_log
go
dbcc shrinkfile (<database_name>,target size)
but the error message display
"Could not locate file 'sqlBackup' in sysfiles.
DBCC execution completeted. If DBCC printed error message, contact
your system administrator"
sqlBackup is the database name,
When I delete the line "dbcc shrinkfile ... " it works fine. However,
when I apply the third line, the error message display.
Any clue how to solve the problem.
thanks
quote:

>To shrink the transaction log, you merely need to back it up and execute
>dbcc shrinkfile.
>If you don't need the backup, do
>backup tran <database_name> with no_log
>go
>dbcc shrinkfile (<database_name>,target size)
>To shrink as far as possible, set target_size to 0.
>For SQL 7, it is dump tran instead of backup tran and dbcc shrinkfile
>(<database_name> )
>Whatever you do, don't delete the transaction log. You were lucky that
>there were no transactions running or recovering at the time, otherwise, yo
u
>would have wound up with a suspect database.

Ginola|||You need to specify the actual name of the log file for that operation
once you are in the database, try this:
backup log sqlbackup with no_log
go
use sqlbackup
go
dbcc shrinkfile (logical name of your log file,0)
You can find the logical name by right-clicking your database in EM and
clicking the log tab and using the logical name (not the physical MDF
name)
HTH
Ray Higdon MCSE, MCDBA, CCNA
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

How to reduce size of sql.log file

Hi,
I am running database on SQL2000 server and sql.log file
that is associated with the database keeps on growing. I
would like to reduce its size but don't know how. I would
appreciate if someone could tell me what is the way to
reduce the sql.log file size.
Thanks in advance.
I did try to backup database, backup log file and shrink
both database and log file, but these actions did not
reduce size of sql.log file.
My database file is:
D:\pgm_db\OrdersManager_Data.MDF
My database log file is:
C:\Program Files\Microsoft SQL
Server\MSSQL\data\OrdersManager_Log.LDF
sql.log file is ascii file in the same directory as
database file. The contents of the file looks like this:
with_subscribe_ 618-c6c ENTER SQLAllocEnv
HENV * 010FF7B0
with_subscribe_ 618-c6c EXIT SQLAllocEnv with return
code 0 (SQL_SUCCESS)
HENV * 0x010FF7B0 (
0x01111520)
with_subscribe_ 618-c6c ENTER SQLAllocConnect
HENV 01111520
HDBC * 01220890
with_subscribe_ 618-c6c EXIT SQLAllocConnect with return
code 0 (SQL_SUCCESS)
HENV 01111520
HDBC * 0x01220890 (
0x011115c8)
with_subscribe_ 618-c6c ENTER SQLConnectW
HDBC 011115C8
WCHAR * 0x011116D0 [
3] "gms"
SWORD 3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
with_subscribe_ 618-c6c EXIT SQLConnectW with return
code 1 (SQL_SUCCESS_WITH_INFO)
HDBC 011115C8
WCHAR * 0x011116D0 [
3] "gms"
SWORD 3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
DIAG [01000] [Microsoft][ODBC SQL Server
Driver][SQL Server]Changed database context
to 'GasManager'. (5701)
DIAG [01000] [Microsoft][ODBC SQL Server
Driver][SQL Server]Changed language setting to us_english.
(5703)
with_subscribe_ 618-c6c ENTER SQLGetInfoW
HDBC 011115C8
UWORD 81
<SQL_GETDATA_EXTENSIONS>
PTR 01220898
SWORD 4
SWORD * 0x0026F27E
with_subscribe_ 618-c6c EXIT SQLGetInfoW with return
code 0 (SQL_SUCCESS)
HDBC 011115C8
UWORD 81
<SQL_GETDATA_EXTENSIONS>
PTR 01220898
SWORD 4
SWORD * 0x0026F27E (4)
with_subscribe_ 618-c6c ENTER SQLAllocStmt
HDBC 011115C8
HSTMT * 0026EA7CThe log is an ODBC tracing log so you have ODBC tracing
turned on. To turn it off, go to Administrative Tools and
select Data Sources (ODBC). In the ODBC Data Source
Administrator, go to the tracing tab and click on the Stop
Tracing Now button.
-Sue
On Mon, 15 Mar 2004 15:51:25 -0800, "Branko Kovac"
<branko.kovac@.invensys.com> wrote:

>Hi,
>I am running database on SQL2000 server and sql.log file
>that is associated with the database keeps on growing. I
>would like to reduce its size but don't know how. I would
>appreciate if someone could tell me what is the way to
>reduce the sql.log file size.
>Thanks in advance.
>I did try to backup database, backup log file and shrink
>both database and log file, but these actions did not
>reduce size of sql.log file.
>My database file is:
>D:\pgm_db\OrdersManager_Data.MDF
>My database log file is:
>C:\Program Files\Microsoft SQL
>Server\MSSQL\data\OrdersManager_Log.LDF
>sql.log file is ascii file in the same directory as
>database file. The contents of the file looks like this:
>with_subscribe_ 618-c6c ENTER SQLAllocEnv
> HENV * 010FF7B0
>with_subscribe_ 618-c6c EXIT SQLAllocEnv with return
>code 0 (SQL_SUCCESS)
> HENV * 0x010FF7B0 (
>0x01111520)
>with_subscribe_ 618-c6c ENTER SQLAllocConnect
> HENV 01111520
> HDBC * 01220890
>with_subscribe_ 618-c6c EXIT SQLAllocConnect with return
>code 0 (SQL_SUCCESS)
> HENV 01111520
> HDBC * 0x01220890 (
>0x011115c8)
>with_subscribe_ 618-c6c ENTER SQLConnectW
> HDBC 011115C8
> WCHAR * 0x011116D0 [
>3] "gms"
> SWORD 3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
>with_subscribe_ 618-c6c EXIT SQLConnectW with return
>code 1 (SQL_SUCCESS_WITH_INFO)
> HDBC 011115C8
> WCHAR * 0x011116D0 [
>3] "gms"
> SWORD 3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
> DIAG [01000] [Microsoft][ODBC SQL Server
>Driver][SQL Server]Changed database context
>to 'GasManager'. (5701)
> DIAG [01000] [Microsoft][ODBC SQL Server
>Driver][SQL Server]Changed language setting to us_english.
>(5703)
>with_subscribe_ 618-c6c ENTER SQLGetInfoW
> HDBC 011115C8
> UWORD 81
><SQL_GETDATA_EXTENSIONS>
> PTR 01220898
> SWORD 4
> SWORD * 0x0026F27E
>with_subscribe_ 618-c6c EXIT SQLGetInfoW with return
>code 0 (SQL_SUCCESS)
> HDBC 011115C8
> UWORD 81
><SQL_GETDATA_EXTENSIONS>
> PTR 01220898
> SWORD 4
> SWORD * 0x0026F27E (4)
>with_subscribe_ 618-c6c ENTER SQLAllocStmt
> HDBC 011115C8
> HSTMT * 0026EA7C|||Thanks for this Sue. It worked.

>--Original Message--
>The log is an ODBC tracing log so you have ODBC tracing
>turned on. To turn it off, go to Administrative Tools and
>select Data Sources (ODBC). In the ODBC Data Source
>Administrator, go to the tracing tab and click on the Stop
>Tracing Now button.
>-Sue
>On Mon, 15 Mar 2004 15:51:25 -0800, "Branko Kovac"
><branko.kovac@.invensys.com> wrote:
>
would
return
us_english.
>.
>sql

Wednesday, March 21, 2012

How to reduce Transaction log file ?

Our SqlServer 2000 database's transaction log is about 70 gig in size. The
Recovery model is "Full". The database and the Transaction log are backed up
everyday, but the Transaction log back up failed because there is not enough
disk space.
How can I reduce the physical file size of Transcaction Log so that I can
back it up and it does not keep growing ?
Thank you.
First, to help ensure no potential for any data loss we need to determine if
the 70gb of space being used by the tran log, is being used by data or if it
is free/white-space being held in the transaction log. There are a couple of
ways to check this, one of which involves highlighting the database in EM,
selecting the TaskPad and looking at the amount of space free/in use within
the Transaction Log device.
If a large amount of space is being consumed by data, then you should
perform a transaction log backup, truncate the log and then immediately
perform a full SQL backup to help preserve data. If you cannot perform the
transaction log backup due to the lack of available disk space, then truncate
the log (ex: backup log <dbname> with truncate_only. Immediately after
performing this step, you must perform a full SQL DB backup in order to
ensure the recoverability of your DB. You should then realize that the
remaining space in your transaction log is now free space that should be
released back to the OS. to perform this, execute a DBCC SHRINKFILE
('<TranLogLogicalName>,<minsize>) where the TranLogLogicalName is the logical
name of the tran log device for that db and the minsize is the least size
that you would like to set the tran log to (in Mbs):
ex:
DBCC SHRINKFILE ('MyDb_log',1)
You should then make sure that the database has ongoing tran log backups
that occur on a repeat frequency throughout the day and a daily/weekly
process.
Regards,
"fortunataw" wrote:

> Our SqlServer 2000 database's transaction log is about 70 gig in size. The
> Recovery model is "Full". The database and the Transaction log are backed up
> everyday, but the Transaction log back up failed because there is not enough
> disk space.
> How can I reduce the physical file size of Transcaction Log so that I can
> back it up and it does not keep growing ?
> Thank you.
>
|||Hi,
Since you do not have the enogh hard disk space; I recommend you to start
the backup cycle again after truncating the Logs.
Execute the below command to truncate the log
Backup log <dbname> with Truncate_only
After that see the size and utilization log using
DBcc SQLPERF(logspace)
Once you see the utilization is less then:-
Use dbname
go
Dbcc shrinkfile('logical_ldf_file_name',size_in_mb_to_s hrink)
go
Get the logical LDF name using the below command:-
use dbname
go
sp_helpfile
Name stands for logical name.
This will ensure that your ldf is shrinked based on the value given.
After doing the above steps do:-
1. Full database backup
2. Start your trasnaction log backup in regular intervals (every 30 minutes
minimum frequency)
The second step will ensure that you LDF will not grow abnormally.
Thanks
Hari
SQL Server MVP
"fortunataw" <fortunataw@.discussions.microsoft.com> wrote in message
news:86FAF3B0-E7F7-4F16-B719-6264666B7694@.microsoft.com...
> Our SqlServer 2000 database's transaction log is about 70 gig in size. The
> Recovery model is "Full". The database and the Transaction log are backed
> up
> everyday, but the Transaction log back up failed because there is not
> enough
> disk space.
> How can I reduce the physical file size of Transcaction Log so that I can
> back it up and it does not keep growing ?
> Thank you.
>

How to reduce Transaction log file ?

Our SqlServer 2000 database's transaction log is about 70 gig in size. The
Recovery model is "Full". The database and the Transaction log are backed up
everyday, but the Transaction log back up failed because there is not enough
disk space.
How can I reduce the physical file size of Transcaction Log so that I can
back it up and it does not keep growing ?
Thank you.First, to help ensure no potential for any data loss we need to determine if
the 70gb of space being used by the tran log, is being used by data or if it
is free/white-space being held in the transaction log. There are a couple o
f
ways to check this, one of which involves highlighting the database in EM,
selecting the TaskPad and looking at the amount of space free/in use within
the Transaction Log device.
If a large amount of space is being consumed by data, then you should
perform a transaction log backup, truncate the log and then immediately
perform a full SQL backup to help preserve data. If you cannot perform the
transaction log backup due to the lack of available disk space, then truncat
e
the log (ex: backup log <dbname> with truncate_only. Immediately after
performing this step, you must perform a full SQL DB backup in order to
ensure the recoverability of your DB. You should then realize that the
remaining space in your transaction log is now free space that should be
released back to the OS. to perform this, execute a DBCC SHRINKFILE
('<TranLogLogicalName>,<minsize> ) where the TranLogLogicalName is the logica
l
name of the tran log device for that db and the minsize is the least size
that you would like to set the tran log to (in Mbs):
ex:
DBCC SHRINKFILE ('MyDb_log',1)
You should then make sure that the database has ongoing tran log backups
that occur on a repeat frequency throughout the day and a daily/weekly
process.
Regards,
"fortunataw" wrote:

> Our SqlServer 2000 database's transaction log is about 70 gig in size. The
> Recovery model is "Full". The database and the Transaction log are backed
up
> everyday, but the Transaction log back up failed because there is not enou
gh
> disk space.
> How can I reduce the physical file size of Transcaction Log so that I can
> back it up and it does not keep growing ?
> Thank you.
>|||Hi,
Since you do not have the enogh hard disk space; I recommend you to start
the backup cycle again after truncating the Logs.
Execute the below command to truncate the log
Backup log <dbname> with Truncate_only
After that see the size and utilization log using
DBcc SQLPERF(logspace)
Once you see the utilization is less then:-
Use dbname
go
Dbcc shrinkfile('logical_ldf_file_name',size_
in_mb_to_shrink)
go
Get the logical LDF name using the below command:-
use dbname
go
sp_helpfile
Name stands for logical name.
This will ensure that your ldf is shrinked based on the value given.
After doing the above steps do:-
1. Full database backup
2. Start your trasnaction log backup in regular intervals (every 30 minutes
minimum frequency)
The second step will ensure that you LDF will not grow abnormally.
Thanks
Hari
SQL Server MVP
"fortunataw" <fortunataw@.discussions.microsoft.com> wrote in message
news:86FAF3B0-E7F7-4F16-B719-6264666B7694@.microsoft.com...
> Our SqlServer 2000 database's transaction log is about 70 gig in size. The
> Recovery model is "Full". The database and the Transaction log are backed
> up
> everyday, but the Transaction log back up failed because there is not
> enough
> disk space.
> How can I reduce the physical file size of Transcaction Log so that I can
> back it up and it does not keep growing ?
> Thank you.
>

How to reduce Transaction log file ?

Our SqlServer 2000 database's transaction log is about 70 gig in size. The
Recovery model is "Full". The database and the Transaction log are backed up
everyday, but the Transaction log back up failed because there is not enough
disk space.
How can I reduce the physical file size of Transcaction Log so that I can
back it up and it does not keep growing ?
Thank you.First, to help ensure no potential for any data loss we need to determine if
the 70gb of space being used by the tran log, is being used by data or if it
is free/white-space being held in the transaction log. There are a couple of
ways to check this, one of which involves highlighting the database in EM,
selecting the TaskPad and looking at the amount of space free/in use within
the Transaction Log device.
If a large amount of space is being consumed by data, then you should
perform a transaction log backup, truncate the log and then immediately
perform a full SQL backup to help preserve data. If you cannot perform the
transaction log backup due to the lack of available disk space, then truncate
the log (ex: backup log <dbname> with truncate_only. Immediately after
performing this step, you must perform a full SQL DB backup in order to
ensure the recoverability of your DB. You should then realize that the
remaining space in your transaction log is now free space that should be
released back to the OS. to perform this, execute a DBCC SHRINKFILE
('<TranLogLogicalName>,<minsize>) where the TranLogLogicalName is the logical
name of the tran log device for that db and the minsize is the least size
that you would like to set the tran log to (in Mbs):
ex:
DBCC SHRINKFILE ('MyDb_log',1)
You should then make sure that the database has ongoing tran log backups
that occur on a repeat frequency throughout the day and a daily/weekly
process.
Regards,
"fortunataw" wrote:
> Our SqlServer 2000 database's transaction log is about 70 gig in size. The
> Recovery model is "Full". The database and the Transaction log are backed up
> everyday, but the Transaction log back up failed because there is not enough
> disk space.
> How can I reduce the physical file size of Transcaction Log so that I can
> back it up and it does not keep growing ?
> Thank you.
>|||Hi,
Since you do not have the enogh hard disk space; I recommend you to start
the backup cycle again after truncating the Logs.
Execute the below command to truncate the log
Backup log <dbname> with Truncate_only
After that see the size and utilization log using
DBcc SQLPERF(logspace)
Once you see the utilization is less then:-
Use dbname
go
Dbcc shrinkfile('logical_ldf_file_name',size_in_mb_to_shrink)
go
Get the logical LDF name using the below command:-
use dbname
go
sp_helpfile
Name stands for logical name.
This will ensure that your ldf is shrinked based on the value given.
After doing the above steps do:-
1. Full database backup
2. Start your trasnaction log backup in regular intervals (every 30 minutes
minimum frequency)
The second step will ensure that you LDF will not grow abnormally.
Thanks
Hari
SQL Server MVP
"fortunataw" <fortunataw@.discussions.microsoft.com> wrote in message
news:86FAF3B0-E7F7-4F16-B719-6264666B7694@.microsoft.com...
> Our SqlServer 2000 database's transaction log is about 70 gig in size. The
> Recovery model is "Full". The database and the Transaction log are backed
> up
> everyday, but the Transaction log back up failed because there is not
> enough
> disk space.
> How can I reduce the physical file size of Transcaction Log so that I can
> back it up and it does not keep growing ?
> Thank you.
>

How to reduce the transaction log file

Hi all,

I know this topic has been discussed in the past, but I still don't quite get it. So please be patient with me

database size created with automatically growth of 10% with unrestricted file growth.

database size = 5 Gb used 4.5 GB (taskpad)
transaction log=8GB used 54MB (taskpad) 7.5 GB free
database run in FULL mode

full backup nightly, transaction log backup every 30 min

What should I do to free up the space that are not used in the transaction log.

Thanks for your help.DBCC SHRINKFILE
( { file_name | file_id }
{ [ , target_size ]
| [ , { EMPTYFILE | NOTRUNCATE | TRUNCATEONLY } ]
}
)|||How big is your hard drive?

If it's like 90GB...don't worry about it...

I'd be more worried though about unrestricted growth...

but you maint plan seems pretty good, and 7 gb for a tranny I would doubt would blow out...|||Doesn't your half hourly transaction log backup clear the space automatically?|||Originally posted by suresh_m_kumar
Doesn't your half hourly transaction log backup clear the space automatically?

No. that is why I don't understand|||The tranny backup every 30 min will truncate the log, but transaction log file (*ldf) is not automatically shrunk witht he truncation - see the post above with the syntax for DBCC shrink file - once you do this, the 30 min backups should keep the log to a more manageable size.|||Originally posted by joejcheng
DBCC SHRINKFILE
( { file_name | file_id }
{ [ , target_size ]
| [ , { EMPTYFILE | NOTRUNCATE | TRUNCATEONLY } ]
}
)

What option should I take : Truncateonly ??
[ , { EMPTYFILE | NOTRUNCATE | TRUNCATEONLY }|||You will want to use truncateonly I belive, so the freed space will be allocated back to the OS. Read this for an explanation of the options, or use the BOL:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_dbcc_8b51.asp

How to reduce the size of transaction log

Hello,
Please could you send me the neccesary steps to reduce the size of the
transaction log in a database, without taking the database offline?
Thanks in advance.
Eduardo Sicouret
The following Microsoft KB article should help you out:
http://support.microsoft.com/kb/272318/en-us
- Peter Ward
WARDY IT solutions
"Eduardo Sicouret" wrote:

> Hello,
> Please could you send me the neccesary steps to reduce the size of the
> transaction log in a database, without taking the database offline?
> Thanks in advance.
> Eduardo Sicouret
>
>

How to reduce the size of transaction log

Hello,
Please could you send me the neccesary steps to reduce the size of the
transaction log in a database, without taking the database offline?
Thanks in advance.
Eduardo SicouretThe following Microsoft KB article should help you out:
http://support.microsoft.com/kb/272318/en-us
- Peter Ward
WARDY IT solutions
"Eduardo Sicouret" wrote:

> Hello,
> Please could you send me the neccesary steps to reduce the size of the
> transaction log in a database, without taking the database offline?
> Thanks in advance.
> Eduardo Sicouret
>
>

How to reduce the size of transaction log

Hello,
Please could you send me the neccesary steps to reduce the size of the
transaction log in a database, without taking the database offline?
Thanks in advance.
Eduardo SicouretThe following Microsoft KB article should help you out:
http://support.microsoft.com/kb/272318/en-us
- Peter Ward
WARDY IT solutions
"Eduardo Sicouret" wrote:
> Hello,
> Please could you send me the neccesary steps to reduce the size of the
> transaction log in a database, without taking the database offline?
> Thanks in advance.
> Eduardo Sicouret
>
>

How to reduce the log file size.

Hi all,
How to reduce the physical file size of Transaction log in
SQL 7.0?>--Original Message--
>Hi all,
>How to reduce the physical file size of Transaction log
in
>SQL 7.0?
>.
>Ytan, this has happened to me. The hard drive on the SQL
box was full.|||Check out below KB articles:
INF: How to Shrink the SQL Server 7.0 Transaction Log
http://support.microsoft.com/default.aspx?scid=kb;en-us;256650
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC SHRINKFILE
http://support.microsoft.com/default.aspx?scid=kb;en-us;272318
http://www.mssqlserver.com/faq/logs-shrinklog.asp
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Ytan" <y24042003@.yahoo.com> wrote in message news:0fea01c38887$5bde8ca0$a401280a@.phx.gbl...
> Hi all,
> How to reduce the physical file size of Transaction log in
> SQL 7.0?sql

How to reduce the log file size

Hi There,
1) I have a production database in which log file is growing very
drastically eventhough I used "simple recovery model". I am using SQL
server 2000. In order to get rid of this log I have been detaching the
database, deleting the log file and re-attaching the database back.
While doing this production system will be off-line.
I am wondering, if there is a way to get rid of this log from this file
and keep the log file smaller in size.
2) I also need help if there is a way to write a bulk insert or bulk
update statement without increasing the log file.
Thanks in advance,
*** Sent via Developersdex http://www.developersdex.com ***In reverse order ..
In simple recovery model bulk logged operations are minimally
logged. The transaction log will be truncated at the checkpoint.
To shrink the log file ..
http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
Server 7.0 Tran Log
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
Server 2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
--
HTH. Ryan
"sasachi sachi sachi" <sasachi@.getmail.com> wrote in message
news:uy6j7X1IGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi There,
> 1) I have a production database in which log file is growing very
> drastically eventhough I used "simple recovery model". I am using SQL
> server 2000. In order to get rid of this log I have been detaching the
> database, deleting the log file and re-attaching the database back.
> While doing this production system will be off-line.
> I am wondering, if there is a way to get rid of this log from this file
> and keep the log file smaller in size.
>
> 2) I also need help if there is a way to write a bulk insert or bulk
> update statement without increasing the log file.
>
> Thanks in advance,
>
> *** Sent via Developersdex http://www.developersdex.com ***|||Firstly, if you are using simple recovery model, the only way the tlog
will grow so large is if you have have any of the conditions in the
below article:
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/?id=317375
Now, if you want the log to be small, the only option is shrinking the
log file:
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC
http://support.microsoft.com/?id=272318
Answer to second question,the best option will be to make your recovery
model Bulk-Logged:
For more info see in BOL: Bulk-Logged Recovery

How to reduce the log file size

Hi There,
1) I have a production database in which log file is growing very
drastically eventhough I used "simple recovery model". I am using SQL
server 2000. In order to get rid of this log I have been detaching the
database, deleting the log file and re-attaching the database back.
While doing this production system will be off-line.
I am wondering, if there is a way to get rid of this log from this file
and keep the log file smaller in size.
2) I also need help if there is a way to write a bulk insert or bulk
update statement without increasing the log file.
Thanks in advance,
*** Sent via Developersdex http://www.codecomments.com ***
In reverse order ..
In simple recovery model bulk logged operations are minimally
logged. The transaction log will be truncated at the checkpoint.
To shrink the log file ..
http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
Server 7.0 Tran Log
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
Server 2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
HTH. Ryan
"sasachi sachi sachi" <sasachi@.getmail.com> wrote in message
news:uy6j7X1IGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi There,
> 1) I have a production database in which log file is growing very
> drastically eventhough I used "simple recovery model". I am using SQL
> server 2000. In order to get rid of this log I have been detaching the
> database, deleting the log file and re-attaching the database back.
> While doing this production system will be off-line.
> I am wondering, if there is a way to get rid of this log from this file
> and keep the log file smaller in size.
>
> 2) I also need help if there is a way to write a bulk insert or bulk
> update statement without increasing the log file.
>
> Thanks in advance,
>
> *** Sent via Developersdex http://www.codecomments.com ***
|||Firstly, if you are using simple recovery model, the only way the tlog
will grow so large is if you have have any of the conditions in the
below article:
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/?id=317375
Now, if you want the log to be small, the only option is shrinking the
log file:
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC
http://support.microsoft.com/?id=272318
Answer to second question,the best option will be to make your recovery
model Bulk-Logged:
For more info see in BOL: Bulk-Logged Recovery

How to reduce the log file size

Hi There,
1) I have a production database in which log file is growing very
drastically eventhough I used "simple recovery model". I am using SQL
server 2000. In order to get rid of this log I have been detaching the
database, deleting the log file and re-attaching the database back.
While doing this production system will be off-line.
I am wondering, if there is a way to get rid of this log from this file
and keep the log file smaller in size.
2) I also need help if there is a way to write a bulk insert or bulk
update statement without increasing the log file.
Thanks in advance,
*** Sent via Developersdex http://www.codecomments.com ***In reverse order ..
In simple recovery model bulk logged operations are minimally
logged. The transaction log will be truncated at the checkpoint.
To shrink the log file ..
http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
Server 7.0 Tran Log
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
Server 2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
HTH. Ryan
"sasachi sachi sachi" <sasachi@.getmail.com> wrote in message
news:uy6j7X1IGHA.1028@.TK2MSFTNGP11.phx.gbl...
> Hi There,
> 1) I have a production database in which log file is growing very
> drastically eventhough I used "simple recovery model". I am using SQL
> server 2000. In order to get rid of this log I have been detaching the
> database, deleting the log file and re-attaching the database back.
> While doing this production system will be off-line.
> I am wondering, if there is a way to get rid of this log from this file
> and keep the log file smaller in size.
>
> 2) I also need help if there is a way to write a bulk insert or bulk
> update statement without increasing the log file.
>
> Thanks in advance,
>
> *** Sent via Developersdex http://www.codecomments.com ***|||Firstly, if you are using simple recovery model, the only way the tlog
will grow so large is if you have have any of the conditions in the
below article:
INF: Transaction Log Grows Unexpectedly or Becomes Full on SQL Server
http://support.microsoft.com/?id=317375
Now, if you want the log to be small, the only option is shrinking the
log file:
INF: Shrinking the Transaction Log in SQL Server 2000 with DBCC
http://support.microsoft.com/?id=272318
Answer to second question,the best option will be to make your recovery
model Bulk-Logged:
For more info see in BOL: Bulk-Logged Recovery

How to reduce size of sql.log file

Hi,
I am running database on SQL2000 server and sql.log file
that is associated with the database keeps on growing. I
would like to reduce its size but don't know how. I would
appreciate if someone could tell me what is the way to
reduce the sql.log file size.
Thanks in advance.
I did try to backup database, backup log file and shrink
both database and log file, but these actions did not
reduce size of sql.log file.
My database file is:
D:\pgm_db\OrdersManager_Data.MDF
My database log file is:
C:\Program Files\Microsoft SQL
Server\MSSQL\data\OrdersManager_Log.LDF
sql.log file is ascii file in the same directory as
database file. The contents of the file looks like this:
with_subscribe_ 618-c6c ENTER SQLAllocEnv
HENV * 010FF7B0
with_subscribe_ 618-c6c EXIT SQLAllocEnv with return
code 0 (SQL_SUCCESS)
HENV * 0x010FF7B0 (
0x01111520)
with_subscribe_ 618-c6c ENTER SQLAllocConnect
HENV 01111520
HDBC * 01220890
with_subscribe_ 618-c6c EXIT SQLAllocConnect with return
code 0 (SQL_SUCCESS)
HENV 01111520
HDBC * 0x01220890 (
0x011115c8)
with_subscribe_ 618-c6c ENTER SQLConnectW
HDBC 011115C8
WCHAR * 0x011116D0 [
3] "gms"
SWORD 3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
with_subscribe_ 618-c6c EXIT SQLConnectW with return
code 1 (SQL_SUCCESS_WITH_INFO)
HDBC 011115C8
WCHAR * 0x011116D0 [
3] "gms"
SWORD 3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
WCHAR * 0x1F7F8B88 [ -
3] "******\ 0"
SWORD -3
DIAG [01000] [Microsoft][ODBC SQL Server
Driver][SQL Server]Changed database context
to 'GasManager'. (5701)
DIAG [01000] [Microsoft][ODBC SQL Server
Driver][SQL Server]Changed language setting to us_english.
(5703)
with_subscribe_ 618-c6c ENTER SQLGetInfoW
HDBC 011115C8
UWORD 81
<SQL_GETDATA_EXTENSIONS>
PTR 01220898
SWORD 4
SWORD * 0x0026F27E
with_subscribe_ 618-c6c EXIT SQLGetInfoW with return
code 0 (SQL_SUCCESS)
HDBC 011115C8
UWORD 81
<SQL_GETDATA_EXTENSIONS>
PTR 01220898
SWORD 4
SWORD * 0x0026F27E (4)
with_subscribe_ 618-c6c ENTER SQLAllocStmt
HDBC 011115C8
HSTMT * 0026EA7CThe log is an ODBC tracing log so you have ODBC tracing
turned on. To turn it off, go to Administrative Tools and
select Data Sources (ODBC). In the ODBC Data Source
Administrator, go to the tracing tab and click on the Stop
Tracing Now button.
-Sue
On Mon, 15 Mar 2004 15:51:25 -0800, "Branko Kovac"
<branko.kovac@.invensys.com> wrote:

>Hi,
>I am running database on SQL2000 server and sql.log file
>that is associated with the database keeps on growing. I
>would like to reduce its size but don't know how. I would
>appreciate if someone could tell me what is the way to
>reduce the sql.log file size.
>Thanks in advance.
>I did try to backup database, backup log file and shrink
>both database and log file, but these actions did not
>reduce size of sql.log file.
>My database file is:
>D:\pgm_db\OrdersManager_Data.MDF
>My database log file is:
>C:\Program Files\Microsoft SQL
>Server\MSSQL\data\OrdersManager_Log.LDF
>sql.log file is ascii file in the same directory as
>database file. The contents of the file looks like this:
>with_subscribe_ 618-c6c ENTER SQLAllocEnv
> HENV * 010FF7B0
>with_subscribe_ 618-c6c EXIT SQLAllocEnv with return
>code 0 (SQL_SUCCESS)
> HENV * 0x010FF7B0 (
>0x01111520)
>with_subscribe_ 618-c6c ENTER SQLAllocConnect
> HENV 01111520
> HDBC * 01220890
>with_subscribe_ 618-c6c EXIT SQLAllocConnect with return
>code 0 (SQL_SUCCESS)
> HENV 01111520
> HDBC * 0x01220890 (
>0x011115c8)
>with_subscribe_ 618-c6c ENTER SQLConnectW
> HDBC 011115C8
> WCHAR * 0x011116D0 [
>3] "gms"
> SWORD 3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
>with_subscribe_ 618-c6c EXIT SQLConnectW with return
>code 1 (SQL_SUCCESS_WITH_INFO)
> HDBC 011115C8
> WCHAR * 0x011116D0 [
>3] "gms"
> SWORD 3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
> WCHAR * 0x1F7F8B88 [ -
>3] "******\ 0"
> SWORD -3
> DIAG [01000] [Microsoft][ODBC SQL Server
>Driver][SQL Server]Changed database context
>to 'GasManager'. (5701)
> DIAG [01000] [Microsoft][ODBC SQL Server
>Driver][SQL Server]Changed language setting to us_english.
>(5703)
>with_subscribe_ 618-c6c ENTER SQLGetInfoW
> HDBC 011115C8
> UWORD 81
><SQL_GETDATA_EXTENSIONS>
> PTR 01220898
> SWORD 4
> SWORD * 0x0026F27E
>with_subscribe_ 618-c6c EXIT SQLGetInfoW with return
>code 0 (SQL_SUCCESS)
> HDBC 011115C8
> UWORD 81
><SQL_GETDATA_EXTENSIONS>
> PTR 01220898
> SWORD 4
> SWORD * 0x0026F27E (4)
>with_subscribe_ 618-c6c ENTER SQLAllocStmt
> HDBC 011115C8
> HSTMT * 0026EA7C|||Thanks for this Sue. It worked.

>--Original Message--
>The log is an ODBC tracing log so you have ODBC tracing
>turned on. To turn it off, go to Administrative Tools and
>select Data Sources (ODBC). In the ODBC Data Source
>Administrator, go to the tracing tab and click on the Stop
>Tracing Now button.
>-Sue
>On Mon, 15 Mar 2004 15:51:25 -0800, "Branko Kovac"
><branko.kovac@.invensys.com> wrote:
>
would
return
us_english.
>.
>sql

How to Reduce or Delete the Log file... Log file size creating problem

I am using Replication with two of my SQL Server Databases , One Db is Publisher and other one is Subscriber , and data is continously replicating after every 5 mins . Now Publisher Database Log File increased upto 2541 MB and its creating problem while having any transaction or having any operation with DB . It also turned Replication utility Off.

I tried to delete log file by turning SQL Server off , but it makes DB mode SUSPECT and UNACCESSBLE.

Plz help me out to delete or reduce the log file size by maintaining the state of data.

Also let me know wht is the method so that log file can automatically delete its contents when reach to certain limit.

Regards
Imran MalikWhy are risking by deleting the SQL system files.

Use DBCC SHRINKFILE to reduce the Tlog file size, refer to books online for more information.|||You haven't mentioned about the version of SQL used.

If its version 7 then enable 'trunc.log at chkpt.' on the database.
If its version 2K then use SIMPLE RECOVERY model.

For more information again refer BOL.:)|||By changing to the simple recovery model, your only backup mechanism is the full or differential backup, you can no longer perform transaction log backups. If you need to shrink the file, however, and maintain the ability to perform transaction log backups, there is a Stored Procedure I found at SQLServerCentral.com. It's called sp_force_shrink_log and I find it quite useful. You can find it at http://www.sqlservercentral.com/scripts/contributions/26.asp after you register with them.|||Thank You very much Satya and loach for telling me the way to reduce the size , I am using SQL Server 2K .

DBCC SHRINKFILE and sp_force_shrink_log are helpful for reducing file size but for log deletion wht I have done is just deattach the database , remove log file and and attach db again , it refreshed and made DB log again with 1 MB. (I tested this with dummy Dbs.)

and my Databases are also connected through replication utility , so it restricts me to deattach db using in replication , so I have to turned replication off to deattach and attach db . currently I am looking into procedure or way so that without disabling replication make log refresh coz it will take long process to disable and then again follow through steps for having last settings to turn replication ON between 2 databases.

Thanks u All

Regards
Imran|||How about the backups schedule interval for LOG?

How to reduce log file size?

I have a problem about log of transection file. How do I set up automatic to reduce size of log file?Have a look at these resources :-
http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
Server 7.0 Tran Log
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
Server 2000 with DBCC SHRINKFILE
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
HTH
Ryan Waight, MCDBA, MCSE
"Mesak" <anonymous@.discussions.microsoft.com> wrote in message
news:FC013E7B-E4ED-4922-9B19-1967FA02C6AC@.microsoft.com...
> I have a problem about log of transection file. How do I set up automatic
to reduce size of log file?