Wednesday, November 19, 2008

Oracle: Data Block

Data Blocks: Smallest logical component of oracle database.It consists of number of bytes of disk space in OS. Usually in units of 2kb,4kb,8kb(Default),16kb or 32kb.

DB_BLOCK_SIZE gives your current block size.

Remember, Oracle will read the disk in terms of blocks. If you a have name of 4kb stored in a 32kb block, oracle will read the entire 32kb to retrieve your name. Also, OS also has disk block size and reads data in terms of disk block, Typically your oracle block size should be a multiple of disk block size.

System Tablespace is always created with standard block size. In addition to standard you can create 4 non standard block size for your tablespace.Data block contains row data portion (data stored in table or index) , free space prortion (space left for new data),overhad and header portion (for maintenance).

Extents: Two or more contiguous (touching each other) data blocks. It is a unit of space allocation
Segements: Set of extents to form a logical structure like table or index
Tablspace: Set of one or more data files containing related segments

In order to see data contained in a block, you need to dump it in OS

Select OWNER,SEGMENT_NAME,segment_type,tablespace_name,
header_file,header_block from dba_segments
where segment_name = 'CASES'

Alter System dump datafile header_file BLOCK header_block

Alter system dump datafile 15 block 1339

Go to UDUMP directory, the latest *.trc file will contain the binary dump of the block

Wednesday, November 12, 2008

Oracle: SQL to retrieve table and column comments

For the whole database
Select ut.owner,ut.table_name,ut.comments Table_Comments,uc.column_name,uc.comments Column_Comments
from dba_tab_comments ut, dba_col_comments uc,dba_tab_columns utc
where ut.owner = uc.owner
and uc.owner = utc.owner
and ut.table_name = uc.table_name
and ut.owner = 'Your_Owner_Name'
and uc.table_name = utc.table_name
and uc.column_name = utc.column_name
order by owner,ut.table_name

For the Schema
Select ut.table_name,ut.comments Table_Comments,uc.column_name,uc.comments Column_Comments,data_type
from USER_tab_comments ut, user_col_comments uc,user_tab_columns utc
where ut.table_name = uc.table_name
and uc.table_name = utc.table_name
and uc.column_name = utc.column_name
order by ut.table_name

Tuesday, November 4, 2008

FlashVars in Flex 3

To pass values from the host to swf file, follow the following steps


1) Open the html or aspx file where you have flex swf file embedded.
2) You will see 2 AC_FL_RunContent sections
3) Look at the line in Red, I am passing the value Hello World to the swf file

AC_FL_RunContent(
"src", "FlashV",
"FlashVars", "MMredirectURL=Hello World",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "FlashV",
"quality", "high",
"bgcolor", "#869ca7",
"name", "FlashV",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);

-------------------
Now in mxml file, on ApplicationComplete, call a function
applicationComplete="Init()"

private function Init():void
{
var o:Object = this.loaderInfo.parameters;
Alert.show(o.MMredirectURL.toString());
}



















Saturday, November 1, 2008

Indian Foods: DOSA

South Indian dish (commonly used for breakfast)

Dosa
DOSA with Mint chutney and Potato