文档解决问题:
现场Hibos版本较低,因故需要升级新版本,HiBOS新版较旧版数据库有一些变化 , 旧版数据库覆盖到新版库时,部分功能或后台页面可能无法正常,碰到类似问题,可尝试执行该文档中语句升级DB_HIBOS表结构。
HiBOS旧库升级至新版后数据库升级
文档解决问题:
现场Hibos版本较低,因故需要升级新版本,HiBOS新版较旧版数据库有一些变化 , 旧版数据库覆盖到新版库时,部分功能或后台页面可能无法正常,碰到类似问题,可尝试执行该文档中语句升级DB_HIBOS表结构。
[if !supportLists]1. [endif]备份Hibos数据库
[root@PEGFD-Hibos ~]# /home/backup/backup.daily
导出/home/backup/daily/目录下当前日期时间的数据库文件
备份/usr/eflow/目录下conf文件夹等
2. Hibos后,导入数据库文件、conf文件夹等
[root@PEGFD-Hibos daily]# tar zxfDB_HIBOS.20191128.tgz DB数据自定义最新的
[root@PEGFD-Hibos
daily]# ls
DB_HIBOS.20191128 DB_HIBOS.20191128.tgz
[root@PEGFD-Hibos
daily]# mysql -uroot -pamttgroup DB_HIBOS < DB_HIBOS.20191128
[if !supportLists]3. [endif]登录进Hibos页面查看所有菜单是否正常,如果有提示数据库错误,进入mysql命令行执行以下语句
[root@PEGFD-Hibos daily]# mysql -uroot -pamttgroup DB_HIBOS
Reading table information for completion of table and column
names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor.
Commands end with ; or \g.
Your MySQL connection id is 36684
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All
rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current
input statement.
mysql>
以下语句在MySQL命令行执行。
以下的语句在旧库导入完成后再执行。
以下的乱码无关紧要,不用理会直接执行即可
alter table T_CardBatch add CredentialsLevel tinyint(4) default -1;
alter table T_CardBatch add CredentialsType tinyint(4) default -1;
alter Table T_CardBatch add RedirectUrl varchar(256) default '';
alter Table T_CardBatch add `PhoneFlag` char(1) DEFAULT '0';
alter table T_CardBatch add IspGroupID int(8) DEFAULT '0', add QosGroupID int(8) DEFAULT '0';
ALTER TABLE T_Schedule ADD BwAccEnable char(1) default '0' afterMaxOnline;
ALTER TABLE T_Schedule ADD DhcpEnable char(1) default '0' afterBwAccEnable;
ALTER TABLE T_Schedule ADD Managers varchar(255) afterExtraVlans;
ALTER TABLE T_Priority add NetworksupervisorSet varchar(32) NOT NULL DEFAULT '000000000000000000000000000000';
ALTER TABLE T_WirelessInfo add Longitude char(64) DEFAULT NULL;
ALTER TABLE T_WirelessInfo add Latitude char(64) DEFAULT NULL;
ALTER TABLE T_SysParam add AccountOrIP varchar(64) DEFAULT NULL;
alter table T_MacLog add phone varchar(32) comment '';
alter table T_AcctDetail add Frequency decimal(8,1);
alter table T_AcctDetail add MeetStartTime int(16) default 0;
以上命令执行后,可查看HiBOS的状态,如果正常,可不用向下看了
如果仍然报错,继续执行以下命令
insert into T_SysParam(ParamName,ParamValue,Sort) value('O2oWechat',0,100);
insert into T_SysParam(ParamName,ParamValue,Sort) value('NetworkInterface',0,110);
insert into T_SysParam(ParamName,ParamValue,Sort) value('DhcpProportion',9,120);
insert into T_SysParam(ParamName,ParamValue,Sort) value('MacProportion',9,130);
alter table T_AcctDetail add `SmsStatus` int(4) DEFAULT '0';
alter table T_Account add `SmsStatus` int(4) DEFAULT '0';
以上命令执行后,可查看HiBOS的状态,如果正常,可不用向下看了
如果仍然报错,继续执行以下命令
DROP TABLE IF EXISTS `T_FailureDomain`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_FailureDomain`(
`LogID` int(16) NOT NULLAUTO_INCREMENT,
`FailureDomain` varchar(256) COLLATE latin1_german1_ci NOT NULL,
`FailureTimes` int(5) unsigned DEFAULT '0',
`LastDate` int(16) unsigned DEFAULT '0',
PRIMARY KEY (`LogID`)
) ENGINE=MyISAM AUTO_INCREMENT=1179 DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci;
DROP TABLE IF EXISTS `T_InternetSurveillance`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_InternetSurveillance`(
`PlaceID` char(15) NOT NULL DEFAULT '' COMMENT 'É��ø·þÎñ³¡Ëù±à Âë',
`PlaceName` varchar(255) DEFAULT '' COMMENT 'É��ø·þÎñ³¡ËùÃû³Æ',
`ProvinceID` char(6) NOT NULL DEFAULT '' COMMENT 'Ê¡·�',
`CityID` char(6) NOT NULL DEFAULT '' COMMENT '³ÇÊ�',
`AreaID` char(6) NOT NULL DEFAULT '' COMMENT 'Çø�Ø',
`PlaceLong` char(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '³¡Ëù¾Â¶È',
`PlaceLat` char(64) CHARACTER SET utf8 DEFAULT NULL COMMENT '³¡Ëùγ¶È',
`PlaceType` int(1) DEFAULT '0' COMMENT '³¡Ëù·þÎñÀà ��',
`PlaceNature` int(1) DEFAULT '0' COMMENT '³¡Ëù¾ÂÓªÃ�ÔÖÊ',
`PlaceLegalPerson` char(64) DEFAULT '' COMMENT '³¡Ëù¾ÂÓª·¨ÈË',
`PlaceIDType` int(3) DEFAULT '0' COMMENT '¾ÂÓª·¨ÈËÓÃ�Ã�§Ö¤¼þÀà Ã�Ã�',
`PlaceIDNumber` char(128) DEFAULT '' COMMENT '¾ÂÓª·¨ÈËÓÃ�Ã�§Ö¤¼þºÅÂë',
`PlacePhoneNum` char(128) DEFAULT '' COMMENT '�ª�µ·½Ê½',
`PlaceOpenTime` int(25) DEFAULT NULL COMMENT 'ÓªÒµ¿ªÊ¼Ê±¼ä£¨Ê±£©',
`PlaceCloseTime` int(25) DEFAULT NULL COMMENT 'ÓªÒµ½áÊøʱ¼ä',
`AccessFunction` char(128) DEFAULT '' COMMENT '³¡Ëù�øÂç½ÓÈ뷽ʽ',
`PlaceIP` char(64) DEFAULT '0' COMMENT '�øÂç½ÓÈëÕ˺Żò¹Ì¶¨IPµØÖ·',
`PlaceBarCode` char(64) DEFAULT NULL COMMENT '°²È«³§ÉÌ×éÖ¯»ú¹¹´úÂë',
`PlaceAddr` char(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '³¡Ëù�ê�¸µØÖ·',
`TelecomProvider` char(2) CHARACTER SET utf8 DEFAULT '0' COMMENT '³¡Ëù�øÂç½ÓÈë·þÎñÉÌ',
`AccountOrIP` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '�øÂç½ÓÈëÕ˺ŻòÕßIPµØÖ·',
`AccountOrEndIP` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '½áÊøIPµØÖ·',
`PlaceOpenTimemin` int(25) DEFAULT NULL COMMENT '¿ªÊ¼Ê±¼ä£¨·ÖÖÓ£©',
`PlaceCloseTimemin` int(25) DEFAULT NULL COMMENT '½áÊøʱ¼ä£¨·Ö£©',
`PlaceSafePerson` char(64) DEFAULT '' COMMENT '°²È«Ô±',
`PlaceSafePhone` char(128) DEFAULT '' COMMENT '°²È«Ô±µç»°',
`PlaceSafeID` char(128) DEFAULT '' COMMENT '°²È«Ô±É÷Ã�Ö¤',
PRIMARY KEY (`PlaceID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `T_SuppliersInformation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_SuppliersInformation`(
`SuppliersName` char(70) NOT NULL,
`SuppliersID` char(64) DEFAULT NULL,
`SuppliersAdress` char(255) DEFAULT NULL,
`SuppliersTechnicist` char(128) DEFAULT NULL,
`SuppliersPhone` char(128) DEFAULT NULL,
`SuppliersMail` char(32) DEFAULT NULL,
`Suppliersverson` char(32) DEFAULT NULL,
PRIMARY KEY (`SuppliersName`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `T_FreeVlan`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_FreeVlan`(
`VlanID` int(4) NOT NULL,
`FreeTime` int(8) DEFAULT '0',
`OncePortal` varchar(16) DEFAULT '',
`Description` varchar(40) DEFAULT '',
PRIMARY KEY (`VlanID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `T_ScheduleRecurring`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_ScheduleRecurring`(
`ScheduleID` int(16) NOT NULLAUTO_INCREMENT,
`AccountID` varchar(16) NOT NULL,
`Password` varchar(16) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
`ScheduleName` varchar(32) DEFAULT '',
`PeriodType` char(1) DEFAULT '0',
`PeriodCount` int(4) DEFAULT '0',
`ScheduleInDate` int(16) unsigned DEFAULT '0',
`ScheduleOutDate` int(16) unsigned DEFAULT '0',
`ScheduleStartTime` int(16) DEFAULT '0',
`PolicyID` int(8) DEFAULT '0',
`PortalMode` char(1) DEFAULT '0',
`MaxOnLine` int(4) DEFAULT '0',
`RedirectUrl` varchar(128) DEFAULT '',
`BwTierID` int(8) DEFAULT '0',
`UpRate` int(8) DEFAULT '0',
`DownRate` int(8) DEFAULT '0',
`TotalUpRate` int(8) DEFAULT '0',
`TotalDownRate` int(8) DEFAULT '0',
`VlanID` int(4) DEFAULT '0',
`Memo` varchar(64) DEFAULT '',
`CreateDate` int(16) unsigned DEFAULT '0',
`CreateOperator` varchar(16) DEFAULT '',
`CancelFlag` char(1) DEFAULT '0',
`CancelDate` int(16) unsigned DEFAULT '0',
`CancelOperator` varchar(16) DEFAULT '',
`ConferenceCode` varchar(16) DEFAULT '',
`ConferenceSSID` varchar(64) DEFAULT '',
`ExtraGuestRooms` varchar(255) DEFAULT '',
`ExtraVlans` varchar(128) DEFAULT '',
`SalesEmail` varchar(200) DEFAULT '',
`AlertEmail` varchar(200) DEFAULT '',
`AlertSMS` varchar(200) DEFAULT '',
`LastScheduleTime` int(16) unsigned DEFAULT '0',
PRIMARY KEY (`ScheduleID`),
KEY `AccountID` (`AccountID`),
KEY `ScheduleInDate` (`ScheduleInDate`),
KEY `ScheduleOutDate` (`ScheduleOutDate`),
KEY `CreateDate` (`CreateDate`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `T_ConferencePlanner`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_ConferencePlanner`(
`PlannerID` varchar(16) NOT NULL,
`Password` varchar(40) NOT NULL,
`ScheduleID` int(16) DEFAULT '0',
`RealName` varchar(32) DEFAULT '',
`CreateTime` int(16) unsigned DEFAULT '0',
`LoginTime` int(16) unsigned DEFAULT '0',
`LoginNum` int(8) DEFAULT '0',
`ValidState` char(1) DEFAULT '1',
`LastLoginFailTime` int(16) unsigned DEFAULT '0',
`LoginFailCount` int(8) DEFAULT '0',
`TmpLockState` char(1) DEFAULT '0',
`TmpLockTime` int(16) unsigned DEFAULT '0',
`LastPasswordTime` int(16) unsigned DEFAULT '0',
PRIMARY KEY (`PlannerID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `T_ConferenceNotification`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_ConferenceNotification`(
`SerialNo` int(16) NOT NULLAUTO_INCREMENT,
`ScheduleID` int(16) DEFAULT '0',
`Title` varchar(64) NOT NULL,
`Content` varchar(255) DEFAULT '',
`ReleaseTime` int(16) unsigned DEFAULT '0',
`ExpireTime` int(16) unsigned DEFAULT '0',
PRIMARY KEY (`SerialNo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `T_ConferenceMessage`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_ConferenceMessage`(
`SerialNo` int(16) NOT NULLAUTO_INCREMENT,
`ScheduleID` int(16) DEFAULT '0',
`FromRole` char(1) DEFAULT '0',
`FromID` varchar(16) DEFAULT '',
`Content` varchar(255) DEFAULT '',
`CreateTime` int(16) unsigned DEFAULT '0',
PRIMARY KEY (`SerialNo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
alter table T_MacLog Add `OpenID` varchar(72) DEFAULT '', add `BwTierID` int(8) DEFAULT '0', add `UpRate` int(8) DEFAULT '0', add `DownRate` int(8) DEFAULT '0';
CREATE TABLE `T_UrlSurvey`(
`SerialNo` int(12) NOT NULLAUTO_INCREMENT,
`SiteUrl` varchar(64) DEFAULT '',
`SiteName` varchar(64) DEFAULT '',
`BaseTime` int(6) DEFAULT '0',
PRIMARY KEY (`SerialNo`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
ALTER TABLE T_AcctPolicy ADD `BatchAcctFlag` char(1) DEFAULT '0', ADD `BatchFeeRate` decimal(8,2) DEFAULT '0.00', ADD `BatchMaxFee` decimal(8,2) DEFAULT '0.00';
ALTER TABLE T_Account ADD `GuestBirthday` varchar(16) DEFAULT '', ADD `GuestBirthday2` varchar(16) DEFAULT '',
ADD `DepartureDate` int(16) unsigned DEFAULT '0';