Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Location
    Brazil
    Posts
    59

    Unanswered: Integrity job error

    Hi folks,

    I created a job to check the integrity of my databases every week using SQL Server Maintenance Plan Wizard.
    The job is failing every time...
    For tb_basico database it works fine, but with the other one (tb_cep) it doesn't work...

    Does someone have an idea to solve this problem?

    The message is:

    [1] Database tb_basico: Check Data and Index Linkage...

    ** Execution Time: 0 hrs, 0 mins, 11 secs **

    [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft][ODBC SQL Server Driver][SQL Server]Database state cannot be changed while other users are using the database 'tb_cep'
    [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE statement failed.
    [Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption command failed.
    [2] Database tb_cep: Check Data and Index Linkage...
    [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not processed. Database needs to be in single user mode.

    The following errors were found:

    [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not processed. Database needs to be in single user mode.
    ** Execution Time: 0 hrs, 0 mins, 1 secs **
    Nadia

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The problem is that other users are in the database while you are attempting to run the job created by the wizard. The wizard created job needs exclusive use of the database to complete the tasks you've asked it to do.

    If you want to continue to run the wizard task, then I'd do an ALTER DATABASE mydb SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE, then run the job created by the wizard. After the job completes, you can ALTER DATABASE mydb SET MULTI_USER to allow the users back into the database.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •