Jump to content

Recommended Posts

Posted

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

Posted
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
Posted
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

Posted

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; 

  • Thanks 1
Posted
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

Posted

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.

Posted

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.

Posted
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 :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...