NewsCNCnetPDMAbout usSupport
  

ORACLE DATABASE TABLES | CNCNETPDM MANUAL

This section describes the steps to setup required and optional database tables for CNCnetPDM in case you're using an Oracle database.

  • Note: Starting with CNCnetPDM Ver. 6.3.3.1 the names of all database tables can be configured on a per-service basis, see chapter Connect of CNCnetPDM INI file for details.

For an Oracle database the information in section SQL Server Database tables applies also but the scripts to create the tables look slightly different.

MTH_RAW_DATA

The following code can be used to create MTH_RAW_DATA. CNCnetPDM stores all data acquired in every reading cycle in this table. This Alternatively you can use MTH_RAW_DATA_ORACLE.sql from this zip archive. Here user is MTH and tablespace is USERS, please change that according to your needs.

 CREATE TABLE "MTH"."MTH_RAW_DATA" 
   (	"GROUP_ID" NUMBER, 
	"READING_TIME" DATE NOT NULL ENABLE, 
	"DEVICE_NUMBER" NUMBER NOT NULL ENABLE,
	"TAG_CODE" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
	"TAG_DATA" VARCHAR2(255 BYTE), 
	"CREATION_DATE" DATE, 
	"PROCESSING_FLAG" NUMBER DEFAULT 2 NOT NULL ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS" ;
   COMMENT ON COLUMN "MTH"."MTH_RAW_DATA"."GROUP_ID" IS 'Tag context group identifier';
   COMMENT ON COLUMN "MTH"."MTH_RAW_DATA"."READING_TIME" IS 'Reading time for the tag data';
   COMMENT ON COLUMN "MTH"."MTH_RAW_DATA"."DEVICE_NUMBER" IS 'Device number sending tag data';
   COMMENT ON COLUMN "MTH"."MTH_RAW_DATA"."TAG_CODE" IS 'Tag code';
   COMMENT ON COLUMN "MTH"."MTH_RAW_DATA"."TAG_DATA" IS 'Tag data';
   COMMENT ON COLUMN "MTH"."MTH_RAW_DATA"."CREATION_DATE" IS 'Creation time';
   COMMENT ON TABLE "MTH"."MTH_RAW_DATA"  IS 'This table contains the unprocessed tag data collected from devices'; 
FIG 1:    Setup script (ORACLE) for database table MTH_RAW_DATA

MTH_ONLINE_DATA

To only store the most recent data from your machines you can use table MTH_ONLINE_DATA. CNCnetPDM updates all existing records for every device in this table when new data is queried. The update interval depends on the value for PollInterval in section [GENERAL] of CNCnetPDM.ini. To use this table please make sure that you have set WriteOnlineData = 1 in section [Connect] of CNCnetPDM.ini. You can create table MTH_ONLINE_DATA manually by using the following code or file MTH_ONLINE_DATA_ORACLE.sql from this zip archive. Here again user is MTH and tablespace is USERS, please change that if needed.

 CREATE TABLE "MTH"."MTH_ONLINE_DATA" 
   (	"GROUP_ID" NUMBER, 
	"READING_TIME" DATE NOT NULL ENABLE, 
	"DEVICE_NUMBER" NUMBER NOT NULL ENABLE,
	"TAG_CODE" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
	"TAG_DATA" VARCHAR2(255 BYTE), 
	"CREATION_DATE" DATE, 
	"PROCESSING_FLAG" NUMBER DEFAULT 2 NOT NULL ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS" ;
   COMMENT ON COLUMN "MTH"."MTH_ONLINE_DATA"."GROUP_ID" IS 'Tag context group identifier';
   COMMENT ON COLUMN "MTH"."MTH_ONLINE_DATA"."READING_TIME" IS 'Reading time for the tag data';
   COMMENT ON COLUMN "MTH"."MTH_ONLINE_DATA"."DEVICE_NUMBER" IS 'Device number sending tag data';
   COMMENT ON COLUMN "MTH"."MTH_ONLINE_DATA"."TAG_CODE" IS 'Tag code';
   COMMENT ON COLUMN "MTH"."MTH_ONLINE_DATA"."TAG_DATA" IS 'Tag data';
   COMMENT ON COLUMN "MTH"."MTH_ONLINE_DATA"."CREATION_DATE" IS 'Creation time';
   COMMENT ON TABLE "MTH"."MTH_ONLINE_DATA"  IS 'This table contains the unprocessed tag data collected from devices'; 
FIG 2:    Setup script (ORACLE) for database table MTH_ONLINE_DATA

MTH_USER_CONTEXT

For table MTH_USER_CONTEXT you can use the following code or alternatively MTH_USER_CONTEXT_ORACLE.sql from this zip archive. Here again user is MTH and tablespace is USERS, please change that if needed.

  CREATE TABLE "MTH"."MTH_USER_CONTEXT" 
   (	"USER_CONTEXT_PK_KEY" NUMBER NOT NULL ENABLE, 
	"SCAN_TIME" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
	"EQUIPMENT_FK" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
	"WORKORDER_FK" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
	"SEGMENT_FK" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
	"ITEM_FK" VARCHAR2(255 BYTE) NOT NULL ENABLE, 
	"EQUIP_DOWN_REASON" VARCHAR2(255 BYTE), 
	"SYSTEM" VARCHAR2(20 BYTE), 
	 CONSTRAINT "MTH_USER_CONTEXT_PK" PRIMARY KEY ("USER_CONTEXT_PK_KEY")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS" ;
FIG 3:  Setup script (ORACLE) for database table MTH_USER_CONTEXT

MTH_EQP_SHIFT_AVAIL_V

To only acquire data within an active shift for a device you can use the following code or alternatively file MTH_EQP_SHIFT_AVAIL_V_ORACLE.SQL from this zip archive.

  CREATE TABLE "MTH"."MTH_EQP_SHIFT_AVAIL_V" 
   (	"EQUIPMENT_FK" VARCHAR2(255 BYTE) NOT NULL ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS" ;
FIG 4:  Setup script (ORACLE) for database table MTH_EQP_SHIFT_AVAIL_V

For testing you can insert the 4 digit device number into field EQUIPMENT_FK and adjust the .ini file for CNCnetPDM to only collect data within a shift. In a production environment MTH_EQP_SHIFT_AVAIL_V should be a view that looks up if there’s an active shift for the equipment in a shift table and, if yes, returns the 4 digit device number.

Privacy notice

This website uses cookies. By continuing to use it you agree to our privacy policy. 

https://www.inventcom.net/support/cncnetpdm-manual/oracle-database-tables

Support | CNCnetPDM Manual | Overview

Version 8.0.0.0 User Manual | Here you can find everything you need to install, setup and configure CNCnetPDM for your needs.... [read more]
Support | CNCnetPDM Manual | Overview

Support | CNCnetPDM Manual | Setup

This section describes the steps to install CNCnetPDM. EXTRACT FILES Create a folder for CNCnetPDM on your PC or at a Server. Due to Windows UAC please do NOT to... [read more]
Support | CNCnetPDM Manual | Setup

Support | CNCnetPDM Manual | Foreground Program

This section describes the steps to start CNCnetPDM as a foreground program. After extracting the files it is possible and save to immediately start CNCnetPDM. By default... [read more]
Support | CNCnetPDM Manual | Foreground Program

Support | CNCnetPDM Manual | Background Service

This section shows the steps to install and start CNCnetPDM as a background service. CNCnetPDM is able to and, in a production environment, usually runs as a windows background... [read more]
Support | CNCnetPDM Manual | Background Service

Support | CNCnetPDM Manual | Instances

This section describes the steps to setup and run multiple instances of CNCnetPDM on a single PC. In case you would like or have to work with different parameters for specific... [read more]
Support | CNCnetPDM Manual | Instances

Support | CNCnetPDM Manual | CNCnetPDM INI File

This section describes the steps to adjust CNCnetPDM via it's INI file according to your needs. CNCnetPDM.ini contains all information needed to control the functions of the... [read more]
Support | CNCnetPDM Manual | CNCnetPDM INI File

Support | CNCnetPDM Manual | OPC UA Server

The CNCnetPDM Standard OPC UA Server enables to add OPC UA Server functionality to any controller type (e.g. Fanuc, Mitsubishi, Heidenhain, PLCs) supported by CNCnetPDM. It... [read more]
Support | CNCnetPDM Manual | OPC UA Server

Support | CNCnetPDM Manual | MTConnect Overview

The CNCnetPDM MTConnect Adapter enables you to access machine controllers connected to CNCnetPDM from within your applications or any MTConnect compatible program like an... [read more]
Support | CNCnetPDM Manual | MTConnect Overview

Support | CNCnetPDM Manual | MTConnect Getting Started

Here you can find everything you need to know to get started with the CNCnetPDM MTConnect adapter. This section shows all necessary steps to setup CNCnetPDM, use the MTConnect... [read more]
Support | CNCnetPDM Manual | MTConnect Getting Started

Support | CNCnetPDM Manual | MTConnect Standard Agent 1.3

This document describes setup of the MTConnect Standard Agent Version 1.3 it’s usage and test with the CNCnetPDM MTConnect Adapter. CNCNETPDM SETUP | AGENT SETUP |... [read more]
Support | CNCnetPDM Manual | MTConnect Standard Agent 1.3

Support | CNCnetPDM Manual | SQL Server Database Tables

This section describes the steps to setup an MS SQL Server database and required as well as optional tables for CNCnetPDM. Note: Starting with CNCnetPDM Ver. 6.3.3.1 the names of... [read more]
Support | CNCnetPDM Manual | SQL Server Database Tables

Support | CNCnetPDM Manual | MySQL MariaDB Database Tables

This section describes the steps to setup required and optional database tables for CNCnetPDM in case you're using a MySQL or MariaDB (Version >= 5.5!)  database.... [read more]
Support | CNCnetPDM Manual | MySQL MariaDB Database Tables

Support | CNCnetPDM Manual | Database Connectivity

To connect to a database CNCnetPDM uses a Universal Data Link (.udl) file that contains information about your database. Connect to an MS SQL Server database... [read more]
Support | CNCnetPDM Manual | Database Connectivity

Support | CNCnetPDM Manual | Database Output

For both, MS SQL-Server and Oracle databases CNCnetPDM writes data acquired from devices to table RawDataTable (default MTH_RAW_DATA) and/or... [read more]
Support | CNCnetPDM Manual | Database Output

Support | CNCnetPDM Manual | Licensing

When you start the program or service the first time without a license CNCnetPDM automatically creates a license key for your copy. Without a purchased license key initially this... [read more]
Support | CNCnetPDM Manual | Licensing
Modified: 2023-11-25