How to recover database from .mdf file

create a database of
equal size to the one you're trying to attach
shutdown the server (Stop)
swap in the old mdf file (replace new .mdf file with .mdf file to be recovered )
Location: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA
bring up the server (start) and let the database attempt to be recovered and then go into suspect mode
put the database into emergency mode with ALTER DATABASE
run DBCC CHECKDB (dbname, REPAIR_ALLOW_DATA_LOSS) which will rebuild the log and run full repair
Your database will be available again but you'll have lost data and the data won't be transactionally consistent
USE [master]
GO
ALTER DATABASE [RdmStoreInformation] SET EMERGENCY
GO
ALTER DATABASE [RdmStoreInformation] SET SINGLE_USER
GO
DBCC CHECKDB ([RdmStoreInformation], REPAIR_ALLOW_DATA_LOSS)
GO
ALTER DATABASE [RdmStoreInformation] SET MULTI_USER
GO
ALTER DATABASE [RdmStoreInformation] SET ONLINE
GO
This is a issue I had to fix and it's solution listed here for your reference(I gathered all the In-formations by surfing web)

Interesting, did you get any errors trying to attach the .mdf file?
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • How to create database from .sql file

    how to create database from .sql file..?? i put the sintax query in a sql file.. and i want to call it in java code..
    ho to do it..??

    why do you want to do this from java?
    i just don't see the point.
    find your dba and have him/her run it for you

  • How to recover deleted attached mdf file from sql server management studio

    Hi everyone
    I've faced very bad problem
    I had a mdf file that created in visual studio, and then I had attached this file to sql server management studio and after that, when I wanted to deattach
    this file I had a big mistake; and deleted the mdf file; then now this file was deleted from my computer
    I test several recovery tools but they can't find deleted mdf file; the volume of the mdf file was more than 2 GB.
    Please help me if you can

    Hello,
    If you don't have a backup of the database, then it's not really possible to get it back. There are some "Undelete" Tools available for Windows, but when even only one page was overwritten on disk, then it's not possible to recover it.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to Recover database from old backup and full archive log file

    Hi Oracle expert!
    I met problem when restore my oracle database.
    In my case:
    - My database version: 10.2.0.2
    - I have a database full backup (01-Nov)
    - I have all Archived log file from (01-Nov -> 05-Nov)
    - My database drop in 05-Nov with disk error (no datafile, no redo..).
    - I have no any RMAN backup from (01-Nov -> 05-Nov)
    How can i restore my database to 05-Nov?
    Thanks

    user10280724 wrote:
    Hi Chinar.
    When i used RMAN flow as your step, but i met the problem!
    - After recover database i select sequence#, applied from v$archived_log;
    --> it apply newest archived log that i had.
    - but when I select Data from table created between 01-Nov to 05-Nov, it not found!
    Not the same way the step:
    SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL?
    It apply newest the same archived log i had table created between 01-Nov to 05-Nov.
    How can i do with RMAN to recover my table?That is not possible,if your all available archive logs applied using rman or through sqlplus(recover database using backup controlfile until cancel) and one of these logs contain your table then there are not any problems.So there are not any difference between recovery using rman and user managed(using sqlplus),but there main matter is applying all archive logs.So first check through rman list copy of archivelog all or list backup of archivelog all and identify there in rman repository is any information or not about these logs.

  • How to recover database without archive files

    Hello,
    I've a test database without archive files and I need to know how to recover it without using archive files.
    What is SQL command to recover database wthout archives?
    Thanks in advance for your help.
    Regards,
    Carles

    There are serveral information missing in this posting and as a support personnel, I would like to find out more when I see postings like this.
    1. This person wants to "Test" his backup and recovery in NOARCHIVELOG mode.
    2. He/She did not say his database had already crashed or had a problem.
    3. He/She did not give any indication the kind of scenario he wants to recover from.
    4. He/She did not mention the state of his database at the time of he posting.
    5. He/She did not mention the Release of his Oracle Server or Platform.
    6. He/She did not mention the type of backup he already has in place (although provided later as Full COLD Backup). How "genuine" is the back?
    7. What actions has already been taken to attempt recovery.
    In my support experience, I normally would go through a list of questions witht he use/client to get the full picture of the current status of the database before I give answers that would worsen situations, especially in a Disaster Recovery sitaution.
    Personaly, I would suggest you have a look at the list above. One of the most important is number 3 (The Recovery Scenario), then number 4, number 6 and 7. Number 7 will determine the situation of your database. So, when you ask for SQL commands to use, there are different commands for different kind of recovery depending on what has gone wrong or what kind of file is damaged (Datafiles, Logfiles, Control Files, one tablespace, one table, entire database gone, etc).

  • How to recover data from .bkf files made when os was XP Proffesional into the system when it is windows7

    Hello Sir/Madam,
    Previously I was using Microsoft Wndows XP Professional,with version: 5.1.2600 Service Pack 3 Build 2600.
    I took .bkf files by using the Backup utility (i.e. Start -> All Programs -> Accessories -> System Tools and then click Backup)
    And paste it to my external hard disk.
    Then I used OS :Microsoft Windows 7 Professional(Version 6.1.7600 Build 7600).I formated my system deleted all the partitions and created new partions and installed Windows 7.
    Now I have the .bfk files in my external hard disk and I want to recover my data from that .bfk files made from xp-sp3 pc to windows 7.
    Plz help me.....
    I downloaded Windows NT Backup - Restore Utility and tried to install NtBackupRestore_x86.msi .But it will not installed in Windows 7 with a message that this requires Removable Storage Management. Since RSM is not included in Windows 7 how does
    one access old Backups from Windows XP?
    Will the NtBackupRestore program be updated to be compatible with Windows 7? plz help................................

    Yes, you need to first install Removable Storage Management software before installing NT-Backup.exe in Windows 7. To know more about restoring backup file, you can read this post: http://belanalavade.blog.com/2014/04/15/how-to-repair-damaged-bkf-file/
    Berdooook
    No.  You do not need to install Removable Storage Management in Windows 7 to read NT backups!
    You go to http://support.microsoft.com/kb/974674 and download the package for Windows 7 that Microsoft has published specifically for this!
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • How to recover database using dbf file

    Hi all,
    My oracle database gets crash. But i have all the dbf file . But there is no controlfile,redo log file and pfile . So i have to create a database that will contain these existing dbf file.
    Can anyone tell what are the steps i have to follow ?
    Regards

    Does the datafiles comes from a cold backup or was database closed when disk crashed ?
    Well, what's your OS ?
    You need to write a new init.ora file, create the dba service if your under windows, and recreate the database with the command line, that will create controlfile and redolog.
    Nicolas.
    Argh, this is a Re: Lost database, and you already get answer into the other. Spending time here.
    Message was edited by:
    N. Gasparotto

  • How to load images from css file in JavaFX 8

    I have this css file which loads images in JavaFX 8 application:
    #pill-left {
        -fx-padding: 5;
         -fx-border-image-source: url("/com/dx57dc/images/left-btn.png");
        -fx-border-image-slice: 4 4 4 4 fill;
        -fx-border-image-width: 4 4 4 4;
        -fx-border-image-insets: 0;
        -fx-border-image-repeat: stretch;
         -fx-background-color: null !important;
    #pill-left:selected { -fx-border-image-source: url("/com/dx57dc/images/left-btn-selected.png"); }
    #pill-left .label {
        -fx-text-fill: #d3d3d3;
        -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.75) , 0, 0.0 , 0 , -1 );
    #pill-left:selected .label {
        /* -fx-text-fill: black; */
        -fx-text-fill: white;
        -fx-effect: dropshadow( one-pass-box , white , 0, 0.0 , 0 , 1 );
    #pill-center {
        -fx-padding: 5;
         -fx-border-image-source: url("/com/dx57dc/images/center-btn.png");
        -fx-border-image-slice: 4 4 4 4 fill;
        -fx-border-image-width: 4 4 4 4;
        -fx-border-image-insets: 0;
        -fx-border-image-repeat: stretch;
         -fx-background-color: null !important;
    #pill-center:selected { -fx-border-image-source: url("/com/dx57dc/images/center-btn-selected.png"); }
    #pill-center .label {
        -fx-text-fill: #d3d3d3;
         -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.75) , 0, 0.0 , 0 , -1 );
    #pill-center:selected .label {
        -fx-text-fill: black;
        -fx-effect: dropshadow( one-pass-box , white , 0, 0.0 , 0 , 1 );
    #pill-right {
        -fx-padding: 5;
        -fx-border-image-source: url("/com/dx57dc/images/right-btn.png");
        -fx-border-image-slice: 4 4 4 4 fill;
        -fx-border-image-width: 4 4 4 4;
        -fx-border-image-insets: 0;
         -fx-border-image-repeat: stretch;
        -fx-background-color: null !important;
    #pill-right:selected { -fx-border-image-source: url("/com/dx57dc/images/right-btn-selected.png"); }
    #pill-right .label {
         -fx-text-fill: #d3d3d3;
        -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.75) , 0, 0.0 , 0 , -1 );
    #pill-right:selected .label {
        -fx-text-fill: black;
        -fx-effect: dropshadow( one-pass-box , white , 0, 0.0 , 0 , 1 );
    The images are located at the Java package com.dx57dc.images
    In Java 7_25 this code works as expected but in JavaFX 8 b99 I get this error:
    ava.lang.NullPointerException
    at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:1129)
    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:1598)
    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1520)
    at com.sun.javafx.sg.prism.NGGroup.renderChildren(NGGroup.java:233)
    at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:199)
    at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:1249)
    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:1598)
    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1520)
    at com.sun.javafx.sg.prism.NGGroup.renderChildren(NGGroup.java:233)
    at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:199)
    at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:1249)
    at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:1598)
    at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1520)
    at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:99)
    at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(AbstractPainter.java:210)
    at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:95)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:129)
    at java.lang.Thread.run(Thread.java:724)
    D3D Vram Pool: 13,331,480 used (5.0%), 13,331,480 managed (5.0%), 268,435,456 total
    20 total resources being managed
    4 permanent resources (20.0%)
    1 resources locked (5.0%)
    7 resources contain interesting data (35.0%)
    0 resources disappeared (0.0%)
    D3D Vram Pool: 13,331,480 used (5.0%), 13,331,480 managed (5.0%), 268,435,456 total
    20 total resources being managed
    4 permanent resources (20.0%)
    1 resources locked (5.0%)
    7 resources contain interesting data (35.0%)
    0 resources disappeared (0.0%)
    D3D Vram Pool: 13,331,480 used (5.0%), 13,331,480 managed (5.0%), 268,435,456 total
    20 total resources being managed
    4 permanent resources (20.0%)
    1 resources locked (5.0%)
    7 resources contain interesting data (35.0%)
    0 resources disappeared (0.0%)
    What is the proper way to load images from css in Java 8?
    Ref
    How to load images from css file in JavaFX 8 - Stack Overflow

    There is nothing special to do - you execute the statement from your program just like any other SQL statement.  The only thing to be aware of are the privilege/permission issues:
    When loading from a file on a client computer:
    READ CLIENT FILE privilege is also required for the database user.
    Read privileges are required on the directory being read from.
    The allow_read_client_file database option must be enabled.
    The read_client_file secure feature must be enabled.
    Revoking these privileges is also the only way you can prevent a user from executing the statement.

  • How to recover photos from a usb key to put on ipad

    how to recover photos from a usb key to put on ipad

    What do you mean 'how to recover' ? If you want to copy the photos from the USB drive to your iPad then you can try using the camera connection kit, but a lot of USB drives require more power than is supplied to the kit and the photos need to be in a particular format : you need to create a DCIM directory off the root of the drive with the photos underneath it, and the photo filenames need to be exactly 8 characters long (no spaces) plus the file extension i.e. in a similar format as if a camera had created/written them

  • How to recover photos from device that screen doesnt work, and didn't use cloud or a memory card. (chip)

    How to recover photos from device that screen doesnt work, and didn't use cloud or a memory card. (chip)

        I'm sorry to hear you no longer have access to your pictures ItzKB11. I know they're important, we'll do everything we can to help. However, since you did not back them up to any source and the screen does not work, we only have a couple options. Try using the USB cable to tranfer to PC:
    From the Device to a Computer
      • Launch Windows Explorer.
    Using the computer keyboard, press Windows E (  E) keys.
    Alternatively, right-click Start then click Explore.
      • Using Windows Explorer, navigate to:
      • SCH-I545 > Phone
      • Utilize the computer to copy video/picture files from the following folders into the desired folder(s) on the computer's hard drive:
      • DCIM
      • Download
      • Movies
      • Pictures
      • Disconnect the USB cable from the computer.
    If you're unable to retrieve them that way, use this http://vz.to/1zyIQwo.
    AdaS_VZW
    Follow us on Twitter at @VZWSupport 

  • How to insert data from *.dmp file to  oracle 11g using Oracle SQL Develope

    hi
    i backup my database using PL/SQL developer and made *.dmp file
    how to insert data from *.dmp file to oracle 11g using Oracle SQL Developer 2.1.1.64
    and how to make *.dmp file from sql*plus ?
    thanks in advance

    Pl/Sql developer has a config window, there you choose the exec to do the import/export.
    Find it and his home version, it may be exp or expdp, the home version is the version of the client where the exp executable is.
    Then use the same version of imp or impdp to execute the import, you do not need to use Oracle SQL Developer 2.1.1.64. If you want to use it, you must have the same version in the oracle home that exp/imp of sql developer use.

  • Building Database from .dbf files

    Hello All,
    I had to reinstall oracle software. But I have all the data\control\log files from previous installation.
    So my question is, Can I rebuild my database from those files? If so, how?
    All the installation directories are same as before. I don't know if this helps but just wanted to provide as much info as possible.
    Thanks,
    Satish

    All your tablespace, user, grants, etc. information is stored within the system datafile, so if you install the Oracle server, then manually recreate the directory structure from your previous database (for example on NT, you'd create d:\oracle\oradata\your_sid\*.dbf
    d:\oracle\admin\your_sid\pfile | bdump | etc...) then put the datafiles in the location where the control files says they should be, and your pfile points to the correct control files then it will be OK.
    Your pfile will contain the location(s) of your control files. When you nomount the database, the instance will start and the pfile will find the location/locate the control file (this is why you recreate the control file in nomount mode); then when you mount the database, the control files are actually opened and read so the instance can locate the datafiles, identify the tablespaces, etc (this is why you have to put the control files in the location(s) specified in the pfile and datafiles, etc. back in the location specified in the control file). Then opening the database just basically validates everything and opens for use. As long as you don't specify SIZE or REUSE for the datafiles in the control file, and comment out everything after the CHARACTER SET listed in the control file and you still have the datafiles that contain data, you won't need anything like an import. You may need media recovery of some sort or experiment with incomplete recovery (if files are available) and open with resetlogs; but normally if you have an OracleService and you have a pfile, control files, and datafiles, everything will be there (user info and all is stored in the system datafile).
    Hope this helps answer some of your questions. Anyway - you can try it and if it fails, you can always start over as long as you have a backup copy of your datafiles and controlfiles and pfile.
    Gridahsir

  • How to recover vm host os file system (e.g / ,/boot )

    how to recover vm host os file system (e.g / ,/boot ) from the destroy os ,at the same time ,it dosen't impact other image

    Anybody knows if the source code of scadm tool is available somewhere ? (opensolaris etc. ?)
    I don't have any additional advice to offer other than asking that you to try the flash-update all over again,
    one more time, as if it were the beginning again.Yes but how because the SC is not discovered anymore by Solaris :
    "rmclomv: WARNING: DP_GET_SDP_VERSION failed, ret=4"
    "The SC hardware could not be initialized."
    Can you try to flash the mainalomfw ? Your log contained only the flash of the alombootfw !
    /usr/platform/`uname -i`/sbin/scadm download alommainfw
    I guess jumper JP2 allows to recover from a failed flash by selecting the un-touched half the PROM.It does not work as the SC is not responding anymore to Solaris
    Sun Microsystems Inc. SunOS 5.10 Generic January 2005
    v210:~#
    v210:~# cd /usr/platform/`uname -i`/lib/images
    v210:/usr/platform/SUNW,Sun-Fire-V210/lib/images# /usr/platform/`uname -i`/sbin/scadm download alommainfw
    scadm: The SC hardware could not be initialized.
    v210:/usr/platform/SUNW,Sun-Fire-V210/lib/images#
    ERROR: ERROR: Unable to open the SC device.
    It's a pitty that obtaining OBP/ALOM updates requires a service contract. I got a V210 recently.
    Unfortunately both OBP and ALOM are the intial release 4.8.2 / 1.0.I agree but it's probably also because you need support in case it fails ;-)
    Thanks for your answers!

  • Load into database from a file

    hi,
    i need to know is there any other means other than sql loader ,i import data into the oracle8i database from a file i.e)if i need to load into a server from a client machine
    which does not have oracle 8i client version how could i
    do it.kindly help out. thanks in advance.

    UTL_FILE
    With the UTL_FILE package, your PL/SQL programs can read and write operating system text files. UTL_FILE provides a restricted version of operating system stream file I/O.
    UTL_FILE I/O capabilities are similar to standard operating system stream file I/O (OPEN, GET, PUT, CLOSE) capabilities, but with some limitations. For example, you call the FOPEN function to return a file handle, which you use in subsequent calls to GET_LINE or PUT to perform stream I/O to a file. When file I/O is done, you call FCLOSE to complete any output and free resources associated with the file.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_file.htm#ARPLS069
    Joel P�rez

  • How to recover Nikon NEF photo files?

    How to recover Nikon NEF photo files?How to recover Nikon NEF photo files with free data recovery software - MiniTool
    Power Data Recovery. Recover Nikon NEF photo files you can with MiniTool Power Data Recovery.

    Hi, 
    I think the issue is related to a third-party software. You need to ask for help from the vendor of the third-party software .
    Regards, 
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • 10.5.6 update broke clock / time

    Hi guys, I'm having trouble with my clock since this weekend when daylight saving time started. It has reset to Dec. 31, 1969. I think its 10.5.6, I updated about two weeks ago. I usually have clock set to the Americas-Apple server using my LAN. I lo

  • Import of consignment material

    we have a procurement process of import consignment material.In consignment the prices flow from inforecord. In imports the cvd,customs duty flow from conditions in purchase order.now when we make a import consignment purchase order, in the PO there

  • AWTPermission "accessClipboard" issue in JRE 1.6.0_07

    Is AWTPermission check of "accessClipboard" removed from Java Applet AWTEvent event processing in JRE 1.6.0_07? In JRE 1.6.0_07, I can now copy from JTextArea to system clipboard, without signing the applet and without granting the AWTPermission "acc

  • Waiting for approval from other device on mac

    Im waiting for the macs keychain access to send approval to one of my other devices for approval after a fresh installation of mavericks 10.9.3, my question is how long should it take because its been 3 hours so far. it doesnt appear to be working fo

  • Create a test and development environment : only one CMS running

    Hi, Can anyone tell me how to create a test and Develpment environment for one CMS? I'm running BO XI 3.1 enterprise edition. Thanks Peter