Showing posts with label reports. Show all posts
Showing posts with label reports. Show all posts

Friday, March 23, 2012

log file size and mirroring

How do I shrink a log file in a database that's been mirrored?

DBCC ShrinkFile(id) reports the size can drop considerably, but even after a CHECKPOINT, it doesn't shrink.

DBCC ShrinkFile('name') says it doesn't find the file name. The properties dialog for the database in SSMS doesn't list any files, even though sp_helpdb says they're there.

Must I disable mirroring, fix DBCC ShrinkSomething, then re-enable mirroring? Can I just pause mirroring?

There are 2 options available for you,

1.

USE XXX
GO
CHECKPOINT
GO
BACKUP LOG [XXX] TO [XXX_TLOG] WITH NOFORMAT, INIT, NAME = N'XXX-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
DBCC SHRINKFILE(XXX_Log, 1)
GO

2.

BACKUP LOG [dbname] TO DISK='Path'

Then do the shrink

dbcc shrinkfile ('TLOGFILENAME', yoursize) -- where yoursize is a number in MB

Since the CHECKPOINT option didnt work for you, try the 2nd option and revert if you have any concern

|||Thanks for responding, Deepak.

I'm sorry if my question was not clear. I've tried both of the techniques you suggest and the database log file doesn't shrink.

The log_reuse_wait_desc column in sys.databases says "NOTHING" for the invovled database.

Why doesn't SQL server release the log file space to the OS?
|||

May I ask a question related issue? Is the participal database should be pause before shrinking?

Regards,

Melih

|||

Deepak,

I tried to run query and I get message following:

Cannot shrink log file 2 (XXX_log) because all logical log files are in use.

Deepak Rangarajan wrote:

There are 2 options available for you,

1.

USE XXX
GO
CHECKPOINT
GO
BACKUP LOG [XXX] TO [XXX_TLOG] WITH NOFORMAT, INIT, NAME = N'XXX-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
DBCC SHRINKFILE(XXX_Log, 1)
GO

2.

BACKUP LOG [dbname] TO DISK='Path'

Then do the shrink

dbcc shrinkfile ('TLOGFILENAME', yoursize) -- where yoursize is a number in MB

Since the CHECKPOINT option didnt work for you, try the 2nd option and revert if you have any concern

log file size and mirroring

How do I shrink a log file in a database that's been mirrored?

DBCC ShrinkFile(id) reports the size can drop considerably, but even after a CHECKPOINT, it doesn't shrink.

DBCC ShrinkFile('name') says it doesn't find the file name. The properties dialog for the database in SSMS doesn't list any files, even though sp_helpdb says they're there.

Must I disable mirroring, fix DBCC ShrinkSomething, then re-enable mirroring? Can I just pause mirroring?

There are 2 options available for you,

1.

USE XXX
GO
CHECKPOINT
GO
BACKUP LOG [XXX] TO [XXX_TLOG] WITH NOFORMAT, INIT, NAME = N'XXX-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
DBCC SHRINKFILE(XXX_Log, 1)
GO

2.

BACKUP LOG [dbname] TO DISK='Path'

Then do the shrink

dbcc shrinkfile ('TLOGFILENAME', yoursize) -- where yoursize is a number in MB

Since the CHECKPOINT option didnt work for you, try the 2nd option and revert if you have any concern

|||Thanks for responding, Deepak.

I'm sorry if my question was not clear. I've tried both of the techniques you suggest and the database log file doesn't shrink.

The log_reuse_wait_desc column in sys.databases says "NOTHING" for the invovled database.

Why doesn't SQL server release the log file space to the OS?
|||

May I ask a question related issue? Is the participal database should be pause before shrinking?

Regards,

Melih

|||

Deepak,

I tried to run query and I get message following:

Cannot shrink log file 2 (XXX_log) because all logical log files are in use.

Deepak Rangarajan wrote:

There are 2 options available for you,

1.

USE XXX
GO
CHECKPOINT
GO
BACKUP LOG [XXX] TO [XXX_TLOG] WITH NOFORMAT, INIT, NAME = N'XXX-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
DBCC SHRINKFILE(XXX_Log, 1)
GO

2.

BACKUP LOG [dbname] TO DISK='Path'

Then do the shrink

dbcc shrinkfile ('TLOGFILENAME', yoursize) -- where yoursize is a number in MB

Since the CHECKPOINT option didnt work for you, try the 2nd option and revert if you have any concern

sql

Wednesday, March 7, 2012

Log copy job using robocopy reports errors

Hi,
We are using a sql job to copy log files to a standby server using
robocopy. Often times the sql job status reports a failure however
robocopy itself reports the file copy was successful.
Has anyone run into this before. I would like to find out why these jobs
are reporting failures as they a sending out an aweful lot of notifications.
Thanks
DilanI assume you are using Agent and CmdExec jobsteps? Agent uses the return cod
e from the process you
start to determine whether the execution was successful or not. If the proce
ss (RoboCopy) returns
anything different from 0, you will get failure of that job step. So you nee
d to determine why
RoboCopy returns such a return code. I presume that RoboCopy returns proper
error messages, so just
define an output file for the job step and check there for the error message
s from RoboCopy.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Dilan A" <dilan.a@.youtelus.net> wrote in message news:GnXTf.8832$A4.8081@.clgrps12...seagreen">
> Hi,
> We are using a sql job to copy log files to a standby server using robocop
y. Often times the sql
> job status reports a failure however robocopy itself reports the file copy
was successful.
> Has anyone run into this before. I would like to find out why these jobs a
re reporting failures as
> they a sending out an aweful lot of notifications.
> Thanks
> Dilan

Log copy job using robocopy reports errors

Hi,
We are using a sql job to copy log files to a standby server using
robocopy. Often times the sql job status reports a failure however
robocopy itself reports the file copy was successful.
Has anyone run into this before. I would like to find out why these jobs
are reporting failures as they a sending out an aweful lot of notifications.
Thanks
Dilan
I assume you are using Agent and CmdExec jobsteps? Agent uses the return code from the process you
start to determine whether the execution was successful or not. If the process (RoboCopy) returns
anything different from 0, you will get failure of that job step. So you need to determine why
RoboCopy returns such a return code. I presume that RoboCopy returns proper error messages, so just
define an output file for the job step and check there for the error messages from RoboCopy.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Dilan A" <dilan.a@.youtelus.net> wrote in message news:GnXTf.8832$A4.8081@.clgrps12...
> Hi,
> We are using a sql job to copy log files to a standby server using robocopy. Often times the sql
> job status reports a failure however robocopy itself reports the file copy was successful.
> Has anyone run into this before. I would like to find out why these jobs are reporting failures as
> they a sending out an aweful lot of notifications.
> Thanks
> Dilan

Log copy job using robocopy reports errors

Hi,
We are using a sql job to copy log files to a standby server using
robocopy. Often times the sql job status reports a failure however
robocopy itself reports the file copy was successful.
Has anyone run into this before. I would like to find out why these jobs
are reporting failures as they a sending out an aweful lot of notifications.
Thanks
DilanI assume you are using Agent and CmdExec jobsteps? Agent uses the return code from the process you
start to determine whether the execution was successful or not. If the process (RoboCopy) returns
anything different from 0, you will get failure of that job step. So you need to determine why
RoboCopy returns such a return code. I presume that RoboCopy returns proper error messages, so just
define an output file for the job step and check there for the error messages from RoboCopy.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Dilan A" <dilan.a@.youtelus.net> wrote in message news:GnXTf.8832$A4.8081@.clgrps12...
> Hi,
> We are using a sql job to copy log files to a standby server using robocopy. Often times the sql
> job status reports a failure however robocopy itself reports the file copy was successful.
> Has anyone run into this before. I would like to find out why these jobs are reporting failures as
> they a sending out an aweful lot of notifications.
> Thanks
> Dilan

Friday, February 24, 2012

Log Backup Job works, but reports failure.

All the transaction logs are created, but the Application log entry below
appears, and the job shows as having failed.
Any ideas, anyone?
Thanks,
Jim
Event Type: Warning
Event Source: SQLSERVERAGENT
Event Category: Job Engine
Event ID: 208
Date: 8/2/2005
Time: 9:47:24 AM
User: N/A
Computer: GENOME-MARS
Description:
SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
'DB Maintenance Plan 1'' (0xAF8C5DECB6A71142915AA55ED294E0B4) - Status:
Failed - Invoked on: 2005-08-02 09:07:42 - Message: The job failed. The Job
was invoked by User UAB\jmoon. The last step to run was step 1 (Step 1).
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Start Enterprise Mangler. Drill down to Management | Database Maintenance
Plans. Right click and select "Maintenance Plan History...". Set the
filters to isolate the plan that failed. Select the entry for the plan and
the failure date, click the "Properties..." button to see the details of why
it failed.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Jim" <please.reply@.group> wrote in message
news:upRvnl4lFHA.3656@.TK2MSFTNGP09.phx.gbl...
> All the transaction logs are created, but the Application log entry below
> appears, and the job shows as having failed.
> Any ideas, anyone?
> Thanks,
> Jim
> --
> Event Type: Warning
> Event Source: SQLSERVERAGENT
> Event Category: Job Engine
> Event ID: 208
> Date: 8/2/2005
> Time: 9:47:24 AM
> User: N/A
> Computer: GENOME-MARS
> Description:
> SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance
> Plan 'DB Maintenance Plan 1'' (0xAF8C5DECB6A71142915AA55ED294E0B4) -
> Status: Failed - Invoked on: 2005-08-02 09:07:42 - Message: The job
> failed. The Job was invoked by User UAB\jmoon. The last step to run was
> step 1 (Step 1).
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
> ----
>
|||Here's the explanation!
http://support.microsoft.com/default...&Product=sql2k
Simple recovery model is the culprit--can't do transaction log backups...
Jim
"Geoff N. Hiten" <sqlcraftsman@.gmail.com> wrote in message
news:u%23LtDp4lFHA.2628@.tk2msftngp13.phx.gbl...
> Start Enterprise Mangler. Drill down to Management | Database Maintenance
> Plans. Right click and select "Maintenance Plan History...". Set the
> filters to isolate the plan that failed. Select the entry for the plan
> and the failure date, click the "Properties..." button to see the details
> of why it failed.
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "Jim" <please.reply@.group> wrote in message
> news:upRvnl4lFHA.3656@.TK2MSFTNGP09.phx.gbl...
>

Log Backup Job works, but reports failure.

All the transaction logs are created, but the Application log entry below
appears, and the job shows as having failed.
Any ideas, anyone?
Thanks,
Jim
--
Event Type: Warning
Event Source: SQLSERVERAGENT
Event Category: Job Engine
Event ID: 208
Date: 8/2/2005
Time: 9:47:24 AM
User: N/A
Computer: GENOME-MARS
Description:
SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
'DB Maintenance Plan 1'' (0xAF8C5DECB6A71142915AA55ED294E0B4) - Status:
Failed - Invoked on: 2005-08-02 09:07:42 - Message: The job failed. The Job
was invoked by User UAB\jmoon. The last step to run was step 1 (Step 1).
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
----
--Start Enterprise Mangler. Drill down to Management | Database Maintenance
Plans. Right click and select "Maintenance Plan History...". Set the
filters to isolate the plan that failed. Select the entry for the plan and
the failure date, click the "Properties..." button to see the details of why
it failed.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Jim" <please.reply@.group> wrote in message
news:upRvnl4lFHA.3656@.TK2MSFTNGP09.phx.gbl...
> All the transaction logs are created, but the Application log entry below
> appears, and the job shows as having failed.
> Any ideas, anyone?
> Thanks,
> Jim
> --
> Event Type: Warning
> Event Source: SQLSERVERAGENT
> Event Category: Job Engine
> Event ID: 208
> Date: 8/2/2005
> Time: 9:47:24 AM
> User: N/A
> Computer: GENOME-MARS
> Description:
> SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance
> Plan 'DB Maintenance Plan 1'' (0xAF8C5DECB6A71142915AA55ED294E0B4) -
> Status: Failed - Invoked on: 2005-08-02 09:07:42 - Message: The job
> failed. The Job was invoked by User UAB\jmoon. The last step to run was
> step 1 (Step 1).
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
> ----
--
>|||Here's the explanation!
http://support.microsoft.com/defaul...2&Product=sql2k
Simple recovery model is the culprit--can't do transaction log backups...
Jim
"Geoff N. Hiten" <sqlcraftsman@.gmail.com> wrote in message
news:u%23LtDp4lFHA.2628@.tk2msftngp13.phx.gbl...
> Start Enterprise Mangler. Drill down to Management | Database Maintenance
> Plans. Right click and select "Maintenance Plan History...". Set the
> filters to isolate the plan that failed. Select the entry for the plan
> and the failure date, click the "Properties..." button to see the details
> of why it failed.
> Geoff N. Hiten
> Senior Database Administrator
> Microsoft SQL Server MVP
>
> "Jim" <please.reply@.group> wrote in message
> news:upRvnl4lFHA.3656@.TK2MSFTNGP09.phx.gbl...
>