Part 8 – Building Oracle 12c development suite – Library setup for Oracle Enterprise Linux 6.5 for Oracle RDBMS 12c

Library setup for Oracle Enterprise Linux 6.5 for Oracle RDBMS 12c

Oracle Corporation provides the ability for developers to create a complete development suite on their personal windows desktop or laptop without requiring the expensive equipment required for a true production system. This article outlines the process for configuration libraries for an Oracle Enterprise Linux 6.5 installation in preparation for installation of Oracle 12c RDBMS.
NOTE: This process can be used for most Linux installations, regardless of original company or organization providing the base Linux OS.

1. Logon to your Windows desktop/laptop as an administrator and open Oracle VirtualBox.
2. Logon to your Linux VM as the root user.
3. Change directory to your yum repository with command: “cd /etc/yum.repos.d”

[root@oel65 ~]# cd /etc/yum.repos.d
[root@oel65 yum.repos.d]#

4. Extract the repository from the oracle public yum website with the command: “wget http://public-yum.oracle.com/public-yum-ol6.repo”

[root@OEL65 yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol6.repo
–2015-04-12 18:49:53– http://public-yum.oracle.com/public-yum-ol6.repo
Resolving public-yum.oracle.com… 70.186.29.33, 70.186.29.58
Connecting to public-yum.oracle.com|70.186.29.33|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 5046 (4.9K) [text/plain]
Saving to: “public-yum-ol6.repo.1”

100%[======================================>] 5,046 –.-K/s in 0s

2015-04-12 18:49:53 (225 MB/s) – “public-yum-ol6.repo.1” saved [5046/5046]

[root@OEL65 yum.repos.d]#

5. Edit the yum repo file with appropriate values with the following perl command: “perl -pi.bak -e ‘s/enabled=0/enabled=1/g’ /etc/yum.repos.d/public-yum-ol6.repo”

[root@OEL65 yum.repos.d]# perl -pi.bak -e ‘s/enabled=0/enabled=1/g’ /etc/yum.repos.d/public-yum-ol6.repo
[root@OEL65 yum.repos.d]#

6. Download necessary RPM file from oracle with command: “wget –no-check-certificate https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle”

[root@OEL65 yum.repos.d]# wget –no-check-certificate https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
–2015-04-12 18:50:29– https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Resolving public-yum.oracle.com… 70.186.29.58, 70.186.29.33
Connecting to public-yum.oracle.com|70.186.29.58|:443… connected.
WARNING: no certificate subject alternative name matches
requested host name “public-yum.oracle.com”.
HTTP request sent, awaiting response… 200 OK
Length: 1011 [text/plain]
Saving to: “/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle”

100%[======================================>] 1,011 –.-K/s in 0s

2015-04-12 18:50:30 (16.8 MB/s) – “/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle” saved [1011/1011]

[root@OEL65 yum.repos.d]#

7. Use the following yum command to install the packages from oracle for 12c RDBMS install: “yum install oracle-rdbms-server-12cR1-preinstall”

[root@OEL65 yum.repos.d]# yum install oracle-rdbms-server-12cR1-preinstall
Loaded plugins: rhnplugin, security
This system is receiving updates from ULN.
Setting up Install Process



public_ol6_MySQL | 1.2 kB 00:00
libdmx.x86_64 0:1.1.3-3.el6 libstdc++-devel.x86_64 0:4.4.7-11.el6
xorg-x11-utils.x86_64 0:7.5-6.el6 xorg-x11-xauth.x86_64 1:1.0.2-7.1.el6

Complete!

8. This completes the setup of the VM libraries for Oracle 12c RDBMS.

Larry Catt, OCP

Oracle 12c – Valid Time Temporal Setup

 

Oracle 12c has added a feature called valid time temporal which determines when a table row is valid.  This is done by defining the table with two hidden columns giving a start and stop top for data validity.   This article describes the setup of valid time temporal and its use in Oracle database.

 

  1. Logon to your oracle server as oracle software owner and logon to sqlplus as sysdba.

 

[root@linux2 ~]# su – oracle

Last login: Wed Mar 14 06:50:11 EST 2015 on pts/1

Enter database to use:

1 – ORCL

2 – CDB1

Option >

1

[oracle@linux2 ~]$ sqlplus / as sysdba

 

SQL*Plus: Release 12.1.0.2.0 Production on Thu Mar 15 07:50:07 2015

 

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

 

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

 

SQL>

 

  1. Valid-time periods can be set during table creation or after with ‘ALTER TABLE’. In this example we will create a table test.test_time with the following statement:   NOTE: using the ‘PERIOD FOR’ clause to implicitly defined columns for valid time temporal.

 

CREATE TABLE test.test_times (pers_id NUMBER PRIMARY KEY,

 first_name VARCHAR2( 20),

last_name VARCHAR2( 25),

PERIOD FOR probation);

 

  1. When the table is described only the following columns are displayed.

 

DESCRIBE probationary_emps

Name                    Null?                     Type

————–         ———                                 ————–

EMP_ID                NOT NULL           NUMBER

FIRST_NAME                                     VARCHAR2( 20)

LAST_NAME                                       VARCHAR2( 25)

 

  1. Quering the USER_TAB_COLS shows additional hidden columns

 

column column_name format a15

column data_type format a30

column hidden format a8

set pagesize 500

SELECT column_name,

data_type,

 hidden_column AS HIDDEN FROM dba_tab_cols

WHERE table_name = ‘TEST_TIMES’;

 

 

SQL> column column_name format a15

column data_type format a30

column hidden format a8

set pagesize 500

SELECT column_name,

data_type,

 hidden_column AS HIDDEN FROM dba_tab_cols

WHERE table_name = ‘TEST_TIMES’;

SQL> SQL> SQL> SQL>   2    3    4

COLUMN_NAME     DATA_TYPE                      HIDDEN

————— —————————— ——–

LAST_NAME       VARCHAR2                       NO

FIRST_NAME      VARCHAR2                       NO

PERS_ID         NUMBER                         NO

PROBATION       NUMBER                         YES

PROBATION_END   TIMESTAMP(6) WITH TIME ZONE    YES

PROBATION_START TIMESTAMP(6) WITH TIME ZONE    YES

 

6 rows selected.

 

SQL>

 

 

  1. insert the following records into new table:

insert into test.test_times(pers_id, first_name, last_name, probation_start, probation_end)

values(1, ‘John’, ‘Doe’, to_date(’01-JAN-16′,’DD-MON-YY’),to_date(’01-APR-16′,’DD-MON-YY’));

insert into test.test_times(pers_id, first_name, last_name, probation_start, probation_end)

values(2, ‘Jan’, ‘Doe’, to_date(’01-May-16′,’DD-MON-YY’),to_date(’01-SEP-16′,’DD-MON-YY’));

insert into test.test_times(pers_id, first_name, last_name, probation_start, probation_end)

values(3, ‘Bill’, ‘Jones’, to_date(’01-OCT-16′,’DD-MON-YY’),to_date(’01-JAN-17′,’DD-MON-YY’));

 

commit;

 

  1. Now select all records in the table test_times.

 

SQL> select * from test.test_times;

 

   PERS_ID FIRST_NAME           LAST_NAME

———- ——————– ————————-

         1 John                 Doe

         2 Jan                  Doe

         3 Bill                 Jones

 

SQL>

 

  1. Now perform the same select but limiting results by hidden column of PROBATION_END

 

SQL> select * from test.test_times where probation_end<to_date(’01-NOV-16′,’DD-MON-YY’);

 

   PERS_ID FIRST_NAME           LAST_NAME

———- ——————– ————————-

         1 John                 Doe

         2 Jan                  Doe

 

SQL>

 

  1. This completes the setup and testing of Valid Time Temporal in Oracle 12c.

 

Larry Catt

OCP