Posts

Featured Post

Steps To Shutdown / Startup The Exadata

Image
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/12.1.0.2/grid/bin/crsctl 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/12.1.0.2/grid/bin/crsctl 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/12.1.0.2/grid/bin/crsctl 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

Image
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
http://www.oracle.com/technetwork/middleware/id-mgmt/downloads/index.html

Install OID, follow instructions:
https://docs.oracle.com/en/middleware/lifecycle/12.2.1.3/inoim/installing-product-software.html#GUID-5D47117E-3983-4BED-BADB-CB7DDD63DB34

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

Managing AWR in Active Data Guard Standby Databases

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

Solution
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

Image
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
displayconfig122.sql:

PROMPT disable FAST_START FAILOVER;
PROMPT disable configuration;
PROMPT remove configuration;
DECLARE
   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

Image
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 tail_alert.sh

#!/bin/bash

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

ECHO_RED="\E[1;40;31m"
ECHO_STD="\E[1;40;37m"

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" = "" ]
then
    ALERT_FILE=${ORACLE_BASE}/diag/${DIR_TYPE}/${ORACLE_UNQNAME,,}/${ORACLE_SID}/trace/alert_${ORACLE_SID}.log
    if [ ! -s ${ALERT_FILE} ]
    then
        echo
        echo -e &…

DBA Scripts coding considerations for best compatibility to any platform

Image
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

Image
Hi,
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/12.1.0.2/grid/bin/crsctl stat res -t -w "TYPE = ora.database.type"|awk '/^ora./ {l=$…