Pankaj Chandiramani

Subscribe to Pankaj Chandiramani feed
Cloud Management and Data Center Automation
Updated: 1 week 4 hours ago

Applying CPU Patch on RAC using EM -A White paper

Wed, 2008-02-27 23:59

I wrote this paper to describes the process & benefits of applying patches using the EM.
Case : RAC - 3 node
Patch : CPU July 2007
Method : Rolling patch , zero downtime , using Deployment procedures in EM.

You can access the paper here on OTN.
or by copying the below url :

Other interesting white papers on EM are also listed here .

Categories: DBA Blogs

Configure SSO(single sign-on) with Apex

Fri, 2007-08-31 01:25

I am loving the experience with Apex , we plan to have couple of new application using APEX , for that i neeed to configure SSO with apex .

It can be done in 3 steps :

  1. Creating partner app
  2. Installing sdk (You need to get sso sdk from midtier)
  3. Configuring apex for sso(You need to login a zip file from here)
For step 1 , you need below :
HOME URL : http: // apex_server_name/pls/apex
Success URL : http: // apex_server_name/pls/apex/wwv_flow_custom_auth_sso.process_success
Log Out URL : http: // apex_server_name/pls/apex/apex

Note : not covering the actual creation process , pls look at "Creating Partner App in AS admin guide"

For Step 2:
First unlock the flows schema according to the apex version you have .
SQL> alter user flows_030100 account unlock; (If your Apex version is change acccordingly)

Now you need to copy sso sdk from the midtier , Login to Middle tier $ORACLE_HOME/sso/lib
copy , unzip it . It creates some sql scripts & packages .

Login to db as user flows_030100 & run loadsdk.sql
SQL>@loadsdk.sql (Make sure you are executing under flows_XXXX)

Above will load the sso schema into flows account.

For Step 3:
Now we need to wire sso & apex schema(flows_xx)

SQL> @regapp.sql
It will prompt you for
Enter value for listener_token: HTML_DB:Hostname:7777
Enter value for site_id: enter_value_returned_while_registering_sso
Enter value for site_token: enter_value_returned_while_registering_sso
Enter value for login_url: http: // apex_url_here/pls/orasso/orasso.wwsso_app_admin.ls_login
Enter value for encryption_key: enter_value_returned_while_registering_sso
Enter value for ip_check: N

These above value you will get from Registring as partner app in step 1

Now configure authentication packages under flows_XXX schema
You need to login a zip file from here:
Unzip & get 2 files , execute as below

SQL> @custom_auth_sso.sql
SQL> @custom_auth_sso.plb

Finally you should lock flows_XXXX schema & grant execute permission to public user
SQL> alter user flows_020200 account unlock;
SQL> grant execute on wwv_flow_custom_auth_sso to APEX_PUBLIC_USER;

All set , once you use the authentication schema as sso , you can see the login page .

Categories: DBA Blogs

Installing Apex 3.0.1

Mon, 2007-08-20 20:33

I have been using Apex extensively now , have created 3-4 application for production usage & i can finally say that its easy to use for us non developers also ;)

I will be covering the installation of Apex 3.0.1 in this post & will cover the SSO part in next .

Software Req:

  1. Download Apex 3.0.1 from here
  2. 10g Db
  3. Http server
In short , the process of Installing & configuring apex goes like this :
Install 10g Db --> Install Http server (i used 10g AS) -->Install Apex

Starting the Apex Installation
I assume you have 10g Db installed , else read this post for details .

You need to create 2 table space , i created  apex1 & apex2 to seed the apex data :

create tablespace apex1 datafile '/apexdb/apex1.dbf' size 50M autoextend on next 10M maxsize 300M;

create tablespace apex2 datafile '/apexdb/apex2.dbf' size 50M autoextend on next 10M maxsize 300M;

Now we will seed the db with Apex configs .
Download Apex 3.0.1 from here & unzip it .

This will craete a subdirectory with name apex , cd into it & start sqlplus as sysdba & run apexins.sql as shown below.
cd apex

sqlplus system@tns_alias as sysdba
@apexins.sql {pass} {ts for user} {ts for files} {ts for temp} /i/


pass - Password for Apex Super User
ts for user - Tablespace for User data (Created above)
ts for files - Tablespace for Apex files (Created above)
ts for temp - temporary tablespace (Usually Temp)
i - is the alias for image directory configuration in Application Server (Apache httpd.conf)

According to our config above , i used :

Sqlplus > @apexins.sql welcome apex1 apex2 temp /i/

It Takes ard 1 hr to get the seed data .

After this is complete , we go to the HTTP server location to configure Apex with it . AS we have the Oracle 10g AS installed we go to $ORACLE_HOME/Apache/modplsql/conf directory .

There in dads.conf we add the below lines :

Alias /i/ "/apex/images/"  (replace with your image location)

AddType text/xml xbl
AddType text/x-component htc
<Location /pls/apex>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString host:port:service_name ServiceNameFormat
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword apex_public_user_password
Allow from all

For above replace according to your server & install locations , we did below :
PlsqlDatabaseConnectString apexdb

Post Install
After this you need to restart the Appache server as shown below :

dcmctl updateconfig -ct ohs
opmnctl restartproc ias-component=HTTP_Server (Restart HTTP Server to check it)
ou are all set to use the Apex , try http://hostname.domainname:port/pls/apex

I will be writing on how to configure sso in next post

Categories: DBA Blogs

11g , get -set - go !!!!

Fri, 2007-08-10 01:55

11g for linux is available for download @OTN from here.
Read all abt the new features for HA , Db Replay   etc from

Categories: DBA Blogs

11g whitepapers @ OTN

Mon, 2007-07-23 02:09

I have seen couple of good technical whitepapers at otn , below is the link to the same .
These cover the complete series for new features , security , HA etc

Categories: DBA Blogs

Backing Up and Recovering Voting Disks

Tue, 2007-07-10 21:31

Backing Up and Recovering Voting Disks

What is a voting disk & why its needed ?
The voting disk records node membership information. A node must be
able to access more than half of the voting disks at any time.

For example, if you have seven voting disks configured, then a node must
be able to access at least four of the voting disks at any time. If a
node cannot access the minimum required number of voting disks it is evicted, or removed, from the cluster.

Backing Up Voting Disks

When to backup voting disk ?

  1.       After installation
  2.       After adding nodes to or deleting nodes from the cluster
  3.       After performing voting disk add or delete operations

To make a backup copy of the voting disk, use the Linux dd command. Perform this operation on every voting disk as needed where voting_disk_name is the name of the active voting disk and backup_file_name is the name of the file to which you want to back up the voting disk contents:
dd if=voting_disk_name of=backup_file_name

If your voting disk is stored on a raw device, use the device name in place of voting_disk_name. For example:
dd if=/dev/sdd1 of=/tmp/voting.dmp

Note : When you use the dd command for making backups of the voting disk, the backup can be performed while the Cluster Ready Services (CRS) process is active; you do not need to stop the crsd.bin process before taking a backup of the voting disk.

Recovering Voting Disks

If a voting disk is damaged, and no longer usable by Oracle Clusterware, you can recover the voting disk if you have a backup file.

dd if=backup_file_name of=voting_disk_name

Categories: DBA Blogs

Administring OCR

Mon, 2007-07-09 20:52

Administring OCR
We will see how OCR(Oracle cluster Registry) backup & recovery is done .

Oracle clusterware automatically creastes a OCR backup every 4 hrs & retains the last 3 backups . Actually the CRSD process creates & manages the backup for each full day & a weekly backup at nd of the week .
Default backup Location : $CRS_HOME/cdata/$clustername

Other than the automated backup , you can export the content any time you want to a file .
eg : $ ocrconfig -export emergency_export.ocr

You can see the list of ocrbackup by using :
$ ocrconfig -showbackup

As the backup directory is default , you can change the dir by using below command
$  ocrconfig -backuploc <directory>

OCR can be restored (if you have a backup ) be below command

NOTE: Should you need to restore, make sure all CRS daemons on all nodes are stopped.

To perform a restore, execute the command:

$ cd CRS_Home/cdata/crscluster
$ ocrconfig -restore  week.ocr

If you had exported using the above command & want to resore , then you can use import
IMPORTANT: Importing a backup when CRS daemons are running will only corrupt OCR.  

$ ocrconfig -import emergency_export.ocr

If anything is wrong than you can use the OCRDUMP comand to dump all info to a file & check
$ ocrdump OCR_DUMP

Also you can use :

$ ocrcheck 
to check for the stats of OCR

Categories: DBA Blogs

Get Ready for Oracle Database 11g -July 11th 2007

Mon, 2007-06-18 21:21

The Countdown Has Begun to July 11, 2007, when 11g DB will be here :)
Its much awaited release as it has some new feature improvements in high availability, performance, scalability, manageability and diagnosability.

Categories: DBA Blogs

Recovery Scenarios Part-2

Sun, 2007-06-10 20:42

Part 2 for the recovery scenarios

B) Lost control File or Media Failure:
      (Disk lost with all the files w/o SYSTEM tablespace)

SVRMGRL> shutdown abort;

run {
allocate channel c1 type disk;
restore controlfile to '/usr1/ora817/test/dbs/control01.ctl';
replicate controlfile from '/usr1/ora817/test/dbs/control01.ctl';
restore database;
sql "alter database mount";
recover database;
sql "alter database open resetlogs";
release channel c1;
RMAN> Reset database

(C) Table recovery: (Incomplete recovery)

happens when some one drops table by mistake, and by the time he/she
informs the DBA, other people are still working on the database. So the
DBA has to recover the database until time when the table was dropped.
That causes other people to re-work from that point onwards, and hence
it is an "Incomplete recovery"

When something like this happens, try to find out the exact time of accident.

SVRMGRL> shutdown immediate;

run {                                 
allocate channel c1 type disk;           
set until time "to_date('2004-01-16:13:17:00','YYYY-MM-DD:HH24:MI:SS')";  
restore database;                        
recover database;                        
sql "alter database open resetlogs";     
RMAN> Reset database

(D) If both the ACTIVE redolog files are gone:

SVRMGRL> startup nomount;

run {
allocate channel c1 type disk;
set until logseq=7 thread=1;
restore controlfile to '/usr1/ora817/test/dbs/control01.ctl';
replicate controlfile from '/usr1/ora817/test/dbs/control01.ctl';
restore database;
sql "alter database mount";
recover database;
sql "alter database open resetlogs";
release channel c1;

If for some reason this attempt fails,

SVRMGRL> alter database mount;  (equivalent of startup mount;)
SVRMGRL> alter database drop logfile group 2;  (optional)
SVRMGRL> recover database using backup controlfile until cancel;  

(Recover to the point till you have good archivelogs, and then Type CANCEL at the prompt)
SVRMGRL> alter database open resetlogs;

RMAN> Reset database

Run the following script to find out the status of backup process:

alter session set NLS_DATE_FORMAT = 'MM/DD/YY (HH:MIAM)';

col start_time format a20 heading "Backup of this|Database started at"
col a format 999.99 heading "% Complete|so far"
col b format a20 heading "Time taken so far|for this backup"

select start_time,round(sofar/totalwork*100,2) a ,
Hrs and
Mins' as b
from v$session_longops
 where substr(opname,1,4)='RMAN'
 and (round(sofar/totalwork*100,2))<100
 and (round(sofar/totalwork*100,2))>0
 and totalwork !=0;
-- -----------------------------------------

Categories: DBA Blogs