Backup and insert

  • backup and insertion process is doing same time. some times backup process is getting error when insertion is doing

  • How are you doing the backup? What's the 'insertion process' actually doing? What's the error that you're getting?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • i have one backup application. Backup is doing with query. Somebody is doing to insert record to database via another application. I think error is related to based on conflict

  • You're going to have to give us more than that it you want help. The exact error would be a start. What the "Backup is doing with query." really is would also be rather useful.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • When you say backup, do you mean that you have a script that looks similar to this:

    BACKUP DATABASE mydatabasename TO DISK = '\\someserver\someshare\mydatbasename.bak'

    Or are you doing something else entirely?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I am using this query. My question is that when i run this query, some body try to insert/edit/update record the exception occured in application. Can you please tell the suggestion to override the exception

  • vasaya (12/21/2009)


    I am using this query.

    Which query, the one that Grant gave as sample? Give your query for better understanding.

    My question is that when i run this query, some body try to insert/edit/update record the exception occured in application. Can you please tell the suggestion to override the exception

    You have not yet given the exact error you seem to get.

    It sounds like some trigger is enabled on a backup event. Not possible to say thats definite, unless some sort of error message is known. These guesses are like shots in the dark..


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • QUERY-BACKUP DATABASE DB NAME TO DISK = 'BACKUP DRIVE' WITH NOFORMAT, NOINIT, NAME = N'DB NAME-Full Database Backup',SKIP, NOREWIND, NOUNLOAD, STATS = 10

    If i am trying to insert query directly from query analyzer, i will not get any error.

    Inserting record to database from another application. Error occurs when using application. one time one error is showing another time another error, even i can't trace the exact error

  • What are the errors that you're getting? It is not possible to help you resolve errors if we don't know what they are.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You have to give us some details on this. It's very normal to take a database backup while inserts are occurring without getting a single error. If you're getting one, you're in an abnormal situation. But we need the error message or we can't possibly help you. Just remember, we can't see what you're seeing.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Two simple options:

    1: use sp_who, and kill to kill processes that block your backup

    The database will halt the processing of anything you kill.

    2: perform backup in single user mode: EXEC sp_dboption 'dbname', 'single user', 'true'

    The database will only be available to you until you:

    sp_dboption 'dbname', 'single user', 'false'

  • freeman.e.l (12/23/2009)


    Two simple options:

    1: use sp_who, and kill to kill processes that block your backup

    The database will halt the processing of anything you kill.

    2: perform backup in single user mode: EXEC sp_dboption 'dbname', 'single user', 'true'

    The database will only be available to you until you:

    sp_dboption 'dbname', 'single user', 'false'

    I don't think backing up in single user mode is a wise option. Not sure if his database is Live 24x7:w00t:.

    Vasaya..try to find the T-SQL of the insert query using below code.

    SELECT sqltext.TEXT,

    req.session_id,

    req.status,

    req.command,

    req.cpu_time,

    req.total_elapsed_time

    FROM sys.dm_exec_requests req

    CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext

    While running above query if you find any query which is running for long time it can be killed using following command.

    KILL [session_id]

    Make sure you are not killing any valid production session, therefore I would suggest you to do thorough investigation of what's being killed and what it is doing in the first place..

    Hope this helps..:cool:

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply