Try the following Unix tips and tricks

Source: Internet
Author: User

There are hundreds of commands for managing Oracle in UNIX. Now let's take a look at some of the UNIX techniques that are especially useful for Oracle experts.

Locating files anywhere on a UNIX server
You can use the Find command in UNIX to locate a particular file.

root> pwd
/
Root> find. -print|grep-idbmspool.sql
./oracle/product/9.1.2/rdbms/admin/dbmspool.sql

Locate an Oracle file that contains a specific string
This is a shell command that is used to find all the most commonly used shells that contain the specified string. For example, suppose you are trying to locate a script that queries the V$process table.

You can use the following command, UNIX will search all subdirectories and find v$process forms in all files.

Root> find. -print|xargsgrep v\ $process
./tx_rbs.sql:v$process p,
./unix_who.sql:from V$session A, v$process b
./session.sql:fromv$session B, v$process a

Locating the most recently created UNIX file
The following commands are useful for finding the Unix files that were recently added to your server. Part of the task of Oracle database administrators is to monitor the background_dump_dest and user_dump_dest that are used to track files, and to clear out trace files that are no longer needed.

The following command lists all the files that have been created in the last two weeks.

Root> find. -mtime-14-print
.
./janet1_ora_27714.trc
./janet1_ora_27716.trc

Find large files on UNIX servers
The following commands are useful when the Unix file system is filled up. As you may know, Oracle hangs when Oracle has to expand a table space and cannot extend the Unix file system.

The following script shows all files that are larger than 1MB. Note that you want to specify the size parameter in kilobytes.

Root> find. -size +1024-print

./prodsid_ora_22951.trc

Get a list of installed ORACLE products in the current $oracle_home
The following commands are useful for locating all the safe products in your Oracle environment.

Cat $ORACLE _HOME/UNIX.PRD |\
Nawk-f\ "' {printf ("%-40s%-10s%-20s\n ", $, $, $)} ' |\
grep ' ^[^] '



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.