radius mamager数据库备份

1.整理连接日志数据:

create table radacct_201203 like radacct;
insert into radacct_201203
  select * from radacct
  where acctstoptime < '2012-04-01 00:00:00';
delete from radacct
 where acctstoptime < '2012-04-01 00:00:00'

2.整理即将到期用户数据:

create table rm_users_201205 like rm_users;
insert into rm_users_201205
  select * from rm_users
  where expiration like '2012-05%'

3.整理rm_radacct数据:

create table rm_radacct_201203 like rm_radacct;
 insert into rm_radacct_201203
   select * from rm_radacct
   where acctstoptime < '2012-04-01 00:00:00';
 delete from rm_radacct
  where acctstoptime < '2012-04-01 00:00:00'

 4.整理syslog数据:

create table rm_syslog_2012q1 like rm_syslog;
insert into rm_syslog_2012q1
  select * from rm_syslog
  where datetime < '2012-04-01 00:00:00';
delete from rm_syslog_2012q1
where datetime < '2012-01-01 00:00:00'

 5.输出上月开户数据:

create table rm_users_201205 like rm_users;
insert into rm_users_201205
select * from rm_users
where expiration like '2012-05%'

你可能感兴趣的:(mysql,radiusmanager)