O'Reilly logo

Unix for Oracle DBAs Pocket Reference by Donald K. Burleson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

File Management

Most Oracle DBAs are responsible for the management of the Oracle data files on their database servers. You must be able to determine the status of all the Oracle data files, initialization files, trace files, and log files.

List Recently Touched Files

As a DBA, you often need to see the most recently touched files in a filesystem. An Oracle file is touched each time that the file is read or written. Knowing when a file has been touched can offer you insight into the behavior of Oracle on your server. The ls command in the following example generates a sorted list of files, with the most recently accessed files appearing first. That output is piped through head in order to limit the display to the most recently touched files.

>ls -alt|head

-rw-r----- 1 ... 52429312 May 11 07:00 arlog272.arc
-rw-r----- 1 ... 393829   May 10 20:20 arlog21.arc.Z
-rw-r----- 1 ... 19748689 May 10 20:03 arlog27.arc.Z
-rw-r----- 1 ... 16018687 May 10 08:05 arlog26.arc.Z

Note that "touched" is different from "changed." A file is touched anytime that the file is read by a process, but a file is only changed when it has been written.

Tip

The -l option of the ls command always causes the modification date to be listed with each file, even when you use the ls -alt|head command to see the most recently touched files. The -t option causes the output to be sorted by touched date, but the modification date is still the date that is displayed. The -a option lists all files in your directory.

List Recently ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required