Hi, i have a vb.net here i have 2 timers. one look every night at 2 o'clock pm and make a backup of my sql server express database to drive c:
In the Program runs at this moment some other action and another timer that checks different things and write this to the sql database .
are the some things that i have to pay attention when i make the backup ?
Or is it equal when i make a backup and at the same time i write data ?
SQL Server is perfectly capable of taking a backup while other operations are happening. Just remember that this could have impact on performance if your hardware is not properly sized.
WesleyB
Visit my SQL Server weblog @. http://dis4ea.blogspot.com
|||Inaddition to what Wesley had said, always schedule the backup in off production hours so that the load will be less and it would'nt cause a performance bottleneck|||
though, sql server is capable of taking backup online... what i feel is its always better to take the backup after all the major activities are completed. You schedule the backup after the Program does the database activities. And also check the backup plan u need. If fullbackup is taking lot of time , take differential backup daily and weekly full backup. And also do not keep the backup and original database in the same location (c:\ which u have mentioned).
Madhu
|||Okay thank you for your reply.
but somethimes i got the following error
************** Ausnahmetext **************
System.ArgumentOutOfRangeException: no negative number necessarily (Nicht negative Zahl erforderlich.)
Parametername: count
bei System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
bei System.Data.SqlClient.TdsParserStateObject.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
bei System.Data.SqlClient.TdsParserStateObject.ReadString(Int32 length)
bei System.Data.SqlClient.TdsParser.ProcessError(Byte token, TdsParserStateObject stateObj)
bei System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
bei System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
bei System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
bei System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
This happens sometimes when i execute the following command
BACKUP DATABASE MYDBA TO DISK="c:\test.bak' WITH INIT,NOSKIP
and with this i execute it
Try
Dim cmdSQLServer As New SqlCommand
With cmdSQLServer
.CommandTimeout = 0
.CommandText = sSQLCommand
.CommandType = CommandType.Text
.Connection = g_Connection
intRowsAffected = .ExecuteNonQuery
End With
cmdSQLServer.Dispose()
Catch sqldbe As SqlException
End Try
|||Did you see that you are using double quotes before the path ? The path should be enclosed in single quotes. You could also try the SMO namespace which enabled you to administer your SQL Server in a object-oriented way.
Jens K. Suessmeyer
http://www.sqlserver2005.de
No comments:
Post a Comment