tj2419 Posted May 1, 2013 Posted May 1, 2013 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
secretlife Posted May 1, 2013 Posted May 1, 2013 (edited) 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. Edited May 1, 2013 by secretlife 1
tj2419 Posted May 2, 2013 Author Posted May 2, 2013 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
Meldrew Posted May 2, 2013 Posted May 2, 2013 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
KK20 Posted May 2, 2013 Posted May 2, 2013 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
Geoff Posted May 2, 2013 Posted May 2, 2013 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. CREATE TABLE statistics_backup LIKE moodle.statistics; INSERT statistics_backup SELECT * FROM moodle.statistics; Then remove the data from the statistics table. TRUNCATE TABLE moodle.statistics; 1
tj2419 Posted May 2, 2013 Author Posted May 2, 2013 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. CREATE TABLE statistics_backup LIKE moodle.statistics; INSERT statistics_backup SELECT * FROM moodle.statistics; Then remove the data from the statistics table. 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
Geoff Posted May 2, 2013 Posted May 2, 2013 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.
KK20 Posted May 2, 2013 Posted May 2, 2013 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.
tj2419 Posted May 9, 2013 Author Posted May 9, 2013 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. CREATE TABLE statistics_backup LIKE moodle.statistics; INSERT statistics_backup SELECT * FROM moodle.statistics; Then remove the data from the statistics table. TRUNCATE TABLE moodle.statistics; Worked perfectly thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now