11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

64 CHAPTER 2 ■ DATABASE DIAGNOSABILITY AND FAILURE REPAIROptions Description (Default)-------------------------------------------------------script script file name (None)help help on the command options (None)exec exec a set of commands (None)-------------------------------------------------------$Type exit or quit to exit the adrci command-line interface.Using adrci in Scripts and in Batch ModeIn addition to using adrci interactively, you can also use adrci commands within scripts andoperating system batch files. To incorporate a group of adrci commands into a script, simplycreate a file with all the adrci commands you want to execute, and then execute the script atthe adrci prompt.To use adrci commands in a shell script or a Windows batch file, you simply invoke adrciusing the command-line parameter exec to which you pass the adrci commands you want toexecute. That is, you must use the following syntax in your batch file when invoking adrci:adrci exec="command[; command]..."For example, if you want to use the two adrci commands show homes and show incident ina script, use the following syntax:adrci exec="show homes; show incident"Note that each of the commands must be separated by a semicolon (;). Here’s an exampleshowing how to use the ADR command-line interface to do the equivalent of the usual vialert$ORACLE_SID.log command, which lets you read the alert log in a text editor:adrci exec="set homepath diag/rdbms/orcl/orcl1; set editor vi; show alert -V"Alternatively, you can pipe adrci commands to a shell script, as shown in the followingscript example, which lets you see all the alert log entries that contain the word ORA-, whichindicates an <strong>Oracle</strong>-related error:adrci show baseADR base is "/u01/app/oracle"adrci>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!