PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Error in attach DB after power failure
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Error in attach DB after power failure

Réponse
 
LinkBack Outils de la discussion
Vieux 14/07/2008, 16h19   #1
Mario Morellini
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Error in attach DB after power failure

After power failure i have this error when try to attach DB
this is the command
sp_attach_db MYDB','S:SQLDB\MYDBnew.mdf','S:\SQLDB\MYDB_lognew. ldf'

and this is the error:
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'TELEMACOFTV6'. CREATE DATABASE is aborted.
Msg 5242, Level 22, State 1, Line 1
An inconsistency was detected during an internal operation in database
'TELEMACOFTV6'(ID:55) on page (1:9). Please contact technical support.
Reference number 6.



Can me.
Regards
Mario Morellini


  Réponse avec citation
Vieux 14/07/2008, 21h21   #2
David Hay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Error in attach DB after power failure

Mario,

You can try the following from books online, but honestly your best
bet would be to restore to your latest backup.

David Hay



sp_attach_single_file_db
Attaches a database having only one data file to the current server.

Syntax
sp_attach_single_file_db [ @dbname = ] 'dbname'
, [ @physname = ] 'physical_name'

Arguments
[@dbname =] 'dbname'

Is the name of the database to be attached to the server. dbname is
sysname, with a default of NULL.

[@physname =] 'phsyical_name'

Is the physical name, including path, of the database file.
physical_name is nvarchar(260), with a default of NULL.

Return Code Values
0 (success) or 1 (failure)

Result Sets
None

Remarks
When sp_attach_single_file_db attaches the database to the server, it
builds a new log file and performs additional cleanup work to remove
replication from the newly attached database.

Used sp_attach_single_file_db only on databases that were previously
detached from the server using an explicit sp_detach_db operation.

Permissions
Only members of the sysadmin and dbcreator fixed server roles can
execute this procedure.

Examples
This example detaches pubs and then attaches one file from pubs to the
current server.

EXEC sp_detach_db @dbname = 'pubs'
EXEC sp_attach_single_file_db @dbname = 'pubs',
@physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data
\pubs.mdf'



  Réponse avec citation
Vieux 15/07/2008, 13h23   #3
Mario Morellini
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Error in attach DB after power failure

David
I tried with the "sp_attach_single_file_db @dbname= 'MYDB', @physname=
'S:\SQLDB\MyDBnew.mdf'"
but the result is same.

Msg 1813, Level 16, State 2, Line 1
Could not open new database 'MYDB'. CREATE DATABASE is aborted.
Msg 5242, Level 22, State 1, Line 1
An inconsistency was detected during an internal operation in database
'MYDB'(ID:55) on page (1:9). Please contact technical support. Reference
number 6.

anybody have another idea ?

Mario Morellini


  Réponse avec citation
Vieux 15/07/2008, 17h44   #4
David Hay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Error in attach DB after power failure

Mario,

From the error it looks like there are pages that are messed up in the
file. You might want to take SQL down and do a full scandisk and let
it attempt to fix any errors. Then a full defrag of the disk as well
before attempting to reattach. With the power outage a scandisk would
probably be a good thing even if you were not seeing problems now! If
all that fails then at this point I think the database is corrupted
beyond SQL's ability to correct itself. The only answer is RESTORE.
I hope you have a recent good backup!

Good luck!

David Hay
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h25.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10113 seconds with 12 queries