Featured Post

Steps To Shutdown / Startup The Exadata

ShutDownLog in to the first database server as root.Change to the OneCommand directory# cd /opt/oracle.SupportTools/onecommand Note whether the Grid Infrastructure is currently enabled for autostart, so that this state can be restored later:# dcli -g dbs_group -l root /u01/app/ config crs Disable the Grid Infrastructure for autostart on the database servers if the previous step indicated it is currently enabled for autostart.# dcli -g dbs_group -l root /u01/app/ disable crs Note: This is step is [Optional] and it can required during maintenance operation like “firmware patches” which requires to reboot the Compute Node several times. Stop the Grid Infrastructure stack on the database servers (compute nodes):# dcli -g dbs_group -l root "/u01/app/ stop crs" Verify that the Grid Infrastructure stack has shutdown successfully on the database servers. The following command should show no output if the GI stack has…

Install Oracle Internet Directory (OID) in Standalone mode

Oracle Internet Directory (OID) is an LDAP server which uses an Oracle database as a datastore. Client machines can use the OID for all TNS lookups. With OID. Once all client machines are configured correctly any modifications to the TNS lookups can be done from a central location reducing the amount of client machine administration.
This guide is about installing and using Oracle Internet Directory in Standalone mode, no need for Oracle Fusion Middleware Infrastructure.

Step-by-step guide

Download Oracle Internet Directory (Part of identity management) from

Install OID, follow instructions:

Starting the Installation Program:
./fmw_12. Configure the Domain:
$ORACLE_HOME/oracle_common/common/bin/ Start the Servers for Standalone Oracle Internet …

Managing AWR in Active Data Guard Standby Databases

- Automatic Workload Repository (AWR) snapshots cannot be taken in a read-only standby environment.
- Performance monitoring and analysis is limited to basic STATSPACK functionality .

In Oracle Database 12.2, the AWR framework is enhanced to support capture of remote snapshots from any generic database, including Active Data Guard (ADG) databases. This framework is called the Remote Management Framework (RMF).
• A target catalog database collects snapshots from the remote databases (sources).
• Snapshots can be collected automatically or manually.
• AWR tables on the catalog database accumulate snapshot data from all sources via database links.
• Source databases must be registered on the catalog via new DBMS_WORKLOAD_REPOSITORY.REGISTER_REMOTE_DATABASE API

These are the basic steps for setting up the RMF topology for generating AWR on the physical standby:
1. Configure database nodes to add to the topology.
2. Create the topology.
3. Register database nodes with the t…

Extract Data Guard Commands on Oracle 12.2

Hi, These days I am starting to work on Oracle 12.2, leaving behind the old versions.
Since my main domain is Oracle Data Guard,  I posted a blog about Oracle 12c Release 2 New Features for Active Data Guard, one of a big new feature I missed is that the internal Data Guard broker configuration was changed dramatically on 12.2.
Last week, I tried to "Extract Data Guard Commands", and realized it is not working as before :(
So I sat down and adjusted it to work on 12.2, this time I enhanced the output with some more important information.

Run the following script as sysdba

PROMPT disable configuration;
PROMPT remove configuration;
   rid                      INTEGER;
   indoc                    VARCHAR2 (4000);
   outdoc                   VARCHAR2 (4000);
   p                        INTEGER;
   z                        XMLTYPE;
   y                        CLOB;
   v_xml                    XMLTYPE;
   tout                …

Coloring alert.log output via tail and less

Making my day to day job easier and convenient I like having some utilities and some aliases. We, the DBAs nation, have a need to look at the alert.log file frequently. So basically, I did the following:
-Created a script to tail my alert.log file.
-Colored the important words.
-Added an alias to that script
$ vi


export SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${SCRIPT_DIR}/platform.env


LIGHT_RED=`echo -e '\033[1;40m\033[1;31m'`
RED=`echo -e '\033[1;40m\033[0;31m'`
LIGHT_PURPLE=`echo -e '\033[1;40m\033[0;35m'`
GREEN=`echo -e '\033[1;40m\033[32m'`
NORMAL=`echo -e '\033[0m'`

if [ "$1" = "" ]
    if [ ! -s ${ALERT_FILE} ]
        echo -e &…

DBA Scripts coding considerations for best compatibility to any platform

Did you find yourself trying to convert your DBA scripts to work on other OS or UNIX flavors ? This is a typical issue DBAs cope with, the solutions can be:
Each system has its own best scripting code (PowerShell for windows, bash for Linux), let's keep some versions of the same code.Write the code in a common language for all systemsShell: In the past I used the old Posix shell (sh) which exited in all Unix systems. These days I use bash as is very common. Perl: Oracle installation already has its own Perl, no need to install it.Java: Oracle installation already has its own java, no need to install it.Python: Python should be installed, but the libraries that can be used are huge, and you can write shorter code.Write in sql/plsql as much as you can, the external code will be minimal (cmd / sh).Work remotely from your convenient operating system, using your scripts written in the language you master.Use a few macros injected to your terminal.Why use scripts, I use Toad / Cloud Con…

Basics commands for DBA part 1 - finding instance

In the next few blogs I will discuss on scripting technics that DBA usually needs. I am concentrating in the commands, that are usually part of larger script. Later on I will submit some scripts that uses these technics.

Identifying all instances running on the current machine Option 1:  # ps -ef |grep smon
oracle    3025     1  0  2016 ?        00:00:48 asm_smon_+ASM
oracle   11459     1  0 17:24 ?        00:00:00 ora_smon_fdb
root     12763 11332  0 17:52 pts/1    00:00:00 grep --color=auto smon SID is fdb and process id is 11459
Option 2:  # pgrep  -lf _pmon_
3025 asm_pmon_+asm
11459 ora_pmon_fdb SID is fdb and process id is 11459
 Option 3:  Cleaner way for sid:
$ ps -ef |grep 'ora_smon_.*$' | grep -v grep | awk -F_ '/ora_smon/{print $NF}'
fdb SID is fdb
Option 4:  When we already know ASM home (grid infrastructure) we can use the cluster commands:
$ /oracle/product/ stat res -t -w "TYPE = ora.database.type"|awk '/^ora./ {l=$…