Storage File¶
The storage files (*.storage) defines schema objects such as tables, indexes, objects, sequences etc. This file type is not directly deployable into the database and has to pass through the code generator which produces database deployable CRE files. The core storage file can be empty if no additions or changes to the template generated base storage file exist.
Note: All CRE files generated from storages files should be re-runnable without giving hard errors. Creating objects using the framework methods, i.e. calling methods beginning with Database_SYS.Create_
, will protect you from getting hard errors but when creating database objects and not using the framework, you must consider the fact that the object already exists in the database. CRE files should only be used during fresh installations, and never in a upgrade installation unless a new component is installed.
Base storage file¶
In the Base storage file the following are defined:
- The table
- The primary index
- The unique index for rowkey
- Unique index on columns holding Search Domains
The Base storage file is generated and cannot be changed.
layer Base; -------------------- TABLE DEFINITIONS -------------------------------------- TABLE person_info_tab IS ( person_id VARCHAR2(20) NOT NULL, name VARCHAR2(100) NOT NULL, ... assigned_car VARCHAR2(10) NULL, TEXT_ID$ VARCHAR2(50) DEFAULT sys_guid() NOT NULL, rowversion NUMBER NOT NULL, rowkey VARCHAR2(50) DEFAULT NULL); PRIMARY KEY person_info_pk IS person_info_tab ( person_id); UNIQUE CONSTRAINT person_info_rk IS person_info_tab ( rowkey); UNIQUE INDEX person_info_sx1 IS person_info_tab ( text_id$); -------------------- OTHER DEFINITIONS --------------------------------------
Core storage file¶
In the core storage files, R&D add additional database objects. In this type of file it is possible to:
- Add extra indexes
- Add sequences
- Add types (both simple and arrays)
- Add additional tables
- Add any PLSQL call
It is possible to have a specific anonymous PLSQL block, in which case you can run any specific code that you want to execute and create extra database objects for.
It is only possible to have one plsql block per storage file. - Overtake any of the objects created in the base storage file
(Table definition, primary key definition column order)
TABLE transaction_sys_status_tab IS ( id NUMBER NOT NULL, line NUMBER NOT NULL, text VARCHAR2(2000) NULL, status_type VARCHAR2(10) NOT NULL, rowversion NUMBER NOT NULL, ROWKEY VARCHAR2(50) NULL); UNIQUE CONSTRAINT transaction_sys_status_rk IS transaction_sys_status_tab (rowkey); PRIMARY KEY transaction_sys_status_pk IS transaction_sys_status_tab ( id, line); SEQUENCE transaction_sys_seq IS MINVALUE 1; INDEX transaction_sys_local_ix IS transaction_sys_local_tab ( state, queue_id); INDEX transaction_sys_local_ix1 IS transaction_sys_local_tab(posted,id); OBJECT Search_Domain_State_Type IS ( search_domain VARCHAR2(50), index_name VARCHAR2(30), text_key VARCHAR2(100), text VARCHAR2(4000), Timestamp DATE); COLLECTION Search_Domain_States_Type IS TABLE OF Search_Domain_State_Type; BEGIN Ctx_Ddl.Create_Section_Group('APPLICATION_SEARCH', 'AUTO_SECTION_GROUP'); BEGIN Ctx_Ddl.Drop_Preference('APPLICATION_SEARCH_LEXER'); EXCEPTION WHEN OTHERS THEN NULL; END; Ctx_Ddl.Create_Preference('APPLICATION_SEARCH_LEXER', 'BASIC_LEXER'); Ctx_Ddl.Set_Attribute('APPLICATION_SEARCH_LEXER', 'PRINTJOINS', '_'); BEGIN Ctx_Ddl.Drop_Preference('APPLICATION_SEARCH_STORAGE'); EXCEPTION WHEN OTHERS THEN NULL; END; Ctx_Ddl.Create_preference('APPLICATION_SEARCH_STORAGE', 'BASIC_STORAGE'); Ctx_Ddl.Set_attribute('APPLICATION_SEARCH_STORAGE','FORWARD_INDEX','TRUE'); Ctx_ddl.Set_attribute('APPLICATION_SEARCH_STORAGE','SAVE_COPY','PLAINTEXT'); END;
Customization storage file¶
In the customization storage file, customization specific extra information to the storage is written. In these files it is possible to:
- Add extra indexes
- Add sequences
- Add types (both simple and arrays)
- Add additional tables
- Add any PLSQL call
It is possible to have a specific anonymous PLSQL block, in which you can run any specific code that you want to execute and create extra database objects for.
It is only possible to have one plsql block per storage file. - Overtake any of the objects created in the previous layers storage file
(Table definition, primary key definition column order)