Tuesday, September 29, 2009

Createdisk, Deletedisk and Querydisk in ASM

The /etc/init.d/oracleasm script is used to create, delete and query ASM disks and make disks available.

Create and Delete ASM disk:
Run below command to Create ASM disks.
# /etc/init.d/oracleasm createdisk DATA1 /dev/sdc
Creating Oracle ASM disk "DATA1" [ OK ]

Run below command to Delete ASM disks.
# /etc/init.d/oracleasm deletedisk DATA1
Deleting Oracle ASM disk "DATA1" [ OK ]

Query/List/Scan ASM disk:
Run the below querydisk command to see if the Disk/Device is used by ASM:
# /etc/init.d/oracleasm querydisk /dev/sdc
Checking if device "/dev/sdc" is an Oracle ASM disk [ OK ]

# /etc/init.d/oracleasm querydisk DATA1
Checking for ASM disk "DATA1" [ OK ]

Run below command to list Existing disks
# /etc/init.d/oracleasm listdisks
DATA1

Run the below command to scan the disks created on another node.
# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks [ OK ]

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

Friday, September 18, 2009

How to move or replace and repair OCR (Oracle Cluster Registry)

Moving or Replacing Oracle Cluster Registry:
If you are replacing or moving an OCR/OCR MIRROR make sure that other OCR file is ONLINE and also clusterware is running on the node that you are performing the replace operation.

Please note that the OCR that you are replacing or moving can be either online or offline.

Run the below command to move or replace OCR
#ocrconfig -replace ocr
For ex:- ocrconfig -replace ocr /dev/raw/raw5

Run the below command to move or replace OCR MIRROR.

#ocrconfig -replace ocrmirror
For ex: - ocrconfig -replace ocr /dev/raw/raw6

Repairing Oracle Cluster Registry (OCR) Configuration:
You may need to repair an OCR configuration, if your OCR configuration changes ran (adding/removing/replacing OCR/OCR mirror) while the node is shutdown.

Make sure you run the command on the node which you have shutdown and you cannot perform this operation while oracle clusterware is running.

Run the below command to repair
# ocrconfig –repair ocrmirror device_name
for ex:- ocrconfig –repair ocrmirror /dev/raw/raw1

Click here to learn How to Add and Remove Oracle Cluster Registry

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

Wednesday, September 16, 2009

How to Change Static parameters in SPFILE and PFILE

Change Static parameters in SPFILE:
Changing static parameters requires the SPFILE option for the SCOPE clause with ALTER SYSTEM Statement and changes applies to SPFILE only. The changes cannot be applied to active Instance and the database needs to be restarted to take effect the modified parameters.

You can identify the static parameters using below query
SQL> select name, value, issys_modifiable from v$parameter
where name='processes';
NAME                     VALUE          ISSYS_MODIFIABLE
------------------- -------------- ---------------------------
Processes               150                 FALSE

All parameter that have the column ISSYS_MODIFIABLE value FALSE in the V$PARAMETER view are STATIC parameters and remaining are DYNAMIC parameters in Oracle database.

The ALTER SYSTEM command with SCOPE=SPFILE the will not update the value in the V$PARAMETER view but it will show the new value in the V$SPPARAMETER view as Oracle SPFILE parameter is updated.

For ex:-
SQL> alter system set processes=200 scope=both;
alter system set processes=200 scope=both
               *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified

Above statement failed because “processes” is Static parameter and can be used with SCOPE=SPFILE only.

SQL> alter system set processes=200 scope=spfile;
System altered.

You can view the new value in V$SPPARAMETER view as the SPFILE is updated.

SQL> select name, value, isspecified from v$spparameter
where name ='processes';
NAME                     VALUE         ISSYS_MODIFIABLE
------------------- -------------- ---------------------------
Processes               150                 TRUE

Changing Static parameters in PFILE:
Edit the “$ORACLE_HOME/dbs/init.ora” file with new value and bounce the database to take effect the modified parameters.

Identify weather using PFILE or SPFILE:
To check SPFILE or PFILE used by Database or instance, run below commands.

You can see the Oracle SPFILE location.

SQL > show parameter spfile;
NAME                    TYPE        VALUE
------------------ ----------- -----------------------------------------
spfile                     string          /oracle/v10201/dbs/spfileOradb.ora

SQL > select name, value from v$parameter where name = 'spfile';
NAME          VALUE
------------ ------------------------------------------------------------
spfile             /oracle/v10201/dbs/spfileOradb.ora

SQL> select count(1) from v$spparameter where isspecified = 'TRUE';

Returns a NON-ZERO value if SPFILE is in use.

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

ORA-19755: could not open change tracking file

You will receive ORA-19755 under following circumstances

1. When moving the Change tracking file
2. During Database Recovery
3. During Database startup

The reason is due to missing or corrupted Block change tracking file.

Errors during database startup
ORA-19755: could not open change tracking file
ORA-19750: change tracking file: '+DATA/testdb/changetracking/ctf.411. 5567291'
ORA-17503: ksfdopn:2 Failed to open file +DATA/testdb/changetracking/ctf.411.5567291'
ORA-15012: ASM file '+DATA/testdb/changetracking/ctf.411. 5567291' does not exist

Errors during Recovery:-
RMAN-03002: failure of recover command at 05/05/2009 08:13:29
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile ‘/oradata/testdb/flash_recovery_area/archivelog/arch_1_532_432353.arc‘
ORA-00283: recovery session canceled due to errors
ORA-19755: could not open change tracking file
ORA-19750: change tracking file: ‘/u02/oradata/test/ofsap_blk_change.dbf’
ORA-27037: unable to obtain file status

Solution:-
Disable Block change tracking and perform recover and enable the tracking.

Click here learn Enable/Disable and moving the Block change tracking file

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/

Friday, September 11, 2009

How to Add and Remove OCR (Oracle Cluster Registry)

Adding an OCR (Oracle Cluster Registry):-

You can also add an OCR after completing the Oracle RAC installation, if you didn’t mirror the OCR during installation. Please note that you must run all the commands as “root”.

Run the below command to add OCR MIRROR.
#ocrconfig -replace ocrmirror

Removing an Oracle Cluster Registry (OCR)
To remove OCR/OCR MIRROR the other OCR must be online.

Run the below command on any node to remove OCR.
# ocrconfig -replace ocr

Run the below command on any node to remove OCR Mirror.
# ocrconfig -replace ocrmirror

Please note that these commands update the OCR configuration on all of the nodes where Oracle Clusterware is running.

Click here to learn How to backup and recover Oracle Cluster Registry.
Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/