Skip to content

Commit f12113d

Browse files
committed
optimizer
1 parent 3275d2f commit f12113d

File tree

188 files changed

+32799
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+32799
-1
lines changed

optimizer/LICENCE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Oracle dw-vldb
2+
3+
You may not use the identified files except in compliance with the
4+
Universal Permissive License (UPL), Version 1.0 (the "License.")
5+
6+
You may obtain a copy of the License at
7+
https://opensource.org/licenses/UPL. A copy of the license is
8+
also reproduced below.
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13+
implied.
14+
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
19+
```
20+
Copyright (c) 2014, 2016 Oracle and/or its affiliates
21+
The Universal Permissive License (UPL), Version 1.0
22+
23+
Subject to the condition set forth below, permission is hereby granted to any person obtaining
24+
a copy of this software, associated documentation and/or data (collectively the "Software"),
25+
free of charge and under any and all copyright rights in the Software, and any and all patent
26+
rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified
27+
Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below),
28+
to deal in both
29+
30+
(a) the Software, and (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
31+
one is included with the Software (each a Larger Work to which the Software is contributed by such licensors),
32+
without restriction, including without limitation the rights to copy, create derivative works of,
33+
display, perform, and distribute the Software and make, use, sell, offer for sale, import, export,
34+
have made, and have sold the Software and the Larger Work(s), and to sublicense the foregoing rights
35+
on either these or other terms.
36+
37+
This license is subject to the following condition:
38+
39+
The above copyright notice and either this complete permission notice or at a minimum a reference
40+
to the UPL must be included in all copies or substantial portions of the Software.
41+
42+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
43+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
44+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
45+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
46+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
47+
```

optimizer/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
This is a top level repository for code examples related to the Oracle Optimizer and, occasionally, Data Warehousing and Very Large Databases.
1+
2+
This is a top level repository for code examples related to the Oracle Optimizer, Data Warehousing and Very Large Databases.
3+
4+
There are examples and scripts relating to the Oracle Database and, in particular, the Oracle Optimizer.
25

36
The examples are generally self-contained, each wthin a directory containing all the scripts you'll need to complete a particular example. The scripts can be executed using SQL Plus or <a href="http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html">Oracle SQL Developer.</a>
47

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- DISCLAIMER:
2+
-- This script is provided for educational purposes only. It is
3+
-- NOT supported by Oracle World Wide Technical Support.
4+
-- The script has been tested and appears to work as intended.
5+
-- You should always run new scripts initially
6+
-- on a test instance.
7+
set echo off
8+
connect / as sysdba
9+
10+
REM To allow for re-execution of this script,
11+
REM the user is first dropped, then created.
12+
drop user aczm12c cascade;
13+
14+
set echo on
15+
create user aczm12c identified by oracle_4U;
16+
alter user aczm12c default tablespace users;
17+
grant connect, dba to aczm12c;
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
-- DISCLAIMER:
2+
-- This script is provided for educational purposes only. It is
3+
-- NOT supported by Oracle World Wide Technical Support.
4+
-- The script has been tested and appears to work as intended.
5+
-- You should always run new scripts initially
6+
-- on a test instance.
7+
8+
set timing off
9+
set echo off
10+
set lines 400 pages 1000
11+
set feedback 1
12+
set pause off
13+
set echo on
14+
15+
16+
PROMPT Connect to the Attribute Clusters/Zone Map Schema
17+
connect aczm12c/oracle_4U
18+
19+
PROMPT Drop SALES_SOURCE table
20+
drop table sales_source
21+
/
22+
--
23+
PROMPT Create the SALES_SOURCE table
24+
PROMPT This will provide us with a consistent dataset
25+
PROMPT for any fact tables we choose to create later on
26+
--
27+
CREATE TABLE sales_source
28+
(
29+
order_id NUMBER(20) NOT NULL ,
30+
order_item_number NUMBER(3) NOT NULL ,
31+
sale_date DATE NOT NULL ,
32+
delivered DATE ,
33+
sale_agent VARCHAR2(100) NOT NULL ,
34+
product_id NUMBER(10) NOT NULL ,
35+
amount NUMBER(10,2) NOT NULL ,
36+
quantity NUMBER(5) NOT NULL ,
37+
location_id NUMBER(20) NOT NULL ,
38+
warehouse VARCHAR2(100) NOT NULL
39+
)
40+
/
41+
42+
PROMPT Drop the LOCATIONS table
43+
DROP TABLE locations
44+
/
45+
46+
PROMPT Create the LOCATIONS table
47+
CREATE TABLE locations
48+
(
49+
location_id NUMBER(20) ,
50+
state VARCHAR2(100) NOT NULL ,
51+
county VARCHAR2(100) NOT NULL ,
52+
description VARCHAR2(1000) NOT NULL ,
53+
PRIMARY KEY (location_id)
54+
)
55+
/
56+
57+
PROMPT Drop the PRODUCTS table
58+
DROP TABLE products
59+
/
60+
61+
PROMPT Create the PRODUCTS table
62+
CREATE TABLE products
63+
(
64+
product_id NUMBER(20) ,
65+
product_name VARCHAR2(20) ,
66+
product_description VARCHAR2(100) ,
67+
PRIMARY KEY(product_id)
68+
)
69+
/
70+
71+
72+
73+

0 commit comments

Comments
 (0)