What Is A CMDB?

Today I like post a short reference about CMDB, this concept is used in many organizations and I think knows it can help. A configuration management database (CMDB) is a repository that acts as data warehouse for information technology installations.

The Information Technology Infrastructure Library (ITIL) framework, describes the use of CMDBs as part of infrastructure operations and support. In the ITIL context, a CMDB represents the authorized configuration of the significant components of the IT environment.

CMDB basically is a database or repository which includes all systems, software and theirs configurations. CMDB helps an organization understand the relationships between the components of a system and track their configurations.

HTH – Antonio NAVARRO

One More Time, “IS NULL” Is Not The Same That “= NULL”

Today a developer ask me about a issue that he has when executed a query, it must to return rows and he didn’t any get. When I took a look at query I can see a “= NULL” like a filter condition in the where clause. Of course, I see it many times, and it is a error in Oracle, Sybase, MySQL, SQL Server, ……. In this case the person has been working as sql developer since two months ago, it can be a excuse.

I post the, maybe, more simple example;

TEST*ANTO> create table uno (col1 number(5), col2 number(5));

Tabla creada.

TEST*ANTO> insert into uno values (1,2);

1 fila creada.

TEST*ANTO> insert into uno (col1) values (3);

1 fila creada.

TEST*ANTO> select * from uno;

      COL1       COL2
__________ __________
         1          2
         3 ø

REM 
REM AND NOW, THE PROBE
REM 

REM *** This not return anything ***

TEST*ANTO> select * from uno where col2 = NULL;

ninguna fila seleccionada

REM *** This return one row ***

TEST*ANTO> select * from uno where col2 IS NULL;

      COL1       COL2
__________ __________
         3 ø

HTH – Antonio NAVARRO

Other Way To See Rman Configuration

Usually we use the show all command at rman prompt to see the configuration use for rman where a backup or restore is performed. In this example I like show the SQL way, for it we need connect to recovery catalog (It is different if we use controlfile as catalog).
The best is connect with the user propetary, but in this case I use a nominative user and referenced the catalog propietary user (rman2015). Let’s go;

Let me describe the RC_RMAN_CONFIGURATION view, it have the configuration for rman and each database;

 
SQL>  set lines 80
SQL>  desc rman2015.rc_rman_configuration
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 DB_KEY                                    NOT NULL NUMBER
 CONF#                                     NOT NULL NUMBER
 NAME                                      NOT NULL VARCHAR2(65)
 VALUE                                              VARCHAR2(1025)
 DB_UNIQUE_NAME                                     VARCHAR2(512)
 SITE_KEY                                  NOT NULL NUMBER

The next query get the parameters configured by database;

 
SQL> select db_key, name, value from rman2015.rc_rman_configuration;

Of course, the db_key column give us not too information or not very clearly, If you know the database name you can cross the db_key with the rc_database view;

 
SQL> select db_key, name from rman2015.rc_database;

HTH – Antonio NAVARRO

 

Simulate Tape Library With Rman

The proposal of this post is show how to test tape channels. I’ll simulate the tape using disk. Rman include the SBT_LIBRARY param that you need set to “oracle.disksbt” for probes. I recommend you not use it for production enviroments. The first of all you need configure a filesystem or directory where write the backup, let me create a simple directory;

cd /tmp 
mkdir SimulateTapeLibrary

Of course, it is a not good idea use /tmp but let me use it for this example. Now we can backup the database like using tape library. Look at the next code;

Rman> connect target /
RUN {
  ALLOCATE CHANNEL TAPE_CHANNEL TYPE 'SBT_TABPE'
  PARMS="SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=/tmp/SimulateTapeLibrary)";
  BACKUP DATAFILE 1 FORMAT ='%U';
}

Alternatively, you can use a permanent configuration command to set the Oracle library;

CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=oracle.disksbt, ENV= (BACKUP_DIR=/tmp/SimulateTapeLibrary)';

HTH – Antonio NAVARRO

Enable_ddl_logging parameter Parameter

This parameter was introduced by Oracle in Release 11g. It can be a powerfull tool to audit, without audit command, all the ddl language what is used into the database.

Put it on with the next command;

alter system set enable_ddl_logging=true;

For disable it, set the parameter to false;

alter system set enable_ddl_logging=false;

In Oracle 11g it logging the output to the alert.log of the database. In Oracle 12c it change and log the output to a specific file;

$ADR_BASE/diag/rdbms/{DB-name}/{SID}/log/ddl_{SID}.log

HTH – Antonio NAVARRO

 

How To Transfer Enviroments Variables To Rman

I like show how to pass substitution variables from shell to Rman script.

The code for shell scrit is thw followig, please note I use the KSH shell;

 
#!/bin/ksh
set name      = $argv[1]
set format    = $argv[2]
rman @execute_backup.rcv using $tag $format

Below I show the code for rman script named execute_backup.rcv;

 
connect target /
run 
{
backup database
tag &1
format '&2 ';
}
exit;

HTH – Antonio NAVARRO

Oracle Differences Between Crash Recovery And Media Recovery

Today I has assited to a workshop about Rman 12c. We started introducing to ours, there were persons with very differents skills and experience but when the teacher ask us about the differences of Crash Recovery from Media Recovery, many people don’t know what it is. I like remember what every one is.

Crash Recovery, is the automatic (no manual action is needed) recovery, a tipical case is where a power outage occurs, in the next start up Oracle perform the work.

Media Recovery, is the manual recovery (restore and recover), a typical case is when a datafile is lost. You need restore the damaged datafile and apply the archived redo over the datafile.

 
HTH – Antonio NAVARRO