Saturday, March 24, 2012

What happens in Hot Backup of oracle database


alter tablespace ts_name begin backup;

When the command is issued, at this point in time a checkpoint is performed against the target tablespace; then the datafile header is frozen, so no more updates are allowed on it (the datafile header), this is for the database to know which was the last time the tablespace had a consistent image of the data.

The datafiles with the backup in progress will still allow read/write operations just as a regular datafile, I/O activity is not frozen.

Each time a row is modified, not only the row, but the complete block is recorded to the redo log file, this will only happen the first time the block is modified, subsequent transactions on the block will only record the transaction just as normal.

During the user managed backup process the "fractured block" event may be present. Let's remember that the oracle block is the minimum IO unit, and an oracle block is made out of several OS blocks; let's assume a block size of 8K and an OS block of 512b, this will give 16 OS blocks. If during the backup process of a block there is a write operation on the block then the backup will contain a before image and an after image of the oracle block, the complete block in the backup media will be corrupt. This is normal, consistency is not guaranteed on the backup, that is why the header must be frozen to mark the point where the recovery process will have to start, and that is why oracle record a complete block image on the redo log file.

At the time the alter tablespace ts_name end backup; command is issued then the backup process is finished and the datafile header resumes its regular IO activity.

Tuesday, March 6, 2012

How to get/view nodes /server information in RAC


How to get/view nodes /server information in RAC

1) member nodes number/name
olsnodes -n

2)local node/server name
olsnodes -l

3)activates logging
olsnodes -g

RAC administration


Cluster Ready Services (CRS): is Oracle's clusterware software

CRS starts automatically when the server starts/rebooted planned/unplanned, it can be stopped this in the following conditions

Applying a patch set to CRS_HOME
O/S maintenance ( requies reboot)
Troubleshooting CRS problems

1) Starting CRS in 10gR2
$CRS_HOME/bin/crsctl start crs


2)Stopping CRS using Oracle 10g R2
$CRS_HOME/bin/crsctl stop crs

## Stopping CRS using Oracle 10g R1
srvctl stop -d database <database>
srvctl stop asm -n <node>
srvctl stop nodeapps -n <node>
/etc/init.d/init.crs stop

3)disabling/enabling CRS in 10g R2
$CRS_HOME/bin/crsctl [disable|enable] crs

## Oracle 10g R1
/etc/init.d/init.crs [disable|enable]

4)CRS status
$CRS_HOME/bin/crsctl check crs
$CRS_HOME/bin/crsctl check evmd
$CRS_HOME/bin/crsctl check cssd
$CRS_HOME/bin/crsctl check crsd
$CRS_HOME/bin/crsctl check install -wait 600

$CRS_HOME/bin/crs_stat
$CRS_HOME/bin/crs_stat -t
$CRS_HOME/bin/crs_stat -ls
$CRS_HOME/bin/crs_stat -p

Note:
-t more readable display
-ls permission listing
-p parameters


5)create profile for CRS
$CRS_HOME/bin/crs_profile

6)register/unregister application

$CRS_HOME/bin/crs_register
$CRS_HOME/bin/crs_unregister

7)Start/Stop an application
$CRS_HOME/bin/crs_start
$CRS_HOME/bin/crs_stop


8)Resource permissions
$CRS_HOME/bin/crs_getparam
$CRS_HOME/bin/crs_setparam

9)Relocate a resource
$CRS_HOME/bin/crs_relocate