Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2003
    Posts
    8

    Question Unanswered: How to Reduce or Delete the Log file... Log file size creating problem

    I am using Replication with two of my SQL Server Databases , One Db is Publisher and other one is Subscriber , and data is continously replicating after every 5 mins . Now Publisher Database Log File increased upto 2541 MB and its creating problem while having any transaction or having any operation with DB . It also turned Replication utility Off.

    I tried to delete log file by turning SQL Server off , but it makes DB mode SUSPECT and UNACCESSBLE.

    Plz help me out to delete or reduce the log file size by maintaining the state of data.

    Also let me know wht is the method so that log file can automatically delete its contents when reach to certain limit.

    Regards
    Imran Malik

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Why are risking by deleting the SQL system files.

    Use DBCC SHRINKFILE to reduce the Tlog file size, refer to books online for more information.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    You haven't mentioned about the version of SQL used.

    If its version 7 then enable 'trunc.log at chkpt.' on the database.
    If its version 2K then use SIMPLE RECOVERY model.

    For more information again refer BOL.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  4. #4
    Join Date
    Apr 2003
    Location
    SC, USA
    Posts
    51
    By changing to the simple recovery model, your only backup mechanism is the full or differential backup, you can no longer perform transaction log backups. If you need to shrink the file, however, and maintain the ability to perform transaction log backups, there is a Stored Procedure I found at SQLServerCentral.com. It's called sp_force_shrink_log and I find it quite useful. You can find it at http://www.sqlservercentral.com/scri...butions/26.asp after you register with them.

  5. #5
    Join Date
    Apr 2003
    Posts
    8

    Re: How to Reduce or Delete the Log file... Log file size creating problem

    Thank You very much Satya and loach for telling me the way to reduce the size , I am using SQL Server 2K .

    DBCC SHRINKFILE and sp_force_shrink_log are helpful for reducing file size but for log deletion wht I have done is just deattach the database , remove log file and and attach db again , it refreshed and made DB log again with 1 MB. (I tested this with dummy Dbs.)

    and my Databases are also connected through replication utility , so it restricts me to deattach db using in replication , so I have to turned replication off to deattach and attach db . currently I am looking into procedure or way so that without disabling replication make log refresh coz it will take long process to disable and then again follow through steps for having last settings to turn replication ON between 2 databases.

    Thanks u All

    Regards
    Imran

  6. #6
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    How about the backups schedule interval for LOG?
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •