*** THIS PAGE IN-PROGRESS ****
To support multiple databases, the spacewalk schema source is divided into common, oracle specific and postgres specific as of 0.6. In general, most of the tables, views and data (inserts) go into common. The triggers, stored procedures, packages, classes and types will go in the DB specific directories. The build uses chameleon and blend to convert the common parts of the schema and blend them together with the specific parts into an installable file.
If the table is common for both oracle and postgres (and they almost always are), you want to:
Otherwise
Then
To verify common table in oracle:
cd schema/spacewalk/oracle/tables/common/tablename.sql <--- transformed by chameleon, output here
To verify in common table postgres:
cd schema/spacewalk/postgres/tables/common/tablename.sql <--- transformed by chameleon, output here
Notes:
If the table is common for both oracle and postgres (and they almost always are) and the data is loaded using simple insert statements, you want to:
Otherwise
Then
To verify common data insert in oracle:
cd schema/spacewalk/oracle/data/common/tablename.sql <--- transformed by chameleon, output here
To verify in common data insert postgres:
cd schema/spacewalk/postgres/data/common/tablename.sql <--- transformed by chameleon, output here
Notes:
If the view is common for both oracle and postgres (and they almost always are), you want to:
Otherwise
Then
Notes:
These objects are always database specific and need to be created in database specific directories.
Notes:
These objects are always database specific and need to be created in database specific directories.
Notes:
These objects are always database specific and need to be created in database specific directories.
Notes:
These objects are always database specific and need to be created in database specific directories.
Notes:
These objects are oracle specific and need to be created in database specific directories.
Notes:
TBD
Dependencies between database objects are defined in .deps files. The dependency (.deps) files resemble GNU Make dependency files - but they are not. These files are processed by blend and conveniently have a similar syntax but there are several differences:
Blend and (.deps) files have a concept of namespaces. Each root directory listed on the command line for blend to process is considered a namespace which recursively includes all files and sub-directories. Each .deps file can list a path which defines the order in which unqualified references are resolved with (.) dot being the current namespace. Support for both duplicate file names (in difference directories) and unqualified references at the same time provides for natural file names and keeps the .deps files clean and readable.
For example: {{{ path . }}} Or {{{ path . tables }}} To resolve references first in the current namespace then within the tables namespace.
For example, this (.deps) file contained within the tables namespace: {{{ path . views ... tableA :: viewB }}} Where 'viewB' would first be resolved as:
This is compact and safe since names must be unique between tables and views.
Namespaces provides for deterministic resolution of unqualified references. Optionally, references may be qualified by namespace such as tables/rhnChannel where tables is the namespace and rhnChannel is the object. References may be further qualified by file extension such as rhn_user.pks
For example, this (.deps) file contained within the views namespace: {{{ path . packages ... viewA :: procs/procA }}}
Would always resolve to a procedure named 'procA' because it has been qualified.
The object (flie) ordering is deterministic and sorted as follows:
Directory order (defined by DIRS in db Makefile): 1. class 1. types 1. tables 1. procs 1. packages 1. views 1. triggers 1. data 1. synonyms
Triggers, data and synonyms which are never referenced as dependencies really don't need (.deps) files because the directory ordering is enough.
Files found in schema/spacewalk/common/
Are transformed from common -> specific using chameleon during the build and written into the schema/spacewalk//*/common directories. Then blend aggregates and orders all of the (.sql, .pks, .pkb) files and generates a main.sql that may be used to install the schema. {{{ cd schema/spacewalk/oracle make }}} Or, to replace tablespace in Oracle Express: {{{ cd schema/spacewalk/oracle make devel }}} Or, to replace tablespace in Oracle Enterprise: {{{ cd schema/spacewalk/oracle make devel TBS=data_tbs }}}
The devel target creates a devel.sql file that has the [[tbs]]
macro replaced with the appropriate tablespace name.
Then, for oracle using sqlplus load the devel schema. {{{ SQL> @devel }}}
RPMs for chameleon can be found here until released into Fedora extras.
Contains DDL files.
Common DDL/SQL (schema).
/schema/spacewalk/common/tablesContains (.sql) files with DDL for common tables. File names match the name of the table being created and may include
Contains (.sql) files with DDL for common views. File names match the name of view begin created and contain the DDL for creating or replacing the view.
/schema/spacewalk/common/dataContains (.sql) files with SQL for inserting primer data into common tables. File names match the name of table into which the data is inserted/updated.
/schema/spacewalk/oracle/classContains oracle specific user defined types (such as EVR_T) DDL files. File names match the database type begin created.
/schema/spacewalk/oracle/typesContains oracle specific user defined types. File names match the database type begin created.
/schema/spacewalk/oracle/tablesContains (.sql) files with DDL for oracle only tables. File names match the name of the table being created and may include:
Populated at build ^read-only^
/schema/spacewalk/oracle/viewsContains (.sql) files with DDL for oracle views. File names match the name of view begin created and contain the DDL for creating or replacing the view.
/schema/spacewalk/oracle/views/commonPopulated at build ^read-only^
/schema/spacewalk/oracle/dataContains (.sql) files with SQL for inserting primer data into oracle tables. File names match the name of table into which the data is inserted/updated.
/schema/spacewalk/oracle/data/commonPopulated at build ^read-only^
/schema/spacewalk/oracle/triggersContains (.sql) files with DDL for creating/replacing oracle triggers. File names match the name of table on which the trigger is created/replaced.
/schema/spacewalk/oracle/procsContains (.sql) files with DDL for creating/replacing oracle stored procedures/functions. File names match the name of procedure/function begin created.
/schema/spacewalk/oracle/packagesContains (.pks|.pkb) files with DDL for creating/replacing oracle packages. File names match the name of package begin created.
.pks:: Package Declaration (header) .pkb:: Package Definition (body)
/schema/spacewalk/oracle/synonymsContains (.sql) files with DDL for creating/replacing oracle synonyms. File names match the name of synonym begin created.
/schema/spacewalk/postgres/classContains postgres specific user defined types (such as EVR_T) DDL files. File names match the database type begin created.
/schema/spacewalk/postgres/typesContains postgres specific user defined types. File names match the database type begin created.
/schema/spacewalk/postgres/tablesContains (.sql) files with DDL for postgres only tables. File names match the name of the table being created and may include:
Populated at build ^read-only^
/schema/spacewalk/postgres/viewsContains (.sql) files with DDL for postgres views. File names match the name of view begin created and contain the DDL for creating or replacing the view.
/schema/spacewalk/postgres/views/commonPopulated at build ^read-only^
/schema/spacewalk/postgres/dataContains (.sql) files with SQL for inserting primer data into postgres tables. File names match the name of table into which the data is inserted/updated.
/schema/spacewalk/postgres/data/commonPopulated at build ^read-only^
/schema/spacewalk/postgres/triggersContains (.sql) files with DDL for creating/replacing postgres triggers. File names match the name of table on which the trigger is created/replaced.
/schema/spacewalk/postgres/procsContains (.sql) files with DDL for creating/replacing postgres stored procedures/functions. File names match the name of procedure/function begin created.
/schema/spacewalk/postgres/packagesContains (.pks|.pkb) files with DDL for creating/replacing postgres packages. File names match the name of package begin created.
.pks:: Package Declaration (header) .pkb:: Package Definition (body)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4