In-Database Archiving

Companies may need to keep data for longer time for compliance purposes even there is not use these data for companies. In-Database Archiving enables you to archive rows within a table by marking them as inactive. These inactive rows are in the database and can be optimized using compression, but are not visible to an application. The data in these rows is available for compliance purposes if needed by setting a session parameter.

With In-Database Archiving you can store more data for a longer period of time within a single database, without compromising application performance. Archived data can be compressed to help improve backup performance, and updates to archived data can be deferred during application upgrades to improve the performance of upgrades.

Continue reading

Temporal Validity in 12c

Temporal Validity enables you to track time periods for real world validity. Valid times can be set by users and applications for data, and data can be selected by a specified valid time, or a valid time range.

Concepts that are integral to valid time temporal modeling include:

  • Valid time: This is a user-defined representation of time. Examples of a valid time include project start and finish dates, and employee hire and termination dates.
  • Tables with valid-time semantics: These tables have one or more dimensions of user-defined time, each of which has a start and an end.
  • Valid-time flashback queries: This is the ability to do as-of and versions queries using a valid-time dimension.
Continue reading

Clone Virtual Machine

This is always good to have a golden copy of your system. Then you don’t need to spend time to build your environment. For example, you can clone a VM after installed OS and configure network and prerequisites. Within couple of minutes you VM will be ready for any kind of R&D.

Continue reading

Oracle Data Pump (expdp, impdp) in Oracle Database

The Data Pump feature had been introduced from Oracle 10g. Until Oracle 9i, There were a tradition export and import (exp, imp) tools for logical backup. Nowadays Data Pump (expdp & impdp) utilities are mostly use by oracle DBA.

Data Pump is very useful tools to migrate database in difference version of Oracle databases or partial refresh (full database backup / restore also is the option) from prod to non-prod. In addition to basic import and export functionality data pump provides a PL/SQL API and support for external tables.

Continue reading

Configure Heat Map & Automatic Data Optimization (ADO) in Oracle 12c

Nowadays Data is growing very rapidly at enterprises – various industry estimates indicate that data volume is doubling every 2-3 years. The rapid growing data is going to be challenged for IT, both in cost and performance.

Although the cost of storage keeps declining, fast-growing data volumes make storage one of
the costliest elements of most IT budgets. In addition, the accelerating growth of data makes it
difficult to meet performance requirements while staying within budget.

Information Lifecycle Management (ILM) addresses these challenges by storing data in
different storage and compression tiers, according to the enterprise’s current business and
performance needs. This approach offers the possibility of optimizing storage for both cost
savings and maximum performance.

Supported Version: The Heat Map and Automatic Data Optimization (ADO) functionality was only available for non-CDB in Oracle Database 12.1. These functionalities are now supported in the Multitenant architecture in Oracle 12.2 and onward version.

Continue reading

Configure the network environment for Multitenant Database

This topic describes how to configure the network environment on Multitenant Database.

Create a Service:

List of Services:

col NAME for A30
col PDB for A20
set linesize 100
SQL> SELECT service_id, name, pdb
FROM v$services ORDER BY service_id;  

SERVICE_ID NAME                           PDB
---------- ------------------------------ --------------------
         0 pdbnodata.localdomain          PDBNODATA
         0 salespdb.localdomain           SALESPDB
         1 SYS$BACKGROUND                 CDB$ROOT
         2 SYS$USERS                      CDB$ROOT
         5 orclXDB                        CDB$ROOT
         6 orcl.localdomain               CDB$ROOT
         8 pdbtest.localdomain            PDBTEST

7 rows selected.

Create a Service for PDB:

DBMS_SERVICE package will use for creating a new service. For GI env, you may use srvctl to create and manger a service. When execute DBMS_SERVICE.CREATE_SERVICE procedure, it will create the service on current container.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 SALESPDB                       MOUNTED
         5 PDBTEST                        READ WRITE NO
         7 PDBNODATA                      MOUNTED

SQL> alter session set container=PDBTEST;

Session altered.

SQL> BEGIN
  DBMS_SERVICE.CREATE_SERVICE('SRV_PDBTEST1','SRV_PDBTEST1');
END;
/
PL/SQL procedure successfully completed.

SQL> SELECT service_id, name, pdb
FROM v$services
ORDER BY service_id;  

SERVICE_ID NAME                           PDB
---------- ------------------------------ ------------------------------
         8 pdbtest.localdomain            PDBTEST

SQL> EXEC DBMS_SERVICE.START_SERVICE('SRV_PDBTEST1');

PL/SQL procedure successfully completed.

SQL> SELECT service_id, name, pdb
FROM v$services
ORDER BY service_id;  

SERVICE_ID NAME                           PDB
---------- ------------------------------ ------------------------------
         1 SRV_PDBTEST1                   PDBTEST
         8 pdbtest.localdomain            PDBTEST

SQL> conn / as sysdba
Connected.
SQL> SELECT service_id, name, pdb
FROM v$services
ORDER BY service_id;  

SERVICE_ID NAME                           PDB
---------- ------------------------------ ------------------------------
         0 salespdb.localdomain           SALESPDB
         0 pdbnodata.localdomain          PDBNODATA
         1 SYS$BACKGROUND                 CDB$ROOT
         1 SRV_PDBTEST1                   PDBTEST
         2 SYS$USERS                      CDB$ROOT
         5 orclXDB                        CDB$ROOT
         6 orcl.localdomain               CDB$ROOT
         8 pdbtest.localdomain            PDBTEST

8 rows selected.

Make sure that the Service has been included on listener. If not add automatically, then run Alter system register.

[oracle@ocm12c admin]$ lsnrctl status
....
Service "srv_pdbtest1.localdomain" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

Connect to database using service:

SQL> conn USER_PDB/[email protected]:1521/srv_pdbtest1.localdomain
Connected.
SQL>
SQL>
SQL>
SQL> show con_name

CON_NAME
------------------------------
PDBTEST
SQL>
SQL>
SQL> conn C##USERCON/[email protected]:1521/srv_pdbtest1.localdomain
Connected.
SQL> show con_name

CON_NAME
------------------------------
PDBTEST
SQL> select * from tab;

TNAME
--------------------------------------------------------------------------------
TABTYPE  CLUSTERID
------- ----------
ROOT_TEST
TABLE

Add service to TNS file:

[oracle@ocm12c admin]$ tnsping SERTEST1

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 01-SEP-2020 21:26:38

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

Used parameter files:
/u01/app/oracle/product/12.1.0/dbhome_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ocm12c.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SRV_PDBTEST1.localdomain)))
OK (0 msec)

[oracle@ocm12c admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 1 21:26:42 2020

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> conn USER_PDB/oracle@SERTEST1
Connected.

Create a Listener:

Oracle Doc Link:

Database Administrator -> Database Net Services Reference -> 7 Oracle Net Listener Parameters in the listener.ora File

Database Administrator -> Database Net Services Administrator’s Guide -> 13 Enabling Advanced Features of Oracle Net Services (example 13-1)

LISTENER=
  (DESCRIPTION=
    (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
      (ADDRESS=(PROTOCOL=ipc)(KEY=extproc) (queuesize=50))))
SID_LIST_listener=
  (SID_LIST=
    (SID_DESC=
      (SID_NAME=plsextproc)
      (ORACLE_HOME=/oracle8)
      (PROGRAM=extproc)))

Control System Privileges (Truncate or Drop) in Oracle Database

There are two of privileges are available in Oracle.

  • Object Privileges: Object privileges can be granted as Object Level.
  • Example, You will able to provide delete privileges for particular table. User will able to delete records from that particular table only.
  • System Privileges: System Privileges are very powerful privileges as you can’t grant at object level like Object Privileges. You have to provide the privileges as database level.
  • Let say, DBA need to grant a user the drop or truncate table means user will able to drop or truncate any table from any schema in database.
  • Don’t recommended to provide this kind of privileges to any user as these are very risky privileges. But sometimes need to provide for business criticality.
Continue reading

Install Agent on OEM 12c or 13c in Silent Mode

In this topic I will show how to add an agent using Pull method in Silent Mode. Agent Installation processes are same for 12c and 13c.

  • OMS Server : ocmoem
  • Target Server : ocm12c

Login on OMS server using sysman and Synchronized:

[oracle@ocmoem bin]$ ./emcli login -username=sysman
Enter password :

Login successful
[oracle@ocmoem bin]$ ./emcli sync
Synchronized successfully

Get Platform Supported List:

[oracle@ocmoem bin]$ ./emcli get_supported_platforms
-----------------------------------------------
Version = 12.1.0.4.0
 Platform = Linux x86-64
-----------------------------------------------
Platforms list displayed successfully.

Download Agent Software from OMS:

[oracle@ocmoem bin]$ ./emcli get_agentimage -destination=/tmp/agentinstaller -platform="Linux x86-64" -version="12.1.0.4.0"               
=== Partition Detail ===
Space free : 3 GB
Space required : 1 GB
Check the logs at /u01/app/oracle/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2020-08-28_13-00-25-PM.log
Downloading /tmp/agentinstaller/12.1.0.4.0_AgentCore_226.zip
File saved as /tmp/agentinstaller/12.1.0.4.0_AgentCore_226.zip
Downloading /tmp/agentinstaller/12.1.0.4.0_PluginsOneoffs_226.zip
File saved as /tmp/agentinstaller/12.1.0.4.0_PluginsOneoffs_226.zip
Downloading /tmp/agentinstaller/unzip
File saved as /tmp/agentinstaller/unzip
Agent Image Download completed successfully.

Move Agent Software to Target Server:

[oracle@ocmoem agentinstaller]$ ls -l
total 249756
-rw-r--r--. 1 oracle oinstall 255744050 Aug 28 13:01 12.1.0.4.0_AgentCore_226.zip

[oracle@ocmoem agentinstaller]$ scp 12.1.0.4.0_AgentCore_226.zip ocm12c:/u01/software
The authenticity of host 'ocm12c (192.168.56.220)' can't be established.
RSA key fingerprint is d0:b8:8f:8e:9e:9a:b5:71:f6:bf:53:90:d7:57:c9:33.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ocm12c,192.168.56.220' (RSA) to the list of known hosts.
oracle@ocm12c's password:
12.1.0.4.0_AgentCore_226.zip                                                                           100%  244MB 122.0MB/s   00:02

Target Server: ocm12c

Unzip software:

[root@ocm12c agent_install]# unzip 12.1.0.4.0_AgentCore_226.zip
Archive: 12.1.0.4.0_AgentCore_226.zip
inflating: unzip
inflating: agentDeploy.sh
inflating: agentimage.properties
inflating: agent.rsp
extracting: agentcoreimage.zip
extracting: 12.1.0.4.0_PluginsOneoffs_226.zip

Install Agent on OEM using GUI

In this topic I will show how to add an agent using Push method with GUI. Agent Installation processes are same for 12c and 13c.

Install Agent on Target Host:

Navigate to the “Add Targets Manually” screen using the menu at the top-right of the screen (Click on ‘Setup’ > Add Target > Add Targets Manually).

Continue reading

OEM Cloud Control 12c Release 4 Installation on Oracle Linux 6.5

In this article I will describe the installation of Oracle Enterprise Manager (OEM) Cloud Control 12c Release 4 on 6.5.

Continue reading