.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Shrink database log file sql server 2005

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
Hi, I am trying to shrink log file for a testing database.This database will be restored with production database periodically.When i tried to create backup of the log file Processed 0 pages for database 'hcbeta', file 'HC_log' on file 6. The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed. BACKUP LOG successfully processed 0 pages in 0.423 seconds (0.000 MB/sec). I tried EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1 Resulted with error:Unable to execute procedure. The database is not published. Execute the procedure in a database that is published for replication. So tried to publish the database using EXEC sp_dboption 'hcbeta', 'Publish', 'true' resulted error mesage:Msg 15242, Level 16, State 1, Procedure sp_dboption, Line 138 Database option 'Publish' is not unique. and retrived duplicate_options as "merge Publish" ,"Publish" Plesae help me in shrinking my database log file. Thanks, Adi.

View Complete Post

More Related Resource Links

Can't restore database backup file in my database ? using sql server 2005. please help

VERY IMPORTANT i am trying to restore database.bak in sql server 2005 (i know the database.bak was also generated in sql 2005 server) i am trying to restore back up database .bak into the new database i just created in sql server 2005 i have saved my database .bak into c drive and when i select database .bak "From Device", it doesn't get populated in the list below and i see nothing and it keeps on prompting a message "You must select a restore source" Here's the screen shot:   PLEASE HELP..it's really important (i tried restoring database in sql server 2008 and it was sucessful but i am facing this problem in sql server 2005 only)  

Why doesn't SQL Server 2005 Enterprise always shrink a log file after a backup?

I have several databases that, despite being backed up regularly, do not release space to the operating system.  In one extreme case, I have a log file that is less than 1% utilized (and has been for months.) I know how to manually force a shrink, but I should not need to do that on any sort of regular basis.  In fact, it is against best practices to manually shrink a log file (or any database file for that matter) because of the very high risk of an unrecoverable error. It is my understanding that SQL Server will eventually handle these things on its own.  However, it does not appear to be doing so.  Any thoughts as to why? Thanks, Dave

SQL Server 2005 - Differences between "Autoshrink" database option and manual "shrink database / log


Hello All !

I want to know if there are differences between "Autoshrink" database option and the SQL DBCC shrink (database/file) command.

I have, in production environment, a MS application (MIIS) with a SQL 2005 DB. This application takes very large db files (logs and datas). It's absolutely normal (several millions of transactions by day)

However, I had this morning a problem with disk space.

If I run manual dbcc shrink (db / file): I recover 4 GB

If I set "Autoshrink" option: I recover 50 GB

Microsoft doesn't recommand to set the "autoshrink" option on the majority of databases (for performances problems)

Are there links about these differences ?

Thanks for advance for your ideas / help - Regards - Have a nice day ! RHUM2

Insert Excel Data via File Upload into sql server database???

Hi all, I have requirement that User can Upload the Excel Sheet Data to sql server Database at once. How i do that Any Article or hint is apperciated.   Regards 

Failure in restoring an database from tape - SQL Server 2005

Hello everyone, we are trying to restore one of our datebase from tape using the T-Sql commands. Using the GUI results in an timeout. The command we are using to start the restore is: RESTORE DATABASE RECOV FROM Tape = '\\.\tape0' WITH  FILE=2, RECOVERY, NOUNLOAD, STATS=5, MOVE 'xxx_OPL_xxxx_ZEELAND' TO 'K:\RECOVER\data\RECOV.mdf', MOVE 'xxx_OPL_xxxx_ZEELAND' TO 'K:\RECOVER\log\RECOV_log.ldf', REPLACE the restore proces start without any problem, only ending with this: Processed 2598808 pages for database 'xxx_OPL_xxxx_ZEELAND', file 'xxxx_PROD_Data' on file 2. Processed 3 pages for database 'xxxx_OPL_xxxx_ZEELAND', file 'xxxx_PROD_Log' on file 2. Msg 3229, Level 16, State 2, Line 1 Request for device '\\.\tape1' timed out. Msg 3213, Level 16, State 1, Line 1 Unable to unload one or more tapes. See the error log for details. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. In the eventlog, the following is recorded: BackupTapeFile::UnloadTape: PrepareTape(UNLOCK) failure on backup device '\\.\tape0'. Operating system error 21(The device is not ready.). For as far we can judge, the tapedrive is functioning without problems. Using the same tape in an other tapedrive on an different server results in the same error. Hardware used: HP Proliant Server (DL580) with additional SCSI interface card HP StorageWorks LTO 4 tapedriv

My Sql server 2005 Database in recovery mode for 3 -4 hours every day

Hi , Some of our Sql Server 2005 databases remain in recovery mode after midnight for almost 3 to 4 hours. So when my application access them error "Databse in recovery" and for same database this happens again and again every night. Please suggest why and how this can be solved?

SSRS 2005 external images won't display - images on DIFFERENT file server

Hi, Been having trouble getting external images to display in reports rendered on SSRS 2005. Images are displayed as a red X. However, my scenario is different from some of the examples I have read about. - The images are stored on a file server that is DIFFERENT from the box on which the Report Service is running. For various business reasons I cannot copy the images locally to the Report Service box. I am using "file://fileserver/path/to/image.jpg" to retrieve the images. - Since the file server does not have IIS installed, I cannot access the images using the URL method (http:// access). I need to use the file:// method. Currently I am prototyping this setup on my test box, which is running XP Pro and IIS 5.1. The Report Service is installed on this same box. I am currently testing this through the Report Manager web site (http://servername/Reports). The images are displayed using the Image control, which I added to the report using the visual report designer in Visual Studio 2005. It is set up with source=External and with "file://fileserver/path/to/image.jpg" path values. File names are retrieved from our database and file paths are built dynamically using a data processing extension I have written. My best guess as to why this is happening is that the ASPNET service account on my test box does not have access to the particular share on the file serve

how to use sql database remotely(sql server 2005)

hi friends... when i want to connect my pc to sql server then the error comes........ A network-related or instance-specific error occurred while stabling a connection to sql server, The server was not found or was not accessible. Verify that the instance name is correct and that sql server is configured to allow remote connections,(provider: Named Pipes Provider,error:40-Could not open a connection to Sql server)(Microsoft Sql Server,Error:233)   so plz check it and give me advise how can i connect sql server remotely   thanks friends    

SQL-Server 2005 x64 / windows server 2003 x64 crashes during file copy

Hi We are running: Microsoft SQL Server 2005 Standard - 9.00.4294.00 (X64) Microsoft Windows Server 2003 R2 Enterprise x64 We have gigabit interface. Today we copied a file (using robocopy) from our databaseserver to another server (backup-server). The copy was started from the backup-server and source were specified using UNC. The copy were using about 20% of the bandwith (about 200Mbit). During the copy, sql-server reported several errors, for example: AppDomain 15 (mp.dbo[runtime].14) is marked for unload due to memory pressure. The client was unable to reuse a session with SPID 75, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message. ***Stack Dump being sent to [PATH\SQLDump0005.txt Resource Monitor (0x1384) Worker 0x000000008000C1C0 appears to be non-yielding on Node 0. Memory freed: 0 KB. Approx CPU Used: kernel 15 ms, user 218 ms, Interval: 428541. So to me it appears that sql-server crashed during a file copy. We have 27 GB ram. With 24.5 GB dedicated to SQL-Server. The files we copied were quite large, some over 50GB. I found a similar issue about this: http://support.microsoft.com/kb/920739/ Do you think the issue above could be the cause of the sql-server crash? ///Patrik

Can SSAS 2005 run with Sql Server 2008 database engine?

Are there any known issues of running SSAS 2005 with SQL Server 2008 database engine?

Sql Server 2005 ( remove header information from query output file "Job 'bustd_Daily_Query_Output_1

Dear All,I have scheduled job for querying output & asve it into particuler folder....but in the top of file i getting the message like "Job 'bustd_Daily_Query_Output_13July09' : Step 1, 'Query1' : Began Executing 2009-07-13 16:32:06"I want to remove this & want output in txt file format without above header....RegardsRavendra Cindia

Unable to install SQL Server 2005 SP2 - Unable to install Windows Installer MSI File

I have been trying to figure out how to fix this problem for the past couple of days and I was unable to find an answer to my specific problem in the forum.My OS is Windows XP Professional SP3 on MacBook Pro, using Parallels Desktop 4.0. Every single time Windows update tries to install SQL Server 2005 SP2, it fails. I am using Business Contact Manager with Outlook 2007 and SQL Server stops randomly and I am forced to restart the software. I am not sure if it is relevant to this specific problem but I thought I would make a note of this.I have downloaded SP2 and tried to install it locally but that did not work. Here is the error message I get:OS Version: Microsoft Windows XP Professional Service Pack 3 (Build 2600)Package Language: 1033 (ENU)Package Platform: x86Package SP Level: 2Package Version: 3042Command-line parameters specified:     /quiet     /allinstancesCluster Installation: No**********************************************************************************Prerequisites Check & StatusSQLSupport: Passed**********************************************************************************Products Detected                         Language  Level  Patch Level       Platform  EditionExpress Database Services (MSSMLBIZ)      ENU       SP1    2005.090.2047.00  x86       EXPRESS**********************************************************************************Products Disqua

database size limit about SQL Server 2005 Express

I know that there is a size limit (4 GB) for SQL Server 2005 Express, but I am not quite sure if the limit is applied for only ONE database data file or for ALL the database data, suppose I have two databases DB1 and DB2, so which of the following statement is correct? A. The size limit for DB1 is 4GB, and the size limit for DB2 is also 4GB, so if DB1 is 3G and DB2 is 3.5G,that will be OK. B. The total size for both DB1 and DB2 can not be larger than 4GB, which means if DB1 is 3G, then DB2 can not be large than 1G.

could not start the database engine service in Sql Server 2005

Dear All,   I am not able to  start the sql server 2005 database engine services... Sql server 2005 server is installed in one machine(SERVER)  and we have 10 client machine connecting to the server     When i try to start the service from the Service.msc in the SERVER i am getting the following error   =================================== Cannot connect to KEYSKILL. =================================== An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider) ------------------------------Error Number: 2Severity: 20State: 0 ------------------------------Program Location:    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverI

buffer data from a sql server database file

I'm in need of a sample code that will let me buffer data from a database so that I can go next> and <prev in a database file. Does someone have an idea on now to do this. Joe      Toppers BBS http://toppersbbs.dtdns.net C# Windows and Console applications. PHP, Mysql. HTML

SSIS 2005 - XML Source no data loading to sql server database destination

Hello I am trying to load data from xml source to sql server destination, but the task executes with no data loaded to destination. i really appreciate any guidance in working and troubleshooting xml sources. Regards Harris

Database connectivity problem (sql server 2005)

I want to connect my database using my windows application. My database is on the server and i my connection string is something like that Data Source=;User ID=myUserID;pwd=MyPwd;Initial Catalog=MyDatabase When i  try to connect in my local network using this connection string this work fine Data Source=MyServerName;User ID=myUserID;pwd=MyPwd;Initial Catalog=MyDatabase These are my server setting Go to "SQL server 2005 Surface Area Configuration" Surface Area Configuration for Services and Connections In Configure Surface Area for localhost (chnage computer) 1)Click (chnage computer) 2)Then Select Computer Window open, Now checked the local computer -> OK View By Instance: 1)Database Engine -> Service Start 2)Database Engine -> Remote Connections -> Local and remote connections -> Using both TCP/IP and named pipes 3)SQL server Browser - > Service Start Apply - OK View By Component: 1)Database Engine -> Service Start 2)Database Engine -> Remote Connections -> Local and remote connections -> Using both TCP/IP and named pipes 3)SQL server Browser - > Service Start Apply - OK Now In SQL server Configuration Manager. Shared Memory   : Enabled TCP/IP   : Enabled Named Pipes : Enabled VIA  : Disabled Select Client Protocols in the left side. In the TCP/IP Properties these are my
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend