2010/09/17

How to Kill RMAN Backup Sessions

You can identify the Oracle session ID for an RMAN channel by looking in the RMAN log for messages with the format shown in the following example:

channel ch1: sid=15 devtype=SBT_TAPE
You can kill the session using a SQL ALTER SYSTEM KILL SESSION statement. The serial# can be obtained by querying V$SESSION.

2010/08/31

ORA-16038: log <string> sequence# <string> can not be archived

This error can show up when trying to archive an active logfile but the logfile is unavailable.

SQL> alter system archive log current;
alter system archive log current
*
ERROR at line 1:
ORA-16038: log 1 sequence# 19 cannot be archived
ORA-00312: online log 1 thread 1: '/orafs04/oradata/rmant01/redo01a.log'
Trying to drop the logfile will receive the following error:

SQL> alter database drop logfile group 1;
alter database drop logfile group 1
*
ERROR at line 1:
ORA-01624: log 1 needed for crash recovery of instance rmant01 (thread 1)
ORA-00312: online log 1 thread 1: '/orafs04/oradata/rmant01/redo01a.log'
The solution is to clear the logfile with 'unarchived' option first and then drop and recreate the logfile.

SQL> alter database clear unarchived logfile group 1;

Database altered.

SQL> alter database drop logfile group 1;

Database altered.

SQL> alter database add logfile ('/orafs04/oradata/rmant01/redo01a.log') size 100M;

Database altered.
Note: You may need to backup database immediately since you lose the transaction in the logfile which was dropped.

2010/02/18

How to Format a Hard Drive in Linux

Linux referes to hard drives as either 'hdx' or 'sdx' where x is a letter, starting with a, which represents the order in which the drive was added to or detected by the compouter. The 'hd' prefix is used for IDE and PATA (formerly just ATA), and the 'sd' prefix is used for SCSI, SATA and USB drives. Usually a number is also put at the end of 'hdx' or 'sdx' to denote different partitions on the same physical drive, but for the purpose of formatting you only need to know which letter the drive you want to format is.

You can see all the drives attached to your system by typing the command 'ls /dev/hd*' and 'ls /dev/sd*' depending on which type the drives are.

First you will use the 'fdisk /dev/' command to erase any old partitions on the drive and create a new one.

Then, you will use the 'mkfs -t /dev/' to create the filesystem on the drive.

Finally, you will edit /etc/fstab file to mount the drive whenever system is rebooted.