Deferred segment creation on demand – Oracle Database 11G release 2 (11.2)

In Oracle 11G Release 2 segment allocation has been changed. When new table is created, the table segment creation is postponed till first row insert.

This functionality is enabled by default with new parameter DEFERRED_SEGMENT_CREATION set as default to TRUE

DEFERRED_SEGMENT_CREATION = TRUE | FALSE

This new feature allows to save initially a lot of space for newly created objects especially when you have thousands of partitions. However you need to remeber about careful space planing.

Continue reading

Security extension INHERIT [ANY] PRIVILEGES Oracle Database 12C release 1 (12.1)

This new extension in Oracle 12C closes security gap in previous release. When  a user (INVOKER) calls a PL/SQL code with pragma AUTHID CURRENT_USER of other user  then the code is executed with privileges of current user (INVOKER rights).

It’s very useful but can be dangerous if called code has got harm code. For example we can create simple function “get_me_dba_fnc” in schema SH with the pragma AUTHID CURRENT_USER and call it as user TOMASZ with high privileges like DBA and  by mistake grant DBA role to SH without noticing it.

role inherit

In Oracle 12C you can control inheritance of privileges by using following clauses

  • INHERIT PRIVILEGES
  • INHERIT ANY PRIVILEGES

Continue reading

View security extension BEQUEATH CURRENT_USER Oracle Database 12C release 1 (12.1)

This new feature in Oracle 12C changes behavior of calling functions within views. In previous releases all functions used within a view were called using rights of creator of the view (DEFINER rights) no matter if the functions used pragma AUTHID CURRENT_USER(INVOKER rights).

In Oracle 12C you can specify dedicated pragma  during view creation BEQUEATH CURRNT_USER so all functions that are using AUTHID CURRENT_USER will be called with INVOKER rights.

It’s worth to read article: Authid current_user, authid definer

Continue reading

Install Oracle 12C Release 1 (12.1) on Centos Linux 7

This article presents how to install Oracle 12C(12.1.0.1) Release 1 on Centos Linux 7.

Read following article how to install Centos Linux 7: Install Centos Linux 7 (for comfort set 2G memory for your virtual machine before proceeding with Oracle software installation).

Software

Software for 12CR1 is available on OTN or edelivery

Database software

linuxamd64_12c_database_1of2.zip 
linuxamd64_12c_database_2of2.zip

Continue reading

Install Oracle 11G Release 2 (11.2) on Centos Linux 7

This article presents how to install Oracle 11G on Centos Linux 7.

Read following article how to install Centos Linux 7: Install Centos Linux 7 (for comfort set 2G memory for your virtual machine before proceeding with Oracle software installation).

Installation software is available on OTN version 11.2.0.1 or metalink 11.2.0.4. In this installation I’m presenting installation for 11.2.0.4 but for previous version 11.2.0.X it shouldn’t be different.

Oracle software which I verified

release 11.2.0.4

p13390677_112040_Linux-x86-64_1of7.zip 
p13390677_112040_Linux-x86-64_2of7.zip

Continue reading

Install Centos Linux 7

This article presents how to install CentOS Enterprise Linux 7.

I assume you have already downloaded CentOS Enterprise Linux 7 64 bit(about 4 G) and you know how to use VirtualBox 64 bit(100M). Create virtual machine with default settings for RedHat Linux 64 bit. For start 1GB ram and 64G for disk is enough plus increase video memory to 128M and turn on acceleration 3D. Rest of options you can keep default.

Centos7_01

Continue reading

Role and Privileges Analysis Oracle Database 12C release 1 (12.1)

It’s very nice new feature in Oracle Database 12C helping quickly analyze  what roles and privileges are used inside database and by who.

Quick summary about this extension and its features:

  • new PL/SQL package DBMS_PRIVILEGE_CAPTURE to run analysis
    • for both system privileges and object privileges
    • on application module level or user session level
    • in dedicated time
  • create reports that describe used privileges and objects
  • no need to use database vault
  • can show used and unused privileges for system and objects so it’s easy to decide what can be revoked, changed(grant less powerful roles, privileges) to make more secured database

role and privileges analysis

Continue reading

Oracle user defined aggregate function

From time to time Oracle seems to be limited in aggregate functions. However Oracle delivers possibility to create own aggregate function using built-in framework ODCIAggregate routines

Each of the four ODCIAggregate routines required to define a user-defined aggregate function codifies one of the internal operations that any aggregate function performs, namely:

  • Initialize - ODCIAggregateInitialize – initialize the computation of the user-defined aggregate
  • Iterate – ODCIAggregateIterate – calculates aggregations
  • Merge – ODCIAggregateMerge – combines aggregation iterations
  • Terminate – ODCIAggregateTerminate – retuns aggregation value

ODCIAggregate

Continue reading

Install Oracle Enterprise Manager 12C release 4(12.1.0.4) on OEL 5/6

This article presents installation of new Oracle Enterprise Manager 12C version 12.1.0.4 on Oracle Linux OEL5, OEL6. It can be installed using Oracle 12C Release 1 so it’s up to you weather you use database version 11G Release 2 or 12C Release 1 as your repository.

Read following articles to find out how to install Linux OEL5,6.

Read following articles to find out how to install Oracle Database 11G Release 2

Read following articles to find out how to install Oracle Database 12C Release 1

This installation was done using following software:

  • Oracle Virtual Box – 64 bit
  • Oracle Enterprise Linux 6 – 64 bit
  • Oracle Database 11G Release 2(11.2.0.4) – 64 bit for Linux
  • Oracle Oracle Enterprise Manager 12C release 4(12.1.0.4) – 64 bit for Linux

Binaries Oracle Enterprise Manager 12C (12.1.0.4)

em12104_linux64_disk1.zip - enterprise software
em12104_linux64_disk2.zip - enterprise software
em12104_linux64_disk3.zip - enterprise software

You need at least 5GB of memory for this installation so check your VirtualBox settings before proceeding.

Continue reading