Sage 100

 View Only
Expand all | Collapse all

Sage Premium SQL logs

  • 1.  Sage Premium SQL logs

    Posted 08-17-2023 15:38

    Could someone make a recommendation on what directions they follow when condensing down the SQL logs for the company database and limit the grow of the log file? Or point me in the direction if someone already has directions. I have a client that just called the IT group was scheduled to do it but now just found out that don't have anyone on staff that is a SQL DB. The log file is growing daily, and I asked the IT group if they could cap the file size, but they don't know how to do it. I'm assuming that I need to get everyone out of Sage before the utility is run in SQL. I just need to find a resolution quickly because the server is getting slower and slower. TIA.



    ------------------------------
    Shannon Stanley
    Sage 100 Consultant
    Ardent Consulting LLC
    ------------------------------


  • 2.  RE: Sage Premium SQL logs

    Posted 08-17-2023 15:47

    Quick fix, change the database recovery model to Simple.  That recycles log file space without any extra steps.



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 3.  RE: Sage Premium SQL logs

    Posted 08-17-2023 15:50

    No need to kick everyone out.  Make the change, then you can shrink the log files down to a reasonable size.  (I usually go with ~500MB).  Do not shrink the database file size... just the log file size.

    SQL log files are only useful if you have implemented an advanced backup and recovery strategy.  Otherwise, Simple is fine for most Sage 100 systems.



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 4.  RE: Sage Premium SQL logs

    Posted 08-17-2023 16:15
    Kevin,

    Should I set this up "simple" under database recovery for both MAS_System and all the company code log files?

    Also do you have steps or article on how to shrink the log files? Sorry I'm a rookie at SQL.



    Shannon Stanley
    Sage 100 Consultant | Support Specialist

    T:704.839.6697
    E:Shannon.Stanley@ArdentConsultingLLC.com
    W: ArdentConsultingLLC.com






  • 5.  RE: Sage Premium SQL logs

    Posted 08-17-2023 16:23

    Yes, all MAS_* SQL databases can be set to Simple (when you don't have an advanced backup and recovery plan).



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 6.  RE: Sage Premium SQL logs

    Posted 08-17-2023 16:51
    Kevin,

    I forgot to ask, which order do you recommend I go in? Shrinking the log file then apply the limit?
    If a log file is large, do you have to run the shrink utility more than once?


    Shannon Stanley
    Sage 100 Consultant | Support Specialist

    T:704.839.6697
    E:Shannon.Stanley@ArdentConsultingLLC.com
    W: ArdentConsultingLLC.com






  • 7.  RE: Sage Premium SQL logs

    Posted 08-17-2023 17:39

    Change the recovery model, then shrink the log file (while setting the new size at the same time).  Repeat for each database. 

    Rarely you'll have to repeat, if there is an active transaction in the wrong location within the log, blocking the shrink... Check the file size afterwards to make sure the shrink works.

    Note: the new size is not a limit.  SQL will automatically expand the log file size if needed, but it will only do that in times of heavy SQL activity (like running a big "recalculate" utility).  The "Simple" recovery method just means the log space is automatically recycled (only holding actively-being-processed-transactions).



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 8.  RE: Sage Premium SQL logs

    Posted 08-17-2023 19:48

    @Kevin Moyes I ran the utility this evening on three different databases and the utility will not run. The screen would just disappear after I select okay and never started the shrinking process. I would go back in to check the log file size and it's still the same size. What does this mean? (Thank you for the screenshots they were very helpful).



    ------------------------------
    Shannon Stanley
    Sage 100 Consultant
    Ardent Consulting LLC
    ------------------------------



  • 9.  RE: Sage Premium SQL logs

    Posted 08-18-2023 09:28
    If it can, it will shrink it at that time to that size making it very small. If it's jammed up with a bunch of data as Kevin indicated, it will not shrink that will need to be cleaned out. How big are these lock files?

    Carmen Cruz
    Sage Consultant
    carmen.cruz@compudata.com
    215-969-1000 Ext. 279
    www.compudata.com
    Work Smarter... Together 

    CompuData, Inc. • 325 Chestnut St, Ste 700 • Philadelphia • PA • 19106





  • 10.  RE: Sage Premium SQL logs

    Posted 08-18-2023 09:28
    When you ran the shrink process, did you tell it to change the size to 8192?

    Carmen Cruz
    Sage Consultant
    carmen.cruz@compudata.com
    215-969-1000 Ext. 279
    www.compudata.com
    Work Smarter... Together 

    CompuData, Inc. • 325 Chestnut St, Ste 700 • Philadelphia • PA • 19106





  • 11.  RE: Sage Premium SQL logs

    Posted 08-18-2023 11:32

    Make sure there is available free space in the log file.  If this is zero, then you probably didn't change to Simple yet.

    If you have extra room in the file to shrink, but it doesn't happen, try again later... or after hours (when you can stop Sage / SQL), restart the SQL service, which will break any active connections to the database and allow the shrink after you restart.

    Full: log files contain transaction details for everything done in the database since the last full SQL backup of that database.  Log file space keeps growing until a SQL backup command is run against the database.

    Simple: log files are basically just working space, immediately recycled once pending transactions are written to the data file.



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 12.  RE: Sage Premium SQL logs

    Posted 08-17-2023 16:26
      |   view attached

    I don't know where I got the attached file detailing how to shrink th e SQL log file.  It may have been someone from 90 Minds.  If so, my apologies for not citing my source of information.



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------

    Attachment(s)



  • 13.  RE: Sage Premium SQL logs

    Posted 08-17-2023 16:37
    Thank you, Kevin and Doug! I know I will have more questions.

    Shannon Stanley
    Sage 100 Consultant | Support Specialist

    T:704.839.6697
    E:Shannon.Stanley@ArdentConsultingLLC.com
    W: ArdentConsultingLLC.com