Composer 中的 ThingWorx 模型定义 > 数据存储 > 值流 > 值流中大型数据集的迁移脚本 (8.3 及以下版本)
值流中大型数据集的迁移脚本 (8.3 及以下版本)
概述
在 ThingWorx 8.3 及更早版本中,可能会达到值流条目最大限制 (MAX_INT),从而无法再新建值流条目。可通过运行 PTC 提供的脚本来防止此类情况发生。
运行脚本时,会出现下列情况:
新建表格,以便立即启动 ThingWorx 服务器。将值流架构更改为支持大整数,而不是整数,可确保您在更新数据库时不会遇到 MAX_INT 限制问题。
历史数据将从旧表迁移到新表中,这会以后台任务的形式实现。从而允许您立即使用新的 ThingWorx 安装,因为将历史数据导入到新表可能需要较长时间。
适用的版本
新安装 ThingWorx 8.4.0 及更高版本时会包含此功能,因此无需执行任何操作。您可以从 ThingWorx 的任何版本中运行这些脚本,因此,如果您将对早期版本进行升级或希望在当前版本中使用此功能,请遵循以下步骤。
脚本的位置
这些脚本可在更新文件夹中的 ThingWorx 软件下载中找到。软件下载位于 PTC 支持站点
运行脚本
请按照以下步骤运行脚本:
1. 停止 Tomcat。
2. 备份 PostgreSQL 或 MSSQL 数据库。
3. 更新以下架构更新和数据迁移脚本中的连接信息 (服务器端口数据库用户名密码):
PostgreSQL: thingworxPostgresValueStreamSchemaUpdate.sh (Linux) OR thingworxPostgresValueStreamSchemaUpdate.bat (Windows)
AND
thingworxPostgresValueStreamDataUpdate.sh (Linux) OR thingworxPostgresValueStreamDataUpdate.bat (Windows)
MSSQL: thingworxMssqlValueStreamSchemaUpdate.sh (Linux) OR thingworxMssqlValueStreamSchemaUpdate.bat (Windows) AND thingworxMssqlValueStreamDataUpdate.sh (Linux) OR thingworxMssqlValueStreamDataUpdate.bat (Windows)
4. 执行架构更新脚本:
PostgreSQL: thingworxPostgresValueStreamSchemaUpdate.sh (Linux) OR thingworxPostgresValueStreamSchemaUpdate.bat (Windows)
MSSQL: thingworxMssqlValueStreamSchemaUpdate.sh (Linux) OR thingworxMssqlValueStreamSchemaUpdate.bat (Windows)
5. 启动 Tomcat。
6. 执行数据迁移脚本:
PostgreSQL: thingworxPostgresValueStreamDataUpdate.sh (Linux) OR thingworxPostgresValueStreamDataUpdate.bat (Windows)
MSSQL: thingworxMssqlValueStreamDataUpdate.sh (Linux) OR thingworxMssqlValueStreamDataUpdate.bat (Windows)