miércoles, 26 de junio de 2013

Oracle Agente de diagnóstico remoto (RDA) de utilidad

Oracle Agente de diagnóstico remoto (RDA) de utilidad



Oracle Remote Diagnostics Agent (RDA) is used primarily by Oracle Support. I've found that this information is very useful and have used to debug issues in my environment. It is a useful utility to me for particular situations.

The utility ships a readme.txt file for both WIndows and Unix that will help get you started. Rather than discuss everything about RDA and analyze the output it provides, I suggest you give it a whirl. Click on this link and you can view the RDA output.

Many of the most difficult Oracle problems to fix usually are due to some environmental issue or change. It was working yesterday, now it's not, what's different. I use the RDA for a comprehensive environment report. But you'll have to wait a bit, it's not exactly speedy. :-)  
You can download it from MetaLink - Doc ID: 314422.1

Steps and Commands:
UNIX / LINUX
WINDOWS
Unzip Files
use Unix/Linux utility
use any Windows utility
Instructions
README_Unix.txt/README_Linux.txt
README_Windows.txt
Verify Installation
rda.sh -cv
rda.cmd -cv
Run Setup
rda.sh -S or rda.pl -S
rda.cmd -S or rda.pl -S
Run RDA
rda.sh -v or rda.pl -v
rda.cmd -v
To view RDA
Open RDA_INDEX.htm from the RDA output directory


Connection to Database:
Open command prompt.
cmd> set ORACLE_SID=mydb
cmd> sqlplus / as sysdba
And you will be connected to the database.



Oracle Remote Diagnostic Agent (RDA) Report Generation:
Note: I am generating RDA Report on Windows for this article.
Unzip Files:
Unzip the downloaded RDA Utility to a directory ( Here E:/rda ).

Read Instructions:
Go to the directory, where we have unzipped the files and we can read the instructions given in the "Readme_O/S.txt" file.

Verify Installation:
Open command prompt and navigate to the RDA directory.
cmd> rda.cmd -cv

Run Setup:
Open command prompt and navigate to the RDA directory.
cmd> rda.cmd -S
 The script continues on for many more pages as part of the configuration. Choose the options according to your Report need.

Run RDA:
Open command prompt and navigate to the RDA directory.
cmd> rda.cmd -v

View RDA Report:
Open "RDA__index.htm" from the RDA output directory to view the report.

Our RDA Report has been generated.


12 eBooks gratuitos de Microsoft que no te pueden faltar.

12 eBooks gratuitos de Microsoft que no te pueden faltar.


RMAN show all command

RMAN show all command


RMAN> show all;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f'; # default

http://dbaoracledba.blogspot.mx/2012/06/rman-show-all-command.html

How to remove a line/parameter from spfile?

How to remove a line/parameter from spfile?

alter system reset parameter scope=spfile sid='nodename';


Example:


alter system reset undo_tablespace scope=spfile sid='NODE11';

Redundancy Policy in RMAN

Redundancy Policy in RMAN

Configuring the Backup Retention Policy

Retention Policy is of two options:
Window-Based Retention Policy
Redundancy-Based Retention Policy

Configuring a Recovery Window-Based Retention Policy:
The recovery window parameters specifies the number of days between the current time and the earliest point of recoverability.

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
The above can recover the database to any point withing the last week.

RMAN does not automatically delete backups rendered obsolute by the recovery window. Instead RMAN marks them as OBSOLUTE in the REPORT OBSOLUTE output.
RMAN retains all archived logs and incremental backups that are needed to recover the nonobsolete backups.

Configuring a Redundancy-Based Retention Policy:
The redundancy parameter specified the number of backups that has to be maintained for the Datafile & Controlfile by RMAN.
RMAN will mark the backups to be obsoluted , if the number of backups for a specific datafile or control file exceeds the Redundancy Setting.
RMAN keeps a track of which ones to retain and which are obsoluted.

CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
The above will set RMAN to have only 2 backups of the datafile or controlfile. If a backup is taken after that then the older one will be obsoluted.

RMAN retains all archived logs and incremental backups that are needed to recover the nonobsolete backups.

Configuring Control File and Server Parameter File Autobackup
RMAN can be configured to automatically back up the control file and server parameter file whenever the database structure metadata in the control file changes and whenever a backup record is added.
The autobackup enables RMAN to recover the database even if the current control file, catalog, and server parameter file are lost.

Enabling : CONFIGURE CONTROLFILE AUTOBACKUP ON;
Disabling: CONFIGURE CONTROLFILE AUTOBACKUP OFF;

The following command will configure RMAN the autobackup to write to an ASM DiskGroup

ASM Instance :
(To create the disk group )
CREATE DISKGROUP CONTROL
NORMAL REDUNDANCY
FAILGROUP failure_group_1 DISK 'ORCL:ASMD6'
FAILGROUP failure_group_2 DISK 'ORCL:ASMD7';

RMAN :
CONFIGURE CONTROLFILE AUTOBACKUP
FORMAT FOR DEVICE TYPE DISK TO '+CONTROL';

Image copy backup using RMAN



Backup Set:
 A standard RMAN backup set contains one or more backup pieces, and each of these pieces consists of the data blocks for a particular datafile stored in a special compressed format. When a datafile needs to be restored, therefore, the entire datafile essentially needs to be recreated from the blocks present in the backup piece.

Image Copy:
An image copy of a datafile, on the other hand, is much faster to restore because the physical structure of the datafile already exists. Oracle 10g now permit image copies to be created at the database, tablespace, or datafile level through the new RMAN directive BACKUP AS COPY. For example, here is a command script to create image copies for all datafiles in the entire database:
RUN {
# Set the default channel configuration. Note the use of the
# %U directive to insure unique file names for the image copies
ALLOCATE CHANNEL dbkp1 DEVICE TYPE DISK FORMAT 'D:\oracle\rman\ora10G\U%';
# Create an image copy of all datafiles in the database
BACKUP AS COPY DATABASE;
}

 why dont the client wants to have backupsets rather
than image copies? I know that Oracle first perfers to the image copies
compare to incremental or backupsets.

But, you know, image copy is just a block to block copy, no compression. It
would take good considerable time to finish the backup.

10g RMAN has very rich features, like BTC, binary compression and etc.

Vistas de catálogo de RMAN txt

-- Archived and unarchived redo logs
-- RC_ARCHIVED_LOG

SELECT * FROM V$ARCHIVED_LOG;

-- Control files in backup sets
--RC_BACKUP_CONTROLFILE

SELECT * FROM V$BACKUP_DATAFILE ;

-- Corrupt block ranges in datafile backups
-- RC_BACKUP_CORRUPTION
SELECT * FROM V$BACKUP_CORRUPTION ;

-- Datafiles in backup sets
-- RC_BACKUP_DATAFILE

SELECT * FROM V$BACKUP_DATAFILE ;

-- RMAN backups and copies in the repository.
-- RC_BACKUP_FILES
SELECT * FROM V$BACKUP_FILES  ;

-- Backup pieces
--  RC_BACKUP_PIECE
SELECT * FROM V$BACKUP_PIECE ;

-- Archived logs in backups
-- RC_BACKUP_REDOLOG
SELECT * FROM V$BACKUP_REDOLOG   ;

-- Backup sets
-- RC_BACKUP_SET
SELECT * FROM V$BACKUP_SET  ;

-- Server parameter files in backup sets
-- RC_BACKUP_SPFILE
SELECT * FROM V$BACKUP_SPFILE ;

-- Control file copies on disk
-- RC_CONTROLFILE_COPY
SELECT * FROM V$DATAFILE_COPY  ;

-- Ejemplo: /export/home/oracle/rda/output/TMP_RDA/RDA_BR_T28903_01_control.tmp

-- Control file copies on disk
-- RC_COPY_CORRUPTION
SELECT * FROM V$COPY_CORRUPTION ;

-- Databases registered in the recovery catalog (RC_DATABASE) or information about the currently
-- RC_DATABASE
SELECT * FROM V$DATABASE ;

-- Database blocks marked as corrupt in the most recent RMAN backup or copy
-- mounted database (V$DATABASE)
-- RC_DATABASE_BLOCK_CORRUPTION
SELECT * FROM V$DATABASE_BLOCK_CORRUPTION ;

-- All database incarnations registered in the catalog
-- RC_DATABASE_INCARNATION
SELECT * FROM V$DATABASE_INCARNATION ;

-- All datafiles registered in the recovery catalog
-- RC_DATAFILE
SELECT * FROM V$DATAFILE ;

-- Datafile image copies
-- RC_DATAFILE_COPY
SELECT * FROM V$DATAFILE_COPY ;

-- Historical information about online redo logs
-- RC_LOG_HISTORY
SELECT * FROM V$LOG_HISTORY ;

-- Offline ranges for datafiles
-- RC_OFFLINE_RANGE
SELECT * FROM V$OFFLINE_RANGE ;

-- Archived log backups created by proxy copy
-- RC_PROXY_ARCHIVEDLOG
SELECT * FROM V$PROXY_ARCHIVEDLOG ;

-- Control file backups created by proxy copy
-- RC_PROXY_CONTROLFILE
SELECT * FROM V$PROXY_DATAFILE ;

-- Datafile backups created by proxy copy
-- RC_PROXY_DATAFILE
SELECT * FROM V$PROXY_DATAFILE ;

-- Online redo logs for all incarnations of the database since the last catalog resynchronization
-- RC_REDO_LOG
-- V$LOG and V$LOGFILE
SELECT * FROM v$log  ;
SELECT * FROM v$logfile;

-- All redo threads for all incarnations of the database since the last catalog resynchronization
-- RC_RESYNC
-- RC_REDO_THREAD
SELECT * FROM V$THREAD;
-- n/a

-- Recovery catalog resynchronizations
-- RC_RMAN_CONFIGURATION
SELECT * FROM V$RMAN_CONFIGURATION;

-- RMAN persistent configuration settings
-- RC_TABLESPACE
SELECT * FROM V$TABLESPACE ;

Vistas de catálogo de RMAN

RMAN Catalog Views
Vistas de catálogo de RMAN

RMAN Catalog Views

Recovery Catalog View Corresponding V$ View Catalog View Describes
Vistas de catálogo de RMAN

Recuperación Catálogo vista correspondiente V $ View
catálogo que Describe las Vistas.


Archived and unarchived redo logs

RC_ARCHIVED_LOG
V$ARCHIVED_LOG



Registros de rehacer archivados y sin archivar

RC_ARCHIVED_LOG
V $ archived_log


Control files in backup sets

RC_BACKUP_CONTROLFILE
V$BACKUP_DATAFILE

Archivos de control de copia de seguridad

RC_BACKUP_CONTROLFILE
V $ BACKUP_DATAFILE


Corrupt block ranges in datafile backups

RC_BACKUP_CORRUPTION
V$BACKUP_CORRUPTION


Rangos bloque dañado en copias de seguridad de ficheros de datos 

RC_BACKUP_CORRUPTION
V $ BACKUP_CORRUPTION


Datafiles in backup sets

RC_BACKUP_DATAFILE
V$BACKUP_DATAFILE


Archivos de datos de copia de seguridad

RC_BACKUP_DATAFILE
V $ BACKUP_DATAFILE


RMAN backups and copies in the repository.

RC_BACKUP_FILES
V$BACKUP_FILES





Copias de seguridad de RMAN y copia en el repositorio. 

RC_BACKUP_FILES
V $ backup_files



Backup pieces

 RC_BACKUP_PIECE
V$BACKUP_PIECE


Piezas Backup 

 RC_BACKUP_PIECE
V $ BACKUP_PIECE


Archived logs in backups

RC_BACKUP_REDOLOG
V$BACKUP_REDOLOG


Archivado registros de las copias de seguridad 

RC_BACKUP_REDOLOG
V $ BACKUP_REDOLOG


Backup sets

RC_BACKUP_SET
V$BACKUP_SET


Backup

RC_BACKUP_SET
V $ BACKUP_SET


Server parameter files in backup sets

RC_BACKUP_SPFILE
V$BACKUP_SPFILE


Archivos de parámetros del servidor de copia de seguridad

RC_BACKUP_SPFILE
V $ BACKUP_SPFILE


Control file copies on disk

RC_CONTROLFILE_COPY
V$DATAFILE_COPY


Copias de archivos en el disco de control 

RC_CONTROLFILE_COPY
V $ DATAFILE_COPY


Control file copies on disk

RC_COPY_CORRUPTION
V$COPY_CORRUPTION


Copias de archivos en el disco de control 

RC_COPY_CORRUPTION
V $ COPY_CORRUPTION


Databases registered in the recovery catalog (RC_DATABASE) or information about the currently

RC_DATABASE
V$DATABASE


Bases de datos registrados en el catálogo de recuperación (RC_DATABASE) o información acerca de las  actualmente 

RC_DATABASE
V $ database


Database blocks marked as corrupt in the most recent RMAN backup or copy

mounted database (V$DATABASE)
RC_DATABASE_BLOCK_CORRUPTION
V$DATABASE_BLOCK_CORRUPTION


Bloques de base de datos señalados como corruptos en la copia de seguridad de RMAN más reciente o copia 

montada la base de datos (V $ database)
RC_DATABASE_BLOCK_CORRUPTION
V $ DATABASE_BLOCK_CORRUPTION



All database incarnations registered in the catalog

RC_DATABASE_INCARNATION
V$DATABASE_INCARNATION


Todas las encarnaciones de bases de datos registradas en el catálogo 

RC_DATABASE_INCARNATION
V $ DATABASE_INCARNATION



All datafiles registered in the recovery
catalog

RC_DATAFILE
V$DATAFILE

Todos los archivos de datos registrados en el catálogo de recuperación 

RC_DATAFILE
V $ DATAFILE


Datafile image copies

RC_DATAFILE_COPY
V$DATAFILE_COPY


Imagen de archivo de datos copia 

RC_DATAFILE_COPY
V $ DATAFILE_COPY


Historical information about online redo logs

RC_LOG_HISTORY
V$LOG_HISTORY


Información histórica a cerca de rehacer en línea los registros 

RC_LOG_HISTORY
V $ log_history


Offline ranges for datafiles

RC_OFFLINE_RANGE
V$OFFLINE_RANGE


Desconectado rangos de archivos de datos 

RC_OFFLINE_RANGE
V $ OFFLINE_RANGE


Archived log backups created by proxy copy

RC_PROXY_ARCHIVEDLOG
V$PROXY_ARCHIVEDLOG


Seguridad de registros archivados creados por copia proxy de 

RC_PROXY_ARCHIVEDLOG
V $ PROXY_ARCHIVEDLOG


Control file backups created by proxy copy

RC_PROXY_CONTROLFILE
V$PROXY_DATAFILE


Archivo de control copias de seguridad creadas por proxy copia 

RC_PROXY_CONTROLFILE
V $ PROXY_DATAFILE



Datafile backups created by proxy copy

RC_PROXY_DATAFILE
V$PROXY_DATAFILE


Copias de seguridad de ficheros de datos creados por proxy copia 

RC_PROXY_DATAFILE
V $ PROXY_DATAFILE


Online redo logs for all incarnations of the database since the last catalog resynchronization

RC_REDO_LOG
V$LOG and V$LOGFILE


Registros de rehacer en línea para todas las encarnaciones de la base de datos  hasta el último catalogo resincronizado.

RC_REDO_LOG
V $ LOG y V $ LOGFILE


All redo threads for all incarnations of the database since the last catalog resynchronization

RC_RESYNC
RC_REDO_THREAD
V$THREAD
n/a


Todas los redo threads para todas las encarnaciones de la base de datos desde el último catálogo de resincronización

RC_RESYNC 
RC_REDO_THREAD
V $ ROSCA
n / a


Recovery catalog resynchronizations

RC_RMAN_CONFIGURATION
V$RMAN_CONFIGURATION


Recuperación catálogo resincronizaciones

RC_RMAN_CONFIGURATION
V $ RMAN_CONFIGURATION


RMAN persistent configuration settings

RC_TABLESPACE
V$TABLESPACE


RMAN persistentes ajustes de configuración

RC_TABLESPACE
V $ TABLESPACE