I'm an Access man moving towards SQL Server and I'm interested in knowing if there is a utility for my SQL Server version 7 database that is similar to Access' Compact and Repair utility? I'd like a recommendation from a guru on what Prevenatative Maintenance measures I should be running daily/weekly/monthly etc...
After deleting all the test data from all tables in a SQL 2000 database, is there a way to reset all the auto-incrementing fields back to zero in one shot? In Access, you can run the Compact and Repair option. Also, in Sybase SQL, there was an "unload/reload" option to reduce the database size. Is there a similar function in SQL2000? Thanks for all the help
I have a corrupt .sdf database sat on a SD Card but i am unable to find a way to repair it.
So far I have tried a few different methods, most of which just tell me what i already know i.e. "the database is corrupt and needs repairing!!"
I am unable to open the file in SSMS object browser (see above message) which means i cant run repair / shrink utilites. I am also unable to add the database to a vs2005 project (again see above message) meaning again i can't run any repair utilities.
I have also tried using the compact / Repair utility in Query analyser 3.0 on my Windows Mobile 5.0 PDA but once again i am greeted with an "error reading file - Run the Repair Utility" Message.
Lastly i've tried using the SQLCEengine.repair method and, depending on whether i do it on the PDA or on a desktop pc it throws the exceptions "Error occurred reading database file - run the repair utility"(PDA) or "invalid database type" (PC)
Can anyone shed any light as to whether there is another (easier???) way of doing this or if i just have to face it that this file is lost?
Thanks
ps. the code i used for the .repair is as below:
Dim conn As SqlCeEngine
Dim strdb As String
strdb = "SD CardPathnameDatabase.sdf"
conn = New SqlCeEngine(String.Format("Data Source={0}", strdb))
[Microsoft][ODBC SQL Server Driver][SQL Server]Object ID 501576825, index ID 0: Page (1:894606) could not be processed. See other errors for details. [Microsoft][ODBC SQL Server Driver][SQL Server]Table Corrupt: Object ID 501576825, index ID 0, page (1:894606), row 57. Test (!(hdr->r_tagA & (VERSION_MASK | RECTAG_RESV_A | RECTAG_RESV_B))) failed. Values are 112 and 193. [Microsoft][ODBC SQL Server Driver][SQL Server] The repair level on the DBCC statement caused this repair to be bypassed. [Microsoft][ODBC SQL Server Driver][SQL Server] The repair level on the DBCC statement caused this repair to be bypassed. [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation errors and 2 consistency errors in table 'MsgDateDetail' (object ID 501576825). [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation errors and 2 consistency errors in database 'Test'. [Microsoft][ODBC SQL Server Driver][SQL Server]repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (Test repair_fast). [Microsoft][ODBC SQL Server Driver][SQL Server]DBCC execution completed. If DBCC printed error messages, contact your system administrator. ** Execution Time: 3 hrs, 10 mins, 30 secs **
How can i fix these errors.This is production server. This error reported last saturday. I don't have old backup also. everday overwriting the backup. Please any body help me.
I started getting errors everytime i try to access my webmail(horde), my zencart and my forum so i asked my website host and they say i need to repair the SQL database. I have no idea what this means, can someone help please?
The errors are:
Horde: A fatal error has occurred Could not connect to database for SQL SessionHandler. Details have been logged for the administrator.
Zencart: 0 DB_ERROR_NOT_CONNECTED in: [db_cache table] If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
SMF Forum: Connection Problems Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.
I am backing up SQL 6.5 DB using Backup Exec 7.2 on NT 4.0 server SP4 with SQL server agent. The backup job ends in Failed status and a warning that DBname is corrupt. I then try to run DBCC Checkdb, newalloc, and checkcatalog commands to repair the DB. No further ahead yet. Are there any other commands that I can perform on the DB so that the corruption can be repaired, or verified there indeed is corruption of DB?
I have schedule DTS to import every day few tables. It had been workinggreat and had no problem. All of a sudden I started getting this error.ERROR AT DESTINATION FOR ROW NUMBER 100. ERROR ENCOUNTERED SO FAR IN THETASK. 1 UNIDENTIFIED ERROR.Thanks.
I have inherited a poorly administered/maintained database thatcontains the following error:"I/O error (torn page) detected during read at offset 0x000018ee23e000in file 'F:Program FilesISSRealSecure SiteProtectorSiteDatabaseDataRealSecureDB.mdf"I do not have database backups and so therefore cannot restore fromthem. I want to move the database to a new platform and somehowrepair the torn page. Is this possible?
Running SQL 7, Standard version. I had a database marked 'suspect'. I copied the MDF and LDF files to another directory, then deleted the suspect database. I tried to create a new database and attach the MDF file to it. It did not work. Any other ideas? I have no other backups of the data. I am willing to pay for consulting over the phone if necessary.
How can I repair the database (5 gb) and remove the transaction log (45 gb). Whenever I run the maintanence wizard, it corrupts the db and I have to restore the db. Whenever I try to shrink the transaction log, the query runs but it doesn't shrink it at all. Is there a manual method for either of these and if so, how?
a sql server database always contains two file.*.ldf *.mdf When *.ldf was deleted the database may suspend.we can repair such database through about 20 steps.
if you want repair your database .please contact me with email:cn9526@163.net or msn/email :paulyang8848@hotmail.com
you can also see our homepage http://www.haou.net/sqlother/
Server: Msg 8928, Level 16, State 1, Line 1 Object ID 2, index ID 255: Page (1:76914) could not be processed. See other errors for details. Server: Msg 8939, Level 16, State 1, Line 1 Table error: Object ID 2, index ID 255, page (1:76914). Test (IS_ON (BUF_IOERR, bp->bstat) && bp->berrcode) failed. Values are 2057 and -1. CHECKDB found 0 allocation errors and 2 consistency errors in table 'sysindexes' (object ID 2). CHECKDB found 0 allocation errors and 2 consistency errors in database 'OLTP3PRO'. repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (OLTP3PRO ).
The database is not suspect and everything seems to be working fine, so after hours i run the follwing:
DBCC CHECKDB('OLTP3PRO', REPAIR_ALLOW_DATA_LOSS)
But i get the same errors?
Server: Msg 8928, Level 16, State 1, Line 1 Object ID 2, index ID 255: Page (1:76914) could not be processed. See other errors for details. Server: Msg 8939, Level 16, State 1, Line 1 Table error: Object ID 2, index ID 255, page (1:76914). Test (IS_ON (BUF_IOERR, bp->bstat) && bp->berrcode) failed. Values are 2057 and -1. Table error, The text, ntext or image node at page (1:76914), slot 0, text ID 2129023023802 is referenced by page (1:3859) but was not seen in the scan.
The repair level on the DBCC statement caused this repair to be bypassed.
CHECKDB found 4 found 4 consistancy errors.
So it seems CHECKDB with repair does not help ? How do i fix this ?
today my database is (suspect)and not able to connect to the database.so i have excite this code
EXEC sp_resetstatus [YourDatabase]; ALTER DATABASE [YourDatabase] SET EMERGENCY DBCC checkdb([YourDatabase]) ALTER DATABASE [YourDatabase] SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CheckDB ([YourDatabase], REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE [YourDatabase] SET MULTI_USER
and then it worked but some of new rows are deleted can i restore this rows ??
If we restore a database (full backup) first and continuously apply its transnational log backups, do we end up with two identical databases at page level eventually?
If so, page level repair to principle server may work as documented. I can see SAN level mirroring will give you exactly two identical databases at page level eventually at some point of time.
I can see Sybase device (in MS word file) level mirroring will give you two identical things at page level for same device.
But applying the transcriptional logs sequentially on the other servers, can SQL Server guarantee these two databases are identical at page level given there is server configuration can be different?
Some of the data files on our database got corrupted. Is there any tool to get just the data out of the data files and dump somewhere. We can manually rebuild the database using the schema scripts and loading the data. Appreciate any help. Any suggestions are welcome too.
I got help from Dan Guzman on how to set single-user-mode.Thank you very much.After seting single-user-mode, I run DBCC CHECKDB('MYDATABASE',REPAIR_REBUILD)Tehre are error messages.How can I repair torn page problem?Thanks.*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
My Performance Counters for SQL Server 2005 are corrupted. How do I repair them ?
Any help would be appreciated. Thanks.
Salyx
Specs Windows 2003 Standard, AMD x64. SQL Server 2005; x64; 9.00.3042.00; SP2 Standard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2) This is a new install, so no "upgrade from SQL 2000". This is a production server, so "reboot" is hopefully not part of the suggested repair.
Symptom Open Performance Monitor. Open Add Counters. Open Dropdown "Performance Object". Instead of the SQL Server Performance Counter names, a list of 4-digit numbers appears. Other Performance Counters, eg, Processor, work as normal.
Attempted repair 1 - Recovery of system performance counters Open Command Prompt CD WindowsSystem32 lodctr /R This failed to restore the full set of performance counters for an unknown reason.
Attempted repair 2 - Recovery from a backup file from a second host I used the performance counter backup file from a second host which has an identical windows install. This properly restored the system performance counters, but failed to restore the SQL Server ones. This seems odd, because both system have - as much as I can tell - the same applications installed.
Open Command Prompt CD WindowsSystem32 REM Load backup file from second host lodctr /R:c:PerfStringBackup.INI
Attempted repair 3 - Recover SQL Server - specific counters Open Command Prompt CD WindowsSystem32 REM Load backup file from second host lodctr /R:c:PerfStringBackup.INI REM Clear and re-load MSSQLServer counters... unlodctr MSSQLServer lodctr "/R:C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinnsqlctr.ini"
Executing this pretty much wiped most performance counters. Only a small sub-set is now available.
More Info SQL Server 2005 and later SP2 were installed under the administrator account. MSSQLServer service runs under its own Windows Account (permission issues ??) I get Event Log entries regarding x86 vs x64 Performance Counter Libraries. These, however, do not refer to ASP, not SQL Server. I have 2 (virtually) identical hosts (same install sequence of apps). The Performance Counters on the second host work fine. Exctrlst.exe lists MSSQLSERVER service, but I don't know how to diagnose the details.
I have a compact pc program that uses a sql server database (sdf file). I want to check the database integrity when program starts so I added a call to veriy method of SqlCeEngine.
The verify function always returns false even the database is OK and I can work with it.
when I call repair it throws the exception : "The specified module could not be found"
End Sub this code worked well. we know sql7 is not compatiable with vista. please tell us how to connect it wiith sql2005 . we downloaded orcas express edition beta. we created a database also. please let u know how to connect with Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5).
we've got a SQL Server 2005 which replicates with an SQL Server Compact 3.5. Every 10 to 20 synchronisations we're getting the error mentioned above. A Soft reset of the device helps to make the synchronization working again.
Why is this error happening and how can we resolve this?
BTW, we've also running system that replicates with an SQL Server Compact 3.0 without having this problems.
Detection of product '{8670F53C-8AD7-4F34-BDBA-17B38A18CB65}', feature 'SQL_SSMSEE' failed during request for component '{6EC5DFBD-F6B5-4F02-8432-BFB8B03562B8}'
Error Description for Event ID - 1004:
Detection of product '{8670F53C-8AD7-4F34-BDBA-17B38A18CB65}', feature 'SQL_SSMSEE', component '{180F515D-F56C-40DD-9D71-CC532EA8E286}' failed. The resource '' does not exist.
While opening our SAP Mobile Client Application, in the task manager MSIEXEC.EXE is running and trying to repair the application and this will cause our application to take time to lauch. In the Event viewer, whenever we try to lauch our application we are getting this event id's. Can you please kindly provide a solution for this msg.
Long time ago, I downloaded the Northwind and pubs databases from the Microsoft website (I do not remember the details of it) and installed these two databases together into the SQL Server Management Studio Express of my PC (Microsoft Windows XP Pro). I tried to learn an example of using "User Instance" (source code was from a book) on the Northwind database located in my SQL Server Management Studio Express. I just find out that my Northwind database has the title only and no tables at all. If I click on the "+" in front of the "Northwind", I got the following error message:
Microsoft SQL Server Management Studio Express
Failed to retrieve data for this request.(Microsoft SqlServer.Express.SmoEnum)
Additional information:
One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from backup. (Microsoft SQL Server, Error: 5173)..
Please help and tell me how I can repair this Northwind database in my SQL Server Management Studio Express.
Scott Chang
P. S.
I deleted the name 'Northwind' in my SQL Server Management Studio Express, executed the "SQL2005DBScriptsInstnwind" program and I got the following error message: Msg 1802, Level 16, State 4, Line 1
CREATE DATABASE failed. Some file name listed could not be created. Checked related errors.
Msg 5170, Level 16, state 1, Line 1
Cannot create file 'c:Program FilesMicrosoft SQL ServerMSSQL.1DATAorthwindorthwind.ldf' because it already exist. Change the file path or the file name, and retry the operation.
Msg 15100, Level 16, State 1, Procedure sp_dboption, Line 64
The database 'Northwind' does not exist. Use sp_helpdb to show available database.
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'Northwind'. No entry found with that name. Make sure that name is entered correctly
I have a question regarding ROLLUP and how to use the operator.
I've been asked to retrieve a list showing the total repair cost per year displaying Transport Type, Manufacturer and Transport. The query I used is:
SELECT ty.Description AS TransportDescription, t.SerialNumber AS Transport, ty.Manufacturer, SUM (r.RepairCost) AS RepairCost, YEAR(r.EndWorkDate) AS [Year]
[Code] .....
How could I use the rollup function to display subtotals per Transport Type, Manufacturer and Transport?
I have SQL Server Enterprise set up with Merge replication, it is being used to Sync with Windows Mobile Devices as the subscribers.
All the Windows Mobile subscribers have been synchronising fine up until recently, when 1 of the Subscribing Windows Mobile devices received this error. The day after, another device Synchronised fine the first time (note that the Synchronisation was a long one and the SDF grew in size dramatically while the synchronisation occured, but the Sync worked fine and the SDF dropped back to its initial size) The 2nd sync 5 mins later failed however so this Mobile device has the same error also.
Any suggestions as to the below are much appreciated
a) Why this error occurs? b)How do you resolve this error? c)What is the Repair utility mentioned in the error, and is it of use to me?
Thanks in advance, I am very greatful for any advice.
everything is ok for first run. but i leave the program relogin than that error occured ppc2003 second edition devices. Windows mobile 5.0 device works fine. can anybody help me?
VS2005 ver 8.0.50727 SSCE31VSTools-ENU.exe loaded SSCE31SDK-ENU.msi loaded
machine 1 SQL 2005 loaded
machine 2 http://192.168.20.22/ssce/sqlcesa30.dll "Microsoft SQL Server Compact Edition Server Agent" looks fine
pocket pc side C:Program FilesMicrosoft SQL Server Compact Editionv3.1SDKinwce400armv4
End Try ------------------------------------------------------------------------------ i added the following code to very beginning of my code too. that code lock my device
Declare Function LoadLibrary Lib "coredll" Alias "LoadLibrary" (ByVal lpLibFileName As String) As IntPtr
yes,I have an error, like 'The database file may be corrupted. Run the repair utility to check the database file. [ Database name = SDMMC Storage Cardwinpos_2005WINPOS2005.sdf ]' .I develope a program for Pocket Pcs and this program's database sometimes corrupt.what can i do?please help me