All technological notes.
Data Recovery AdvisorData failures
Each check can diagnose one or more failures, which are mapped to a repair.
reactive checks are automatically executed.proactive checks, for example, by executing the VALIDATE DATABASE command.Example of Data Failure:
Data Recovery Advisor can analyze failures and suggest repair options for issuesData Recovery AdvisorData Recovery Advisor
can proactively check for failures, detect and analyze data failures before a database process discovers the corruption and signals an error. 可以先于 db 发现并分析错误.
Characteristics:
User interfaces:
EM GUI interface (several paths)RMAN command linerman target / nocatalog
list failure all;
Supported Database Configurations
RACHealth Monitor automatically executes checks and logs failures and their symptoms as “findings” into the ADR.Data Recovery Advisor consolidates findings into failures. It lists the results of previously executed assessments with failure severity (critical or high).Data Recovery Advisor maps failures to automatic and manual repair options, checks basic feasibility, and presents you with the repair advice.Data Recovery Advisor to do it for you.
| RMAN Command | Action |
|---|---|
LIST FAILURE |
Lists previously executed failure assessment |
ADVISE FAILURE |
Displays recommended repair option |
REPAIR FAILURE |
Repairs and closes failures (after ADVISE in the same RMAN session) |
CHANGE FAILURE |
Changes or closes one or more failures |
LIST FAILURE:
Characteristics:
recovery catalog, it can be in STARTED mode;
MOUNTED mode.Data Recovery Advisor removes these failures from the output.人工修复或消失的失败会被移除Syntax:
failnum: Number of the failure to display repair options forALL: List failures of all priorities.CRITICAL: List failures of CRITICAL priority and OPEN status.
control file).HIGH: List failures of HIGH priority and OPEN status.
archived redo logs).LOW: List failures of Low priority and OPEN status.
CLOSED: List only closed failures.EXCLUDE FAILURE: Exclude the specified list of failure numbers from the list.DETAIL: List failures by expanding the consolidated failure.
LIST FAILURE
[ ALL | CRITICAL | HIGH | LOW | CLOSED | failnum[, failnum,..] ]
[ EXCLUDE FAILURE failnum[,failnum,..] ]
[ DETAIL J]
ADVISE FAILURE:
LIST FAILURE command, this command includes a WARNING before advising on all CRITICAL and HIGH failures. 新插入的失败会显示为警告CRITICAL and HIGH priority failures that are recorded in ADR.Two general repair options are implemented:
no-data-lossdata-loss repairs.When the Data Recovery Advisor generates an automated repair option, it generates a script that shows you how RMAN plans to repair the failure. 会生成脚本
Data Recovery Advisor to automatically repair the failure, then you can use this script as a starting point for your manual repair.operating system (OS) location of the script is printed at the end of the command output.Syntax:
ADVISE FAILURE
[ ALL | CRITICAL | HIGH | LOW | failnum[, failnum,..] ]
[ EXCLUDE FAILURE failnum [,failnum,..] ]
REPAIR FAILURE command:
ADVISE FAILURE command in the same RMAN session.ADVISE FAILURE execution in the current session.仅仅针对当前的建议进行修复
ADVISE FAILURE command. 如果没有失败, 则会自动触发 advise 命令USING ADVISE OPTION integer:
ADVISE FAILURE command );You cannot run multiple concurrent repair sessions.
REPAIR .. PREVIEW sessions are allowed.Syntax:
PREVIEW:
NOPROMPT:
REPAIR FAILURE
[USING ADVISE OPTION integer]
[ { {NOPROMPT | PREVIEW}}...]
CHANGE FAILURE command:
CRITICALCHANGE FAILURE
{ ALL | CRITICAL | HIGH | LOW | failnum[,failnum,..] }
[ EXCLUDE FAILURE failnum[,failnum,..] ]
{ PRIORITY {CRITICAL | HIGH | LOW} | cLose } -- Change status of the failure(s) to closed.
[ NoproMPT ] -- Do not ask user for a confirmation.
CRITICAL.A failure priority can be changed:
HIGH to LowLOW to HIGHHIGH priority, you may want to temporarily change it to Low if the block is in a little-used tablespace.CHANGEV$IR_FAILURE: List of all failures, including closed ones (result of the LIST FAILURE command)V$IR_MANUAL_CHECKLIST: List of manual advice (result of the ADVISE FAILURE command)V$IR_REPAIR: List of repairs (result of the ADVISE FAILURE command)V$IR_FAILURE_SET: Cross-reference of failure and advice identifiers-- start a connectionless command-line session.
-- establishes no initial connection to Oracle Database.
sqlplus /nolog
connect / as sysdba
alter session set container=orclpdb;
-- CLEANUP from previous run
DROP USER bar91 CASCADE;
DROP TABLESPACE bar91tbs INCLUDING CONTENTS AND DATAFILES;
-- Create tablespace
CREATE TABLESPACE bar91tbs
DATAFILE '/u01/app/oracle/oradata/ORCL/orclpdb/bar91tbs01.dbf' SIZE 10M
SEGMENT SPACE MANAGEMENT MANUAL;
-- Create user
CREATE USER bar91 IDENTIFIED BY pass4B91
DEFAULT TABLESPACE bar91tbs
QUOTA UNLIMITED ON bar91tbs;
GRANT CREATE SESSION TO bar91;
-- create table and populate
-- be sure table is at least 2 blocks long
CREATE TABLE bar91.barcopy
TABLESPACE bar91tbs
AS SELECT * FROM HR.EMPLOYEES;
INSERT INTO bar91.BARCOPY
SELECT * FROM bar91.BARCOPY;
INSERT INTO bar91.BARCOPY
SELECT * FROM bar91.BARCOPY;
SELECT * FROM bar91.BARCOPY;

rman target "'sys@orclpdb as sysdba'"
-- backup tbsp
BACKUP AS COPY TABLESPACE bar91tbs;

sqlplus -S /nolog
connect / as sysdba
alter session set container=orclpdb;
UPDATE bar91.BARCOPY SET salary = salary+1;
COMMIT;

sqlplus / as sysdba
shutdown abort
exit
rm /u01/app/oracle/oradata/ORCL/orclpdb/bar91tbs01.dbf
sqlplus / as sysdba
startup
-- try to orclpdb open
show pdbs
alter pluggable database orclpdb open;
-- fails because df is missing

Data Recovery Advisor to list the database failure.rman target "'/ as sysbackup'"
LIST FAILURE;

Data Recovery Advisor to obtain advice on how to repair the failureADVISE FAILURE;


repair failure;
-- open orclpdb in rman
alter pluggable database orclpdb open;


sqlplus / as sysdba
show PDBS


rman target "'sys@orclpdb as sysdba'"
-- delete tbsp
delete NOPROMPT copy of tablespace bar91tbs;
exit;

sqlplus sys@orclpdb as sysdba
show con_name
-- CLEANUP from previous run
DROP USER bar91 CASCADE;
DROP TABLESPACE bar91tbs INCLUDING CONTENTS AND DATAFILES;
