Oracle8 Time Series Cartridge User's Guide Release 8.0.4 A57501-01 |
|
The Oracle8 Time Series Cartridge is an extension to Oracle8 that provides storage and retrieval of timestamped data through object types. The cartridge is a building block for applications rather than being an end-user application in itself. It consists of datatypes along with related functions for managing and processing time series data.
For example, applications can use this cartridge to process historical data derived from financial market transactions, such as trades of stocks, bonds, and mutual fund shares. In such applications, the functions included with the Time Series cartridge let you conveniently perform operations ranging from the simple to the complex, such as:
Time series applications have certain distinct requirements and some degree of commonality. The time series datatypes accommodate the commonality and support extensions that address application-specific requirements. With this cartridge, time series data can be managed more conveniently and efficiently than is possible using only traditional datatypes and user-defined functions.
With the Time Series cartridge, you can use or adapt existing tables for time series applications, or you can create new tables. You can also extend the capabilities of the cartridge to add or modify functions and to create customized calendars.
Within the Oracle Network Computing ArchitectureTM (NCA), data cartridges facilitate the storage and retrieval of complex datatypes required by nontraditional database applications, such as geographic information systems, imaging, workflow, document management, and digital libraries. These applications are built using components or modules that support the capture, input, processing, analysis, storage, retrieval, and display of the complex datatypes.
A data cartridge is the mechanism by which clients, application-specific servers, and database servers can be easily and reliably extended. The Oracle8 Time Series Cartridge provides support for time series domain-specific types, functions, and interfaces. The Time Series cartridge focuses on a set of time series data representation and access mechanisms sufficient to support many applications and the development of more specialized cartridges.
The objects option makes Oracle8 an object-relational database management system, which means that users can define additional kinds of data -- specifying both the structure of the data and the ways of operating on it -- and use these types within the relational model. This approach adds value to the data stored in a database.
Oracle8 with the objects option stores structured business data in its natural form and allows applications to retrieve it that way. For that reason it works efficiently with applications developed using object-oriented programming techniques.
The Time Series cartridge can store time series data in the database under transactional control.
Once stored in the database, this data can be queried and retrieved by finding a row in a table that contains the primary key (which includes the timestamp) using the various alphanumeric columns (attributes) of the table. Typical queries might include the following:
Applications access and manipulate time series data using SQL or PL/SQLTM. See the Oracle8 SQL Reference manual for information on SQL syntax.
The exact procedure for installing the Time Series cartridge is platform-dependent. For more detailed information, see the README.txt file for your platform which can be found either in $ORACLE_HOME/ord/ts/admin (UNIX systems) or $ORACLE_HOME\ord80\ts\admin (Windows NT systems). On many platforms, automated default installation is available using Oracle Installer; however, on some platforms manual installation of the database objects is required.
This section describes the steps required to manually install the Time Series cartridge. It is intended for users who want to customize the database installation or who simply want a better understanding of the Time Series installation process.
To use the Time Series cartridge, at least the following software components must be installed: Oracle8 Enterprise Edition (RDBMS), PL/SQL (on platforms on which it is a separate installation option), and the Oracle8 Time Series Cartridge. These components can be installed all at once, or the Oracle8 Time Series Cartridge can be added to an existing Oracle8 Enterprise Edition release 8.0.4 installation that includes PL/SQL.
Follow these steps to perform a manual installation of the Time Series cartridge:
ORDSYS is the standard schema for Oracle-supplied cartridges, and it has special privileges for data cartridges.
For detailed information about database creation and startup, see the Oracle8 Installation and Configuration Guide for your operating system, the Oracle8 Administrator's Guide, and the Oracle8 Concepts manual.
SVRMGR> @$ORACLE_HOME/rdbms/admin/utlrefld.sql
SVRMGR> CREATE USER ORDSYS IDENTIFIED BY <password>;
The <password> is the password you chose in step 1.
SVRMGR> GRANT connect,resource,create library TO ORDSYS;
SVRMGR> CONNECT ORDSYS/<password> SVRMGR> @$ORACLE_HOME/ord/ts/admin/ordtinst.sql
The user group PUBLIC is granted execute privilege on all Time Series cartridge datatypes and packages.
All Time Series cartridge packages and datatypes are installed under the ORDSYS schema, and all users must include the ORDSYS schema name when referring to these packages and datatypes. However, to simplify references to packages, you can define public synonyms for the Calendar and TimeSeries packages.
To create public synonyms, run the ordtsyn.sql file supplied with the Time Series cartridge in the admin directory. The ordtsyn.sql file creates the following public synonyms:
CREATE PUBLIC SYNONYM TimeSeries for ORDSYS.TimeSeries; CREATE PUBLIC SYNONYM Calendar for ORDSYS.Calendar;
Table 1-1 shows the demos (SQL scripts and related files that demonstrate capabilities) included with the Time Series cartridge. This table includes a description of each demo and the default directory in which its files are installed. (The exact location and directory syntax are platform-dependent.)
Each demo is described in a README file in its directory.
The usage demo, described in this section, is a working example of the usage of the cartridge. The example models a historical database of stock pricing and provides sample queries over this stock database.
The usage demo is designed to guide you through the cartridge in a step-by-step fashion. It includes example code for creating and populating tables and calendars, constructing security views, constructing views to synthesize the interface to time series functions, and running some example queries.
After the cartridge has been installed, you can run the usage demo by going to the appropriate directory (see Table 1-1) and invoking the demo.sql procedure, as follows:
% svrmgrl SVRMGR> @demo
The usage demo files include examples of bulk and incremental loading, defining tables, calendars, and views for the time series cartridge, and running example queries. These files are listed in Table 1-2.
The stock database consists of three tables:
To maintain time series consistency and provide a collection-based interface for time series functions, two views are constructed using these tables.
The security view ensures that insert, update, and delete operations maintain a time series that is consistent with the associated calendar. (Time series consistency is explained in Section 2.6.) The security view and the reference-based view access the three underlying tables. The reference-based view synthesizes references to collections. (Reference-based views are explained in Section 2.5.2.)
Figure 1-1 shows the layering and interdependencies between underlying tables and the security and reference-based views.