Oracle 11g introduced in the new features ADR, Automatic Diagnostic Repository
Personal understanding of this tool is able to efficiently manage some of the log files easily. For example, look at the database alert logs do not have trouble to go to the corresponding path down to find a circle, you can directly use the show alert, such as what is now in the database to see the error directly through the show problem command can be.
Command is also very convenient to use. Direct input adrci to open a special window to use. If you do not know which command to use, you can directly use help.
ADRCI: Release 22.214.171.124.0 - Production on Wed May 13 22:10:14 2015
Copyright (c) 1982, 2009, Oracle and / or its affiliates. All rights reserved.
ADR base = "/ u02 / dg11g"
SET HOMES | HOME | HOMEPATH
SHOW HOMES | HOME | HOMEPATH
There are other commands intended to be used directly by Oracle, type
"HELP EXTENDED" to see the list
But in use, I found that in fact can also have a more concise way.
In the past few days to build data guard environment, always need to constantly switch between multiple paths, if you use adrci when you must first enable the adrci command interface, and then use the specified command to view, the feeling is not enough autonomy and convenience . We can play this way.
First of all, need to use a script. This script can display the corresponding diagnostic path.
In order to obtain 10g after the compatibility, use the background_dump_dest this parameter can also be fully correspond to the corresponding diagnostic path.
Suppose the script is named cdt.sh
TAB_OWNER = `sqlplus -silent / as sysdba < < END
Set pagesize 0 feedback off verify off heading on echo off
Col owner_name format a20
Col table_name format a30
Select value from v \\ $ parameter where name = 'background_dump_dest';
If [-z "$ TAB_OWNER"]; then
Echo "no object exists, please check again"
Echo $ TAB_OWNER
We first realize the similar function show alert.
We can define an alias at the system level
Alias cdt = 'cd `ksh ~ / cdt.sh`
/ Home / ora11g
/ U02 / dg11g / diag / rdbms / dg11g / DG11G / trace
This time can see the relevant trace log, alert log
Again a few used aliases,
Such as the need to parameter file path. We can define aliases like this.
Alias cdp = 'cd $ ORACLE_HOME / dbs'
/ Home / ora11g
For example, look at the database errors, can be so defined, we can be more flexible to specify the error log before and after a few lines of content.
Alias showerr = 'grep -A3 -B3 ORA- `ksh ~ / cdt.sh` / alert * | tail -50'
The display is as follows, this is not also show very clear.
[Ora11g @ oel1 ~] $ showerr
License high water mark = 2
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL
ORA-1507 signalled during: ALTER DATABASE CLOSE NORMAL ...
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Space available in the underlying filesystem or ASM diskgroup.
Error 1034 received logging on to standby
Errors in file /u02/ora11g/diag/rdbms/test11g/TEST11G/trace/TEST11G_arc1_31285.trc:
ORA-01034: ORACLE not available
PING [ARC1]: Heartbeat failed to connect to standby 'DG11G'. Error is 1034.
Wed May 13 15:06:01 2015
Starting background process CJQ0
So to sum up, in fact, we can also try a lot of features themselves, chances are also more convenient for our work, no matter how easy to use and fast is our goal.