Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Friday, March 30, 2012

Maintenance plan failing

i keep getting the following error in my Event Viewer regarding a maintnance
plan I have set up in MS SQL Server 2000:
SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
'DB Maintenance Plan master, msdb, model''
(0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
Any ideas about what I might be doing wrong?
--
John SchusterJohn Schuster wrote:
> i keep getting the following error in my Event Viewer regarding a maintnan
ce
> plan I have set up in MS SQL Server 2000:
> SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Pl
an
> 'DB Maintenance Plan master, msdb, model''
> (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
> 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
> Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
> Any ideas about what I might be doing wrong?
You can't do a transaction log backup on a database that is in Simple
recovery mode.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||> Any ideas about what I might be doing wrong?
Specify a report file for the maint plan. In there you will find the error m
essages that lead to the
job failure.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
news:D4C6E493-E90D-45E6-80B2-3BC0170D8DEB@.microsoft.com...
>i keep getting the following error in my Event Viewer regarding a maintnanc
e
> plan I have set up in MS SQL Server 2000:
> SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Pl
an
> 'DB Maintenance Plan master, msdb, model''
> (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
> 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
> Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
> Any ideas about what I might be doing wrong?
> --
> John Schuster|||I set up a report and i get the following which doesn't tell me much:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
'EPDDOCS3' as 'SEP\EPDDOCS3$' (trusted)
Starting maintenance plan 'DB Maintenance Plan master, msdb, model' on
11/14/2006 12:00:07 AM
Backup can not be performed on database 'master'. This sub task is ignored.
[1] Database model: Transaction Log Backup...
Destination: & #91;X:\MSSQL\EPDdocs_BACKUP\model_tlog_2
00611140000.TRN]
** Execution Time: 0 hrs, 0 mins, 1 secs **
[2] Database model: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 1 secs **
Backup can not be performed on database 'msdb'. This sub task is ignored.
Deleting old text reports... 0 file(s) deleted.
End of maintenance plan 'DB Maintenance Plan master, msdb, model' on
11/14/2006 12:00:08 AM
SQLMAINT.EXE Process Exit Code: 1 (Failed)
--
John Schuster
"Tibor Karaszi" wrote:

> Specify a report file for the maint plan. In there you will find the error
messages that lead to the
> job failure.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
> news:D4C6E493-E90D-45E6-80B2-3BC0170D8DEB@.microsoft.com...
>
>|||Here's the problem:

> Backup can not be performed on database 'msdb'. This sub task is ignored.
You are trying to do a log backup on a database which is in simple recovery
mode. No can do.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
news:AC9FF4A5-0CF5-4661-A9F1-577320DB70A3@.microsoft.com...[vbcol=seagreen]
>I set up a report and i get the following which doesn't tell me much:
> Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
> 'EPDDOCS3' as 'SEP\EPDDOCS3$' (trusted)
> Starting maintenance plan 'DB Maintenance Plan master, msdb, model' on
> 11/14/2006 12:00:07 AM
> Backup can not be performed on database 'master'. This sub task is ignored
.
> [1] Database model: Transaction Log Backup...
> Destination: & #91;X:\MSSQL\EPDdocs_BACKUP\model_tlog_2
00611140000.TRN]
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [2] Database model: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> Backup can not be performed on database 'msdb'. This sub task is ignored.
> Deleting old text reports... 0 file(s) deleted.
> End of maintenance plan 'DB Maintenance Plan master, msdb, model' on
> 11/14/2006 12:00:08 AM
> SQLMAINT.EXE Process Exit Code: 1 (Failed)
> --
> John Schuster
>
> "Tibor Karaszi" wrote:
>|||Thank you for your help.
--
John Schuster
"Tibor Karaszi" wrote:

> Here's the problem:
>
> You are trying to do a log backup on a database which is in simple recover
y mode. No can do.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
> news:AC9FF4A5-0CF5-4661-A9F1-577320DB70A3@.microsoft.com...
>sql

Maintenance plan failing

i keep getting the following error in my Event Viewer regarding a maintnance
plan I have set up in MS SQL Server 2000:
SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
'DB Maintenance Plan master, msdb, model''
(0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
Any ideas about what I might be doing wrong?
John Schuster
John Schuster wrote:
> i keep getting the following error in my Event Viewer regarding a maintnance
> plan I have set up in MS SQL Server 2000:
> SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
> 'DB Maintenance Plan master, msdb, model''
> (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
> 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
> Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
> Any ideas about what I might be doing wrong?
You can't do a transaction log backup on a database that is in Simple
recovery mode.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||I set up a report and i get the following which doesn't tell me much:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
'EPDDOCS3' as 'SEP\EPDDOCS3$' (trusted)
Starting maintenance plan 'DB Maintenance Plan master, msdb, model' on
11/14/2006 12:00:07 AM
Backup can not be performed on database 'master'. This sub task is ignored.
[1] Database model: Transaction Log Backup...
Destination: [X:\MSSQL\EPDdocs_BACKUP\model_tlog_200611140000.T RN]
** Execution Time: 0 hrs, 0 mins, 1 secs **
[2] Database model: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 1 secs **
Backup can not be performed on database 'msdb'. This sub task is ignored.
Deleting old text reports... 0 file(s) deleted.
End of maintenance plan 'DB Maintenance Plan master, msdb, model' on
11/14/2006 12:00:08 AM
SQLMAINT.EXE Process Exit Code: 1 (Failed)
John Schuster
"Tibor Karaszi" wrote:

> Specify a report file for the maint plan. In there you will find the error messages that lead to the
> job failure.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
> news:D4C6E493-E90D-45E6-80B2-3BC0170D8DEB@.microsoft.com...
>
>
|||Thank you for your help.
John Schuster
"Tibor Karaszi" wrote:

> Here's the problem:
>
> You are trying to do a log backup on a database which is in simple recovery mode. No can do.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
> news:AC9FF4A5-0CF5-4661-A9F1-577320DB70A3@.microsoft.com...
>

Maintenance plan failing

i keep getting the following error in my Event Viewer regarding a maintnance
plan I have set up in MS SQL Server 2000:
SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
'DB Maintenance Plan master, msdb, model''
(0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
Any ideas about what I might be doing wrong?
--
John SchusterJohn Schuster wrote:
> i keep getting the following error in my Event Viewer regarding a maintnance
> plan I have set up in MS SQL Server 2000:
> SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
> 'DB Maintenance Plan master, msdb, model''
> (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
> 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
> Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
> Any ideas about what I might be doing wrong?
You can't do a transaction log backup on a database that is in Simple
recovery mode.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||> Any ideas about what I might be doing wrong?
Specify a report file for the maint plan. In there you will find the error messages that lead to the
job failure.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
news:D4C6E493-E90D-45E6-80B2-3BC0170D8DEB@.microsoft.com...
>i keep getting the following error in my Event Viewer regarding a maintnance
> plan I have set up in MS SQL Server 2000:
> SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
> 'DB Maintenance Plan master, msdb, model''
> (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
> 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
> Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
> Any ideas about what I might be doing wrong?
> --
> John Schuster|||I set up a report and i get the following which doesn't tell me much:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
'EPDDOCS3' as 'SEP\EPDDOCS3$' (trusted)
Starting maintenance plan 'DB Maintenance Plan master, msdb, model' on
11/14/2006 12:00:07 AM
Backup can not be performed on database 'master'. This sub task is ignored.
[1] Database model: Transaction Log Backup...
Destination: [X:\MSSQL\EPDdocs_BACKUP\model_tlog_200611140000.TRN]
** Execution Time: 0 hrs, 0 mins, 1 secs **
[2] Database model: Verifying Backup...
** Execution Time: 0 hrs, 0 mins, 1 secs **
Backup can not be performed on database 'msdb'. This sub task is ignored.
Deleting old text reports... 0 file(s) deleted.
End of maintenance plan 'DB Maintenance Plan master, msdb, model' on
11/14/2006 12:00:08 AM
SQLMAINT.EXE Process Exit Code: 1 (Failed)
--
John Schuster
"Tibor Karaszi" wrote:
> > Any ideas about what I might be doing wrong?
> Specify a report file for the maint plan. In there you will find the error messages that lead to the
> job failure.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
> news:D4C6E493-E90D-45E6-80B2-3BC0170D8DEB@.microsoft.com...
> >i keep getting the following error in my Event Viewer regarding a maintnance
> > plan I have set up in MS SQL Server 2000:
> >
> > SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
> > 'DB Maintenance Plan master, msdb, model''
> > (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
> > 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
> > Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
> >
> > Any ideas about what I might be doing wrong?
> > --
> > John Schuster
>
>|||Here's the problem:
> Backup can not be performed on database 'msdb'. This sub task is ignored.
You are trying to do a log backup on a database which is in simple recovery mode. No can do.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
news:AC9FF4A5-0CF5-4661-A9F1-577320DB70A3@.microsoft.com...
>I set up a report and i get the following which doesn't tell me much:
> Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
> 'EPDDOCS3' as 'SEP\EPDDOCS3$' (trusted)
> Starting maintenance plan 'DB Maintenance Plan master, msdb, model' on
> 11/14/2006 12:00:07 AM
> Backup can not be performed on database 'master'. This sub task is ignored.
> [1] Database model: Transaction Log Backup...
> Destination: [X:\MSSQL\EPDdocs_BACKUP\model_tlog_200611140000.TRN]
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> [2] Database model: Verifying Backup...
> ** Execution Time: 0 hrs, 0 mins, 1 secs **
> Backup can not be performed on database 'msdb'. This sub task is ignored.
> Deleting old text reports... 0 file(s) deleted.
> End of maintenance plan 'DB Maintenance Plan master, msdb, model' on
> 11/14/2006 12:00:08 AM
> SQLMAINT.EXE Process Exit Code: 1 (Failed)
> --
> John Schuster
>
> "Tibor Karaszi" wrote:
>> > Any ideas about what I might be doing wrong?
>> Specify a report file for the maint plan. In there you will find the error messages that lead to
>> the
>> job failure.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
>> news:D4C6E493-E90D-45E6-80B2-3BC0170D8DEB@.microsoft.com...
>> >i keep getting the following error in my Event Viewer regarding a maintnance
>> > plan I have set up in MS SQL Server 2000:
>> >
>> > SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
>> > 'DB Maintenance Plan master, msdb, model''
>> > (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
>> > 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
>> > Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
>> >
>> > Any ideas about what I might be doing wrong?
>> > --
>> > John Schuster
>>|||Thank you for your help.
--
John Schuster
"Tibor Karaszi" wrote:
> Here's the problem:
> > Backup can not be performed on database 'msdb'. This sub task is ignored.
> You are trying to do a log backup on a database which is in simple recovery mode. No can do.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
> news:AC9FF4A5-0CF5-4661-A9F1-577320DB70A3@.microsoft.com...
> >I set up a report and i get the following which doesn't tell me much:
> >
> > Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server
> > 'EPDDOCS3' as 'SEP\EPDDOCS3$' (trusted)
> > Starting maintenance plan 'DB Maintenance Plan master, msdb, model' on
> > 11/14/2006 12:00:07 AM
> > Backup can not be performed on database 'master'. This sub task is ignored.
> >
> > [1] Database model: Transaction Log Backup...
> > Destination: [X:\MSSQL\EPDdocs_BACKUP\model_tlog_200611140000.TRN]
> >
> > ** Execution Time: 0 hrs, 0 mins, 1 secs **
> >
> > [2] Database model: Verifying Backup...
> >
> > ** Execution Time: 0 hrs, 0 mins, 1 secs **
> >
> > Backup can not be performed on database 'msdb'. This sub task is ignored.
> >
> > Deleting old text reports... 0 file(s) deleted.
> >
> > End of maintenance plan 'DB Maintenance Plan master, msdb, model' on
> > 11/14/2006 12:00:08 AM
> > SQLMAINT.EXE Process Exit Code: 1 (Failed)
> > --
> > John Schuster
> >
> >
> > "Tibor Karaszi" wrote:
> >
> >> > Any ideas about what I might be doing wrong?
> >>
> >> Specify a report file for the maint plan. In there you will find the error messages that lead to
> >> the
> >> job failure.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >>
> >>
> >> "John Schuster" <JohnSchuster@.discussions.microsoft.com> wrote in message
> >> news:D4C6E493-E90D-45E6-80B2-3BC0170D8DEB@.microsoft.com...
> >> >i keep getting the following error in my Event Viewer regarding a maintnance
> >> > plan I have set up in MS SQL Server 2000:
> >> >
> >> > SQL Server Scheduled Job 'Transaction Log Backup Job for DB Maintenance Plan
> >> > 'DB Maintenance Plan master, msdb, model''
> >> > (0x0D97085E32705247B590ADA245D3FE07) - Status: Failed - Invoked on:
> >> > 2006-11-14 00:00:05 - Message: The job failed. The Job was invoked by
> >> > Schedule 76 (Schedule 1). The last step to run was step 1 (Step 1).
> >> >
> >> > Any ideas about what I might be doing wrong?
> >> > --
> >> > John Schuster
> >>
> >>
> >>
>

Wednesday, March 28, 2012

Maintenance plan error in SQL Server 2000(SP3) Standard Ed!

Hi,
I have delete the user BUILTIN\Administrators, afte that
Maintenance Plan jobs are failed with the following error:
Microsoft (R) SQLMaint Utility (Unicode), Version
[Microsoft SQL-DMO (ODBC SQLState: 28000)] Error 18456:
[Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'NT AUTHORITY\SYSTEM'.
I have given access to the User, under which SQL Server
Agent services runs.
When i added back the user BUILTIN\Administrators, after
that it's runing fine. Please suggest for above problem.
I appreciate it.
Thanks
ssWhat account was the job set up under? And with which account is the
sqlagent running?
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.

Maintenance Plan Creation Failure in Wizard

When trying to create a maintenance plan in MS SQL 2005 using the
wizard I get the following error
TITLE: Maintenance Plan Wizard Progress
--
Create maintenance plan failed.
ADDITIONAL INFORMATION:
Could not load type
'Microsoft.SqlServer.Management.Smo.Agent.JobBaseCollection' from
assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91'.
(Microsoft.SqlServer.MaintenancePlanTasks)
BUTTONS:
OK
--
This seems like something did not install correctly on my server or
something. Any ideas are greatly appreciated.I'm getting the following error when trying to modify an existing maintenanc
e
plan in SQL 2005:
Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)) (System.Windows.Forms)
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid,
Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid
clsid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at Microsoft.DataWarehouse.Design.ComponentDiagram.CreateDdsView(Control
parentControl)
at
Microsoft.DataTransformationServices.Design.DtsComponentDiagram.CreateDdsVie
w(Control parentControl)
at
Microsoft.DataWarehouse.Controls.DdsDiagramHostControl.set_ComponentDiagram(
ComponentDiagram value)
at
Microsoft.DataTransformationServices.Design.DbMaintSequenceDesigner.get_DbMa
intDiagramHost()
at
Microsoft.DataTransformationServices.Design.DbMaintSequenceDesigner.Microsof
t.DataTransformationServices.Design.IDbMaintSequenceDesigner.get_DiagramHost
()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.ge
t_SelectedSubPlanDesignerHost()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.Se
lectSubPlan()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.gr
id_SelectionChanged(Object sender, SelectionChangedEventArgs args)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl.OnSelectionChanged(BlockO
fCellsCollection selectedCells)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl.SelectedCellsInternal(Blo
ckOfCellsCollection col, Boolean bSet)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl.set_SelectedCells(BlockOf
CellsCollection value)
at
Microsoft.SqlServer.Management.UI.Grid.DlgGridControl.SetSelectedCellInt(Int
32 rowIndex, Int32 colIndex)
at
Microsoft.SqlServer.Management.UI.Grid.DlgGridControl.SetSelectedCell(Int32
rowIndex, Int32 colIndex)
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.Po
pulateGrid()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.In
itialize(MaintenancePlanData planData)
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintView.LoadMaintenan
cePlan(String connectionString, IManagedConnection connection, String object
Urn)
at
Microsoft.DataTransformationServices.VsIntegration.DtsDesignerService.OpenDe
signer(String connectionString, Object connection, String objectUrn)
at
Microsoft.SqlServer.Management.DatabaseMaintenance.MaintDesignerMenuHandler.
Invoke()
"pyrahna" wrote:

> When trying to create a maintenance plan in MS SQL 2005 using the
> wizard I get the following error
> TITLE: Maintenance Plan Wizard Progress
> --
> Create maintenance plan failed.
> --
> ADDITIONAL INFORMATION:
> Could not load type
> 'Microsoft.SqlServer.Management.Smo.Agent.JobBaseCollection' from
> assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral,
> PublicKeyToken=89845dcd8080cc91'.
> (Microsoft.SqlServer.MaintenancePlanTasks)
> --
> BUTTONS:
> OK
> --
> This seems like something did not install correctly on my server or
> something. Any ideas are greatly appreciated.
>

Maintenance Plan Creation Failure in Wizard

When trying to create a maintenance plan in MS SQL 2005 using the
wizard I get the following error
TITLE: Maintenance Plan Wizard Progress
Create maintenance plan failed.
ADDITIONAL INFORMATION:
Could not load type
'Microsoft.SqlServer.Management.Smo.Agent.JobBaseC ollection' from
assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91'.
(Microsoft.SqlServer.MaintenancePlanTasks)
BUTTONS:
OK
This seems like something did not install correctly on my server or
something. Any ideas are greatly appreciated.
I'm getting the following error when trying to modify an existing maintenance
plan in SQL 2005:
Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)) (System.Windows.Forms)
at System.Windows.Forms.UnsafeNativeMethods.CoCreateI nstance(Guid& clsid,
Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(G uid clsid)
at System.Windows.Forms.AxHost.CreateWithLicense(Stri ng license, Guid
clsid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Gui d clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at Microsoft.DataWarehouse.Design.ComponentDiagram.Cr eateDdsView(Control
parentControl)
at
Microsoft.DataTransformationServices.Design.DtsCom ponentDiagram.CreateDdsView(Control parentControl)
at
Microsoft.DataWarehouse.Controls.DdsDiagramHostCon trol.set_ComponentDiagram(ComponentDiagram value)
at
Microsoft.DataTransformationServices.Design.DbMain tSequenceDesigner.get_DbMaintDiagramHost()
at
Microsoft.DataTransformationServices.Design.DbMain tSequenceDesigner.Microsoft.DataTransformationServ ices.Design.IDbMaintSequenceDesigner.get_DiagramHo st()
at
Microsoft.SqlServer.Management.DatabaseMaintenance .DbMaintDiagramHostCtrl.get_SelectedSubPlanDesigne rHost()
at
Microsoft.SqlServer.Management.DatabaseMaintenance .DbMaintDiagramHostCtrl.SelectSubPlan()
at
Microsoft.SqlServer.Management.DatabaseMaintenance .DbMaintDiagramHostCtrl.grid_SelectionChanged(Obje ct sender, SelectionChangedEventArgs args)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl .OnSelectionChanged(BlockOfCellsCollection selectedCells)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl .SelectedCellsInternal(BlockOfCellsCollection col, Boolean bSet)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl .set_SelectedCells(BlockOfCellsCollection value)
at
Microsoft.SqlServer.Management.UI.Grid.DlgGridCont rol.SetSelectedCellInt(Int32 rowIndex, Int32 colIndex)
at
Microsoft.SqlServer.Management.UI.Grid.DlgGridCont rol.SetSelectedCell(Int32
rowIndex, Int32 colIndex)
at
Microsoft.SqlServer.Management.DatabaseMaintenance .DbMaintDiagramHostCtrl.PopulateGrid()
at
Microsoft.SqlServer.Management.DatabaseMaintenance .DbMaintDiagramHostCtrl.Initialize(MaintenancePlan Data planData)
at
Microsoft.SqlServer.Management.DatabaseMaintenance .DbMaintView.LoadMaintenancePlan(String connectionString, IManagedConnection connection, String objectUrn)
at
Microsoft.DataTransformationServices.VsIntegration .DtsDesignerService.OpenDesigner(String connectionString, Object connection, String objectUrn)
at
Microsoft.SqlServer.Management.DatabaseMaintenance .MaintDesignerMenuHandler.Invoke()
"pyrahna" wrote:

> When trying to create a maintenance plan in MS SQL 2005 using the
> wizard I get the following error
> TITLE: Maintenance Plan Wizard Progress
> --
> Create maintenance plan failed.
> --
> ADDITIONAL INFORMATION:
> Could not load type
> 'Microsoft.SqlServer.Management.Smo.Agent.JobBaseC ollection' from
> assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral,
> PublicKeyToken=89845dcd8080cc91'.
> (Microsoft.SqlServer.MaintenancePlanTasks)
> --
> BUTTONS:
> OK
> --
> This seems like something did not install correctly on my server or
> something. Any ideas are greatly appreciated.
>

Maintenance Plan Creation Failure in Wizard

When trying to create a maintenance plan in MS SQL 2005 using the
wizard I get the following error
TITLE: Maintenance Plan Wizard Progress
--
Create maintenance plan failed.
--
ADDITIONAL INFORMATION:
Could not load type
'Microsoft.SqlServer.Management.Smo.Agent.JobBaseCollection' from
assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91'.
(Microsoft.SqlServer.MaintenancePlanTasks)
--
BUTTONS:
OK
--
This seems like something did not install correctly on my server or
something. Any ideas are greatly appreciated.I'm getting the following error when trying to modify an existing maintenance
plan in SQL 2005:
Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)) (System.Windows.Forms)
at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid,
Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid
clsid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at Microsoft.DataWarehouse.Design.ComponentDiagram.CreateDdsView(Control
parentControl)
at
Microsoft.DataTransformationServices.Design.DtsComponentDiagram.CreateDdsView(Control parentControl)
at
Microsoft.DataWarehouse.Controls.DdsDiagramHostControl.set_ComponentDiagram(ComponentDiagram value)
at
Microsoft.DataTransformationServices.Design.DbMaintSequenceDesigner.get_DbMaintDiagramHost()
at
Microsoft.DataTransformationServices.Design.DbMaintSequenceDesigner.Microsoft.DataTransformationServices.Design.IDbMaintSequenceDesigner.get_DiagramHost()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.get_SelectedSubPlanDesignerHost()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.SelectSubPlan()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.grid_SelectionChanged(Object sender, SelectionChangedEventArgs args)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl.OnSelectionChanged(BlockOfCellsCollection selectedCells)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl.SelectedCellsInternal(BlockOfCellsCollection col, Boolean bSet)
at
Microsoft.SqlServer.Management.UI.Grid.GridControl.set_SelectedCells(BlockOfCellsCollection value)
at
Microsoft.SqlServer.Management.UI.Grid.DlgGridControl.SetSelectedCellInt(Int32 rowIndex, Int32 colIndex)
at
Microsoft.SqlServer.Management.UI.Grid.DlgGridControl.SetSelectedCell(Int32
rowIndex, Int32 colIndex)
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.PopulateGrid()
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintDiagramHostCtrl.Initialize(MaintenancePlanData planData)
at
Microsoft.SqlServer.Management.DatabaseMaintenance.DbMaintView.LoadMaintenancePlan(String connectionString, IManagedConnection connection, String objectUrn)
at
Microsoft.DataTransformationServices.VsIntegration.DtsDesignerService.OpenDesigner(String connectionString, Object connection, String objectUrn)
at
Microsoft.SqlServer.Management.DatabaseMaintenance.MaintDesignerMenuHandler.Invoke()
"pyrahna" wrote:
> When trying to create a maintenance plan in MS SQL 2005 using the
> wizard I get the following error
> TITLE: Maintenance Plan Wizard Progress
> --
> Create maintenance plan failed.
> --
> ADDITIONAL INFORMATION:
> Could not load type
> 'Microsoft.SqlServer.Management.Smo.Agent.JobBaseCollection' from
> assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral,
> PublicKeyToken=89845dcd8080cc91'.
> (Microsoft.SqlServer.MaintenancePlanTasks)
> --
> BUTTONS:
> OK
> --
> This seems like something did not install correctly on my server or
> something. Any ideas are greatly appreciated.
>sql

Friday, March 23, 2012

Maintenance Job failure

I'm getting the following error when my database is
integrity checked. Error 5070: Database state cannot be
changed while other users are using database.
Is there anyway to tell who or what is using the database?Yes, you can run sp_who to see who is in the database currently.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx
.gbl...
I'm getting the following error when my database is
integrity checked. Error 5070: Database state cannot be
changed while other users are using database.
Is there anyway to tell who or what is using the database?|||Run sp_who2 from within Query Analyzer, to see who are accessing the
database you are checking.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx
.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?|||You should not run the automatic repair option as part of checking
consistency (this option has been removed in SQL Server 2005). Firstly it
requires changing the database state to single_user mode and secondly you
should always do root cause analysis of any inconsistencies.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx
.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?

Maintenance Job failure

I'm getting the following error when my database is
integrity checked. Error 5070: Database state cannot be
changed while other users are using database.
Is there anyway to tell who or what is using the database?
Yes, you can run sp_who to see who is in the database currently.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
I'm getting the following error when my database is
integrity checked. Error 5070: Database state cannot be
changed while other users are using database.
Is there anyway to tell who or what is using the database?
|||Yes, you can run sp_who to see who is in the database currently.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
I'm getting the following error when my database is
integrity checked. Error 5070: Database state cannot be
changed while other users are using database.
Is there anyway to tell who or what is using the database?
|||Run sp_who2 from within Query Analyzer, to see who are accessing the
database you are checking.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?
|||Run sp_who2 from within Query Analyzer, to see who are accessing the
database you are checking.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?
|||You should not run the automatic repair option as part of checking
consistency (this option has been removed in SQL Server 2005). Firstly it
requires changing the database state to single_user mode and secondly you
should always do root cause analysis of any inconsistencies.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?
|||You should not run the automatic repair option as part of checking
consistency (this option has been removed in SQL Server 2005). Firstly it
requires changing the database state to single_user mode and secondly you
should always do root cause analysis of any inconsistencies.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?
sql

Maintenance Job failure

I'm getting the following error when my database is
integrity checked. Error 5070: Database state cannot be
changed while other users are using database.
Is there anyway to tell who or what is using the database?Yes, you can run sp_who to see who is in the database currently.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
I'm getting the following error when my database is
integrity checked. Error 5070: Database state cannot be
changed while other users are using database.
Is there anyway to tell who or what is using the database?|||Run sp_who2 from within Query Analyzer, to see who are accessing the
database you are checking.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?|||You should not run the automatic repair option as part of checking
consistency (this option has been removed in SQL Server 2005). Firstly it
requires changing the database state to single_user mode and secondly you
should always do root cause analysis of any inconsistencies.
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Patty" <anonymous@.discussions.microsoft.com> wrote in message
news:223c001c45d25$a6206310$a301280a@.phx.gbl...
> I'm getting the following error when my database is
> integrity checked. Error 5070: Database state cannot be
> changed while other users are using database.
> Is there anyway to tell who or what is using the database?

Wednesday, March 21, 2012

Maintanence plan challenge!

Heres a challenge...
Sudddenly our backup maintanence plan stoped working. In the job history the
following error is displayed:
The job failed. The job invoked by the user sa. The last step to run was
step 1 (Step 1).
Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
(Error 22029). The step failed.
The maintanence plan error log is empty.
The job does not backup transaction logs and i've deseleccted integrity
check. I've created a new database and recrated the maintanene plan on this
database with the same result. I also created a maintanence plan with only an
integrity check. Still the same result...
I´m going nuts....Hi ,
Can you mail the syntax you are using for sqlmaint.exe along with any
switches that have been used.
Thanks & Regards
Vishal
"Stefan Andersson" wrote:
> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history the
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on this
> database with the same result. I also created a maintanence plan with only an
> integrity check. Still the same result...
> I´m going nuts....|||The maintanence plan are scheduled in Enterprise Manager so i dont run it
with any switches. It does not matter which type of maintanece plan i create
(backup, integrity check, etc).
"Vishal Gandhi" wrote:
> Hi ,
> Can you mail the syntax you are using for sqlmaint.exe along with any
> switches that have been used.
> Thanks & Regards
> Vishal
> "Stefan Andersson" wrote:
> > Heres a challenge...
> >
> > Sudddenly our backup maintanence plan stoped working. In the job history the
> > following error is displayed:
> >
> > The job failed. The job invoked by the user sa. The last step to run was
> > step 1 (Step 1).
> >
> > Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> > (Error 22029). The step failed.
> >
> > The maintanence plan error log is empty.
> >
> > The job does not backup transaction logs and i've deseleccted integrity
> > check. I've created a new database and recrated the maintanene plan on this
> > database with the same result. I also created a maintanence plan with only an
> > integrity check. Still the same result...
> >
> > I´m going nuts....|||Specify a report file for the plan and check for error messages from SQL Server in the report file.
If you are lucky, you find SQL Server errors there.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Stefan Andersson" <StefanAndersson@.discussions.microsoft.com> wrote in message
news:A79A5153-3A52-4456-AE97-28130C174A6B@.microsoft.com...
> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history the
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on this
> database with the same result. I also created a maintanence plan with only an
> integrity check. Still the same result...
> I´m going nuts....sql

Maintance plan in SQL SERVER 2005 WORKGROUP

Can any one tell me what I should do with following error :

I'm working with sql server 2005 workgroup and I installed SP2.

When I make a maintenance plan voor backup the databases (full) then at the end I got the following error !

save maintenance plan failed

One or more arguments are invalid.

I red this problem already on forums but I didn't get it resolved.

When I use sql server 2005 developer It worked fine !

Geert

A strange thing happend :

After installing SP2 on a new server everything went well !

Geert

Monday, March 19, 2012

Maintaining a chain with multiple inserts

Hello,

I know that this has probably been discussed, but I couldn't find
anything with Google. I have the following problem... I receive a set
of text files that describe a chain of insurance claims. Each claim may
be copied from an older claim and it may be copied to a newer claim. I
get files that give information in both directions (i.e., One file says
Claim #1 copied TO Claim #2 and another file says Claim #2 copied FROM
Claim #1). I already have something in place to validate the files
against each other.

What I need to end up with is a row for each claim that gives the
original claim number in the chain (NULL if it is an original claim),
the claim from which it was copied (NULL if none), and the claim to
which it was copied (NULL if none). The problem is that I may need to
insert claims into the middle of a chain (ok, that's not hard), and I
may also receive records in the file that have the same source claim
but multiple destination claims. These records must be changed to
create a single chain. For example, if I receive records that show 1->2
and 1->3 then this should be converted to show 1->2 and 2->3. The
business doesn't have any strong rules on how to reconcile these, so
I've decided to just go with ordering by the claim IDs when determining
order if it's otherwise unclear. Using this, I've solved the second
situation as well, but then I started to consider the situation of
receiving 1->2, 1->3, and 2->4. This should end up as 1->2, 2->3, 3->4
but I can't figure out how to do that without cursors or multiple
passes.

Below is some SQL to work with. Any suggestions are greatly
appreciated. Also, if you can think of any other situations that I
might need to handle then that would be useful as well.

Thanks,
-Tom.

CREATE TABLE Copy_To (
My_ID INT NOT NULL,
Copy_To INT NOT NULL )
GO
ALTER TABLE Copy_To ADD CONSTRAINT PK_Copy_To PRIMARY KEY (My_ID,
Copy_To)
GO

CREATE TABLE Copy_From (
My_ID INT NOT NULL,
Copy_From INT NOT NULL )
GO
ALTER TABLE Copy_From ADD CONSTRAINT PK_Copy_From PRIMARY KEY (My_ID,
Copy_From)
GO

CREATE TABLE Chain (
My_ID INT NOT NULL,
Orig_ID INT NULL,
Copy_To INT NULL,
Copy_From INT NULL )
GO
ALTER TABLE Chain ADD CONSTRAINT PK_Chain PRIMARY KEY (My_ID)
GO

INSERT INTO Copy_To VALUES (2, 3)
INSERT INTO Copy_To VALUES (2, 4)
INSERT INTO Copy_To VALUES (3, 5)
GO
INSERT INTO Copy_From VALUES (3, 2)
INSERT INTO Copy_From VALUES (4, 2)
INSERT INTO Copy_From VALUES (5, 3)
GO
-- The chain table may already have some existing rows
INSERT INTO Chain VALUES (1, NULL, 6, NULL)
INSERT INTO Chain VALUES (6, 1, NULL, 1)
GO
/*
The expected results would be rows in Chain as follows:

My_ID Orig_ID Copy_To Copy_From
1 NULL 2 NULL
2 1 3 1
3 1 4 2
4 1 5 3
5 1 6 4
6 1 NULL 5

In this case the numbers are all sequential, but that will not always
be the case. A chain could be 1->4->8 or possibly even 4->8->1->7.
*/Hi

Your copy_to/from tables seems to be containing a hierarchy that you are
disregarding therefore they may be redundant!!!

If you had a master claimparts table then:

CREATE TABLE CLAIMPARTS ( claim char(1), part int )

INSERT INTO CLAIMPARTS ( claim , part )
SELECT 'A', 1
UNION ALL SELECT 'A', 2
UNION ALL SELECT 'A', 3
UNION ALL SELECT 'A', 4
UNION ALL SELECT 'B', 1
UNION ALL SELECT 'B', 8
UNION ALL SELECT 'B', 7
UNION ALL SELECT 'B', 3

SELECT C.CLAIM, C.PART,
(SELECT MIN(PART) FROM CLAIMPARTS P
WHERE C.PART < P.PART
AND C.CLAIM = P.CLAIM ) AS NEXTPART
FROM CLAIMPARTS C
ORDER BY C.CLAIM, C.PART

Would give you the hierarchy regardless of the previous copyto/from
information.

John

"Thomas R. Hummel" <tom_hummel@.hotmail.com> wrote in message
news:1128105505.180521.155350@.f14g2000cwb.googlegr oups.com...
> Hello,
> I know that this has probably been discussed, but I couldn't find
> anything with Google. I have the following problem... I receive a set
> of text files that describe a chain of insurance claims. Each claim may
> be copied from an older claim and it may be copied to a newer claim. I
> get files that give information in both directions (i.e., One file says
> Claim #1 copied TO Claim #2 and another file says Claim #2 copied FROM
> Claim #1). I already have something in place to validate the files
> against each other.
> What I need to end up with is a row for each claim that gives the
> original claim number in the chain (NULL if it is an original claim),
> the claim from which it was copied (NULL if none), and the claim to
> which it was copied (NULL if none). The problem is that I may need to
> insert claims into the middle of a chain (ok, that's not hard), and I
> may also receive records in the file that have the same source claim
> but multiple destination claims. These records must be changed to
> create a single chain. For example, if I receive records that show 1->2
> and 1->3 then this should be converted to show 1->2 and 2->3. The
> business doesn't have any strong rules on how to reconcile these, so
> I've decided to just go with ordering by the claim IDs when determining
> order if it's otherwise unclear. Using this, I've solved the second
> situation as well, but then I started to consider the situation of
> receiving 1->2, 1->3, and 2->4. This should end up as 1->2, 2->3, 3->4
> but I can't figure out how to do that without cursors or multiple
> passes.
> Below is some SQL to work with. Any suggestions are greatly
> appreciated. Also, if you can think of any other situations that I
> might need to handle then that would be useful as well.
> Thanks,
> -Tom.
> CREATE TABLE Copy_To (
> My_ID INT NOT NULL,
> Copy_To INT NOT NULL )
> GO
> ALTER TABLE Copy_To ADD CONSTRAINT PK_Copy_To PRIMARY KEY (My_ID,
> Copy_To)
> GO
> CREATE TABLE Copy_From (
> My_ID INT NOT NULL,
> Copy_From INT NOT NULL )
> GO
> ALTER TABLE Copy_From ADD CONSTRAINT PK_Copy_From PRIMARY KEY (My_ID,
> Copy_From)
> GO
> CREATE TABLE Chain (
> My_ID INT NOT NULL,
> Orig_ID INT NULL,
> Copy_To INT NULL,
> Copy_From INT NULL )
> GO
> ALTER TABLE Chain ADD CONSTRAINT PK_Chain PRIMARY KEY (My_ID)
> GO
> INSERT INTO Copy_To VALUES (2, 3)
> INSERT INTO Copy_To VALUES (2, 4)
> INSERT INTO Copy_To VALUES (3, 5)
> GO
> INSERT INTO Copy_From VALUES (3, 2)
> INSERT INTO Copy_From VALUES (4, 2)
> INSERT INTO Copy_From VALUES (5, 3)
> GO
> -- The chain table may already have some existing rows
> INSERT INTO Chain VALUES (1, NULL, 6, NULL)
> INSERT INTO Chain VALUES (6, 1, NULL, 1)
> GO
> /*
> The expected results would be rows in Chain as follows:
> My_ID Orig_ID Copy_To Copy_From
> 1 NULL 2 NULL
> 2 1 3 1
> 3 1 4 2
> 4 1 5 3
> 5 1 6 4
> 6 1 NULL 5
> In this case the numbers are all sequential, but that will not always
> be the case. A chain could be 1->4->8 or possibly even 4->8->1->7.
> */|||Hi John,

I think that I may have been unclear about the problem. The Copy_To and
Copy_From columns are IDs. I should have probably put foreign keys to
My_ID in my example code to make that clear. Also, the Copy_To and
Copy_From tables are direct imports of files that I receive, so I have
no control over how that information is presented. If you had a way
that I could convert those rows into something like what you have
(instead of Claim and Part I would basically have the Orig_ID and
My_ID) then that would probably solve my problem.

Thanks,
-Tom.|||Hi Thomas

This gives you the results you wanted, but if you have more than one chain
you will need a means of identifying them.

CREATE VIEW AllIds AS
SELECT My_Id FROM Chain
UNION SELECT My_Id FROM Copy_To
UNION SELECT My_Id FROM Copy_From

SELECT I.My_Id,
CASE WHEN I.My_Id = C.My_Id THEN C.Orig_ID ELSE C.My_Id END AS Orig_ID,
CASE WHEN I.My_Id = C.Copy_to THEN E.Copy_to ELSE (SELECT MIN(My_Id) FROM
AllIds P WHERE I.My_Id < P.My_Id) END AS Copy_To,
CASE WHEN I.My_Id = C.My_Id THEN C.Copy_From ELSE (SELECT MAX(My_Id) FROM
AllIds P WHERE I.My_Id > P.My_Id) END AS Copy_from
FROM AllIds I
JOIN Chain C ON C.My_Id <= I.My_Id AND C.Copy_to >= I.My_Id
JOIN Chain E ON C.Copy_to = E.My_Id AND E.Orig_id = C.My_id
ORDER BY I.My_Id

John

"Thomas R. Hummel" <tom_hummel@.hotmail.com> wrote in message
news:1128138055.333646.242360@.g14g2000cwa.googlegr oups.com...
> Hi John,
> I think that I may have been unclear about the problem. The Copy_To and
> Copy_From columns are IDs. I should have probably put foreign keys to
> My_ID in my example code to make that clear. Also, the Copy_To and
> Copy_From tables are direct imports of files that I receive, so I have
> no control over how that information is presented. If you had a way
> that I could convert those rows into something like what you have
> (instead of Claim and Part I would basically have the Orig_ID and
> My_ID) then that would probably solve my problem.
> Thanks,
> -Tom.|||John Bell wrote:
> Hi Thomas
> This gives you the results you wanted, but if you have more than one chain
> you will need a means of identifying them.

Unfortunately, that's perhaps the biggest problem that I have. The only
way to determine that a row in Copy_To or Copy_From is in a chain with
another row is to follow the links. Once the rows are in the Chain
table the Orig_ID can be used to distinguish all chains.

I'll play around with the code that you included and see if I can get
something worked out. Unfortunately, I think that I'm going to be stuck
recursing through the chains to link them together.

Thanks for all of your help!

-Tom.|||Hi

If your ranges do not overlap then you should be able to cope with the query
I posted use c.my_id as the chains identifier as your orig_id was NULL or
the first entry.

John

"Thomas R. Hummel" <tom_hummel@.hotmail.com> wrote in message
news:1128177507.802681.287910@.f14g2000cwb.googlegr oups.com...
> John Bell wrote:
>> Hi Thomas
>>
>> This gives you the results you wanted, but if you have more than one
>> chain
>> you will need a means of identifying them.
> Unfortunately, that's perhaps the biggest problem that I have. The only
> way to determine that a row in Copy_To or Copy_From is in a chain with
> another row is to follow the links. Once the rows are in the Chain
> table the Orig_ID can be used to distinguish all chains.
> I'll play around with the code that you included and see if I can get
> something worked out. Unfortunately, I think that I'm going to be stuck
> recursing through the chains to link them together.
> Thanks for all of your help!
> -Tom.|||I've come up with a solution to the problem which I thought might be
useful for others. My problem was that I kept trying to find different
ways to force the data into the same structure. Finally it occurred to
me to look for a better model that is easier to work with.

I came up with the following:

CREATE TABLE Chain (
My_ID INT NOT NULL,
Orig_ID INT NOT NULL,
Level INT NOT NULL)
GO
ALTER TABLE Chain ADD CONSTRAINT PK_Chain PRIMARY KEY (My_ID)
GO

Now, converting the data is fairly quick and simple. First I add in all
of the "base" claims. Those are any claims that aren't copied from
somewhere else:

INSERT INTO Chain (My_ID, Orig_ID, Level)
SELECT CT1.My_ID, CT1.My_ID, 0
FROM Copy_To CT1
LEFT OUTER JOIN Copy_To CT2 ON CT2.Copy_To = CT1.My_ID
WHERE CT2.My_ID IS NULL

Once the base claims are added I add each new level in a loop until
there are no levels left:

DECLARE @.ins_count INT
SET @.ins_count = 1
WHILE (@.ins_count > 0)
BEGIN
INSERT INTO Chain (My_ID, Orig_ID, Level)
SELECT
MIN(CF.My_ID),
C1.Orig_ID,
SQ.Max_Level + 1
FROM Copy_From CF
INNER JOIN Chain C1 ON C1.Orig_ID = CF.Copy_From
INNER JOIN (SELECT Orig_ID, MAX(Level) AS Max_Level
FROM Chain
GROUP BY Orig_ID) SQ ON SQ.Orig_ID = C1.Orig_ID
LEFT OUTER JOIN Chain C2 ON C2.My_ID = CF.My_ID
WHERE C2.My_ID IS NULL
GROUP BY C1.Orig_ID, SQ.Max_Level

SELECT @.ins_count = @.@.ROWCOUNT
END

This logic handles all of the various problems with the data such as a
single claim being copied to multiple destination claims. The one
problem that it doesn't handle is a claim which is copied FROM multiple
claims, but this is an unresolvable error condition, so I find those
rows and move them to an error table ahead of time.

To improve performance I made a unique clustered index for Chain on the
Orig_ID and Level.

Getting the data that I need is fast and easy from this table as well:

SELECT C.My_ID, C.Orig_ID, CF.My_ID AS Copy_From, CT.My_ID AS Copy_To
FROM Chain C
LEFT OUTER JOIN Chain CF ON CF.Orig_ID = C.Orig_ID AND CF.Level =
C.Level - 1
LEFT OUTER JOIN Chain CT ON CT.Orig_ID = C.Orig_ID AND CT.Level =
C.Level + 1

-Tom.

Monday, March 12, 2012

Maint. Plan Backups and Single User Mode

I am trying to come up with the best solution for the following issue:
I have a specific DB that needs to be backed up in single user mode. I
want to do this with a a Maitenance Plan but I am not sure if that is
possible or makes sense.
What are my options? Do I have to backup with a script? I would like
the Maint. Plan to kick off the ALTER DB script to kick out users.
Thanks for the help.Why is single-user mode a requirement?
That said, you can eschew the maintenance plan and just script out the
ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
<wfj5444@.gmail.com> wrote in message
news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
I am trying to come up with the best solution for the following issue:
I have a specific DB that needs to be backed up in single user mode. I
want to do this with a a Maitenance Plan but I am not sure if that is
possible or makes sense.
What are my options? Do I have to backup with a script? I would like
the Maint. Plan to kick off the ALTER DB script to kick out users.
Thanks for the help.|||Tom,
is there any refrences on your method, in online books or on the web.
Thanks
"Tom Moreau" wrote:
> Why is single-user mode a requirement?
> That said, you can eschew the maintenance plan and just script out the
> ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> ..
> <wfj5444@.gmail.com> wrote in message
> news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> I am trying to come up with the best solution for the following issue:
> I have a specific DB that needs to be backed up in single user mode. I
> want to do this with a a Maitenance Plan but I am not sure if that is
> possible or makes sense.
> What are my options? Do I have to backup with a script? I would like
> the Maint. Plan to kick off the ALTER DB script to kick out users.
> Thanks for the help.
>|||Basically, check out the following in the BOL:
ALTER DATABASE
BACKUP DATABASE
sp_add_job
sp_add_jobstep
Also, I am curious as to why single-user mode is a requirement.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
Tom,
is there any refrences on your method, in online books or on the web.
Thanks
"Tom Moreau" wrote:
> Why is single-user mode a requirement?
> That said, you can eschew the maintenance plan and just script out the
> ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> ..
> <wfj5444@.gmail.com> wrote in message
> news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> I am trying to come up with the best solution for the following issue:
> I have a specific DB that needs to be backed up in single user mode. I
> want to do this with a a Maitenance Plan but I am not sure if that is
> possible or makes sense.
> What are my options? Do I have to backup with a script? I would like
> the Maint. Plan to kick off the ALTER DB script to kick out users.
> Thanks for the help.
>|||Thanks Tom.
The reason is due to a specific table that gets corrupted if users are
accessing it during backup.
I can not think of more simple solution than going single user, backing
it up and then returning to multi user.
Tom Moreau wrote:
> Basically, check out the following in the BOL:
> ALTER DATABASE
> BACKUP DATABASE
> sp_add_job
> sp_add_jobstep
> Also, I am curious as to why single-user mode is a requirement.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> Tom,
> is there any refrences on your method, in online books or on the web.
> Thanks
> "Tom Moreau" wrote:
> > Why is single-user mode a requirement?
> >
> > That said, you can eschew the maintenance plan and just script out the
> > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > ..
> > <wfj5444@.gmail.com> wrote in message
> > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> > I am trying to come up with the best solution for the following issue:
> >
> > I have a specific DB that needs to be backed up in single user mode. I
> > want to do this with a a Maitenance Plan but I am not sure if that is
> > possible or makes sense.
> >
> > What are my options? Do I have to backup with a script? I would like
> > the Maint. Plan to kick off the ALTER DB script to kick out users.
> >
> > Thanks for the help.
> >
> >|||If the table is getting corrupted, then it's possible that the app is not
properly designed. We'd have to know more first. You could start a
transaction and:
1) begin a transaction
2) do a SELECT on the table with TABLOCKX
3) do the backup
4) rollback the transaction
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
<wfj5444@.gmail.com> wrote in message
news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
Thanks Tom.
The reason is due to a specific table that gets corrupted if users are
accessing it during backup.
I can not think of more simple solution than going single user, backing
it up and then returning to multi user.
Tom Moreau wrote:
> Basically, check out the following in the BOL:
> ALTER DATABASE
> BACKUP DATABASE
> sp_add_job
> sp_add_jobstep
> Also, I am curious as to why single-user mode is a requirement.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> Tom,
> is there any refrences on your method, in online books or on the web.
> Thanks
> "Tom Moreau" wrote:
> > Why is single-user mode a requirement?
> >
> > That said, you can eschew the maintenance plan and just script out the
> > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > ..
> > <wfj5444@.gmail.com> wrote in message
> > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> > I am trying to come up with the best solution for the following issue:
> >
> > I have a specific DB that needs to be backed up in single user mode. I
> > want to do this with a a Maitenance Plan but I am not sure if that is
> > possible or makes sense.
> >
> > What are my options? Do I have to backup with a script? I would like
> > the Maint. Plan to kick off the ALTER DB script to kick out users.
> >
> > Thanks for the help.
> >
> >|||Ah, before I do that let me confirm that you are correct this is an
application issue.
Since this is a boxed application, I do not want to change how it
handles this table.
Do you see any other ways to work around the problem?
Tom Moreau wrote:
> If the table is getting corrupted, then it's possible that the app is not
> properly designed. We'd have to know more first. You could start a
> transaction and:
> 1) begin a transaction
> 2) do a SELECT on the table with TABLOCKX
> 3) do the backup
> 4) rollback the transaction
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> <wfj5444@.gmail.com> wrote in message
> news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> Thanks Tom.
> The reason is due to a specific table that gets corrupted if users are
> accessing it during backup.
> I can not think of more simple solution than going single user, backing
> it up and then returning to multi user.
>
>
> Tom Moreau wrote:
> > Basically, check out the following in the BOL:
> >
> > ALTER DATABASE
> > BACKUP DATABASE
> > sp_add_job
> > sp_add_jobstep
> >
> > Also, I am curious as to why single-user mode is a requirement.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > .
> > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> > Tom,
> > is there any refrences on your method, in online books or on the web.
> > Thanks
> >
> > "Tom Moreau" wrote:
> >
> > > Why is single-user mode a requirement?
> > >
> > > That said, you can eschew the maintenance plan and just script out the
> > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> > >
> > > --
> > > Tom
> > >
> > > ----
> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > SQL Server MVP
> > > Toronto, ON Canada
> > > ..
> > > <wfj5444@.gmail.com> wrote in message
> > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> > > I am trying to come up with the best solution for the following issue:
> > >
> > > I have a specific DB that needs to be backed up in single user mode. I
> > > want to do this with a a Maitenance Plan but I am not sure if that is
> > > possible or makes sense.
> > >
> > > What are my options? Do I have to backup with a script? I would like
> > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> > >
> > > Thanks for the help.
> > >
> > >|||Is it that just this one table will be "corrupt" or will other tables get
corrupted as well? If it's the former, my previous method will handle it.
If it's the later, I'd be tempted to shut down the middle tier, but putting
the DB into single user mode (and killing any running connections to that
DB) would do so as well. Check out the BOL for ALTER DATABASE.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Will" <wfj5444@.gmail.com> wrote in message
news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
Ah, before I do that let me confirm that you are correct this is an
application issue.
Since this is a boxed application, I do not want to change how it
handles this table.
Do you see any other ways to work around the problem?
Tom Moreau wrote:
> If the table is getting corrupted, then it's possible that the app is not
> properly designed. We'd have to know more first. You could start a
> transaction and:
> 1) begin a transaction
> 2) do a SELECT on the table with TABLOCKX
> 3) do the backup
> 4) rollback the transaction
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> <wfj5444@.gmail.com> wrote in message
> news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> Thanks Tom.
> The reason is due to a specific table that gets corrupted if users are
> accessing it during backup.
> I can not think of more simple solution than going single user, backing
> it up and then returning to multi user.
>
>
> Tom Moreau wrote:
> > Basically, check out the following in the BOL:
> >
> > ALTER DATABASE
> > BACKUP DATABASE
> > sp_add_job
> > sp_add_jobstep
> >
> > Also, I am curious as to why single-user mode is a requirement.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > .
> > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> > Tom,
> > is there any refrences on your method, in online books or on the web.
> > Thanks
> >
> > "Tom Moreau" wrote:
> >
> > > Why is single-user mode a requirement?
> > >
> > > That said, you can eschew the maintenance plan and just script out the
> > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> > >
> > > --
> > > Tom
> > >
> > > ----
> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > SQL Server MVP
> > > Toronto, ON Canada
> > > ..
> > > <wfj5444@.gmail.com> wrote in message
> > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> > > I am trying to come up with the best solution for the following issue:
> > >
> > > I have a specific DB that needs to be backed up in single user mode.
> > > I
> > > want to do this with a a Maitenance Plan but I am not sure if that is
> > > possible or makes sense.
> > >
> > > What are my options? Do I have to backup with a script? I would like
> > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> > >
> > > Thanks for the help.
> > >
> > >|||Yes it is the first, the table will be corrupted causing an issue for
one type of data.
When this happens, we have to clean the table and let the app recreate
an empty version.
Sorry you refer to your former method, which method? The ALTER DB
example from above?
Tom Moreau wrote:
> Is it that just this one table will be "corrupt" or will other tables get
> corrupted as well? If it's the former, my previous method will handle it.
> If it's the later, I'd be tempted to shut down the middle tier, but putting
> the DB into single user mode (and killing any running connections to that
> DB) would do so as well. Check out the BOL for ALTER DATABASE.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "Will" <wfj5444@.gmail.com> wrote in message
> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
> Ah, before I do that let me confirm that you are correct this is an
> application issue.
> Since this is a boxed application, I do not want to change how it
> handles this table.
> Do you see any other ways to work around the problem?
>
> Tom Moreau wrote:
> > If the table is getting corrupted, then it's possible that the app is not
> > properly designed. We'd have to know more first. You could start a
> > transaction and:
> >
> > 1) begin a transaction
> > 2) do a SELECT on the table with TABLOCKX
> > 3) do the backup
> > 4) rollback the transaction
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > .
> > <wfj5444@.gmail.com> wrote in message
> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> > Thanks Tom.
> >
> > The reason is due to a specific table that gets corrupted if users are
> > accessing it during backup.
> >
> > I can not think of more simple solution than going single user, backing
> > it up and then returning to multi user.
> >
> >
> >
> >
> > Tom Moreau wrote:
> > > Basically, check out the following in the BOL:
> > >
> > > ALTER DATABASE
> > > BACKUP DATABASE
> > > sp_add_job
> > > sp_add_jobstep
> > >
> > > Also, I am curious as to why single-user mode is a requirement.
> > >
> > > --
> > > Tom
> > >
> > > ----
> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > SQL Server MVP
> > > Toronto, ON Canada
> > > .
> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> > > Tom,
> > > is there any refrences on your method, in online books or on the web.
> > > Thanks
> > >
> > > "Tom Moreau" wrote:
> > >
> > > > Why is single-user mode a requirement?
> > > >
> > > > That said, you can eschew the maintenance plan and just script out the
> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> > > >
> > > > --
> > > > Tom
> > > >
> > > > ----
> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > > SQL Server MVP
> > > > Toronto, ON Canada
> > > > ..
> > > > <wfj5444@.gmail.com> wrote in message
> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> > > > I am trying to come up with the best solution for the following issue:
> > > >
> > > > I have a specific DB that needs to be backed up in single user mode.
> > > > I
> > > > want to do this with a a Maitenance Plan but I am not sure if that is
> > > > possible or makes sense.
> > > >
> > > > What are my options? Do I have to backup with a script? I would like
> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> > > >
> > > > Thanks for the help.
> > > >
> > > >|||I noticed you mention corruption in a particular table - after taking the
backup
- is the backup part of a maintenance plan?
If so does the maintenance plan perform integrity check/repair and or
optimization before backup.
- How do you determine corruption of your table afterwards.
- What errors do you get when you run dbcc checkdb or checktable?
When you run select @.@.version what SQL build number are you on?
"wfj5444@.gmail.com" wrote:
> I am trying to come up with the best solution for the following issue:
> I have a specific DB that needs to be backed up in single user mode. I
> want to do this with a a Maitenance Plan but I am not sure if that is
> possible or makes sense.
> What are my options? Do I have to backup with a script? I would like
> the Maint. Plan to kick off the ALTER DB script to kick out users.
> Thanks for the help.
>|||Yes, use:
ALTER DATABASE MyDB
SET RESTRICTED_USER
WITH ROLLBACK IMMEDIATE
That kicks out the users and makes the DB available only to admins - only
members of the db_owner, dbcreator, or sysadmin roles.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Will" <wfj5444@.gmail.com> wrote in message
news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
Yes it is the first, the table will be corrupted causing an issue for
one type of data.
When this happens, we have to clean the table and let the app recreate
an empty version.
Sorry you refer to your former method, which method? The ALTER DB
example from above?
Tom Moreau wrote:
> Is it that just this one table will be "corrupt" or will other tables get
> corrupted as well? If it's the former, my previous method will handle it.
> If it's the later, I'd be tempted to shut down the middle tier, but
> putting
> the DB into single user mode (and killing any running connections to that
> DB) would do so as well. Check out the BOL for ALTER DATABASE.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "Will" <wfj5444@.gmail.com> wrote in message
> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
> Ah, before I do that let me confirm that you are correct this is an
> application issue.
> Since this is a boxed application, I do not want to change how it
> handles this table.
> Do you see any other ways to work around the problem?
>
> Tom Moreau wrote:
> > If the table is getting corrupted, then it's possible that the app is
> > not
> > properly designed. We'd have to know more first. You could start a
> > transaction and:
> >
> > 1) begin a transaction
> > 2) do a SELECT on the table with TABLOCKX
> > 3) do the backup
> > 4) rollback the transaction
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > .
> > <wfj5444@.gmail.com> wrote in message
> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> > Thanks Tom.
> >
> > The reason is due to a specific table that gets corrupted if users are
> > accessing it during backup.
> >
> > I can not think of more simple solution than going single user, backing
> > it up and then returning to multi user.
> >
> >
> >
> >
> > Tom Moreau wrote:
> > > Basically, check out the following in the BOL:
> > >
> > > ALTER DATABASE
> > > BACKUP DATABASE
> > > sp_add_job
> > > sp_add_jobstep
> > >
> > > Also, I am curious as to why single-user mode is a requirement.
> > >
> > > --
> > > Tom
> > >
> > > ----
> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > SQL Server MVP
> > > Toronto, ON Canada
> > > .
> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> > > Tom,
> > > is there any refrences on your method, in online books or on the web.
> > > Thanks
> > >
> > > "Tom Moreau" wrote:
> > >
> > > > Why is single-user mode a requirement?
> > > >
> > > > That said, you can eschew the maintenance plan and just script out
> > > > the
> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> > > >
> > > > --
> > > > Tom
> > > >
> > > > ----
> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > > SQL Server MVP
> > > > Toronto, ON Canada
> > > > ..
> > > > <wfj5444@.gmail.com> wrote in message
> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> > > > I am trying to come up with the best solution for the following
> > > > issue:
> > > >
> > > > I have a specific DB that needs to be backed up in single user mode.
> > > > I
> > > > want to do this with a a Maitenance Plan but I am not sure if that
> > > > is
> > > > possible or makes sense.
> > > >
> > > > What are my options? Do I have to backup with a script? I would
> > > > like
> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> > > >
> > > > Thanks for the help.
> > > >
> > > >|||"Will" <wfj5444@.gmail.com> wrote in message
news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
> Yes it is the first, the table will be corrupted causing an issue for
> one type of data.
Then call the company that wrote this POS and complain.
SQL Server is designed for online backups. Hell, it would be impossible for
many major websites to work w/o that feature.
> When this happens, we have to clean the table and let the app recreate
> an empty version.
> Sorry you refer to your former method, which method? The ALTER DB
> example from above?
> Tom Moreau wrote:
> > Is it that just this one table will be "corrupt" or will other tables
get
> > corrupted as well? If it's the former, my previous method will handle
it.
> > If it's the later, I'd be tempted to shut down the middle tier, but
putting
> > the DB into single user mode (and killing any running connections to
that
> > DB) would do so as well. Check out the BOL for ALTER DATABASE.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > .
> > "Will" <wfj5444@.gmail.com> wrote in message
> > news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
> > Ah, before I do that let me confirm that you are correct this is an
> > application issue.
> > Since this is a boxed application, I do not want to change how it
> > handles this table.
> >
> > Do you see any other ways to work around the problem?
> >
> >
> > Tom Moreau wrote:
> > > If the table is getting corrupted, then it's possible that the app is
not
> > > properly designed. We'd have to know more first. You could start a
> > > transaction and:
> > >
> > > 1) begin a transaction
> > > 2) do a SELECT on the table with TABLOCKX
> > > 3) do the backup
> > > 4) rollback the transaction
> > >
> > > --
> > > Tom
> > >
> > > ----
> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > SQL Server MVP
> > > Toronto, ON Canada
> > > .
> > > <wfj5444@.gmail.com> wrote in message
> > > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> > > Thanks Tom.
> > >
> > > The reason is due to a specific table that gets corrupted if users are
> > > accessing it during backup.
> > >
> > > I can not think of more simple solution than going single user,
backing
> > > it up and then returning to multi user.
> > >
> > >
> > >
> > >
> > > Tom Moreau wrote:
> > > > Basically, check out the following in the BOL:
> > > >
> > > > ALTER DATABASE
> > > > BACKUP DATABASE
> > > > sp_add_job
> > > > sp_add_jobstep
> > > >
> > > > Also, I am curious as to why single-user mode is a requirement.
> > > >
> > > > --
> > > > Tom
> > > >
> > > > ----
> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > > SQL Server MVP
> > > > Toronto, ON Canada
> > > > .
> > > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> > > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> > > > Tom,
> > > > is there any refrences on your method, in online books or on the
web.
> > > > Thanks
> > > >
> > > > "Tom Moreau" wrote:
> > > >
> > > > > Why is single-user mode a requirement?
> > > > >
> > > > > That said, you can eschew the maintenance plan and just script out
the
> > > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> > > > >
> > > > > --
> > > > > Tom
> > > > >
> > > > > ----
> > > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > > > SQL Server MVP
> > > > > Toronto, ON Canada
> > > > > ..
> > > > > <wfj5444@.gmail.com> wrote in message
> > > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> > > > > I am trying to come up with the best solution for the following
issue:
> > > > >
> > > > > I have a specific DB that needs to be backed up in single user
mode.
> > > > > I
> > > > > want to do this with a a Maitenance Plan but I am not sure if that
is
> > > > > possible or makes sense.
> > > > >
> > > > > What are my options? Do I have to backup with a script? I would
like
> > > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> > > > >
> > > > > Thanks for the help.
> > > > >
> > > > >
>|||> That kicks out the users and makes the DB available only to admins - only
> members of the db_owner, dbcreator, or sysadmin roles.
But wouldn't end result be the same as if you just did a backup with the users connected? Here's my
reasoning:
The app "doesn't support online backup". Now, why is that? Probably because they don't have correct
transaction handling. The backup can grab some data for an operation which isn't done yet, just
because the developers didn't wrap that operation in a transaction.
Now, kicking out the users will do the very same thing. Remember that backup gives us the database
as a snapshot in time (I know you know this, Tom...).
It sounds like the software vendor has produced and sell an application which doesn't allow you to
perform backup of the data. Indeed worrying! I'd have a very serious talk to the app vendor and ask
them for the technical reason why a normal backup operation won't do and also ask them in what way
kicking out the users would make a difference.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uVA8pBMlGHA.1640@.TK2MSFTNGP02.phx.gbl...
> Yes, use:
> ALTER DATABASE MyDB
> SET RESTRICTED_USER
> WITH ROLLBACK IMMEDIATE
> That kicks out the users and makes the DB available only to admins - only
> members of the db_owner, dbcreator, or sysadmin roles.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "Will" <wfj5444@.gmail.com> wrote in message
> news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
> Yes it is the first, the table will be corrupted causing an issue for
> one type of data.
> When this happens, we have to clean the table and let the app recreate
> an empty version.
> Sorry you refer to your former method, which method? The ALTER DB
> example from above?
> Tom Moreau wrote:
>> Is it that just this one table will be "corrupt" or will other tables get
>> corrupted as well? If it's the former, my previous method will handle it.
>> If it's the later, I'd be tempted to shut down the middle tier, but
>> putting
>> the DB into single user mode (and killing any running connections to that
>> DB) would do so as well. Check out the BOL for ALTER DATABASE.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> SQL Server MVP
>> Toronto, ON Canada
>> .
>> "Will" <wfj5444@.gmail.com> wrote in message
>> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
>> Ah, before I do that let me confirm that you are correct this is an
>> application issue.
>> Since this is a boxed application, I do not want to change how it
>> handles this table.
>> Do you see any other ways to work around the problem?
>>
>> Tom Moreau wrote:
>> > If the table is getting corrupted, then it's possible that the app is
>> > not
>> > properly designed. We'd have to know more first. You could start a
>> > transaction and:
>> >
>> > 1) begin a transaction
>> > 2) do a SELECT on the table with TABLOCKX
>> > 3) do the backup
>> > 4) rollback the transaction
>> >
>> > --
>> > Tom
>> >
>> > ----
>> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> > SQL Server MVP
>> > Toronto, ON Canada
>> > .
>> > <wfj5444@.gmail.com> wrote in message
>> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
>> > Thanks Tom.
>> >
>> > The reason is due to a specific table that gets corrupted if users are
>> > accessing it during backup.
>> >
>> > I can not think of more simple solution than going single user, backing
>> > it up and then returning to multi user.
>> >
>> >
>> >
>> >
>> > Tom Moreau wrote:
>> > > Basically, check out the following in the BOL:
>> > >
>> > > ALTER DATABASE
>> > > BACKUP DATABASE
>> > > sp_add_job
>> > > sp_add_jobstep
>> > >
>> > > Also, I am curious as to why single-user mode is a requirement.
>> > >
>> > > --
>> > > Tom
>> > >
>> > > ----
>> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> > > SQL Server MVP
>> > > Toronto, ON Canada
>> > > .
>> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
>> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
>> > > Tom,
>> > > is there any refrences on your method, in online books or on the web.
>> > > Thanks
>> > >
>> > > "Tom Moreau" wrote:
>> > >
>> > > > Why is single-user mode a requirement?
>> > > >
>> > > > That said, you can eschew the maintenance plan and just script out
>> > > > the
>> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
>> > > >
>> > > > --
>> > > > Tom
>> > > >
>> > > > ----
>> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> > > > SQL Server MVP
>> > > > Toronto, ON Canada
>> > > > ..
>> > > > <wfj5444@.gmail.com> wrote in message
>> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
>> > > > I am trying to come up with the best solution for the following
>> > > > issue:
>> > > >
>> > > > I have a specific DB that needs to be backed up in single user mode.
>> > > > I
>> > > > want to do this with a a Maitenance Plan but I am not sure if that
>> > > > is
>> > > > possible or makes sense.
>> > > >
>> > > > What are my options? Do I have to backup with a script? I would
>> > > > like
>> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
>> > > >
>> > > > Thanks for the help.
>> > > >
>> > > >
>|||Yes, this does sound like a very strange app.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:ewInsYQlGHA.1664@.TK2MSFTNGP03.phx.gbl...
> That kicks out the users and makes the DB available only to admins - only
> members of the db_owner, dbcreator, or sysadmin roles.
But wouldn't end result be the same as if you just did a backup with the
users connected? Here's my
reasoning:
The app "doesn't support online backup". Now, why is that? Probably because
they don't have correct
transaction handling. The backup can grab some data for an operation which
isn't done yet, just
because the developers didn't wrap that operation in a transaction.
Now, kicking out the users will do the very same thing. Remember that backup
gives us the database
as a snapshot in time (I know you know this, Tom...).
It sounds like the software vendor has produced and sell an application
which doesn't allow you to
perform backup of the data. Indeed worrying! I'd have a very serious talk to
the app vendor and ask
them for the technical reason why a normal backup operation won't do and
also ask them in what way
kicking out the users would make a difference.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uVA8pBMlGHA.1640@.TK2MSFTNGP02.phx.gbl...
> Yes, use:
> ALTER DATABASE MyDB
> SET RESTRICTED_USER
> WITH ROLLBACK IMMEDIATE
> That kicks out the users and makes the DB available only to admins - only
> members of the db_owner, dbcreator, or sysadmin roles.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Toronto, ON Canada
> .
> "Will" <wfj5444@.gmail.com> wrote in message
> news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
> Yes it is the first, the table will be corrupted causing an issue for
> one type of data.
> When this happens, we have to clean the table and let the app recreate
> an empty version.
> Sorry you refer to your former method, which method? The ALTER DB
> example from above?
> Tom Moreau wrote:
>> Is it that just this one table will be "corrupt" or will other tables get
>> corrupted as well? If it's the former, my previous method will handle
>> it.
>> If it's the later, I'd be tempted to shut down the middle tier, but
>> putting
>> the DB into single user mode (and killing any running connections to that
>> DB) would do so as well. Check out the BOL for ALTER DATABASE.
>> --
>> Tom
>> ----
>> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> SQL Server MVP
>> Toronto, ON Canada
>> .
>> "Will" <wfj5444@.gmail.com> wrote in message
>> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
>> Ah, before I do that let me confirm that you are correct this is an
>> application issue.
>> Since this is a boxed application, I do not want to change how it
>> handles this table.
>> Do you see any other ways to work around the problem?
>>
>> Tom Moreau wrote:
>> > If the table is getting corrupted, then it's possible that the app is
>> > not
>> > properly designed. We'd have to know more first. You could start a
>> > transaction and:
>> >
>> > 1) begin a transaction
>> > 2) do a SELECT on the table with TABLOCKX
>> > 3) do the backup
>> > 4) rollback the transaction
>> >
>> > --
>> > Tom
>> >
>> > ----
>> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> > SQL Server MVP
>> > Toronto, ON Canada
>> > .
>> > <wfj5444@.gmail.com> wrote in message
>> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
>> > Thanks Tom.
>> >
>> > The reason is due to a specific table that gets corrupted if users are
>> > accessing it during backup.
>> >
>> > I can not think of more simple solution than going single user, backing
>> > it up and then returning to multi user.
>> >
>> >
>> >
>> >
>> > Tom Moreau wrote:
>> > > Basically, check out the following in the BOL:
>> > >
>> > > ALTER DATABASE
>> > > BACKUP DATABASE
>> > > sp_add_job
>> > > sp_add_jobstep
>> > >
>> > > Also, I am curious as to why single-user mode is a requirement.
>> > >
>> > > --
>> > > Tom
>> > >
>> > > ----
>> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> > > SQL Server MVP
>> > > Toronto, ON Canada
>> > > .
>> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
>> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
>> > > Tom,
>> > > is there any refrences on your method, in online books or on the web.
>> > > Thanks
>> > >
>> > > "Tom Moreau" wrote:
>> > >
>> > > > Why is single-user mode a requirement?
>> > > >
>> > > > That said, you can eschew the maintenance plan and just script out
>> > > > the
>> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
>> > > >
>> > > > --
>> > > > Tom
>> > > >
>> > > > ----
>> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> > > > SQL Server MVP
>> > > > Toronto, ON Canada
>> > > > ..
>> > > > <wfj5444@.gmail.com> wrote in message
>> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
>> > > > I am trying to come up with the best solution for the following
>> > > > issue:
>> > > >
>> > > > I have a specific DB that needs to be backed up in single user
>> > > > mode.
>> > > > I
>> > > > want to do this with a a Maitenance Plan but I am not sure if that
>> > > > is
>> > > > possible or makes sense.
>> > > >
>> > > > What are my options? Do I have to backup with a script? I would
>> > > > like
>> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
>> > > >
>> > > > Thanks for the help.
>> > > >
>> > > >
>|||Sassan,
It is part of the maintenance plan. We do optimize (remove unused
space) but that is all no other fixing.
Corruption is determined by certain data is missing.
With a checktable there are no errors
We are at build 2187
Sassan Karai wrote:
> I noticed you mention corruption in a particular table - after taking the
> backup
> - is the backup part of a maintenance plan?
> If so does the maintenance plan perform integrity check/repair and or
> optimization before backup.
> - How do you determine corruption of your table afterwards.
> - What errors do you get when you run dbcc checkdb or checktable?
> When you run select @.@.version what SQL build number are you on?
>
> "wfj5444@.gmail.com" wrote:
> > I am trying to come up with the best solution for the following issue:
> >
> > I have a specific DB that needs to be backed up in single user mode. I
> > want to do this with a a Maitenance Plan but I am not sure if that is
> > possible or makes sense.
> >
> > What are my options? Do I have to backup with a script? I would like
> > the Maint. Plan to kick off the ALTER DB script to kick out users.
> >
> > Thanks for the help.
> >
> >|||Greg and Tibor
Greg - We have and they know it is an issue. It is only this specific
table that has the issue.
Tibor - I actually want to make it single user rather than restricted
user. Would that not solve the issue?
The app does support online backup. This is a bug and something they
are going to fix.
Tibor Karaszi wrote:
> > That kicks out the users and makes the DB available only to admins - only
> > members of the db_owner, dbcreator, or sysadmin roles.
> But wouldn't end result be the same as if you just did a backup with the users connected? Here's my
> reasoning:
> The app "doesn't support online backup". Now, why is that? Probably because they don't have correct
> transaction handling. The backup can grab some data for an operation which isn't done yet, just
> because the developers didn't wrap that operation in a transaction.
> Now, kicking out the users will do the very same thing. Remember that backup gives us the database
> as a snapshot in time (I know you know this, Tom...).
> It sounds like the software vendor has produced and sell an application which doesn't allow you to
> perform backup of the data. Indeed worrying! I'd have a very serious talk to the app vendor and ask
> them for the technical reason why a normal backup operation won't do and also ask them in what way
> kicking out the users would make a difference.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:uVA8pBMlGHA.1640@.TK2MSFTNGP02.phx.gbl...
> > Yes, use:
> >
> > ALTER DATABASE MyDB
> > SET RESTRICTED_USER
> > WITH ROLLBACK IMMEDIATE
> >
> > That kicks out the users and makes the DB available only to admins - only
> > members of the db_owner, dbcreator, or sysadmin roles.
> >
> > --
> > Tom
> >
> > ----
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Toronto, ON Canada
> > .
> > "Will" <wfj5444@.gmail.com> wrote in message
> > news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
> > Yes it is the first, the table will be corrupted causing an issue for
> > one type of data.
> >
> > When this happens, we have to clean the table and let the app recreate
> > an empty version.
> >
> > Sorry you refer to your former method, which method? The ALTER DB
> > example from above?
> >
> > Tom Moreau wrote:
> >> Is it that just this one table will be "corrupt" or will other tables get
> >> corrupted as well? If it's the former, my previous method will handle it.
> >> If it's the later, I'd be tempted to shut down the middle tier, but
> >> putting
> >> the DB into single user mode (and killing any running connections to that
> >> DB) would do so as well. Check out the BOL for ALTER DATABASE.
> >>
> >> --
> >> Tom
> >>
> >> ----
> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> SQL Server MVP
> >> Toronto, ON Canada
> >> .
> >> "Will" <wfj5444@.gmail.com> wrote in message
> >> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
> >> Ah, before I do that let me confirm that you are correct this is an
> >> application issue.
> >> Since this is a boxed application, I do not want to change how it
> >> handles this table.
> >>
> >> Do you see any other ways to work around the problem?
> >>
> >>
> >> Tom Moreau wrote:
> >> > If the table is getting corrupted, then it's possible that the app is
> >> > not
> >> > properly designed. We'd have to know more first. You could start a
> >> > transaction and:
> >> >
> >> > 1) begin a transaction
> >> > 2) do a SELECT on the table with TABLOCKX
> >> > 3) do the backup
> >> > 4) rollback the transaction
> >> >
> >> > --
> >> > Tom
> >> >
> >> > ----
> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> > SQL Server MVP
> >> > Toronto, ON Canada
> >> > .
> >> > <wfj5444@.gmail.com> wrote in message
> >> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> >> > Thanks Tom.
> >> >
> >> > The reason is due to a specific table that gets corrupted if users are
> >> > accessing it during backup.
> >> >
> >> > I can not think of more simple solution than going single user, backing
> >> > it up and then returning to multi user.
> >> >
> >> >
> >> >
> >> >
> >> > Tom Moreau wrote:
> >> > > Basically, check out the following in the BOL:
> >> > >
> >> > > ALTER DATABASE
> >> > > BACKUP DATABASE
> >> > > sp_add_job
> >> > > sp_add_jobstep
> >> > >
> >> > > Also, I am curious as to why single-user mode is a requirement.
> >> > >
> >> > > --
> >> > > Tom
> >> > >
> >> > > ----
> >> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> > > SQL Server MVP
> >> > > Toronto, ON Canada
> >> > > .
> >> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> >> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> >> > > Tom,
> >> > > is there any refrences on your method, in online books or on the web.
> >> > > Thanks
> >> > >
> >> > > "Tom Moreau" wrote:
> >> > >
> >> > > > Why is single-user mode a requirement?
> >> > > >
> >> > > > That said, you can eschew the maintenance plan and just script out
> >> > > > the
> >> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> >> > > >
> >> > > > --
> >> > > > Tom
> >> > > >
> >> > > > ----
> >> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> > > > SQL Server MVP
> >> > > > Toronto, ON Canada
> >> > > > ..
> >> > > > <wfj5444@.gmail.com> wrote in message
> >> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> >> > > > I am trying to come up with the best solution for the following
> >> > > > issue:
> >> > > >
> >> > > > I have a specific DB that needs to be backed up in single user mode.
> >> > > > I
> >> > > > want to do this with a a Maitenance Plan but I am not sure if that
> >> > > > is
> >> > > > possible or makes sense.
> >> > > >
> >> > > > What are my options? Do I have to backup with a script? I would
> >> > > > like
> >> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> >> > > >
> >> > > > Thanks for the help.
> >> > > >
> >> > > >
> >|||> Tibor - I actually want to make it single user rather than restricted
> user. Would that not solve the issue?
Not the one I was getting at. If the problem is as I described, the application does several things
that should be all or nothing, but not transaction protected, so you go in and grab the data while
this is running, then kicking out users will be no different from just doing a database backup.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Will" <wfj5444@.gmail.com> wrote in message
news:1150891303.954334.46680@.y41g2000cwy.googlegroups.com...
> Greg and Tibor
> Greg - We have and they know it is an issue. It is only this specific
> table that has the issue.
> Tibor - I actually want to make it single user rather than restricted
> user. Would that not solve the issue?
> The app does support online backup. This is a bug and something they
> are going to fix.
>
> Tibor Karaszi wrote:
>> > That kicks out the users and makes the DB available only to admins - only
>> > members of the db_owner, dbcreator, or sysadmin roles.
>> But wouldn't end result be the same as if you just did a backup with the users connected? Here's
>> my
>> reasoning:
>> The app "doesn't support online backup". Now, why is that? Probably because they don't have
>> correct
>> transaction handling. The backup can grab some data for an operation which isn't done yet, just
>> because the developers didn't wrap that operation in a transaction.
>> Now, kicking out the users will do the very same thing. Remember that backup gives us the
>> database
>> as a snapshot in time (I know you know this, Tom...).
>> It sounds like the software vendor has produced and sell an application which doesn't allow you
>> to
>> perform backup of the data. Indeed worrying! I'd have a very serious talk to the app vendor and
>> ask
>> them for the technical reason why a normal backup operation won't do and also ask them in what
>> way
>> kicking out the users would make a difference.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> news:uVA8pBMlGHA.1640@.TK2MSFTNGP02.phx.gbl...
>> > Yes, use:
>> >
>> > ALTER DATABASE MyDB
>> > SET RESTRICTED_USER
>> > WITH ROLLBACK IMMEDIATE
>> >
>> > That kicks out the users and makes the DB available only to admins - only
>> > members of the db_owner, dbcreator, or sysadmin roles.
>> >
>> > --
>> > Tom
>> >
>> > ----
>> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> > SQL Server MVP
>> > Toronto, ON Canada
>> > .
>> > "Will" <wfj5444@.gmail.com> wrote in message
>> > news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
>> > Yes it is the first, the table will be corrupted causing an issue for
>> > one type of data.
>> >
>> > When this happens, we have to clean the table and let the app recreate
>> > an empty version.
>> >
>> > Sorry you refer to your former method, which method? The ALTER DB
>> > example from above?
>> >
>> > Tom Moreau wrote:
>> >> Is it that just this one table will be "corrupt" or will other tables get
>> >> corrupted as well? If it's the former, my previous method will handle it.
>> >> If it's the later, I'd be tempted to shut down the middle tier, but
>> >> putting
>> >> the DB into single user mode (and killing any running connections to that
>> >> DB) would do so as well. Check out the BOL for ALTER DATABASE.
>> >>
>> >> --
>> >> Tom
>> >>
>> >> ----
>> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> SQL Server MVP
>> >> Toronto, ON Canada
>> >> .
>> >> "Will" <wfj5444@.gmail.com> wrote in message
>> >> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
>> >> Ah, before I do that let me confirm that you are correct this is an
>> >> application issue.
>> >> Since this is a boxed application, I do not want to change how it
>> >> handles this table.
>> >>
>> >> Do you see any other ways to work around the problem?
>> >>
>> >>
>> >> Tom Moreau wrote:
>> >> > If the table is getting corrupted, then it's possible that the app is
>> >> > not
>> >> > properly designed. We'd have to know more first. You could start a
>> >> > transaction and:
>> >> >
>> >> > 1) begin a transaction
>> >> > 2) do a SELECT on the table with TABLOCKX
>> >> > 3) do the backup
>> >> > 4) rollback the transaction
>> >> >
>> >> > --
>> >> > Tom
>> >> >
>> >> > ----
>> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> > SQL Server MVP
>> >> > Toronto, ON Canada
>> >> > .
>> >> > <wfj5444@.gmail.com> wrote in message
>> >> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
>> >> > Thanks Tom.
>> >> >
>> >> > The reason is due to a specific table that gets corrupted if users are
>> >> > accessing it during backup.
>> >> >
>> >> > I can not think of more simple solution than going single user, backing
>> >> > it up and then returning to multi user.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > Tom Moreau wrote:
>> >> > > Basically, check out the following in the BOL:
>> >> > >
>> >> > > ALTER DATABASE
>> >> > > BACKUP DATABASE
>> >> > > sp_add_job
>> >> > > sp_add_jobstep
>> >> > >
>> >> > > Also, I am curious as to why single-user mode is a requirement.
>> >> > >
>> >> > > --
>> >> > > Tom
>> >> > >
>> >> > > ----
>> >> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> > > SQL Server MVP
>> >> > > Toronto, ON Canada
>> >> > > .
>> >> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
>> >> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
>> >> > > Tom,
>> >> > > is there any refrences on your method, in online books or on the web.
>> >> > > Thanks
>> >> > >
>> >> > > "Tom Moreau" wrote:
>> >> > >
>> >> > > > Why is single-user mode a requirement?
>> >> > > >
>> >> > > > That said, you can eschew the maintenance plan and just script out
>> >> > > > the
>> >> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
>> >> > > >
>> >> > > > --
>> >> > > > Tom
>> >> > > >
>> >> > > > ----
>> >> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> > > > SQL Server MVP
>> >> > > > Toronto, ON Canada
>> >> > > > ..
>> >> > > > <wfj5444@.gmail.com> wrote in message
>> >> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
>> >> > > > I am trying to come up with the best solution for the following
>> >> > > > issue:
>> >> > > >
>> >> > > > I have a specific DB that needs to be backed up in single user mode.
>> >> > > > I
>> >> > > > want to do this with a a Maitenance Plan but I am not sure if that
>> >> > > > is
>> >> > > > possible or makes sense.
>> >> > > >
>> >> > > > What are my options? Do I have to backup with a script? I would
>> >> > > > like
>> >> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
>> >> > > >
>> >> > > > Thanks for the help.
>> >> > > >
>> >> > > >
>> >
>|||That confuses me somewhat because the maker's work around is to close
all open instances of this application then back up that one table.
Wouldn't going to single user mode achieve the same thing?
Tibor Karaszi wrote:
> > Tibor - I actually want to make it single user rather than restricted
> > user. Would that not solve the issue?
> Not the one I was getting at. If the problem is as I described, the application does several things
> that should be all or nothing, but not transaction protected, so you go in and grab the data while
> this is running, then kicking out users will be no different from just doing a database backup.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Will" <wfj5444@.gmail.com> wrote in message
> news:1150891303.954334.46680@.y41g2000cwy.googlegroups.com...
> > Greg and Tibor
> >
> > Greg - We have and they know it is an issue. It is only this specific
> > table that has the issue.
> >
> > Tibor - I actually want to make it single user rather than restricted
> > user. Would that not solve the issue?
> >
> > The app does support online backup. This is a bug and something they
> > are going to fix.
> >
> >
> >
> > Tibor Karaszi wrote:
> >> > That kicks out the users and makes the DB available only to admins - only
> >> > members of the db_owner, dbcreator, or sysadmin roles.
> >>
> >> But wouldn't end result be the same as if you just did a backup with the users connected? Here's
> >> my
> >> reasoning:
> >>
> >> The app "doesn't support online backup". Now, why is that? Probably because they don't have
> >> correct
> >> transaction handling. The backup can grab some data for an operation which isn't done yet, just
> >> because the developers didn't wrap that operation in a transaction.
> >>
> >> Now, kicking out the users will do the very same thing. Remember that backup gives us the
> >> database
> >> as a snapshot in time (I know you know this, Tom...).
> >>
> >> It sounds like the software vendor has produced and sell an application which doesn't allow you
> >> to
> >> perform backup of the data. Indeed worrying! I'd have a very serious talk to the app vendor and
> >> ask
> >> them for the technical reason why a normal backup operation won't do and also ask them in what
> >> way
> >> kicking out the users would make a difference.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >>
> >>
> >> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> >> news:uVA8pBMlGHA.1640@.TK2MSFTNGP02.phx.gbl...
> >> > Yes, use:
> >> >
> >> > ALTER DATABASE MyDB
> >> > SET RESTRICTED_USER
> >> > WITH ROLLBACK IMMEDIATE
> >> >
> >> > That kicks out the users and makes the DB available only to admins - only
> >> > members of the db_owner, dbcreator, or sysadmin roles.
> >> >
> >> > --
> >> > Tom
> >> >
> >> > ----
> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> > SQL Server MVP
> >> > Toronto, ON Canada
> >> > .
> >> > "Will" <wfj5444@.gmail.com> wrote in message
> >> > news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
> >> > Yes it is the first, the table will be corrupted causing an issue for
> >> > one type of data.
> >> >
> >> > When this happens, we have to clean the table and let the app recreate
> >> > an empty version.
> >> >
> >> > Sorry you refer to your former method, which method? The ALTER DB
> >> > example from above?
> >> >
> >> > Tom Moreau wrote:
> >> >> Is it that just this one table will be "corrupt" or will other tables get
> >> >> corrupted as well? If it's the former, my previous method will handle it.
> >> >> If it's the later, I'd be tempted to shut down the middle tier, but
> >> >> putting
> >> >> the DB into single user mode (and killing any running connections to that
> >> >> DB) would do so as well. Check out the BOL for ALTER DATABASE.
> >> >>
> >> >> --
> >> >> Tom
> >> >>
> >> >> ----
> >> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> SQL Server MVP
> >> >> Toronto, ON Canada
> >> >> .
> >> >> "Will" <wfj5444@.gmail.com> wrote in message
> >> >> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
> >> >> Ah, before I do that let me confirm that you are correct this is an
> >> >> application issue.
> >> >> Since this is a boxed application, I do not want to change how it
> >> >> handles this table.
> >> >>
> >> >> Do you see any other ways to work around the problem?
> >> >>
> >> >>
> >> >> Tom Moreau wrote:
> >> >> > If the table is getting corrupted, then it's possible that the app is
> >> >> > not
> >> >> > properly designed. We'd have to know more first. You could start a
> >> >> > transaction and:
> >> >> >
> >> >> > 1) begin a transaction
> >> >> > 2) do a SELECT on the table with TABLOCKX
> >> >> > 3) do the backup
> >> >> > 4) rollback the transaction
> >> >> >
> >> >> > --
> >> >> > Tom
> >> >> >
> >> >> > ----
> >> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> > SQL Server MVP
> >> >> > Toronto, ON Canada
> >> >> > .
> >> >> > <wfj5444@.gmail.com> wrote in message
> >> >> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> >> >> > Thanks Tom.
> >> >> >
> >> >> > The reason is due to a specific table that gets corrupted if users are
> >> >> > accessing it during backup.
> >> >> >
> >> >> > I can not think of more simple solution than going single user, backing
> >> >> > it up and then returning to multi user.
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > Tom Moreau wrote:
> >> >> > > Basically, check out the following in the BOL:
> >> >> > >
> >> >> > > ALTER DATABASE
> >> >> > > BACKUP DATABASE
> >> >> > > sp_add_job
> >> >> > > sp_add_jobstep
> >> >> > >
> >> >> > > Also, I am curious as to why single-user mode is a requirement.
> >> >> > >
> >> >> > > --
> >> >> > > Tom
> >> >> > >
> >> >> > > ----
> >> >> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> > > SQL Server MVP
> >> >> > > Toronto, ON Canada
> >> >> > > .
> >> >> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> >> >> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> >> >> > > Tom,
> >> >> > > is there any refrences on your method, in online books or on the web.
> >> >> > > Thanks
> >> >> > >
> >> >> > > "Tom Moreau" wrote:
> >> >> > >
> >> >> > > > Why is single-user mode a requirement?
> >> >> > > >
> >> >> > > > That said, you can eschew the maintenance plan and just script out
> >> >> > > > the
> >> >> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> >> >> > > >
> >> >> > > > --
> >> >> > > > Tom
> >> >> > > >
> >> >> > > > ----
> >> >> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> > > > SQL Server MVP
> >> >> > > > Toronto, ON Canada
> >> >> > > > ..
> >> >> > > > <wfj5444@.gmail.com> wrote in message
> >> >> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> >> >> > > > I am trying to come up with the best solution for the following
> >> >> > > > issue:
> >> >> > > >
> >> >> > > > I have a specific DB that needs to be backed up in single user mode.
> >> >> > > > I
> >> >> > > > want to do this with a a Maitenance Plan but I am not sure if that
> >> >> > > > is
> >> >> > > > possible or makes sense.
> >> >> > > >
> >> >> > > > What are my options? Do I have to backup with a script? I would
> >> >> > > > like
> >> >> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> >> >> > > >
> >> >> > > > Thanks for the help.
> >> >> > > >
> >> >> > > >
> >> >
> >|||Closing the application in a controlled manner is different from kicking out the users from the
database. This is a very important difference. Kicking out the users will leave you with same effect
as just doing a backup. Do what the vendor say and push the vendor for writing a proper application
that support doing backup the same way as the rest of us do :-).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Will" <wfj5444@.gmail.com> wrote in message
news:1150914720.910034.267610@.c74g2000cwc.googlegroups.com...
> That confuses me somewhat because the maker's work around is to close
> all open instances of this application then back up that one table.
> Wouldn't going to single user mode achieve the same thing?
> Tibor Karaszi wrote:
>> > Tibor - I actually want to make it single user rather than restricted
>> > user. Would that not solve the issue?
>> Not the one I was getting at. If the problem is as I described, the application does several
>> things
>> that should be all or nothing, but not transaction protected, so you go in and grab the data
>> while
>> this is running, then kicking out users will be no different from just doing a database backup.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "Will" <wfj5444@.gmail.com> wrote in message
>> news:1150891303.954334.46680@.y41g2000cwy.googlegroups.com...
>> > Greg and Tibor
>> >
>> > Greg - We have and they know it is an issue. It is only this specific
>> > table that has the issue.
>> >
>> > Tibor - I actually want to make it single user rather than restricted
>> > user. Would that not solve the issue?
>> >
>> > The app does support online backup. This is a bug and something they
>> > are going to fix.
>> >
>> >
>> >
>> > Tibor Karaszi wrote:
>> >> > That kicks out the users and makes the DB available only to admins - only
>> >> > members of the db_owner, dbcreator, or sysadmin roles.
>> >>
>> >> But wouldn't end result be the same as if you just did a backup with the users connected?
>> >> Here's
>> >> my
>> >> reasoning:
>> >>
>> >> The app "doesn't support online backup". Now, why is that? Probably because they don't have
>> >> correct
>> >> transaction handling. The backup can grab some data for an operation which isn't done yet,
>> >> just
>> >> because the developers didn't wrap that operation in a transaction.
>> >>
>> >> Now, kicking out the users will do the very same thing. Remember that backup gives us the
>> >> database
>> >> as a snapshot in time (I know you know this, Tom...).
>> >>
>> >> It sounds like the software vendor has produced and sell an application which doesn't allow
>> >> you
>> >> to
>> >> perform backup of the data. Indeed worrying! I'd have a very serious talk to the app vendor
>> >> and
>> >> ask
>> >> them for the technical reason why a normal backup operation won't do and also ask them in what
>> >> way
>> >> kicking out the users would make a difference.
>> >>
>> >> --
>> >> Tibor Karaszi, SQL Server MVP
>> >> http://www.karaszi.com/sqlserver/default.asp
>> >> http://www.solidqualitylearning.com/
>> >>
>> >>
>> >> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
>> >> news:uVA8pBMlGHA.1640@.TK2MSFTNGP02.phx.gbl...
>> >> > Yes, use:
>> >> >
>> >> > ALTER DATABASE MyDB
>> >> > SET RESTRICTED_USER
>> >> > WITH ROLLBACK IMMEDIATE
>> >> >
>> >> > That kicks out the users and makes the DB available only to admins - only
>> >> > members of the db_owner, dbcreator, or sysadmin roles.
>> >> >
>> >> > --
>> >> > Tom
>> >> >
>> >> > ----
>> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> > SQL Server MVP
>> >> > Toronto, ON Canada
>> >> > .
>> >> > "Will" <wfj5444@.gmail.com> wrote in message
>> >> > news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
>> >> > Yes it is the first, the table will be corrupted causing an issue for
>> >> > one type of data.
>> >> >
>> >> > When this happens, we have to clean the table and let the app recreate
>> >> > an empty version.
>> >> >
>> >> > Sorry you refer to your former method, which method? The ALTER DB
>> >> > example from above?
>> >> >
>> >> > Tom Moreau wrote:
>> >> >> Is it that just this one table will be "corrupt" or will other tables get
>> >> >> corrupted as well? If it's the former, my previous method will handle it.
>> >> >> If it's the later, I'd be tempted to shut down the middle tier, but
>> >> >> putting
>> >> >> the DB into single user mode (and killing any running connections to that
>> >> >> DB) would do so as well. Check out the BOL for ALTER DATABASE.
>> >> >>
>> >> >> --
>> >> >> Tom
>> >> >>
>> >> >> ----
>> >> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> >> SQL Server MVP
>> >> >> Toronto, ON Canada
>> >> >> .
>> >> >> "Will" <wfj5444@.gmail.com> wrote in message
>> >> >> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
>> >> >> Ah, before I do that let me confirm that you are correct this is an
>> >> >> application issue.
>> >> >> Since this is a boxed application, I do not want to change how it
>> >> >> handles this table.
>> >> >>
>> >> >> Do you see any other ways to work around the problem?
>> >> >>
>> >> >>
>> >> >> Tom Moreau wrote:
>> >> >> > If the table is getting corrupted, then it's possible that the app is
>> >> >> > not
>> >> >> > properly designed. We'd have to know more first. You could start a
>> >> >> > transaction and:
>> >> >> >
>> >> >> > 1) begin a transaction
>> >> >> > 2) do a SELECT on the table with TABLOCKX
>> >> >> > 3) do the backup
>> >> >> > 4) rollback the transaction
>> >> >> >
>> >> >> > --
>> >> >> > Tom
>> >> >> >
>> >> >> > ----
>> >> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> >> > SQL Server MVP
>> >> >> > Toronto, ON Canada
>> >> >> > .
>> >> >> > <wfj5444@.gmail.com> wrote in message
>> >> >> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
>> >> >> > Thanks Tom.
>> >> >> >
>> >> >> > The reason is due to a specific table that gets corrupted if users are
>> >> >> > accessing it during backup.
>> >> >> >
>> >> >> > I can not think of more simple solution than going single user, backing
>> >> >> > it up and then returning to multi user.
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > Tom Moreau wrote:
>> >> >> > > Basically, check out the following in the BOL:
>> >> >> > >
>> >> >> > > ALTER DATABASE
>> >> >> > > BACKUP DATABASE
>> >> >> > > sp_add_job
>> >> >> > > sp_add_jobstep
>> >> >> > >
>> >> >> > > Also, I am curious as to why single-user mode is a requirement.
>> >> >> > >
>> >> >> > > --
>> >> >> > > Tom
>> >> >> > >
>> >> >> > > ----
>> >> >> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> >> > > SQL Server MVP
>> >> >> > > Toronto, ON Canada
>> >> >> > > .
>> >> >> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
>> >> >> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
>> >> >> > > Tom,
>> >> >> > > is there any refrences on your method, in online books or on the web.
>> >> >> > > Thanks
>> >> >> > >
>> >> >> > > "Tom Moreau" wrote:
>> >> >> > >
>> >> >> > > > Why is single-user mode a requirement?
>> >> >> > > >
>> >> >> > > > That said, you can eschew the maintenance plan and just script out
>> >> >> > > > the
>> >> >> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
>> >> >> > > >
>> >> >> > > > --
>> >> >> > > > Tom
>> >> >> > > >
>> >> >> > > > ----
>> >> >> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> >> > > > SQL Server MVP
>> >> >> > > > Toronto, ON Canada
>> >> >> > > > ..
>> >> >> > > > <wfj5444@.gmail.com> wrote in message
>> >> >> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
>> >> >> > > > I am trying to come up with the best solution for the following
>> >> >> > > > issue:
>> >> >> > > >
>> >> >> > > > I have a specific DB that needs to be backed up in single user mode.
>> >> >> > > > I
>> >> >> > > > want to do this with a a Maitenance Plan but I am not sure if that
>> >> >> > > > is
>> >> >> > > > possible or makes sense.
>> >> >> > > >
>> >> >> > > > What are my options? Do I have to backup with a script? I would
>> >> >> > > > like
>> >> >> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
>> >> >> > > >
>> >> >> > > > Thanks for the help.
>> >> >> > > >
>> >> >> > > >
>> >> >
>> >
>|||Well dang. I was hoping that wasn't the case. I was afraid of where
that was headed.
Thanks,
Will
Tibor Karaszi wrote:
> Closing the application in a controlled manner is different from kicking out the users from the
> database. This is a very important difference. Kicking out the users will leave you with same effect
> as just doing a backup. Do what the vendor say and push the vendor for writing a proper application
> that support doing backup the same way as the rest of us do :-).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Will" <wfj5444@.gmail.com> wrote in message
> news:1150914720.910034.267610@.c74g2000cwc.googlegroups.com...
> > That confuses me somewhat because the maker's work around is to close
> > all open instances of this application then back up that one table.
> >
> > Wouldn't going to single user mode achieve the same thing?
> >
> > Tibor Karaszi wrote:
> >> > Tibor - I actually want to make it single user rather than restricted
> >> > user. Would that not solve the issue?
> >>
> >> Not the one I was getting at. If the problem is as I described, the application does several
> >> things
> >> that should be all or nothing, but not transaction protected, so you go in and grab the data
> >> while
> >> this is running, then kicking out users will be no different from just doing a database backup.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >>
> >>
> >> "Will" <wfj5444@.gmail.com> wrote in message
> >> news:1150891303.954334.46680@.y41g2000cwy.googlegroups.com...
> >> > Greg and Tibor
> >> >
> >> > Greg - We have and they know it is an issue. It is only this specific
> >> > table that has the issue.
> >> >
> >> > Tibor - I actually want to make it single user rather than restricted
> >> > user. Would that not solve the issue?
> >> >
> >> > The app does support online backup. This is a bug and something they
> >> > are going to fix.
> >> >
> >> >
> >> >
> >> > Tibor Karaszi wrote:
> >> >> > That kicks out the users and makes the DB available only to admins - only
> >> >> > members of the db_owner, dbcreator, or sysadmin roles.
> >> >>
> >> >> But wouldn't end result be the same as if you just did a backup with the users connected?
> >> >> Here's
> >> >> my
> >> >> reasoning:
> >> >>
> >> >> The app "doesn't support online backup". Now, why is that? Probably because they don't have
> >> >> correct
> >> >> transaction handling. The backup can grab some data for an operation which isn't done yet,
> >> >> just
> >> >> because the developers didn't wrap that operation in a transaction.
> >> >>
> >> >> Now, kicking out the users will do the very same thing. Remember that backup gives us the
> >> >> database
> >> >> as a snapshot in time (I know you know this, Tom...).
> >> >>
> >> >> It sounds like the software vendor has produced and sell an application which doesn't allow
> >> >> you
> >> >> to
> >> >> perform backup of the data. Indeed worrying! I'd have a very serious talk to the app vendor
> >> >> and
> >> >> ask
> >> >> them for the technical reason why a normal backup operation won't do and also ask them in what
> >> >> way
> >> >> kicking out the users would make a difference.
> >> >>
> >> >> --
> >> >> Tibor Karaszi, SQL Server MVP
> >> >> http://www.karaszi.com/sqlserver/default.asp
> >> >> http://www.solidqualitylearning.com/
> >> >>
> >> >>
> >> >> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> >> >> news:uVA8pBMlGHA.1640@.TK2MSFTNGP02.phx.gbl...
> >> >> > Yes, use:
> >> >> >
> >> >> > ALTER DATABASE MyDB
> >> >> > SET RESTRICTED_USER
> >> >> > WITH ROLLBACK IMMEDIATE
> >> >> >
> >> >> > That kicks out the users and makes the DB available only to admins - only
> >> >> > members of the db_owner, dbcreator, or sysadmin roles.
> >> >> >
> >> >> > --
> >> >> > Tom
> >> >> >
> >> >> > ----
> >> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> > SQL Server MVP
> >> >> > Toronto, ON Canada
> >> >> > .
> >> >> > "Will" <wfj5444@.gmail.com> wrote in message
> >> >> > news:1150833647.087347.294880@.u72g2000cwu.googlegroups.com...
> >> >> > Yes it is the first, the table will be corrupted causing an issue for
> >> >> > one type of data.
> >> >> >
> >> >> > When this happens, we have to clean the table and let the app recreate
> >> >> > an empty version.
> >> >> >
> >> >> > Sorry you refer to your former method, which method? The ALTER DB
> >> >> > example from above?
> >> >> >
> >> >> > Tom Moreau wrote:
> >> >> >> Is it that just this one table will be "corrupt" or will other tables get
> >> >> >> corrupted as well? If it's the former, my previous method will handle it.
> >> >> >> If it's the later, I'd be tempted to shut down the middle tier, but
> >> >> >> putting
> >> >> >> the DB into single user mode (and killing any running connections to that
> >> >> >> DB) would do so as well. Check out the BOL for ALTER DATABASE.
> >> >> >>
> >> >> >> --
> >> >> >> Tom
> >> >> >>
> >> >> >> ----
> >> >> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> >> SQL Server MVP
> >> >> >> Toronto, ON Canada
> >> >> >> .
> >> >> >> "Will" <wfj5444@.gmail.com> wrote in message
> >> >> >> news:1150831918.413415.186750@.h76g2000cwa.googlegroups.com...
> >> >> >> Ah, before I do that let me confirm that you are correct this is an
> >> >> >> application issue.
> >> >> >> Since this is a boxed application, I do not want to change how it
> >> >> >> handles this table.
> >> >> >>
> >> >> >> Do you see any other ways to work around the problem?
> >> >> >>
> >> >> >>
> >> >> >> Tom Moreau wrote:
> >> >> >> > If the table is getting corrupted, then it's possible that the app is
> >> >> >> > not
> >> >> >> > properly designed. We'd have to know more first. You could start a
> >> >> >> > transaction and:
> >> >> >> >
> >> >> >> > 1) begin a transaction
> >> >> >> > 2) do a SELECT on the table with TABLOCKX
> >> >> >> > 3) do the backup
> >> >> >> > 4) rollback the transaction
> >> >> >> >
> >> >> >> > --
> >> >> >> > Tom
> >> >> >> >
> >> >> >> > ----
> >> >> >> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> >> > SQL Server MVP
> >> >> >> > Toronto, ON Canada
> >> >> >> > .
> >> >> >> > <wfj5444@.gmail.com> wrote in message
> >> >> >> > news:1150830179.091800.37840@.y41g2000cwy.googlegroups.com...
> >> >> >> > Thanks Tom.
> >> >> >> >
> >> >> >> > The reason is due to a specific table that gets corrupted if users are
> >> >> >> > accessing it during backup.
> >> >> >> >
> >> >> >> > I can not think of more simple solution than going single user, backing
> >> >> >> > it up and then returning to multi user.
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > Tom Moreau wrote:
> >> >> >> > > Basically, check out the following in the BOL:
> >> >> >> > >
> >> >> >> > > ALTER DATABASE
> >> >> >> > > BACKUP DATABASE
> >> >> >> > > sp_add_job
> >> >> >> > > sp_add_jobstep
> >> >> >> > >
> >> >> >> > > Also, I am curious as to why single-user mode is a requirement.
> >> >> >> > >
> >> >> >> > > --
> >> >> >> > > Tom
> >> >> >> > >
> >> >> >> > > ----
> >> >> >> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> >> > > SQL Server MVP
> >> >> >> > > Toronto, ON Canada
> >> >> >> > > .
> >> >> >> > > "SQLboston" <SQLboston@.discussions.microsoft.com> wrote in message
> >> >> >> > > news:BF33532D-DDDF-486F-8586-2E01F1753780@.microsoft.com...
> >> >> >> > > Tom,
> >> >> >> > > is there any refrences on your method, in online books or on the web.
> >> >> >> > > Thanks
> >> >> >> > >
> >> >> >> > > "Tom Moreau" wrote:
> >> >> >> > >
> >> >> >> > > > Why is single-user mode a requirement?
> >> >> >> > > >
> >> >> >> > > > That said, you can eschew the maintenance plan and just script out
> >> >> >> > > > the
> >> >> >> > > > ALTER, BACKUP and ALTER steps in a regular SQL Agent job.
> >> >> >> > > >
> >> >> >> > > > --
> >> >> >> > > > Tom
> >> >> >> > > >
> >> >> >> > > > ----
> >> >> >> > > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> >> >> >> > > > SQL Server MVP
> >> >> >> > > > Toronto, ON Canada
> >> >> >> > > > ..
> >> >> >> > > > <wfj5444@.gmail.com> wrote in message
> >> >> >> > > > news:1150811487.949518.264330@.c74g2000cwc.googlegroups.com...
> >> >> >> > > > I am trying to come up with the best solution for the following
> >> >> >> > > > issue:
> >> >> >> > > >
> >> >> >> > > > I have a specific DB that needs to be backed up in single user mode.
> >> >> >> > > > I
> >> >> >> > > > want to do this with a a Maitenance Plan but I am not sure if that
> >> >> >> > > > is
> >> >> >> > > > possible or makes sense.
> >> >> >> > > >
> >> >> >> > > > What are my options? Do I have to backup with a script? I would
> >> >> >> > > > like
> >> >> >> > > > the Maint. Plan to kick off the ALTER DB script to kick out users.
> >> >> >> > > >
> >> >> >> > > > Thanks for the help.
> >> >> >> > > >
> >> >> >> > > >
> >> >> >
> >> >
> >