Restoring An SQL 2005 Server Express DB With A LOG That Is To Large

Jul 31, 2006

SQL 2005 Express - Database Restore size problem
Was this post helpful ?














Hi,

I'm trying to restore a SQL Server DB Backup from a SQL Server DB Server on to my Laptop (SQL 2005 Express)

When I execute a restore filelistonly command on the backup file, It seems that the Database included is 1GB, but the Log file is 91 GB in size, which exceeds my diskspace.

I can restore the Data on its own without the log file, but the the Database stays in "restoring" mode. I've tried to switch the restore flag off (update sys.databases set state = 0 where name = 'G001'), but I can`t seem to be able to do it, even if I try to allow updates via:

sp_configure 'allow updates', 1

GO

RECONFIGURE WITH OVERRIDE

GO



Any ideas how I can restore the database without restoring the enormous logfile?

Thanks in advance...



View 3 Replies


ADVERTISEMENT

Restoring A Sql 2000 Db In Sql 2005 Express Db With Sql Server Management Studio Express

Mar 21, 2007

As I said in the subject I've a problem trying to restore a backup of a previous db created in sql 2000 server

When I try to do it I recive the following message:

____________________________________________________________________________________
System.Data.SqlClient.SqlError: Il set di backup include il backup di un database diverso dal database 'musica2007' esistente. (Microsoft.SqlServer.Express.Smo)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476

------------------------------
Program Location:

in Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages)
in Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
in Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)
____________________________________________________________________________________

What should I do? What's the probem? I've already tried to look for the solution in other messages but I didn't find anything..... Thanks for help,,, by Luke

View 1 Replies View Related

Restoring BAK File Sql Server 2005 Express

Apr 3, 2007

Hello Everyone,
I am trying to restore a bak file which came with code for a tutorial.  I think it is safe to restore, but sql server 2005 express has the following problem when I try to restore it.
TITLE: Microsoft SQL Server Management Studio Express------------------------------
Restore failed for Server 'BOBSQLEXPRESS'.  (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
------------------------------ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:Program Files (x86)Microsoft SQL ServerMSSQL.1MSSQLDashboard.mdf'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&LinkId=20476
The links given for help have no information about the problem and I'm not really sure where I should be looking to solve this.  I'm a newbie to databases so if you could provide a step-by-step answer that would be best.  Thanks in advance.
                                                                                                                              Robert

View 4 Replies View Related

Restoring A SQL Server Express 2005 Database To SQL Server Standard 2005

Mar 24, 2007

Hello,If I backup and restore an express database to sql server 2005 standard, will there still be limitations in regards to the database size, cpu...etc.? Thanks,Jon 

View 1 Replies View Related

Restoring Sql Server 7.0 Database Into Sql Server 2005 Express - Problem!

Feb 19, 2007

Hi!

I'm a beginner w ith SQL Express and am having some problems. I am using 2005 SP1 and installed the SQL Server Management Studio Express as well. I have a backup from a SQL Server 7.0 database that I am trying to restore into my database using the management studio. When I try to restore from the file into my database, I get the error,

System.Data.SqlClient.SqlError: The backup of the system database on the device D:GMBeta2Local.bak cannot be restored because it was created by a different version of the server (7.00.1063) than this server (9.00.3033). (Microsoft.SqlServer.Express.Smo)

Is this true? Is there any way for me to get this data into my SQL Server 2005 express on my laptop?

View 1 Replies View Related

Large MSMerge_History, MSMerge_genhistory,MSRepl_errors Tables In SQL Server 2005 Express Edition (Merge Push Subscriber)

Nov 23, 2006

SQL Server 2005 Standard Edition act as publisher and distributor.
All subscribers are SQL Server 2005 Express Edition.
According to 2005 book online, "MSMerge_History table exists in distribution database". Howevey I found this table in Subscriber database which is in SQL Server 2005 Express Edition.
The problem is this table (MSMerge_History) and other two tables (MSMerge_genhistory, MSRepl_errors) are quite large. We want to keep SQL Server 2005 Express database as small as possible so we can put more data into it.
Is there anyway (Manually or automatically) to clean those tables in SQL Server 2005 Express? Please help.

View 3 Replies View Related

Restoring A Sql Express Backup To Sql 2005

Jun 2, 2008

i'm trying to set up one of the asp.net website starter kits and part of the process is to backup the sql express db and then import it into the sql 2005 at the web hosting account.  it's not working and i'm wondering if there's any difference between the backups they make.  the sql express makes a file with a .bak extension and the sql 2005 at the host makes a file with a .sqlbak extension.  i was assuming that was just a naming thing and not a structural thing but the host's tech support has said:
"This sort of thing happens when the database being imported is not properly formatted. You can try downloading and using sql express from microsoft to see if you can do it manually, but most likely you will need to save your database again properly set for import to an mssql server rather than however you did."
all i had done was rename the .bak file from express to .sqlbak as that was the choice for backup files.
i will note that it also failed importing the .mdf, which works fine locally with the site but i did make some changes to it from the original that came with the starter kit.
should a backup file made with sql express (using sql management studio express, by right clicking on the file and choosing tasks > backup) normally be importable by sql 2005?
or, i suppose, does it make sense that a db that works fine locally with sql express (within a visual web developer express project anyway) would actually be "formatted" in a way that would cause it to fail to import into sql 2005?
thanks much for any assistance.

View 3 Replies View Related

Restoring Databases In Sql 2005 Express - Filename Changes?

Mar 22, 2008

Hello,
Does anyone else ever experience this problem, and if so do you know what causes it:
When ever I restore a database called say XXX.mdf, it restores OK and I can view via MSE as XXX.mdf. Then when I visit MSE again there is another database called C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataXXX.mdf - both are linked to the same .mdf file, however if you try to expand XXX.mdf nothing happens as though the database has been detached?
Cheers MArco

View 3 Replies View Related

Restoring Database From MS SQL 2000 To SQL Express 2005

Sep 4, 2006

Hello,

I tried to restore a database which I backuped from MS SQL 2000 to SQL Express 2005 but it always failed with the following error message. What could be the problem?

Restore failed for Server 'SERVSQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)

Additional information

System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'gtp' database.

(Microsoft.SqlServer.Express.Smo)

Thanks

View 23 Replies View Related

Error While Restoring SQL7 Data On SQL Express 2005

May 16, 2006

Hi,

I have backup of data from SQL Server 7.0 and now when i'm trying to restore it into SQL Express 2005, I'm getting following error......

--------------------
Msg 3154, Level 16, State 2, Line 1
The backup set holds a backup of a database other than the existing 'GOSLDW' database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
--------------------

Here is SQL i'm using to restore database,

RESTORE DATABASE GOSLDW
FROM DISK = 'C:sqlserverDataGOSLDW'
WITH MOVE 'GOSLDW' TO 'C:sqlserverDataGOSLDW.mdf',
MOVE 'GOSLDW' TO 'C:sqlserverDataGOSLDW.ldf'
GO


Why i'm getting this error? Am i missing anything here?

Thanks in advance for your HELP.

- R

View 8 Replies View Related

SQL Server Express Stuck Restoring...

Jan 25, 2007

I seem to have a problem with one of my SQL Server Express databases. I started a restore task from a SQL Server 2005 BAK file (that included full-text data), which couldn't continue so I cancelled. Now, the database I attempted to restore to has the status "(Restoring...)".

This is a tiny database and a restore should (if it could) take only a few seconds.

I'm using SQL Server 2005 Management Studio (v9...).

Anyone know how to either cancel the restore or get the database into a good state again? I've tried stopping and starting (and restarting) the express instance, with no joy.

View 1 Replies View Related

How To Apply SQL Server 2005 Express SP1 To The Version Of SQL Server 2005 Express Which Installs With Visual Studio 2005?

Aug 8, 2006

When I installed VS 2005, it installed the default version of SQL Server 2005 Express that ships with Visual Studio 2005 installer media.

How can apply SQL Server 2005 Express SP1 to update this existing instance?

Currently, if I run this query:

SELECT @@version

I get the following:

Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

After applying SP1, I should get 9.00.2047.00.


Should I just go to this link and download & install the SQL Server 2005 Express Edition SP1:

http://msdn.microsoft.com/vstudio/express/sql/download/


Thank you,

Bashman

View 11 Replies View Related

Restoring SQL Server 2000 Backup To Express

Dec 7, 2006

When I try to restore my SQL Server 2000 backup file to a newly installed copy of SQL Server 2005 Express using Studio Express, I get the following error:

The backup set holds a backup of a database other than the existing 'UpperBridge' database. (Microsoft.sqlservfer.Express.smo)

The backup is made from an SQL Server 2000 database called 'UpperBridge'

I am trying to restore to a database called 'UpperBridge' which I created under 'New databases' in Studio Express.

Any help very much appreciated.

View 1 Replies View Related

Problem Restoring Database On SQL Server Express '05, Vista

May 6, 2008

Hi All,
I have an issue that's stopping me restoring a database on SQL Server Express 2005 running under Windows Vista. I'm installing a system that I've used several times before on other systems and part of the installation procedure is to use the 'restore' function to install a database from a backup file. So I'm essentially restoring but to a db that doesn't yet exist in my SQL Server, this normally goes without a hitch. However on attempting this on a Vista system, I get the following error message -

System.Data.SqlClient.SqlError: The operating system returned the error '5(error not found)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLiCasework.mdf'. (Microsoft.SqlServer.Express.Smo)

where iCasework is the name I've given in the restore dialogue as the DB to restore to (which as I said, doesn't exist at the moment).

Things I've tried so far: -
I have a feeling this is down to a permissions problem, so I've tried the following already
1) Running Management Studio Express as Administrator - exact same error message
2) During the initial install, I set up the default admin user to use SQL Server authentication, having read threads about vaguely similar errors I used the Surface Area Config tool to add my windows login as an admin with admin rights and tried connecting to the Server with those credentials then running the restore - exact same error message

and

3) I also tried manually creating an empty db called iCasework and then restoring the external backup into that existing backup, which just gave a different error stating that the backup file didn't match the structure of the existing db. I could create the whole db structure manually but that would entirely negate the purpose of restoring from the backup and, more to the point, has never been necessary on any other system we've done this one.

Has anyone got any ideas that I could try next please?

View 7 Replies View Related

Backing Up From Server And Restoring To Local Express - Files Not Visible

Mar 25, 2013

i wanted to test routines using my local sql server engine and thought I could backup the mdf ldf file on the true network sql server in which I am listed as a dbowner with full permissions. In fact i can add users for the at db etc.The backup allows me to browse to a local folder

with the following being the default C:Program FilesMicrosoft SQL ServerMSSQL10_50.CMS_PROJECTMSSQLBackup

i name the file and it executes properly but when i try to restore that file to my local db that path is not even visible to me.In fact when i use exploreer I cannot even find the folders after Microsoft SQL Server!I search for .bak but nothing.How can I see that folder construction in the sql browser but never in explorer -

View 2 Replies View Related

SQL Server Express Login Issue With Large Databases

Feb 6, 2007

Hello,

My company works with SQL Server 2005 express locally with Visual Studio to develop websites. Everything works very well.

We use SQL Server 2005 express on our production server as well. We change the database over to a non-User Instance when the site is ready to go live. Everything works fine here as well.

We run into issues when databases get near 100 MB. This is well below the stated database size limit for Express of 4GB.

At that point, about once a day, a site with a "large" database will stop responding. The error that we'll get is "Cannot open database 'DBNAME' requested by the login. The login failed. Login failed for user 'DBUSER'

The only way we've found to fix this is to restart the SQL Express service. Obviously, that isn't a very useful alternative.

Has anyone run into anything like this? Could we have some setting wrong?

Would moving to the full version of SQL Server 2005 fix this?

View 3 Replies View Related

Upgrading From Sql Server 2005 Express Edition To Sql Server 2005 Express With Advanced Services

Oct 4, 2006

If i have been using sql server 2005 express for developing my application and i decide to upgrade to sql server 2005 express with advanced services while still working on the same application, what will happen to my  application's database. Can i be able to continue with my work with out any major regrets.

View 1 Replies View Related

Edited Data Won't Propagate Back To The Database (VB 2005 Express && SQL Server 2005 Express)

Dec 11, 2006



Hi,

I'm trying to learn some VB programming with the VB 2005 Express Absolute Beginner Series video tutorials (which I think is great) and have come across a problem that I can't solve.

When I follow the instructions in Lesson 9 (Databinding Data to User Interface Controls) my application will display the data from the database correctly and I can edit it (and as long as the debugger is running the data remains changed). However, the changes won't propagate back to the database. I don't get any error messages but after I edit the data, save (with the save button on the BindingNavigator toolbar), and end debugging the data in my database remains unchanged. When I use a MessageBox to show how many rows where edited/updated in the

Me.myTableTableAdapter.Update(Me.myDatabaseDataSet.myTable)

I get the correct number back. I'm sure the problem is not due to coding errors since I've also tried running the accompanying Lesson 9 project file that can be downloaded from MSDN and the problem persists.

I'm using Windows XP SP2, SQL Server 2005 Express Edition and VB 2005 Express Edition. I've tried installing SQL Server 2005 Express with a number of different settings, including default settings, but it doesn't make any difference.

Would greatly appreciate any feedback on this as I'm keen to resolve this problem so I can get on with the next tutorial lesson.

Thanks,
Ieyasu

View 6 Replies View Related

Restoring A Db In SQL Server 2005

Dec 21, 2006

Hello,

I received a backup Sql Server file and I am trying to restore it. When trying to restore the backup using SQL Server 2000, I get the following message:

"the backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database. RESTORE DATABASE is terminating abnormally."

After doing some research online, I figured out that the backup I received must be from SQL Server 2005. Therefore, I installed SQL SErver 2005 on my laptop (so now I have both 2000 and 2005 on my laptop)..

I tried to use the restore database option in SQL Server 2005 ( SQL Server Management Studio) to restore my backup, and I get the same error message (written again below) as I did when using SQL Server 2005:

"The backed-up database has on-disk structure version 611. The server supports version 539 and cannot restore or upgrade this database. RESTORE DATABASE is terminating abnormally"

Can anyone please provide me assistance on what I'm doing wrong? Is the issue that I have both SQL Server 2000 and SQL Server 2005 installed on my laptop? Thanks.

View 7 Replies View Related

How Can I Onnect Visual Basic Express 2005 To A Remote SQL Server Express 2005?

Sep 13, 2006

HiIm trying to connect Visual Basic Express 2005 to a remote SQL Server Express 2005. I cant find how i can do that in VB.net Express.In Web developer there are no problem to connect to a remote SQL server but i cant find it in VB.net Express. The XP with the SQL server that i want to connect to is on the local network. Greatful for help!

View 1 Replies View Related

Visual Basic 2005 Express And SQL Server 2005 Express - Display Image

Jun 13, 2007

Hi Guys,
I created a Product database table using Visual Basic 2005 Express and SQL Server 2005 Express. I have just added a new column [Picture] to the database table, which of course, should store an image or picture of a product. I am writing to kindly ask you guys for help .


i) How do I include image files into this column [Picture]?
ii) How do I get this image to display on Visual Basic 2005 Express form, so that when a product is selected the product image is displayed accordingly?


Your help much appreciated. Thanks.

Paul

View 8 Replies View Related

Restoring A 2005 DataBase Into A 2000 Server

Mar 12, 2007

I would like to know if it is possible to make a backup of a database in a SQL Server 2005 server and restoring it in a SQL Server 2000 server.

Thanks a lot in advanced.

View 5 Replies View Related

Restoring SQL Server2000 Backup To SQL Server 2005

Oct 3, 2007

Hi,

I have a sql server 2000 backup and I want to restore it into a Sql Server 2005 database.

I did the restore on the usual way. All the database tables were created, but the data didn't get restored.

Pls help!
Thanks!

View 7 Replies View Related

Reseting Users After Restoring SQL Server 2005

Jan 9, 2008

I am restoring a production copy of db XYZ to the development server db XYZ. I want to retain the original users on the development server for db XYZ. How do I create a script that will reset the users on the development server with the same permissions and access they had before the production copy was restored on development? I have searched and searched and cannot find the answer. I can use a third party tool - Embarcadero - to script out the create and update stmts but it is not 100% correct. I end up having to do alot of manual work.

any assistance would be greatly appreciated.
thanks

View 5 Replies View Related

Visual Basic .NET 2005 Express && Sql Server 2005 Express Remote Server

Mar 12, 2007

Hi,
 I want to make a component library in Visual Basic.NET and connect to a remote Sql Server. When I create a new DataSet with the wizard, I can only connect to a .mdf file, but not to a Sql Server. With Visual Web Developer I can connect to a Sql server. What is the difference between these enviroments ? How can I do the same with Visual Basic.NET ?
 Thanks in advance.

View 1 Replies View Related

Upgrading From 'SQL Server Express 2005' To 'SQL Server Express 2005 With Advance Services'

Apr 20, 2006

Currently I have following things installed on my Computer





1. SQL Server Express 2005

2. SQL Server Management Studio Express 2005 CTP



I need to install following things

A. Microsoft SQL Server 2005 Express Edition with Advanced Services

B. Microsoft SQL Server 2005 Express Edition Toolkit



Do I need to uninstall any any of 1 or 2?

What should be my path to upgrade these software.









View 8 Replies View Related

Problem When Restoring Old Version Database To Sql Server 2005

Jul 26, 2006

Dear All,

I am experiencing a problem that, after i have made a backup database file in SQL Server version (9.00.1090), when i restore the database in a newer SQL Server 2005 version(9.00.1399), an error occurs.

The error is:

Restore failed for Server 'demo'. (Microsoft.SqlServer.Smo)

Additional information:
System.Data.SqlClient.SqlError: The database was backed up on a server running version 9.00.1090. That version is incompatible with this server, which is running version 9.00.1399. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo)

Anyone can tell me how i could fix this?
Why would it happen?

Thank you very much

Regards,

George

View 1 Replies View Related

Restore LDF File After Restoring Backups In SQL Server 2005?

Aug 22, 2007

I'm working on a restore procedure for the case where all MDF filesare missing, but the LDF files are all intact. A full backup is doneevery 24 hours, and a log backup is done every 3 hours. Afterrestoring the last full + log backups, is it at all possible to usethe LDF files to recover data from that point up to a newer point intime?I've found a post which explains how to do this on SQL Server 2000<http://groups.google.com/group/comp...s.ms-sqlserver/browse_thread/thread/3ef5c7cbc0a83334/f3b0c70811d35ed7>, but step 4fails with the following error message:BACKUP LOG cannot be performed because there is no current databasebackup.

View 2 Replies View Related

Storing Large Files In The SQL Server 2005

Feb 9, 2006

I have a table that I'm inserting a file into and using the Image data type to store the binary object.  Now the code below works fine for files around 1.5 MB, but anything larger and it's like the code won't even execute and I get a Page Not found error.
I'm in the process of running some traces to find out what's going on in the backend, but I'm assuming there's something amiss with my code.  The Image data type should handle files that size with no problem but for some reason it isn't.
Does anyone see anything wrong?
Thanks
Dim iLength As Integer = CType(File1.PostedFile.InputStream.Length, Integer)
If iLength = 0 Then Exit Sub 'not a valid file
Dim sContentType As String = File1.PostedFile.ContentType
Dim sFileName As String, i As Integer
Dim bytContent As Byte()
ReDim bytContent(iLength) 'byte array, set to file size

'strip the path off the filename
i = InStrRev(File1.PostedFile.FileName.Trim, "")
If i = 0 Then
sFileName = File1.PostedFile.FileName.Trim
Else
sFileName = Right(File1.PostedFile.FileName.Trim, Len(File1.PostedFile.FileName.Trim) - i)
End If
conn = New SqlConnection(eco)
conn.Open()
cmd = New SqlCommand("INSERT INTO ECO_Attachments (ECOID, FromType, DocName,OldRev,NewRev,NtLogin,DisplayName, FileName, FileSize, FileData, ContentType) VALUES (@ECOID, @FromType,@DocName,@OldRev,@NewRev,@NtLogin,@DisplayName, @FileName, @FileSize, @FileData, @ContentType) ")
cmd.Connection = conn
Try
File1.PostedFile.InputStream.Read(bytContent, 0, iLength)
With cmd
.Parameters.Add("@ECOID", SqlDbType.Int)
.Parameters.Add("@FromType", SqlDbType.NVarChar, 50)
.Parameters.Add("@DocName", SqlDbType.NVarChar, 250)
.Parameters.Add("@OldRev", SqlDbType.NVarChar, 50)
.Parameters.Add("@NewRev", SqlDbType.NVarChar, 50)
.Parameters.Add("@NTLogin", SqlDbType.NVarChar, 100)
.Parameters.Add("@DisplayName", SqlDbType.NVarChar, 200)
.Parameters.Add("@FileName", SqlDbType.NVarChar, 255)
.Parameters.Add("@FileSize", SqlDbType.Real)
.Parameters.Add("@FileData", SqlDbType.Image)
.Parameters.Add("@ContentType", SqlDbType.NVarChar, 50)
.Parameters("@ECOID").Value = ECOID
.Parameters("@FromType").Value = From
.Parameters("@DocName").Value = DocName
.Parameters("@OldRev").Value = OldRev
.Parameters("@NewRev").Value = NewRev
.Parameters("@NTLogin").Value = NTLogon
.Parameters("@DisplayName").Value = DisplayName
.Parameters("@FileName").Value = sFileName
.Parameters("@FileSize").Value = iLength
.Parameters("@FileData").Value = bytContent
.Parameters("@ContentType").Value = sContentType
.ExecuteNonQuery()
'.ExecuteScalar()
End With
Catch ex As Exception
Response.Write(ex)
'Handle your database error here
conn.Close()
End Try

View 1 Replies View Related

SQL Server 2005 Large IO And Logical Reads

May 22, 2008

A table in one of my databases is running very slowly. The IO is very high and below is a printout from the SET STATISTICS IO ON command run on a common query used on the table:


(4162 row(s) affected)

Table 'WebProxyLog'. Scan count 3, logical reads 873660, physical reads 3493, read-ahead reads 505939, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

I have a clustered unique index and a nonclustered index on the table. I have ran SQL Profiler and opened the trace in Database Tuning Advisor, DTA displays 0% improvement suggestions. I have a number of statistics on the table and index which are all up to date and fragmentation is less than 1%. I've tried a number of variations on indexes to improve performance but to no avail. There is only one query which runs on the table, and the nonclustered index created on the table did significantly improve performance, however the query still runs at around 23 seconds. The query does bring back a large amount of data however i'm sure there is a way to bring down the IO and logical reads to improve performance.

The table and index scripts are below:




Code Snippet
-- =================== Table and Clustered index ===========================
CREATE TABLE [dbo].[WebProxyLog](
[ClientIP] [bigint] NULL,
[ClientUserName] [nvarchar](514) NULL,
[ClientAgent] [varchar](128) NULL,
[ClientAuthenticate] [smallint] NULL,
[logTime] [datetime] NULL,
[servername] [nvarchar](32) NULL,
[DestHost] [varchar](255) NULL,
[DestHostIP] [bigint] NULL,
[DestHostPort] [int] NULL,
[bytesrecvd] [bigint] NULL,
[bytessent] [bigint] NULL,
[protocol] [varchar](12) NULL,
[transport] [varchar](8) NULL,
[operation] [varchar](24) NULL,
[uri] [varchar](2048) NULL,
[mimetype] [varchar](32) NULL,
[objectsource] [smallint] NULL,
[rule] [nvarchar](128) NULL,
[SrcNetwork] [nvarchar](128) NULL,
[DstNetwork] [nvarchar](128) NULL,
[Action] [smallint] NULL,
[WebProxyLogid] [int] IDENTITY(1,1) NOT NULL,
CONSTRAINT [pk_webproxylog_webproxylogid] PRIMARY KEY CLUSTERED
(
[WebProxyLogid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

-- =================== Nonclustered Index ===========================

CREATE NONCLUSTERED INDEX [dta_ix_WebProxyLog_Kaction_clientusername_logtime_uri_mimetype_webproxylogid] ON [dbo].[WebProxyLog]
(
[Action] ASC
)
INCLUDE ( [ClientUserName],
[logTime],
[uri],
[mimetype],
[WebProxyLogid]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

-- =================== Query which is called regularly on the table ===========================

SELECT [User] = CASE
WHEN LEFT(clientusername,3) = domain' THEN RIGHT(clientusername,LEN(clientusername) - 3)
ELSE clientusername
END,
logtime AS [Date],
desthost AS [Site],
uri AS [Actual Site]
FROM webproxylog
WHERE CONVERT(Datetime,CONVERT(VarChar(25),logtime,106),106) BETWEEN '20 apr 2008' AND '14 may 2008'
AND(RIGHT(uri,4) NOT IN('.css','.jpg','.gif','.png','.bmp','.vbs'))
AND (RIGHT(uri,3) NOT IN('.js'))
AND LEFT(mimetype,6) = 'text/h'
AND (uri NOT LIKE '%sometext.local%')
AND (uri NOT LIKE '%sometext.co.uk%')
AND [action] = 9
AND (clientusername IN ('USERNAME'))
ORDER BY logtime ASC;





PS There are 60,078,605 rows in the table

Please help!

Many Thanks

View 6 Replies View Related

Restoring A SQL Server 2005 Database Into SQL Server 2000

Nov 21, 2007

Hey guys
 We currenlty have SQL Server 2000 installed inhouse for testing.  A client has given us a backup of their 2005 database and i'm wondering if the restore will work into 2000, or any issues i should be aware of. Should i just install msde locally on my machine and restore the database?
 thanks

View 2 Replies View Related

Read Large Binary Data From Sql Server 2005

Jul 14, 2007

Hi I've followed a tutorial on how to write and read varbinary(max) data to and from a database. But when i try to read the data i get the error that the data would be truncated, but only when the varbinary(max)  is greater then 8kB. I've used a system stored procedure (sp_tableoption) to set the table that holds the data to store data outside rows. To select the data i'm using a stored procedure:               SELECT imageData , MIMEType FROM Pictures WHERE (imageTitle = @imageTitle)        And then using an .aspx page to Response.Write the data:Using conn As New sql.SqlConnection            conn.ConnectionString = ConfigurationManager.ConnectionStrings("myConnectionString").ToString            Dim getLogoCommand As New sql.SqlCommand            getLogoCommand.CommandType = Data.CommandType.StoredProcedure            getLogoCommand.CommandText = "GetPicture"            getLogoCommand.Connection = conn            Dim imageTitleParameter As New sql.SqlParameter("@imageTitle", Data.SqlDbType.NVarChar, 200)            imageTitleParameter.Value = Request("imageTitle")            imageTitleParameter.Direction = Data.ParameterDirection.Input            getLogoCommand.Parameters.Add(imageTitleParameter)            conn.Open()            Using logoReader As sql.SqlDataReader = getLogoCommand.ExecuteReader                logoReader.Read()                If logoReader.HasRows = True Then                    Response.Clear()                    Response.ContentType = logoReader("MIMEtype").ToString()                    Response.BinaryWrite(logoReader("imageData"))                End If            End Using            conn.Close()        End Using  Can anyone please help me with this?!

View 2 Replies View Related

SQL Server 2005 Slows Down After A Large Number Of Queries

Jul 4, 2007

Hi,

We are running SQL Server 2005 Ent Edition with SP2 on a Windows 2003 Ent. Server SP2 with Intel E6600 Dual core CPU and 4GB of RAM. We have an C# application which perform a large number of calculation that run in a loop. The application first load transactions that needs to be updated and then goes to each one of the rows, query another table get some values and update the transaction.

I have set a limit of 2GB of RAM for SQL server and when I run the application, it performs 5 records update (the process described above) per second. After roughly 10,000 records, the application slows down to about 1 record per second. I have tried to examine the activity monitor however I can't find anything that might indicate what's causing this.

I have read that there are some known issues with Hyper-Threaded CPUs however since my CPU is Dual-core, I do not know if the issue applies to those CPUs too and I have no one to disable one core in the bios.

The only thing that I have noticed is that if I change the Max Degree of Parallelism when the server slows down (I.e. From 0 to 1 and then back to 0), the server speeds up for another 10,000 records update and then slows down. Does anyone has an idea of what's causing it? What does the property change do that make the server speed up again?

If there is no solution for this problem, does anyone know if there is a stored procedure or anything else than can be used programmatically to speed up the server when it slows down? (This is not the optimal solution however I will use it as a workaround)

Any advice will be greatly appreciated.

Thanks,
Joe

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved