Showing posts from June, 2013

Enterprise manager Performance Hub (Real Time) 12c

Enterprise manager express is 

SQL> drop user osama cascade ;
User dropped.
SQL> create user osama identified by osama;
User created.
SQL> grant select any table to osama;
Grant succeeded.
SQL> grant select any dictionary to osama ;
Grant succeeded.
SQL> grant create session to osama;
Grant succeeded.
SQL> conn osama/osama ;
Connected. SQL> EXEC  DBMS_SQL_MONITOR.BEGIN_OPERATION ('My_First_JOB', forced_tracking => 'Y');
BEGIN DBMS_SQL_MONITOR.BEGIN_OPERATION ('My_First_JOB', forced_tracking => 'Y'); END;
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'BEGIN_OPERATION' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
to avoid this error :

SQL> VAR myjob_id NUMBER; SQL> EXEC :myjob_id := DBMS_SQL_MONITOR.BEGIN_OPERATION ('My_First_JOB', forced_tracking => 'Y')
PL/SQL procedure successfully completed.
myjob_id : variable

12c Auditing Tutorial

SQL*Plus: Release Production on Fri Jun 28 17:07:52 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release - 64bit Production
With the Partitioning, OLAP, Advanced Analytics, Real Application Testing
and Unified Auditing options

New Auditing came with oracle 12c called Unified Auditing which is " enables selective and effective auditing inside the Oracle database using policies and conditions. The new policy based syntax simplifies management of auditing within the database and provides the ability to accelerate auditing based on conditions. For example, audit policies can be configured to audit based on specific IP addresses, programs, time periods, or connection types such as proxy authentication. In addition, specific schemas can be easily exempted from auditing when the audit policy is enabled."

You can check here.

regarding to oracle Documentation with this kind of new audit you can capt…

12c Oracle Support Document until now

Second day for 12c database since it was  officially published, There is no much offical document from oracle until now. But i tried to collect as much as i can and share it here 
RMAN Enhancements in Oracle 12c [ID 1534487.1]
Master Note For Oracle Database 12c Release 1 (12.1) Database/Client Installation/Upgrade/Migration Standalone Environment (Non-RAC) [ID 1520299.1]

Oracle Database 12.1 : FAQ on Queryable Patch Inventory [ID 1530108.1]
Oracle Database 12c Release 1 (12.1) Upgrade New Features [ID 1515747.1]
Complete Checklist for Manual Upgrades to Oracle Database 12c Release 1 (12.1) [ID 1503653.1]
Changes For Oracle Database 12.1 Standalone Installation [ID 1483380.1]

Requirements for Installing Oracle Database 12.1 on Solaris 10 SPARC [ID 1517948.1]
Requirements for Installing Oracle Database 12.1 on RHEL6 or OL6 64-bit (x86-64) [ID 1529864.1]
Requirements for Installing Oracle Database 12.1 64-bit (AMD64/EM64T) on SLES 11 [ID 1519770.1]
How To Dow…

Database 12c New Audit Features

Amazing Features on Oracle Database 12c , I will blog everything i tested and check in New Oracle Database 12 , This Time Audit Enhancement :

Create Audit Policy :

SQL> create audit policy test_audit privileges select any table ;
Audit policy created.

Where : Privileges indicate to What this audit policy will do.
SQL> create audit policy test_audit_object actions select,update, lock on osama.test ; Audit policy created.
Where  Actions indicate to DML ,DDL Commands.
Until Now , You only Create Audit Policy Without Enable 
In the below way you enable audit for all users 
SQL> audit policy test_audit ; Audit succeeded.
SQL> audit policy  test_audit_object ; Audit succeeded.
Enable Audit On Some Users
SQL> audit policy test_audit by osama; Audit succeeded.
i want to enable audit but not for all users ;
SQL> audit policy test_audit expect osama; Audit succeeded.
also whenever successful or not successful still exists 
SQL> audit policy test_audit whenever successful  Audit su…

Enable Enterprise Express for Database 12c

Oracle Database 12c comes with new feature called Enterprise manager 12c express, this new enterprise manager control Database 12c using GUI , manager storage , performance , user, roles, accounts and others new features added , No command to start or shutdown EM 12c express by default when you start/shutdown database it will be up/down.

export ORACLE_SIDMake sure listener is up and database is registered.
sqlplus / as sysdba
SQL> show parameter dispatcher ;
------------------------------------ ----------- ------------------------------
dispatchers     string (PROTOCOL=TCP) (SERVICE=db12cX
DB)Configure HTTP PORT  SQL> exec DBMS_XDB_CONFIG.setHTTPPort (8080);Check the below pictures that describe EM Express :

DBMS_XDB.setHTTPPort is deprecated

Thank you
Osama mustafa

Security Features 12c

As Any Newer Version of database oracle Enhance Security This time Oracle create new users for administration purpose

Separate user duties :

SQL> select username from dba_users where username like '%SYS%';

SYS  : Super user
SYSKM : Key magament tasks
SYSDG : Data Guard Managment
SYSBACKUP : backup management

The Privilege Analysis feature allows you to: 
Define a privilege captureStart a privilege analysis during a period of timeDelete capture analysisThe Capture can be Done on Three level : UserRoleContextto understand this new package check the below examples :
sqlplus / as sysdba
SQL> create user test identified  by test ;
SQL> grant create session to test ; Grant succeeded.
SQL> grant select any table to test ; Grant succeeded.
Create new Capture using this package :
        name           =>  'test_capture', -
        description    =>…

tiny features : Truncate table in 12c

New Features with Database 12c , CASCADE Usually used with Drop or update command (10g,11g) But now with Database 12c , you can use this features with Truncate command

SQL> select * from test ;
no rows selected SQL> desc test ;
 Name   Null?    Type
 ----------------------------------------- -------- ----------------------------
 TEST_NAME    VARCHAR2(20) SQL> truncate table test cascade ;
Table truncated. More Features coming up :) Thank you  Osama mustafa

Another New Features 12c : generated as identity / Sequence Replacement

in old version of oracle database if you want to create automatic generated number you have to create sequence and use attribute nextval.

But with oracle database 12c this concept is changed new features add when you create table called generated as identity.

Check the Below Demonstration which explain this new features :

SQL> create table test (test_id number generated as identity , test_name varchar2(20));
SQL> desc test ;
 Name   Null?      Type
 -----------------------------------------   -------- --------------
 TEST_NAME         VARCHAR2(20) SQL> insert into test values (1,'osama');
insert into test values (1,'osama')
ERROR at line 1:
ORA-32795: cannot insert into a generated always identity column The TEST_ID Column will be inserting automatically  no need to use in insert command.

SQL> insert into test (TEST_NAME) values ( 'Jennifer' );
1 row created.
SQL> select * from test ;

Queryable Patch Inventory New Features 12c

Again !!! Oracle 12c Under test , every time i tested it i discover new features, while i am testing today i found new folder under $ORACLE_HOME called QOPatch , for the first time when i opened this folder i only found two files,

Check the note :

Oracle Database 12.1 : FAQ on Queryable Patch Inventory [ID 1530108.1] from the name you can see it's retrieve  information  using query, and to use query you have to get access to SQL Plus, this features  allow you access to the OPatch information from within the database.  This Package called  DBMS_QOPATCH

Some of Attribute to use with this package :


Since this function used to get Opatch information within database then you have to access to SQL…

Move Datafiles Online 12c

As you know Oracle database 12c released Yesterday and we all still test it and learn what are the new features !!

For the first time in Oracle Database you can move objects online without offline or shutdown database which is very useful and helpful for any DBA's

Check the example below :

SQL> select file_name from dba_data_files ;

/u01/app/oracle/oradata/db12c/undotbs01.dbf Let's move system01.dbf 
SQL> alter database move datafile '/u01/app/oracle/oradata/db12c/system01.dbf' to '/u01/system.dbf';
SQL> select File_name from dba_data_files ;

New Features 12c EXPDP

While i am testing Oracle 12c i notice new features in expdp , which you can export view like the following :

SQL> create table test ( id number);
Table created.
SQL> create view test_vw as select * from test ;
View created.
SQL> create directory dump as '/u01/dump';
Directory created.
SQL> grant read,write on directory dump to osama ;
Grant succeeded. [oracle@test12c u01]$ expdp directory=dump dumpfile=test.dmp logfile=test.log VIEWS_AS_TABLES=test_vw
Export: Release - Production on Wed Jun 26 18:33:52 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
Username: osama Password: 
Connected to: Oracle Database 12c Enterprise Edition Release - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "OSAMA"."SYS_EXPORT_TABLE_01":  osama/******** directory=dump dumpfile=test.dmp logfile=test.log VIEWS_AS_TABLES=test_vw 
Estimate in progress usin…

Database 12c Installation

1. Download the Oracle Database 12.1 Software from OTN
2. Make sure Oracle Database Software and OS are certified using
3. Make sure of the following


you need to configure Swap Memory And make sure you RAM is enough to avoid Out Of memory during the installation.


as i mention before check certified OS with database, in my case i will use Redhat 6 update 4.

install Packages :

binutils- (x86_64)
glibc-2.12-1.7.el6 (x86_64)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libaio-0.3.107-10.el6 (x86_64)
libXext-1.1 (x86_64)
libXtst- (x86_64)
libX11-1.3 (x86_64)
libXau-1.0.5 (x86_64)
libxcb-1.5 (x86_64)
libXi-1.3 (x86_64)
make-3.81-19.el6sysstat-9.0.4-11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
ksh  <== any version of ksh is acceptable
libstdc++-devel-4.4.4-13.el6 (x86_64…

Oracle Enterprise Manager unable to Start

When I checked the log Located $ORACLE_HOME/SID_HOSTNAME/sysman/log

I found the below errors :

app.ContextInitializer contextInitialized.420 - Integration Class not found


ERROR main: nmectla_agentctl: Error connecting to

First you need to make sure that the link in and ports and configured right and hostname is correct, restrat dbconsole if this not works then check the below

On Host :

oracle@TEST:/u01/app/$ echo $TZ
localtime oracle@TEST:/u01/app/$ export TZ=Etc/GMT+2 emctl config agent updateTZ emctl resetTZ agent 
Restart Dbconsole

Emctl start dbconsole   Thank you
Osama mustafa

12c Officaly Released

Finally After Waiting Oracle 12c Available to Download
Or ON oracle edelivery Here

Thank you
Osama mustafa

Enable Debug Mode Oracle Enterprise Manager

you need to change directory to below :
/u01/app/oracle/product/11.2.0/dbhome_1/sysman/config under this directory you will work on Backup two files. using cp command.
Open File :


log4j.rootCategory=WARN, emagentlogAppender, emagenttrcAppender
log4j.rootCategory=DEBUG, emagentlogAppender, emagenttrcAppender Change  EMAGENT_PERL_TRACE_LEVEL=WARN
Restart dbconsole

Thank you  Osama mustafa

Share Folder On Solaris For Window Purpose

In this article i will show how to share folder in Solaris and use this folder for Copy/Paste in windows , I will use NFS so you need to make sure it's already enable in Windows

Select Control Panel.Select Programs.Select Programs and Features.Select Turn Windows Features on or off.Select Services for NFS.Select the check box Client for NFS and click OK.
Now On Solaris Side , Using Share command 
share [-F fstype] [ -o options] [-d ""] [resource]
Create Folder and use the below command to share 
share -F nfs -o rw -d "codereview dirs" /u01/Shared --> my Shared Folder

root@Host:/u01# cat /etc/dfs/sharetab 
/u01/Sharedu01_Sharednfssec=sys,rw Now back to windows open Command Prompt "cmd"
and run the below command :
showmount -e Server-IP 
Exports list on :
/u01/Shared                        All Machines
/u01/hmmdb                         All Machines Command to share on windows : mount -o mtype=hard Server-IP:P…

Oracle Java SE Critical Patch Released

"The June 2013 Oracle Java SE Critical Patch Update was released on June 18, 2013. Oracle strongly recommends applying the patches as soon as possible.

The Critical Patch Update Advisory is the starting point for relevant information. It includes the list of products affected, a summary of the security vulnerabilities, and a pointer to obtain the latest releases and patches."

June 2013 Oracle Java SE Critical Patch Update: Here

The next four scheduled dates for Oracle Java SE Critical Patch Updates are:
16 April 2013
18 June 2013
15 October 2013
14 January 2014

Thank you
Osama mustafa

Extend File system On Solaris Using ZFS Command

The below is demostration for extend File system On Solaris 11 :   root@TEST:~# zfs list
NAME                      USED  AVAIL  REFER  MOUNTPOINT
oracle                    107G  10.6G  1.11M  /oracle
oracle/u01                105G  13.0G   105G  /u01
rpool                    32.2G  46.0G    39K  /rpool
rpool/ROOT               5.40G  46.0G    31K  legacy
rpool/ROOT/solaris       5.40G  46.0G  5.03G  /
rpool/ROOT/solaris/var    318M  46.0G   314M  /var
rpool/dump               1.03G  46.1G  1.00G  -
rpool/export              854K  46.0G    32K  /export
rpool/export/home         822K  46.0G    32K  /export/home
rpool/export/home/omnix   790K  46.0G   790K  /export/home/omnix
rpool/swap               25.8G  46.8G  25.0G  - root@TEST:~# zpool list
oracle   140G   105G  34.9G  75%  1.00x  ONLINE  -
rpool   79.5G  31.4G  48.1G  39%  1.00x  ONLINE  - root@TEST:~# zpool set autoexpand=on oracle

root@TEST:~# zpool list

cannot unmount '/export/home/oracle': Device busy

Operating System : Solaris 11

When run the below command :
zfs destroy rpool/export/home/grid  cannot unmount '/export/home/oracle': Device busy

Solution :

zfs unmount rpool/export/home/grid
zfs destroy rpool/export/home/grid

Thank you
Osama mustafa

cannot mount 'rpool/u01' on '/u01': mountpoint or dataset is busy

When you try to use the below command :

zfs create -o mountpoint=/u01 rpool/u01

Error :
cannot mount 'rpool/u01' on '/u01': mountpoint or dataset is busy
The Solution :
First destroy rpool/u01zfs create rpool/u01zfs set mountpoint=/u01 rpool/u01mkdir /u01zfs mount /u01

Thank you  Osama Mustafa

Example on how to add Virtual Host On em12c

Active/Passive Clusterware , how to use it with em12c ? How to monitor OS and Database ? As One Single host Agent will deploy on Both Hosts without Any problem but in this case you will only Deal with one Host as Single not as Clusterware.
i will provide example how to add active/passive Clusterware to em12c :

First Agent should be deploy for single Host not acitve/passive clusterware, after do that Run the below command from Single Host  emctl deploy agent -o -n "Service_name" -A
The Below Commands should be run from new agent Location 
emctl secure agent emctl start agent emctl config agent addinternaltargets

**I prefer to set Service_name ---> OracleAgent12cShared. ** Re run the above command on the passive Node after Failover shared storage on it.
Thank you  Osama Mustafa

Oracle OTN Forum Upgraded

After waiting Long More than one month to upgrade Oracle Forum, yesterday New Release Published with Big Surprise for all of us.
Lot Of New Features, New Look , and New Red Banner if you get used old forum it's easy for you to deal with new one , Specially it's Have Lot of Social media Features
Change Your AvatarLike PostsAdd FriendsPrivate messageusing @ to Tag SomeoneFollow PostYou can include your mobile number. This is What I know until now, And We need time to know how to use it and get use to it, Since lot of new Features and totally Surprise me also you read this article here.
I guess Good things need time, and some of these feature not working 100% but hope everything Will Goes smoothly.
Thank you  Osama Mustafa

Some notes you maybe need for Em12c

I would like to share some MOS  Notes that could be useful please note that You can share yours in comments

EM12c R2: How to Upgrade to EM 12c R2 - Two System Method [ID 1363162.1]
EM12c: How to install JVM Diagnostics (JVMD) in Cloud Control [ID 1493862.1]
EM12c: How To Upgrade Plugin On 12.1 Management Agent [ID 1490762.1]
How to Install 12c Agent on Virtual Host [ID 1469995.1]

EM12c Upgrade : Agents Are Not Listed in the Upgrade Console With Error Inventory Data Is Missing From the Repository [ID 1489109.1]

EM 12c : How to Discover All Targets On a Single Host After Agent Installation ? [ID 1386817.1]
EM 12c : Understanding Promote Target Functionality [ID 1386161.1]

EM12c How to Perform Automatic Host Discovery Using IP Scan Method ? [ID 1386811.1]
EM12c Agent status Fails With "Peer Not Authenticated" Error. [ID 1510706.1]

EM12C: Agent Installation Failed With Error: "OMS_HOST and EM_UPLOAD_PORT is not active" [ID 1371873.1]

How To Upgrade Java Diagnostics In…

Allow users Login Solaris 11

Solaris 11 is the most amazing Platform that you can deal with , Specially if you want to install any Oracle products. you don't need to check anything before install.

By default root login on solaris disabled and you cannot login as root. ( which is amazing for security ) but sometimes you need to enable this login and to do that follow the below steps :

after login to privileged  user can access on Solaris switch user to etc/user_attr
# The system provided entries are stored in different files
# under "/etc/user_attr.d".  They should not be copied to this file.
# Only local changes should be stored in this file.
# This line should be kept in this file or it will be overwritten.
oracle::::type=normal;;defaultpriv=basic,net_privaddr type should be normal.

and to enable SSH for root user you have to do the following :

vi /etc/ssh/sshd_config
PermitRootLogin = yes vi /etc/default/login
#CONSOLE =/dev/login|console rolemod -K type=normal root

Thank y…