Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

Προβλημα με Attach Database

Îåêßíçóå áðü ôï ìÝëïò imanos. Τελευταία δημοσίευση από το μέλος imanos στις 25-01-2006, 17:38. Υπάρχουν 6 απαντήσεις.
Ταξινόμηση Δημοσιεύσεων: Προηγούμενο Επόμενο
  •  25-01-2006, 12:11 8927

    Προβλημα με Attach Database

     Σε προσπάθεια attach μιας βάσης mdf έχω το παρακάτω μύνημα

    Error: 9003, Severity: 20, State: 1

    The LSN (42:119:1) passed to log scan in database 'databaseName' is invalid..

    Προσπαθώντας να την κάνω attach χωρίς το Log File πάλι παίρνω μύνημα λάθους

    Error 1813 : Could not open database 'databaseName' .Create Database aborted.

    Device Activation error .The physical name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\databaseName_LOG.LDF' may be incorrect.

     

    Έχει κανείς καμμιά ιδέα .

     


    Ιωάννης Μανουσάκης
  •  25-01-2006, 12:44 8928 σε απάντηση της 8927

    Απ: Προβλημα με Attach Database

    Τα 2 αρχεία log και mdf είναι πολύ στενά δεμένα μαζί τους.
    Όταν αντιγράφεις κάπου ένα, θα πρέπει να αντιγράφεις μαζί και το αντίστοιχο έτερο ήμιση "log" που δημιουργήθηκε για το mdf.
    Άν θέλεις να αντικαταστήσεις μια βάση, θα πρέπει να δώσεις και το log που έχει μαζί της.
    Άν το log file είναι διαφορετική "version" από το mdf το απορρίπτει.
    Simple Photography
  •  25-01-2006, 14:23 8933 σε απάντηση της 8928

    Απ: Προβλημα με Attach Database

    Στο πρώτο μύνημα λάθους στο attach δηλώνονται και το mdf και το log  .


    Ιωάννης Μανουσάκης
  •  25-01-2006, 14:47 8934 σε απάντηση της 8927

    Απ: Προβλημα με Attach Database

    Δώσε μας λίγες πληροφορίες, αυτή η βάση είναι από το production σύστημα ή προσπαθείς να την πάρεις από το development στο production;

    Δοκίμασε να κάνεις sp_attach_db_single_file μόνο με mdf ώστε να φτιάξει νέο log file
    Vir prudens non contra ventum mingit
  •  25-01-2006, 14:56 8935 σε απάντηση της 8934

    Απ: Προβλημα με Attach Database

    Επίσης, για ποιά έκδοση SQL Server μιλάμε και τι SP έχει;
    Vir prudens non contra ventum mingit
  •  25-01-2006, 15:24 8936 σε απάντηση της 8927

    Απ: Προβλημα με Attach Database

    Για δοκίμασε και αυτό (από Google Groups) :

    If you need to ignore the current LDF file and if your database is not
    detached properly and if you do not have the backup, follow
    the below steps to bring up your database. In the below step-7 is a
    undocumented DBCC command.

    1. Create a new database with the same name and same MDF and LDF files
    2. Stop sql server and rename the existing MDF to a new one and copy the
    original MDF to this location and delete the LDF files.
    3. Start SQL Server
    4. Now your database will be marked suspect
    5. Update the sysdatabases to update to Emergency mode. This will not use
    LOG files in start up

     Sp_configure "allow updates", 1
     go
     Reconfigure with override
     GO
     Update sysdatabases set status =  32768 where name = "BadDbName"
     go
     Sp_configure "allow updates", 0
     go
     Reconfigure with override
     GO

    6. Restart sql server. now the database will be in emergency mode
    7. Now execute the undocumented DBCC to create a log file
       DBCC REBUILD_LOG(dbname,'c:\dbname.ldf')  -- Undocumented step to create a new log file.
       (replace the dbname and log file name based on ur requirement)
    8. Execute sp_resetstatus <dbname>
    9. Restart SQL server and see the database is online.


    Sex is like programing; One mistake, and you will have to support it for the rest of your life…
  •  25-01-2006, 17:38 8938 σε απάντηση της 8927

    Απ: Προβλημα με Attach Database

    raPhaeL Μου έλυσες το πρόβλημα.
    Ευχαριστώ

    Ιωάννης Μανουσάκης
Προβολή Τροφοδοσίας RSS με μορφή XML
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems