Sunday, October 1, 2017

Cache Fusion In Oracle Rac

cache fusion is disk less cache coherency mechanism in Oracle RAC that provides copies of data blocks directly from one instance’s memory cache (in which that block is available) to other instance (instance which is request for specific data block).  Cache Fusion provides single buffer cache (for all instances in cluster) through interconnect.

In Single Node oracle database, an instance looking for data block first checks in cache, if block is not in cache then goes to disk to pull block from disk to cache and return block to client.

In RAC Database there is remote cache so instance should look not only in local cache (cache local to instance) but on remote cache (cache on remote instance). If cache is available in local cache then it should return data block from local cache; if data block is not in local cache, instead of going to disk it should first go to remote cache (remote instance) to check if block is available in local cache (via interconnect)

This is because of accessing data block from remote cache is faster than accessing it from disk.

Terminating Instance Due To Error 472/ORA-00472

Terminating Instance Due To Error 472/ORA-00472

Cause:

When  user killed pmon process using kill -9 <pid> you will get this error in the alert log file.

MMAN: terminating instance due to error 472
ORA-00472: PMON process terminated with error
Instance terminated by MMAN, pid = 26700.

Terminating Instance Due To Error 474/ORA-00474

Terminating Instance Due To Error 474/ORA-00474

Cause:

When user killed smon process using kill -9 <pid> you will get this error in the alert log file.

Errors in file /u01/home/oracle/product/10.2.0/db_1/admin/PROD/bdump/prod_pmon_26800.trc:
ORA-00474: SMON process terminated with error
Mon Feb 25 15:51:26 2013
PMON: terminating instance due to error 474
Instance terminated by PMON, pid = 26800

How To Find Whether The Parameter Is Static or Dynamic

How To Find Whether The Parameter Is Static or Dynamic?


ISSYS_MODIFIABLE column display the values FALSE and IMMEDIATE.

FALSE: it means database bounce is require.
IMMEDIATE: it means database bounce not require.

Example:

SQL> select ISSYS_MODIFIABLE from v$parameter where name like '%control_files%';

ISSYS_MOD
---------
FALSE

SQL> select ISSYS_MODIFIABLE from v$parameter where name like '%open_cursors%';

ISSYS_MOD
---------
IMMEDIATE

SQL> select ISSYS_MODIFIABLE from v$parameter where name like '%undo_tablespace%';

ISSYS_MOD
---------
IMMEDIATE

SQL> select ISSYS_MODIFIABLE from v$parameter where name like '%log_archive_dest%';

ISSYS_MOD
---------
IMMEDIATE

Thursday, September 28, 2017

Moving/Renaming Of Datafiles In Oracle

Moving/Renaming Of Datafiles In Oracle

Example:

/home/oracle/OraHome1/databases/ora9 (actual location)
/home/oracle/databases/ora9 (changed location)

SQL> select tablespace_name, substr(file_name,1,70) from dba_data_files;

TABLESPACE_NAME                SUBSTR(FILE_NAME,1,70)
------------------------------ ----------------------------------------------------------------------
SYSTEM                         /home/oracle/OraHome1/databases/ora9/system.dbf
UNDO                           /home/oracle/OraHome1/databases/ora9/undo.dbf
DATA                           /home/oracle/OraHome1/databases/ora9/data.dbf

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/home/oracle/OraHome1/databases/ora9/redo1.ora
/home/oracle/OraHome1/databases/ora9/redo2.ora
/home/oracle/OraHome1/databases/ora9/redo3.ora

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/home/oracle/OraHome1/databases/ora9/ctl_1.ora
/home/oracle/OraHome1/databases/ora9/ctl_2.ora
/home/oracle/OraHome1/databases/ora9/ctl_3.ora

Now, the database can be shut down:

SQL> shutdown immediate;

The files can be copied to their destination:
$ cp /home/oracle/OraHome1/databases/ora9/system.dbf  /home/oracle/databases/ora9/system.dbf
$ cp /home/oracle/OraHome1/databases/ora9/undo.dbf    /home/oracle/databases/ora9/undo.dbf
$ cp /home/oracle/OraHome1/databases/ora9/data.dbf    /home/oracle/databases/ora9/data.dbf

SQL> startup mount;

SQL> alter database rename file '/home/oracle/OraHome1/databases/ora9/system.dbf' to '/home/oracle/databases/ora9/system.dbf';
SQL> alter database rename file '/home/oracle/OraHome1/databases/ora9/undo.dbf'   to '/home/oracle/databases/ora9/undo.dbf';
SQL> alter database rename file '/home/oracle/OraHome1/databases/ora9/data.dbf'   to '/home/oracle/databases/ora9/data.dbf';

SQL> shutdown immediate;

SQL> shutdown mount;

SQL> alter database open;

Monday, September 25, 2017

Fixed ORA-00845: MEMORY_TARGET not supported on this system in Rac environment

Fixed ORA-00845: MEMORY_TARGET not supported on this system in Rac environment

Error:

[root@rac01 ~]# crsctl start cluster -all

CRS-2672: Attempting to start 'ora.crf' on 'rac01'

CRS-2672: Attempting to start 'ora.crf' on 'rac02'

CRS-2672: Attempting to start 'ora.asm' on 'rac02'

CRS-2672: Attempting to start 'ora.asm' on 'rac01'

CRS-2676: Start of 'ora.crf' on 'rac02' succeeded

CRS-2676: Start of 'ora.crf' on 'rac01' succeeded

CRS-5017: The resource action "ora.asm start" encountered the following error:
ORA-00845: MEMORY_TARGET not supported on this system
. For details refer to "(:CLSN00107:)" in "/u01/app/grid/diag/crs/rac02/crs/trace/ohasd_oraagent_grid.trc".
CRS-2674: Start of 'ora.asm' on 'rac02' failed
CRS-2679: Attempting to clean 'ora.asm' on 'rac02

Reason:
/dev/shm is also know as tmpfs i.e. temporary file system which keeps all the file system in virtual memory to speed up several processes.

Solution:

To increase the size
# mount -o remount,size=3G /dev/shm

Verify the size
# df -h
Filesystem   Size   Used   Avail  Use%  Mounted on
/dev/sda3   7.6G    4.4G   2.9G   61%   /
tmpfs       3G      1007M  2.1G   33%   /dev/shm
/dev/sda1   194M    25M    160M   14%   /boot

To make permanent changes to your file system update your fstab
# vi /etc/fstab
tmpfs  /dev/shm  tmpfs  defaults,size=3G  0 0

Update the new fstab file
# mount -a