+ Post New Thread
Results 1 to 10 of 10
Virtual Learning Platforms Thread, Moodle - how do you flush a table? And CPD in Technical; Hi We use moodle 1.9 on a windows server 2008. We use my SQL administrator to manage the tables. Our ...
  1. #1

    Join Date
    May 2011
    Location
    United Kingdom
    Posts
    562
    Thank Post
    135
    Thanked 21 Times in 20 Posts
    Rep Power
    12

    Moodle - how do you flush a table? And CPD

    Hi

    We use moodle 1.9 on a windows server 2008. We use my SQL administrator to manage the tables.

    Our statistics table has gotten too big so when it is enabled on a page it takes 30 seconds to load the page. I want to flush the table to start off with an empty table. Does anyone have a good step by step on how I can do this?

    Secondly does anyone know of any good moodle administrator courses? Not a course for creating courses but one that helps manage a moodle install. Good maintenance tasks, problem solving etc? Preferably in the north west?

    Or does anyone know of any good checklists for moodle maintenance tasks? Like annual tasks to keep moodle running quickly.

    Thanks

  2. #2

    Join Date
    Dec 2007
    Location
    Preston
    Posts
    369
    Thank Post
    14
    Thanked 86 Times in 79 Posts
    Rep Power
    31
    If you are on 1.9 you might struggle to find a face to face administrator course but the book (1.9 version) of Moodle administration https://moodle.org/mod/data/view.php?d=55&rid=1942 by Alex Büchner is a very useful manual to have to hand. And at the back of the book is a "Moodle healthcheck" which sounds very similar to your checklist.
    Last edited by secretlife; 2nd May 2013 at 01:59 AM.

  3. Thanks to secretlife from:

    tj2419 (3rd May 2013)

  4. #3

    Join Date
    May 2011
    Location
    United Kingdom
    Posts
    562
    Thank Post
    135
    Thanked 21 Times in 20 Posts
    Rep Power
    12
    Thanks I'll look at that. If it was a middle 2.# course that would be fine as I want to start looking at moving us over and upgrading. Cheers

  5. #4

    Join Date
    Apr 2007
    Location
    Cornwall
    Posts
    347
    Thank Post
    22
    Thanked 96 Times in 67 Posts
    Rep Power
    40
    Quote Originally Posted by tj2419 View Post
    Our statistics table has gotten too big so when it is enabled on a page it takes 30 seconds to load the page. I want to flush the table to start off with an empty table. Does anyone have a good step by step on how I can do this?
    You'll want to truncate the table, but does anyone know if this will have issues in moodle - are there any linked tables that will make this a really bad idea?

    Meldrew

  6. #5

    Join Date
    Oct 2008
    Posts
    226
    Thank Post
    2
    Thanked 13 Times in 13 Posts
    Rep Power
    22
    backup the database and try! A lot of the bits-and-bobs I tried when developing our moodle site was trial and error. Forums are hit and miss and due to 1.9 being rather aged now you might struggle. Upgrading should fix your problem too: https://tracker.moodle.org/browse/MDL-30643

  7. #6

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227
    I would copy the table, then truncate the old one (I'm guessing at the table names here, check them first).

    First create a copy of the table and data.

    Code:
    CREATE TABLE statistics_backup LIKE moodle.statistics; INSERT statistics_backup SELECT * FROM moodle.statistics;
    Then remove the data from the statistics table.

    Code:
    TRUNCATE TABLE moodle.statistics;

  8. Thanks to Geoff from:

    tj2419 (9th May 2013)

  9. #7

    Join Date
    May 2011
    Location
    United Kingdom
    Posts
    562
    Thank Post
    135
    Thanked 21 Times in 20 Posts
    Rep Power
    12
    Quote Originally Posted by Geoff View Post
    I would copy the table, then truncate the old one (I'm guessing at the table names here, check them first).

    First create a copy of the table and data.

    Code:
    CREATE TABLE statistics_backup LIKE moodle.statistics; INSERT statistics_backup SELECT * FROM moodle.statistics;
    Then remove the data from the statistics table.

    Code:
    TRUNCATE TABLE moodle.statistics;
    Would you just run that from within MY SQL Administrator? And truncate effectively clears all the data from the table?

    Anyone know any good moodle courses for admins with moodle 2.#?

    Thanks

  10. #8

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,850
    Thank Post
    110
    Thanked 598 Times in 514 Posts
    Blog Entries
    1
    Rep Power
    227
    Yeah, whatever you use to run SQL. I use dbforge Studio Express and PHPMyAdmin personally but whatever you are comfortable with.

    TRUNCATE removes the data from a table where as DROP removes the structure too.

  11. #9

    Join Date
    Oct 2008
    Posts
    226
    Thank Post
    2
    Thanked 13 Times in 13 Posts
    Rep Power
    22
    I would still backup if you dont know what you are doing. Who knows what cron jobs run maintenance for the moodle database. It all might be fine but if something else is linked and thus updated/removed from other tables then good luck with that.

    that being said, you'll have backups from your normal backup schedule so they will be good to go if things go wrong.

  12. #10

    Join Date
    May 2011
    Location
    United Kingdom
    Posts
    562
    Thank Post
    135
    Thanked 21 Times in 20 Posts
    Rep Power
    12
    Quote Originally Posted by Geoff View Post
    I would copy the table, then truncate the old one (I'm guessing at the table names here, check them first).

    First create a copy of the table and data.

    Code:
    CREATE TABLE statistics_backup LIKE moodle.statistics; INSERT statistics_backup SELECT * FROM moodle.statistics;
    Then remove the data from the statistics table.

    Code:
    TRUNCATE TABLE moodle.statistics;
    Worked perfectly thanks



SHARE:
+ Post New Thread

Similar Threads

  1. How do you manage multiple codecs and formats?
    By sven in forum AV and Multimedia Related
    Replies: 7
    Last Post: 17th March 2011, 01:26 PM
  2. How do you encrypt school data (and offer secure file deletion) ?
    By revilloc in forum How do you do....it?
    Replies: 3
    Last Post: 11th November 2009, 12:17 PM
  3. How do you filter AD users and computers...
    By kennysarmy in forum Windows
    Replies: 3
    Last Post: 29th September 2008, 01:51 PM
  4. Replies: 19
    Last Post: 21st April 2008, 11:53 AM
  5. Replies: 2
    Last Post: 30th January 2007, 11:27 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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