Friday, March 30, 2012
maintenance plan for all databases
I would like to know if its better to create ONE maintenance plan for all
databases or create a maint plan for every database.
Thanks,
Ramu
Ramu,
It depends on whether every database should have the same maintenance plan.
Don't make more plans than you need, that just adds more work for you to set
up and maintain, but don't try to cram everything into a single plan if they
should be treated differently.
I have 3 to 5 maintenance plans per server, depending on the class of
individual databases.
RLF
"Ramu" <Ramu@.discussions.microsoft.com> wrote in message
news:6B7A5A16-CC9C-4B3C-A1DC-19BFF4DD3AAF@.microsoft.com...
> Hi,
> I would like to know if its better to create ONE maintenance plan for all
> databases or create a maint plan for every database.
> Thanks,
> Ramu
>
|||On Aug 9, 10:46 am, Ramu <R...@.discussions.microsoft.com> wrote:
> Hi,
> I would like to know if its better to create ONE maintenance plan for all
> databases or create a maint plan for every database.
> Thanks,
> Ramu
Often times I like to simply separate my base maintenance plans into
one that works on the system tables, while the other works on the user
tables.
sql
maintenance plan for all databases
I would like to know if its better to create ONE maintenance plan for all
databases or create a maint plan for every database.
Thanks,
RamuRamu,
It depends on whether every database should have the same maintenance plan.
Don't make more plans than you need, that just adds more work for you to set
up and maintain, but don't try to cram everything into a single plan if they
should be treated differently.
I have 3 to 5 maintenance plans per server, depending on the class of
individual databases.
RLF
"Ramu" <Ramu@.discussions.microsoft.com> wrote in message
news:6B7A5A16-CC9C-4B3C-A1DC-19BFF4DD3AAF@.microsoft.com...
> Hi,
> I would like to know if its better to create ONE maintenance plan for all
> databases or create a maint plan for every database.
> Thanks,
> Ramu
>|||On Aug 9, 10:46 am, Ramu <R...@.discussions.microsoft.com> wrote:
> Hi,
> I would like to know if its better to create ONE maintenance plan for all
> databases or create a maint plan for every database.
> Thanks,
> Ramu
Often times I like to simply separate my base maintenance plans into
one that works on the system tables, while the other works on the user
tables.|||I do a plan for production (user databases), one for system, and if
needed one for transaction logs. I like to separate them. I don't
think SQL cares but it seems neater to me.
acorcoran wrote:
> On Aug 9, 10:46 am, Ramu <R...@.discussions.microsoft.com> wrote:
>> Hi,
>> I would like to know if its better to create ONE maintenance plan for all
>> databases or create a maint plan for every database.
>> Thanks,
>> Ramu
> Often times I like to simply separate my base maintenance plans into
> one that works on the system tables, while the other works on the user
> tables.
>
maintenance plan for all databases
I would like to know if its better to create ONE maintenance plan for all
databases or create a maint plan for every database.
Thanks,
RamuRamu,
It depends on whether every database should have the same maintenance plan.
Don't make more plans than you need, that just adds more work for you to set
up and maintain, but don't try to cram everything into a single plan if they
should be treated differently.
I have 3 to 5 maintenance plans per server, depending on the class of
individual databases.
RLF
"Ramu" <Ramu@.discussions.microsoft.com> wrote in message
news:6B7A5A16-CC9C-4B3C-A1DC-19BFF4DD3AAF@.microsoft.com...
> Hi,
> I would like to know if its better to create ONE maintenance plan for all
> databases or create a maint plan for every database.
> Thanks,
> Ramu
>|||On Aug 9, 10:46 am, Ramu <R...@.discussions.microsoft.com> wrote:
> Hi,
> I would like to know if its better to create ONE maintenance plan for all
> databases or create a maint plan for every database.
> Thanks,
> Ramu
Often times I like to simply separate my base maintenance plans into
one that works on the system tables, while the other works on the user
tables.|||I do a plan for production (user databases), one for system, and if
needed one for transaction logs. I like to separate them. I don't
think SQL cares but it seems neater to me.
acorcoran wrote:
> On Aug 9, 10:46 am, Ramu <R...@.discussions.microsoft.com> wrote:
> Often times I like to simply separate my base maintenance plans into
> one that works on the system tables, while the other works on the user
> tables.
>
Wednesday, March 21, 2012
maintanence plan fails - Adding job step
it. It is failing when attempting to add the job steps to the agent. I have
performed this on two other dev server without any issues. I verified all
the settings, configurations, protocols, proxies, and logins are configured
the same on all servers.
The other servers taht this is working on do not have any special proxy
settings and I tried to create a new connection and used the "local
connection" settings. None will work.
Here is the tech details from the error it is generating. Any help will be
appreciated.
===================================
Create maintenance plan failed.
===================================
Create failed for JobStep 'Subplan'.
(Microsoft.SqlServer.MaintenancePlanTasks)
For help, click:
http://go.microsoft.com/fwlink?ProdN...p&LinkId=20476
Program Location:
at
Microsoft.SqlServer.Management.DatabaseMaintenance .MaintenancePlanSubPlan.AddAgentJob(ServerConnecti on localConnObj, String proxyName)
at
Microsoft.SqlServer.Management.DatabaseMaintenance .MaintenancePlanSubPlan..ctor(String
subplanName, String proxyAccount, Package package, ServerConnection
localConnObj)
at
Microsoft.SqlServer.Management.DatabaseMaintenance .MaintenancePlan.AddSubPlan(String subplanName, String proxyAccount)
at
Microsoft.SqlServer.Management.MaintenancePlanWiza rd.MaintenancePlanWizardForm.PerformActions()
===================================
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
Program Location:
at
Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String
sqlCommand, ExecutionTypes executionType)
at
Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at
Microsoft.SqlServer.Management.Smo.ExecutionManage r.ExecuteNonQuery(StringCollection queries)
at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.Ex ecuteNonQuery(StringCollection queries, Boolean includeDbContext)
at
Microsoft.SqlServer.Management.Smo.SqlSmoObject.Cr eateImplFinish(StringCollection createQuery, ScriptingOptions so)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.Cr eateImpl()
===================================
The specified '@.subsystem' is invalid (valid values are returned by
sp_enum_sqlagent_subsystems). (.Net SqlClient Data Provider)
For help, click:
http://go.microsoft.com/fwlink?ProdN...4&LinkId=20476
Server Name: TST-TFS2005\TSTTFS2005,1450
Error Number: 14234
Severity: 16
State: 1
Procedure: sp_verify_subsystem
Line Number: 28
Program Location:
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQuer yTds(String
methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at
Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String
sqlCommand, ExecutionTypes executionType)
Stan
This error generally means that SSIS is not installed on the server. This is
required for the new style maintenance plans in SQL2005. Can you confirm
whether Integration Services is installed on the server you are seeing the
error on.
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Stan" <Stan@.discussions.microsoft.com> wrote in message
news:696C7781-51A5-4B4E-9595-9AA307ECA806@.microsoft.com...
>I am trying to create a new maint plan on a dev server and it fails to
>create
> it. It is failing when attempting to add the job steps to the agent. I
> have
> performed this on two other dev server without any issues. I verified all
> the settings, configurations, protocols, proxies, and logins are
> configured
> the same on all servers.
> The other servers taht this is working on do not have any special proxy
> settings and I tried to create a new connection and used the "local
> connection" settings. None will work.
> Here is the tech details from the error it is generating. Any help will
> be
> appreciated.
>
> ===================================
> Create maintenance plan failed.
> ===================================
> Create failed for JobStep 'Subplan'.
> (Microsoft.SqlServer.MaintenancePlanTasks)
> --
> For help, click:
> http://go.microsoft.com/fwlink?ProdN...p&LinkId=20476
> --
> Program Location:
> at
> Microsoft.SqlServer.Management.DatabaseMaintenance .MaintenancePlanSubPlan.AddAgentJob(ServerConnecti on
> localConnObj, String proxyName)
> at
> Microsoft.SqlServer.Management.DatabaseMaintenance .MaintenancePlanSubPlan..ctor(String
> subplanName, String proxyAccount, Package package, ServerConnection
> localConnObj)
> at
> Microsoft.SqlServer.Management.DatabaseMaintenance .MaintenancePlan.AddSubPlan(String
> subplanName, String proxyAccount)
> at
> Microsoft.SqlServer.Management.MaintenancePlanWiza rd.MaintenancePlanWizardForm.PerformActions()
> ===================================
> An exception occurred while executing a Transact-SQL statement or batch.
> (Microsoft.SqlServer.ConnectionInfo)
> --
> Program Location:
> at
> Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String
> sqlCommand, ExecutionTypes executionType)
> at
> Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(StringCollection
> sqlCommands, ExecutionTypes executionType)
> at
> Microsoft.SqlServer.Management.Smo.ExecutionManage r.ExecuteNonQuery(StringCollection
> queries)
> at
> Microsoft.SqlServer.Management.Smo.SqlSmoObject.Ex ecuteNonQuery(StringCollection
> queries, Boolean includeDbContext)
> at
> Microsoft.SqlServer.Management.Smo.SqlSmoObject.Cr eateImplFinish(StringCollection
> createQuery, ScriptingOptions so)
> at Microsoft.SqlServer.Management.Smo.SqlSmoObject.Cr eateImpl()
> ===================================
> The specified '@.subsystem' is invalid (valid values are returned by
> sp_enum_sqlagent_subsystems). (.Net SqlClient Data Provider)
> --
> For help, click:
> http://go.microsoft.com/fwlink?ProdN...4&LinkId=20476
> --
> Server Name: TST-TFS2005\TSTTFS2005,1450
> Error Number: 14234
> Severity: 16
> State: 1
> Procedure: sp_verify_subsystem
> Line Number: 28
>
> --
> Program Location:
> at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception,
> Boolean breakConnection)
> at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
> exception, Boolean breakConnection)
> at
> System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
> stateObj)
> at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
> SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
> bulkCopyHandler, TdsParserStateObject stateObj)
> at System.Data.SqlClient.SqlCommand.RunExecuteNonQuer yTds(String
> methodName, Boolean async)
> at
> System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult
> result, String methodName, Boolean sendToPipe)
> at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> at
> Microsoft.SqlServer.Management.Common.ServerConnec tion.ExecuteNonQuery(String
> sqlCommand, ExecutionTypes executionType)
>
> --
> Stan
Monday, March 12, 2012
Maint. plans
databases in a server, I created the backup device first and checked to
see that there is enough space on that drive to hold the backups and the
tran log dumps. the job is failing the optimization is failing too. In
the plan log it indicates that the server must be in single user mode to
complete the backup of the tran log. The backup of the main databases
does not happen until sun morning so I do not know if this is going to
fail as well. The funny thing is if I try to backup the db from EM it
works. This is the error message I get from the job history:
Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE
42000] (Error 22029). The step failed.
Can anyone help?
*** Sent via Developersdex http://www.examnotes.net ***Bill,
Having the option in the maint plan to "Attempt to repair any minor
problems." will require the database to be in single user mode. Might look
to see if that option is selected for the maint plan.
HTH
Jerry
"Bill Orova" <nospam@.devdex.com> wrote in message
news:uWnAePtvFHA.3256@.TK2MSFTNGP09.phx.gbl...
> I have created a maintenance plan to do the backup for a set of
> databases in a server, I created the backup device first and checked to
> see that there is enough space on that drive to hold the backups and the
> tran log dumps. the job is failing the optimization is failing too. In
> the plan log it indicates that the server must be in single user mode to
> complete the backup of the tran log. The backup of the main databases
> does not happen until sun morning so I do not know if this is going to
> fail as well. The funny thing is if I try to backup the db from EM it
> works. This is the error message I get from the job history:
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE
> 42000] (Error 22029). The step failed.
> Can anyone help?
>
> *** Sent via Developersdex http://www.examnotes.net ***|||
Jerry Spivey,
Thank you very much that was the problem
Bill Orova
*** Sent via Developersdex http://www.examnotes.net ***|||Maintenance plans are a blessing and a curse. Depending on what options you
check they try to do too much.
If you just want to backup your databases you can back them up directly to a
file.
BACKUP DATABASE foo TO DISK = 'c:\foo.bak' WITH INIT
You don't even need to create a backup device first!
If you want to perform database maintenance I would suggest that you look
into DBCC commands and run them separately.
You can schedule your backups and your DBCC statements via jobs within the
SQL Server Agent node of Enterprise Manager.
Keith
"Bill Orova" <nospam@.devdex.com> wrote in message
news:uWnAePtvFHA.3256@.TK2MSFTNGP09.phx.gbl...
> I have created a maintenance plan to do the backup for a set of
> databases in a server, I created the backup device first and checked to
> see that there is enough space on that drive to hold the backups and the
> tran log dumps. the job is failing the optimization is failing too. In
> the plan log it indicates that the server must be in single user mode to
> complete the backup of the tran log. The backup of the main databases
> does not happen until sun morning so I do not know if this is going to
> fail as well. The funny thing is if I try to backup the db from EM it
> works. This is the error message I get from the job history:
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE
> 42000] (Error 22029). The step failed.
> Can anyone help?
>
> *** Sent via Developersdex http://www.examnotes.net ***
Maint. Plan Help
As I recall (and it has been a while), one of the things that the maintenance plan will try to set up is an index reorg and (possibly) space reclamation. You don't want to touch either of these with your database. At least, I don't think you do. I would probably skip the maintenance plan wizard altogether and set up backup jobs to make sure your database is being backed up.
When I did this, I had to set up 5 backup devices (named FULL, 0600, 1200, 1800 and 0000). I then scheduled the full backup to write to the FULL backup device and four transaction log backups to write to the other four devices (at midnight, 6:00am, noon and 6:00pm). The backups would overwrite the files (so another process would have to copy the backup files to a remote location).
SQL 6.5. Ugh. It's the reason I drink so much now.
Regards,
hmscott
maint. plan fails but doenst report error
I have this maint. plan where each and every step has been failing the last couple of days. The problem is, it doesn't write anything to the error logs. It only reports to the application log that each step of the plan has failed.
I suspect this might be a user rights problem, but it's difficult for me to say. What kind of rights are necessary for writing to the error logs?
In general, what rights are necessary for the user that runs the SQL Server Agent? And has anybody else experienced something similar?
MNJThis is mostly about scheduling a DTS package as a job. However, the security aspect of it should pertain to your situation as well.
Go Here: http://support.microsoft.com/default.aspx?scid=kb;en-us;269074 (Microsoft Knowledge Base Article 269074)
maint. plan failes
Hi
I have been running a maintenance plan on SQL'05 developer for a while. After installing SP1 for MS Small Businness Accounting == SBAV1UPD, the maint. plan will not run. SBA uses SQL2K RT. The SP broke Outlook as well.
The error that I'm getting is that 'execution failed' with an advise to check the log, no error appears in the logs.
Is this a known bug? is there a fix / workaround?
David L.
David,
This is the first I'm hearing of this problem. If you have a support contract with us I recommend you contact Microsoft Support. You can find information on contacting MS Support @. http://www.microsoft.com/services/microsoftservices/srv_support.mspx.
Otherwise, you can try uninstalling reinstalling SQL2K5 - I know that's not a great option but I have no idea what the interaction is between SBA SP1 and SQL2K5. It sounds like something was unregistered. The other thing you could try is installing SQL2K5 SP1.
Good luck.
Dan
|||Hi Dan
Installing SQL'05 SP1 did not clear the issue, however, deleting the maint. plan and then re-creating the plan cleared it up.
Odd
Thanks .. David L.
Maint. plan data optimization on system DBs
Does it really make sense to run maint. plan data optimization jobs on
SQL Server 2K system DBs (master,msdb)? If yes, why? Isn't it risky
(e.g. when rebuilding an index fails in the middle of the process)?
Many thanks,
Pablo
No it doesn't - unless you're storing user data in them. You cannot rebuild
the indexes of the critical system tables (sysindexes, syscolumns,
sysobjects) anyway.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.cc> wrote in message
news:udEsTKpPEHA.308@.TK2MSFTNGP11.phx.gbl...
> Hello,
> Does it really make sense to run maint. plan data optimization jobs on
> SQL Server 2K system DBs (master,msdb)? If yes, why? Isn't it risky
> (e.g. when rebuilding an index fails in the middle of the process)?
> --
> Many thanks,
> Pablo
Maint. plan data optimization on system DBs
Does it really make sense to run maint. plan data optimization jobs on
SQL Server 2K system DBs (master,msdb)? If yes, why? Isn't it risky
(e.g. when rebuilding an index fails in the middle of the process)?
--
Many thanks,
PabloNo it doesn't - unless you're storing user data in them. You cannot rebuild
the indexes of the critical system tables (sysindexes, syscolumns,
sysobjects) anyway.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.cc> wrote in message
news:udEsTKpPEHA.308@.TK2MSFTNGP11.phx.gbl...
> Hello,
> Does it really make sense to run maint. plan data optimization jobs on
> SQL Server 2K system DBs (master,msdb)? If yes, why? Isn't it risky
> (e.g. when rebuilding an index fails in the middle of the process)?
> --
> Many thanks,
> Pablo
Maint. plan data optimization on system DBs
Does it really make sense to run maint. plan data optimization jobs on
SQL Server 2K system DBs (master,msdb)? If yes, why? Isn't it risky
(e.g. when rebuilding an index fails in the middle of the process)?
Many thanks,
PabloNo it doesn't - unless you're storing user data in them. You cannot rebuild
the indexes of the critical system tables (sysindexes, syscolumns,
sysobjects) anyway.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"msnews.microsoft.com" <pablo@.this_isnt_my_mail.cc> wrote in message
news:udEsTKpPEHA.308@.TK2MSFTNGP11.phx.gbl...
> Hello,
> Does it really make sense to run maint. plan data optimization jobs on
> SQL Server 2K system DBs (master,msdb)? If yes, why? Isn't it risky
> (e.g. when rebuilding an index fails in the middle of the process)?
> --
> Many thanks,
> Pablo
Maint. Plan Backups and Single User Mode
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.
> >> >> >> > > >
> >> >> >> > > >
> >> >> >
> >> >
> >