Explain the functions of the head and tail of the log.
Placing redo log entries, Writing to redo log files
Oracle maintains two important pointers that you should be aware of.
One points to the tail of the log and
the other points to the head of the log.
As changes are made to a database, new redo log entries are always placed at the head of the log. The Log Writer process, on the other hand, always looks at the tail of the log. The Log Writer's job is to continually check the tail of the log to see if there are any new redo log records, and then to write those records to the redo log files as quickly as possible. The following series of images illustrates this process:
Check the Tail of the log
Viewing Linux Files using tail command
Many times your only interest is in seeing the end of a file.
To view just the last handful of lines in a file, use the tail command.
$ tail required_packages.txt
glibc-kernheaders-2.4-9.1.103.EL.i386.rpm will be required as a
By default, tail displays the last 10 lines of a file. This is a great way to look at recent entries in Oracle database alert logs. If more than 10 lines need to be seen, specify a number of lines as an option. For example, tail -15 required_packages.txt will show the last 15 lines of the file required_packages.txt. When a log file is being actively written to, like with an alert log, displaying new lines on the screen as they are written to the file may be preferred. To do that, add the -f option to the tail command like this: tail -f alert_TEST.log. This allows the monitoring of a log in near real time, though sometimes lines may appear too quickly to read.
Viewing Linux Files using head command
$ head required_packages.txt
Refer to Note 880211.1
The head command defaults to displaying the first 10 lines of the specified file. Like with tail, the default can be overridden and more lines or fewer lines can be displayed by adding a number as an option. For example, head -5 required_packages.txt will display only the first five lines of the file.
Specifying Redo Log Writing Process
Timely protection of application data requires use of the log writer process to propagate primary database modifications to one or more standby databases. This is achieved using the LGWR attribute of the LOG_ARCHIVE_DEST_n initialization parameters.
Choosing the LGWR attribute indicates that the log writer process (LGWR) will concurrently create the archived redo logs as the online redo log is populated. Depending on the configuration, this may require the log writer process to also transmit redo log files to remote archival destinations. Choosing the ARCH attribute indicates that the (ARCn) archiver process will create archived redo logs on the primary database and also transmit redo logs for archival at specified destinations. This is the default setting. The LGWR and ARCH attributes are mutually exclusive. Therefore, you cannot specify the two attributes for the same destination. The LGWR attribute can be specified for individual destinations and this allows you to specify that the log writer process writes to redo logs and archives for some destinations while the archiver process archives redo logs to other destinations.