Mirrored database in Disconnected/In Recovery state

I am running Microsoft SQL 2008 R2 database server I have a mirrored database that shows in the following state 'databasename (Principal, Disconnected/In Recovery)'. When I look at the mirror server is shows in the same state 'databasename (mirror, Disconnected/In
Recovery)'. I am not able to do anything with either DB, I cannot break the mirror, I can't take it offline, I cannot delete it. This is a Dev Database so if need be I could destroy it and re-create. But I would like to figure out what the issue is and get
it working again in case I was to have this problem in production.
Thanks for any Help!

Hi wstclair,
I’m writing to follow up with you on this post. Was the problem resolved after performing our action plan steps? If you are satisfied with our solution, I’d like to mark this issue as "Answered". Please also feel free to unmark the issue, with any new findings
or concerns you may have.
Thanks,
Sofiya Li
Sofiya Li
TechNet Community Support

Similar Messages

  • Backup of mirrored database is not possible?

    Hi Please correct me,
    backup of mirror database is not possible right?
    Thanks
    Shashikala
    Shashikala

    Hi Shashikala,
    While a database mirroring session is active, the mirror database is in a recovering state and it is not accessible. Thus as Ashwin’s post, backup and restore of the mirror database is not allowed. In addition, you need to note the following things:
    •Backup of the principal database is allowed, but BACKUP LOG WITH NORECOVERY is not allowed.
    •Restoring the principal database is not allowed.
    For more information, you can review this article:
    Database Mirroring and Backup and Restore.
    Thanks,
    Lydia Zhang

  • Background Script if database get disconnect Re open an application

    Dear Sir,
    we prepare a shell script to Re open an application if database get disconnect,
    and the details as showing below:
    *#  -1-to check if we are not connecting to Database Re-open*
    tnsping80 tnsname > c:\test.txt
    FOR /F "skip=6" %%A IN (C:\test.txt) DO IF %%A NEQ OK GOTO reset
    del c:\test.txt
    *#  -2- to check if there is any job waiting on database Re-open*
    sqlplus -s username/password@tnsname @jobWaiting.sql
    FOR /F "skip=3" %%A IN (C:\test.txt) DO IF %%A EQU 1 GOTO reset
    del C:\test.txt
    My problem is when the database get disconnecting after calling statement-1-, statement -2- failed and the background process stop working,
    so how i can catch the error when I'm calling sqlplus -s username/password@tnsname.
    Regards,

    First try to sqlplus -l option to ask sqlplus to exit after first connection failure otherwise sqlplus retries to connect and prompts for new connect string:
    >
    -L[OGON]
    Specifies not to reprompt for username or password if the initial connection does not succeed. This can be useful in operating system scripts that must either succeed or fail and you don't want to be reprompted for connection details if the database server is not running.
    >
    Then on Windows use %errorlevel% to check sqlplus return code. If sqlplus connection fails, errorlevel should be set to a non zero value.

  • Mirror Database shows Recovery state in Database mirroring in sql 2012

    Hi I am working on DBmirroring and have encountered problem of mirror database showing recovery state.
    I tried to resolve issue by removing database mirroring from principal ,removing endpoints from both the nodes and
    finally firing alter database db1 set partner off statement also.But when reconfigure dbmirroring on principal it does not allow
    start dbmirroring and mirror database db1 comes in to recovery state from restoring stage.
    srm_2010

    ok in that case why it is not allowing me to configure db mirroring when I am trying from SSMS.It gives an error.tell me????
    srm_2010
    And what is the error ? If while configuring mirroring it fails for some reason you have to make sure the mirror database which has gone in recovery state needs to be brought in restoring state.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Backup Mirroring Database or Recovering database

    Hi All,
    First, I apologize for posting this in two different palces. I have posted here but no response and I think this is a better place to post.
    SQL Server 2012 - Windows 2008 R2.
    Can you backup a mirroring database (Not the primary database but the one in mirroring partner) when it is in "suspend mirroring" state or "Disconnected" state or any other state ?. The idea is to backup the database on mirroring partner
    before DR (Disaster Recovery) test (before putting the database online) then have the test be done than restore the database from the previous backup to continue with the mirroring without copying the primary database Full-Differential-TRN log backups again
    from primary and establishing the mirroring again. Thanks for any input.

    Can't use Availabilty groups due to the network setup. I am looking for a solution wher I don't have to copy large backup files (Full + Diff + TRN) after the DR test to re-establish the mirroring again.
    Why would you have to take full and log backup again. No need to take diff backup at all. If mirroring fails when you try to configure it fist time try to find out reason why it failed you don't require to restore full backup again.
    Hope I can understand what you are saying
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Second day of "In Recovery" state

    Hello,
    during insert of 100 billion records my HDD gone out of free space, SSMS crashed. After restarting SSMS I saw my database in state "In Recovery". Today is the second day of the recovery. I have no backups. Data file size is about 6GB, log file
    50GB (!). I have now about 30 GB of free space. I don't see anywhere recovery progress. And probably am not sure recovery is active.  All settings (recovery etc.) are default settings for SQL Server Express 2012.. What can I do? I just want not to lose
    my database and go to the state before this large insert.
    Sergey.

    Hello Sergey,
    The following blog explains that "Too many Virtual log files can cause slow database recovery"
    http://blogs.msdn.com/b/saponsqlserver/archive/2012/02/22/too-many-virtual-log-files-vlfs-can-cause-slow-database-recovery.aspx
    To correct the situation and prevent its recurrence:
    Backup the Transaction Log of the database
    Shrink the Transaction Log as much as possible using DBCC SHRINKFILE
    Ideally do this in a maintenance window
    Multiple SHRINKFILE executions might be called for to substantially shrink it
    Expand the Transaction Log back to its target initial size
    Set the Transaction Log growth size to be in units of 1 GB
    Apply the latest CUs for SQL Server 2008 or 2008 R2
    Regards, Don Rohan [MSFT]
    Thanks Don!
    But probably I should do this after recovery completes.
    To the moment it still in progress but I can not check it's status..
    I see in error log file that sometimes the database  starts up again (see log below). What could be a reason? Does recovery start from scratch on each "db starting up"? 
    2014-01-06 16:38:58.77 spid53      Starting up database 'ket'.
    2014-01-06 17:01:51.02 spid53      Database ket has more than 1000 virtual log files which is excessive. Too many virtual log files can cause long startup and backup times. Consider shrinking the log and using a different growth increment to
    reduce the number of virtual log files.
    2014-01-06 17:32:15.59 Server      Server resumed execution after being idle 321 seconds: user activity awakened the server. This is an informational message only. No user action is required.
    2014-01-06 17:32:29.07 spid53      Starting up database 'ket'.
    2014-01-06 17:55:21.99 spid53      Database ket has more than 1000 virtual log files which is excessive. Too many virtual log files can cause long startup and backup times. Consider shrinking the log and using a different growth increment to
    reduce the number of virtual log files.
    Sergey.

  • I made erase for all my settings and contents from 8 hours and still now in recovery state ?what shall i do?, i made erase for all my settings and contents from 8 hours and still now in recovery state ?what shall i do?

    i made erase for all my settings and contents from 8 hours and still now in recovery state ?what shall i do?, i made erase for all my settings and contents from 8 hours and still now in recovery state ?what shall i do?

    we have almost similar problem. i also did restored my iphone5. and it keeps restoring after it finishes. what i did was, i disconnected the phone from iTunes and pressed the home & power button, hold it till the apple logo appears. but i will warn you. after i did this, my phone did worked after, but now im having problem with siri and voice command. both keeps on making calls, playing music even the phone is just inside my bag or not using it. when i use the phone, it keep on going home, enabling siri, going to music wihtout touching anything. such a pain in the neck

  • How to Increase database / log size of mirrored database

    Hi All,
    I have been asked to increase the default database and log size of two databases, both of which are mirrored.
    I have been trying to find out what else I need to do in this case other than the standard resizing.
    Are there extra steps I need to perform as these dbs are mirrored (SQL Mirroring)?
    Farren

    Hi Farren,
    Based on my test, if you choose to expand the mirrored database by increasing the size of an existing data or log file, you can directly execute the ALTER DATABASE statement on the Principal server as Uri’s post, but before that please make sure the mirroring
    status is synchronized. You can check the mirroring configuration and partner status with the following query.
    SELECT DB_NAME(DATABASE_ID) 'DBNAME',mirroring_state,
    mirroring_state_desc,mirroring_role,mirroring_role_desc,
    mirroring_partner_name,mirroring_partner_instance
    FROM sys.database_mirroring
    WHERE mirroring_guid IS NOT NULL
    However, if you choose to expand the mirrored database by adding a new file to the database, you need to perform extra steps as follows.
       1. Check the mirroring configuration and partner status with above query.
       2. Run the below command on the principal server to break the mirror.  
    ALTER DATABASE DatabaseName SET PARTNER OFF
       3. Create your database file on the principal server.
       4. Run a log backup on the principal server.
       5. Restore this log backup on the mirrored server using the NORECOVERY and MOVE options.
       6. Re-establish mirroring between the servers for this database.
    Reference:
    Increase the Size of a Database
    How to add a database file to a mirrored SQL Server database
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • Why db mirror can not set db recovery model to simple?

    Hi ,All
    I have a question . 
    DB replication can set db recovery model to simple ,why db mirror can not  db recovery model to simple.
    DB mirror must be set to full recovery model.
    As far as I know, whatever db mirror  and db replication ,there is a log reader to read the log in the ldf file
    DB mirror and DB replication are almost the same principle to replicate the db to another db server
    Thanks a lots
    Love SQL

    Database mirroring involves redoing every
    insert, update, and delete operation that occurs on the principal database onto the mirror database as quickly as possible. Redoing is accomplished by sending a stream of active transaction log records to the mirror server, which applies log records to the
    mirror database, in sequence, as quickly as possible. Unlike replication, which works at the logical level, database mirroring works at the level of the physical log record.
    There is no log reader agent in case of mirroring its more internal. Mirroring
    uses the transaction log to redo everything at the mirror site.  In simple recovery model, the transaction log is effectively transitory and only enough information is kept in the log for undo/redo to keep the database consistent during
    crash recovery. Thats why mirroring does not work in simple recovery model.

  • DPM is Only Allowing Express Full Backups For a Database Set to Full Recovery Model

    I have just transitioned my SQL backups from a server running SCDPM 2012 SP1 to a different server running 2012 R2.  All backups are working as expected except for one.  The database in question is supposed to be backuped up iwht a daily express
    full and hourly incremental schedule.  Although the database is set to full recovery model, the new DPM server says that recovery points will be created for that database based on the express full backup schedule.  I checked the logs on the old DPM
    server and the transaction log backups were working just fine up until I stopped protection the data source.  The SQL server is 2008 R2 SP2.  Other databases on the same server that are set to full recovery model are working just fine.  If we
    switch the recovery model of a database that isn't protected by DPM and then start the wizard to add it to the protection group it properly sees the difference when we flip the recovery model back and forth.  We also tried switching the recovery model
    on the failing database from full to simple and then back again, but to no avail.  Both the SQL server and the DPM server have been rebooted.  We have successfully set up transaction log backups in a SQL maintenance plan as a test, so we know the
    database is really using the full recovery model.
    Is there anything that someone knows about that can trigger a false positive for recovery model to backup type mismatches?

    I was having this same problem and appear to have found a solution.  I wanted hourly recovery points for all my SQL databases.  I was getting hourly for some but not for others.  The others were only getting a recovery point for the Full Express
    backup.  I noted that some of the databases were in simple recovery mode so I changed them to full recovery mode but that did not solve my problem.  I was still not getting the hourly recovery points.
    I found an article that seemed to indicate that SCDPM did not recognize any change in the recovery model once protection had started.  My database was in simple recovery mode when I added it (auto) to protection so even though I changed it to full recovery
    mode SCDPM continued to treat it as simple. 
    I tested this by 1) verify my db is set to full recovery, 2) back it up and restore it with a new name, 3) allow SCDPM to automatically add it to protection over night, 4) verify the next day I am getting hourly recovery points on the copy of the db. 
    It worked.  The original db was still only getting express full recovery points and the copy was getting hourly.  I suppose that if I don't want to restore a production db with an alternate name I will have to remove the db from protection, verify
    that it is set to full, and then add it back to protection.   I have not tested this yet.
    This is the article I read: 
    Article I read

  • Error: ME is in recovery state (also does not come back from sleep)

    Hi,
    my name is Ifor and I bought a Lenovo X220 (4290-44G) exactly 2 years ago.
    The following happened:
    -I noticed an error while booting. The screen said: ME is in recovery state. After that I noticed my computer won't wake up from sleep after I closed the lid. So I installed a fresh windows 7 ultimate install. All the drivers have been downloaded from Windows Update or the Lenovo site.
    The error still is not fixed, so I updated my BIOS with the newest .iso file from the Lenovo support site. The error still persists!  
    Also, my processor gets really warm and my screen sometimes flicker. I've had no problems or what-so-ever before.
    All I found was this link and I updated my bios already: http://en.community.dell.com/support-forums/laptop/f/3518/t/19456189.aspx
    I would be really grateful if someone could help me.
    Kind regards,
    Ifor

    Same problem with my T420. The Intel(R) Active Management Technology - SOL (COM4) doesn't work either.
    Fresh windows 7 pro installed, latest BIOS from Lenovo, flashed CMOS, installed drivers with Lenovo system update software...

  • Doubt about database point in time recovery using rman

    Hi Everyone,
    I have been practising various rman restore and recovery scenarios . I have a doubt regarding database point in time recovery using rman. Imagine i have a full database backup including controlfile scheduled to run at 10 PM everyday. today is 20th dec 2013. imagine i want to restore the database to a prior point in time ( say 18th dec till 8 AM). so i would restore all the datafiles  from 17th night's backup and apply archives till 8 AM of 18th dec . in this scenario should i restore the controlfile too from 17th dec bkp ( i am assuming yes we should ) or can we use the current controlfile ( assuming it is intact). i found the below from oracle docs.
    Performing Point-in-Time Recovery with a Current Control File
    The database must be closed to perform database point-in-time recovery. If you are recovering to a time, then you should set the time format environment variables before invoking RMAN. The following are sample Globalization Support settings:
    NLS_LANG = american_america.us7ascii
    NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
    To recover the database until a specified time, SCN, or log sequence number:
    After connecting to the target database and, optionally, the recovery catalog database, ensure that the database is mounted. If the database is open, shut it down and then mount it:
    2.  SHUTDOWN IMMEDIATE;
    3.  STARTUP MOUNT;
    4. 
    Determine the time, SCN, or log sequence that should end recovery. For example, if you discover that a user accidentally dropped a tablespace at 9:02 a.m., then you can recover to 9 a.m.--just before the drop occurred. You will lose all changes to the database made after that time.
    You can also examine the alert.log to find the SCN of an event and recover to a prior SCN. Alternatively, you can determine the log sequence number that contains the recovery termination SCN, and then recover through that log. For example, query V$LOG_HISTORY to view the logs that you have archived. 
    RECID      STAMP      THREAD#    SEQUENCE#  FIRST_CHAN FIRST_TIM NEXT_CHANG
             1  344890611          1          1      20037 24-SEP-02      20043
             2  344890615          1          2      20043 24-SEP-02      20045
             3  344890618          1          3      20045 24-SEP-02      20046
    Perform the following operations within a RUN command:
    Set the end recovery time, SCN, or log sequence. If specifying a time, then use the date format specified in the NLS_LANG and NLS_DATE_FORMAT environment variables.
    If automatic channels are not configured, then manually allocate one or more channels.
    Restore and recover the database.
      The following example performs an incomplete recovery until November 15 at 9 a.m. 
    RUN
      SET UNTIL TIME 'Nov 15 2002 09:00:00';
      # SET UNTIL SCN 1000;       # alternatively, specify SCN
      # SET UNTIL SEQUENCE 9923;  # alternatively, specify log sequence number
      RESTORE DATABASE;
      RECOVER DATABASE;
    If recovery was successful, then open the database and reset the online logs:
    5.  ALTER DATABASE OPEN RESETLOGS;
    I did not quiet understand why the above scenario is using current controlfile as the checkpoint scn in the current controlfile and the checkpoint scn in the datafile headers do not match after the restore and recovery. Thanks in Advance for your help.
    Thanks
    satya

    Thanks for the reply ... but what about the checkpoint scn in the controlfile . my understanding is that unless the checkpoint scn in the controlfile and datafiles do not match the database will not open. so assuming the checkpoint scn in my current controlfile is 1500 and i want to recover my database till scn 1200. so the scn in the datafiles (which is 1200) is not not matching with the scn in the controlfile(1500). so will the database open in such cases.
    Thanks
    Satya

  • Exception Message=Unable to connect to the VMM database because the database is in an inconsistent state.

    Hello,
    I have a problem with SCVMM 2012 R2, it always gives error when tries to "Run the dynamic optimizer" process. The process starts automatically every 30mins. When I analyzed report.txt file I found error message:Exception Message=Unable
    to connect to the VMM database because the database is in an inconsistent state.Contact an experienced SQL administrator whenever this error occurs. In some cases, it may be necessary to restore the VMM database. If the problem persists, contact
    Microsoft Help and Support.
    NOTE: If I start the process manually, it completes without any errors.
    Any help would be appreciated

    I'm led to believe this is a bug in UR5 and I think it was a bug in VMM 2012 SP1 RTM.
    Our TAM says this will be fixed in UR6. We had to turn off Dynamic optimizer or we could have rolled back to UR4 but there were other bugs in UR4 which hurt us more.

  • How to turn a database status from "in recovery" to "online"?

    How to turn a database status from "in recovery" to "online"?
    We were trying to turn a datase to offline status using management studio - the operation was closed before it could reach the end.

    Hi Brian,
    Thanks for your feedback;
    I have completed the following actions to solve the issue:
    1. Start SQL Server in single user mode.
    2. Check database status: there i noticed that it was normal
    3. Restart SQL Server in multi-user mode
    4. Check database status: normal
    5. Check my data: ok
    Thank you again
    Lulu01
    You should have wait for an while or atleaset you need to check in the sql errorlog, what phases it is or if any issues persists that shows in the errorlog messages.
    also you would have been used sys.databases, to seewhat's the value for state_desc for your database.
    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

  • RMAN-20001: target database not found in recovery catalog

    I am practicing loss off all control files. I have rman catalog backups which are set to autobackup controlfile. So far I did this.
    RMAN> startup nomount;
    Oracle instance started
    Total System Global Area 209715200 bytes
    Fixed Size 1272864 bytes
    Variable Size 155190240 bytes
    Database Buffers 50331648 bytes
    Redo Buffers 2920448 bytes
    RMAN> restore controlfile from autobackup;
    Starting restore at 08-SEP-10
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    recovery area destination: /u02/flash_recovery
    database name (or database unique name) used for search: TEST
    channel ORA_DISK_1: autobackup found in the recovery area
    channel ORA_DISK_1: autobackup found: /u02/flash_recovery/TEST/autobackup/2009_12_09/o1_mf_s_705171034_5l0kgv4o_.bkp
    channel ORA_DISK_1: control file restore from autobackup complete
    output filename=/u02/control_files/TEST/control02.ctl
    output filename=/u03/oradata/TEST/control03.ctl
    Finished restore at 08-SEP-10
    RMAN> alter database mount;
    database mounted
    released channel: ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of alter db command at 09/08/2010 14:54:50
    RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
    I am assuming this has something to do with DBID but ... I don't have it and I don't know how to find it.

    Hi BelMan,
    Here is output
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    56869 Full 11.20M DISK 00:00:00 08-SEP-10
    BP Key: 56871 Status: AVAILABLE Compressed: NO Tag: TAG20100908T135312
    Piece Name: /u01/oracle/product/10.2.0/db_1/dbs/cf_c-549414289-20100908-00
    Control File Included: Ckp SCN: 125665520 Ckp time: 08-SEP-10
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    56993 Full 11.20M DISK 00:00:00 08-SEP-10
    BP Key: 56995 Status: AVAILABLE Compressed: NO Tag: TAG20100908T142547
    Piece Name: /u01/oracle/product/10.2.0/db_1/dbs/cf_c-549414289-20100908-01
    Control File Included: Ckp SCN: 125668490 Ckp time: 08-SEP-10

Maybe you are looking for

  • How can one optimize Swing

    How come i wrote a simple code extending JPanel as shown belo trying to render a new component but realized the running code was consuming like 88% of the processor time, using windows task manager. Is there a way to help swing eat less memory and pr

  • How to create value base permits ?

    Hi Every one, How to create value base permits For Exapmle If the cost of order is blow 50,000 then this permit will be aproved by person X and when cost of order increases above 50,000 then permit will be aproved by person Y I hope I m clear in my q

  • Exchange rate diffrences for procurement

    Hi Group I am trying to use SAP note 164505 to differentiate my actual PPV and Exchange rate diffrences. I changed my set up but still my entries are not changed at the time of Invoice. As per SAP system will change entries at the time of Invoice and

  • FilterOp.notContains element is missing in the archive.xsd

    <FilterOp>...<enumeration value="notContains"/> is in the stubbing documentation but is missing in the archive.xsd.

  • ITunes won't start / keeps hanging my Mac

    Can someone help me figure out how to get iTunes working again? Tried deleting old library/creating new one per Apple's instructions to no avail. Process: iTunes [3083] Path: /Applications/iTunes.app/Contents/MacOS/iTunes Identifier: com.apple.iTunes