|
|
|
![]() |
|
|
|
|
|
Tip of the Week
(Archived) Last night, a client test database stopped running. It was in archive log mode and ran out of space in the archive log file system. Luckily, this was a test database, so there was no production impact. And, luck born of being prepared, since we are using Oracle Enterprise Manager (OEM) to monitor this database, when the error appeared in the alert log, an email was sent notifying us of the problem, allowing a quick resolution. The quick resolution was the following one line UNIX command that deleted all archive logs more than 30 days old, freeing up enough space in the file system for the new archive log to be written and the database to resume operation: find <path> -mtime +30 -exec rm {} \; The find command locates files beginning at the supplied path that meet specified conditions. The components of the above command are:
In scripting, I would always recommend using the full path in the find command. I know of at least one major database crash caused by the find command referring to the current directory and navigation to the correct directory failing, resulting in the wrong set of files being deleted by mistake. In further responding to this issue. I have already set up OEM to monitor available space in the archive log file system, with notifying emails to be sent at 20% and 10% free space available. I have also recommended that the above find command be incorporated into the existing backup scripts to prevent this situation from happening again. Note: This tip was tested on Solaris 9 using the Korn shell. Was this tip useful? Did you find any errors? Do you have any suggestions? Do you care? Click here for the tip feedback page. Thank you. |
|
|
|
|