Oracle Database Preinstallation Tasks and Setting a local repo on CentOS 6.9

Copy the ISO file into the VM (i.e. Downloads folder) and create a dir to use to mount the ISO to:
mkdir -p /var/OSimage/OL6.9_x86_64

Mount the directory with ISO file to a path:
mount -o loop, ro /home/oracle/Downloads/CentOS-6.9-x86_64-bin-DVD1.iso /var/OSimage/OL6.9_x86_64/

Go to cd /etc/yum.repos.d and edit the “CentOS-Base.repo” file and add enabled=0 to each section to disable these entries

Add a new file “OL69.repo”

name=CentOS 6.9 x86_64

*Make sure the gpgkey file exists in that path or use an equivalent

Command to check which packages have been installed or not:

rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel libXext libXtst libX11
libXau libxcb libXi make sysstat

Source: Oracle Database Preinstallation Tasks

Create a Data Generator using sequence and a loop in Oracle DB

Create a sequence (i.e. “tmp” starting with 10001) to be used in statements:

MAXVALUE 9999999999999999999999
MINVALUE 1[/sql]

Enter the following in a DB-Tool editor:

FOR Lcntr IN 1..10000
insert into customer (surname, forname, some_id, some_field)
values (‘SN’ || tmp.nextval, ‘FN’ || tmp.nextval, 123456, ‘abcdef’);

Output should be something like this:


How to check the version of an Oracle Database with PL/SQL

Login to the database and execute the following:

[sql]select * from v$version;
select * from product_component_version;[/sql]


[text]Oracle Database 11g Enterprise Edition Release – 64bit Production
PL/SQL Release – Production
CORE    Production
TNS for 64-bit Windows: Version – Production
NLSRTL Version – Production[/text]



RegEx use in Find with PLSQL Developer

The following are supported regular expression operators for use in PL/SQL Developer by Allround Automations:[text]a+ One or more occurrences of a
a* Zero or more occurences of a
a? Zero or one (i.e. optional) occurence of a
a{n} Exactly n occurences of a
a{n,} n or more occurences of a
a{,m} Zero or at most m occurences of a
a{n,m} At least n but not more than m occurences of a
a|b Either a or b
a||b a or b or both a and b in any order
abc a followed by b followed by c
[abc] A single character, one of a or b or c
[a-b] A single character, ranging in value from a to b inclusive
[^abc] A single character, any except a, b or c
(abc) a followed by b followed by c
“abc” The letters a followed by b followed by c with no special significance attached to a, b or c
. Any character except a newline
\a The letter a, with no special significance attached to a, special forms:\t The tab character
\n The newline character
\r The return character
\f The formfeed character
\b The backspace character
\xNN The hex character NN
\0ooo The octal character ooo
\w A single character, one of [a-zA-Z0-9_]
\W Any single character not matching \w
\d A single character [0-9]
\D A single character not matching \d
\s A whitespace character [\t\r\n\f\b\ ]
\S A single character not matching \s[/text]
All credits to Marco Kalter (Allround Automations) for this tip!

How to check the java version of an Oracle Database

Create a function in the DB to retrive the java properties:

[sql]CREATE OR REPLACE FUNCTION get_java_property(prop IN VARCHAR2)
LANGUAGE JAVA name ‘java.lang.System.getProperty(java.lang.String) return java.lang.String’;[/sql]

Then, run the following command to output the Java version:

[sql]SELECT get_java_property(‘java.version’) FROM dual;[/sql]