System-level alias vs Oracle ADR Functions

Source: Internet
Author: User

System-level alias vs Oracle ADR Functions

The new feature ADR launched by Oracle in 11 GB, that is, Automatic Diagnostic Repository
My personal understanding is that this tool can efficiently manage some log files. For example, to view the Database alert logs, you don't have to go to the corresponding path to find a circle and use show alert directly. For example, you can directly run the show problem command to view the errors in the current database.
Command is also very convenient to use. Enter adrci directly to open a special window. If you do not know which commands to use, use help directly.
$ Adrci
ADRCI: Release 11.2.0.1.0-Production on Wed May 13 22:10:14 2015
Copyright (c) 1982,200 9, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u02/dg11g"
Adrci> help
HELP [topic]
Available Topics:
CREATE REPORT
ECHO
EXIT
HELP
HOST
IPS
PURGE
RUN
SET BASE
SET BROWSER
SET CONTROL
SET ECHO
SET EDITOR
Set homes | HOME | HOMEPATH
SET TERMOUT
SHOW ALERT
SHOW BASE
SHOW CONTROL
SHOW HM_RUN
Show homes | HOME | HOMEPATH
SHOW INCDIR
SHOW INCIDENT
SHOW PROBLEM
SHOW REPORT
SHOW TRACEFILE
SPOOL
There are other commands intended to be used directly by Oracle, type
"Help extended" to see the list
However, in addition to the use, we can find a more concise approach.
When building a data guard environment over the past few days, you always need to constantly switch between multiple paths. If you use adrci, you must first enable the adrci command interface and then use the specified command to view the information, I feel that I am not independent and convenient. We can do this.
First, let's talk about a script to be used. This script displays the corresponding diagnostic path.
To obtain compatibility after 10 Gb, you can use the background_dump_dest parameter to completely match the corresponding diagnostic path.
Assume that the Script Name Is 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 ';
Exit;
End'

If [-z "$ TAB_OWNER"]; then
Echo "no object exists, please check again"
Exit 0
Else
Echo $ TAB_OWNER
Fi

Let's first implement similar functions of show alert.
We can define an alias at the system level.
Alias cdt = 'cd' ksh ~ /Cdt. sh''

$ Pwd
/Home/ora11g
$ Cdt
$ Pwd
/U02/dg11g/diag/rdbms/dg11g/DG11G/trace

In this case, you can view the trace logs and alert logs.
A few more aliases are used,
For example, you need to go to the path of the parameter file. We can define aliases in this way.
Alias cdp = 'CD $ ORACLE_HOME/dbs'

$ Pwd
/Home/ora11g
$ Cdp
$ Pwd
/U01/app/ora11g/product/11.2.0/dbhome_1/dbs

For example, to view database errors, we can define the rows before and after the specified error log more flexibly.
Alias showerr = 'grep-A3-B3 ORA-'ksh ~ /Cdt. Sh'/alert * | tail-50'

The display content is as follows, so it is 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...
Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
--
Space available in the underlying filesystem or ASM diskgroup.
Error 1034 removed ed logging on to the standby
Errors in file/u02/ora11g/diag/rdbms/test11g/TEST11G/trace/TEST11G_arc1_31285.trc:
A 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
--
To sum up, we can try a lot of functions on our own, which may be more convenient for our work. No matter what, it is our goal to make it easy to use and fast.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.