Tuesday, August 31, 2010

Moore's Law & more

Computers, Notebooks, Laptops, Smartphones, Netbooks seem to be popular now than a decade away. The advent of smaller devices have always grabbed my attention. Apple has always lead the way bringing in a revolution time and again. Be in the first of the Mac desktops, iPhone, iPad, they have defined the way humans interact with the machines. (not as in Terminator)

While talking of computers, I get reminded of the Moore's Law which states "The number of transistors that can be placed inexpensively on an integrated circuits will double approximately every two years"

The first time I came to know about Moore's law in 1998 (Pentium III, AMD K6 days), I wondered is it even possible. Now over 12 years hence I believe in the law more than anything. Intel and AMD are able to churn out faster, multi cored, 64 bit processors to market in the last 3 years. Its amazing how things are turning out - quad core, hexa core and octa cores.

While speed and parallel processing is the key, there is a separate market segment that has evolved since the advent of the first iPhones and Netbook based-computers. Smart Phones evolved that empowered users to be "connected" all the time. Netbooks were lighter alternatives to cater majority of users whose computing requirement is just "internet based". Lighter netbooks came with single and dual core processors that are energy efficient with longer battery life enabling users to stay on the go longer.

The next few years, one can clearly see the market belongs to iPad and Anaroid based pads with touch sensitive screens, HD screens and HD audio, that users can carry easily and satisfy their thirst be it being connected, entertainment, games or reading books. These small devices will be the household names. No wonder Internet is the best invention ever.

Wednesday, August 25, 2010

Oracle Tips: Table Reorg

The most efficient way to re-organize tables in 11.2 is
alter table <table_name> move;

The above command preserves all constraints and index definitions.
Of course, indexes based on row_id would be impacted. 
But its important to verify if any of the indexes on the table are UNUSABLE. If so rebuild the indexes as below
Alter index <index_name> rebuild tablespace <tablespace_name> ;

Another way I came across but have not tried is

alter table <table_name> enable row movement;
alter table <table_name> shrink space;

This is supposed to repack the rows and bring the High Water Mark down.


Tuesday, August 24, 2010

Oracle Tips: using Data Pump

Create Directory for Export & Import Data in Oracle
-- Unix
create directory expdp_dir as '/u01/backup/exports'; OR
-- Windows
create directory expdp_dir as 'C:\orabackup\exports';

grant read,write on directory expdp_dir to system, user1, user2, user3;

Data Pump Export
Full Export Mode

expdp system/<password>@<db_name> DIRECTORY=expdp_dir DUMPFILE=expfull.dmp FULL=y LOGFILE=expfull.log

Schema Export Mode
expdp <schema_owner/system>/<password>@<db_name> DIRECTORY=expdp_dir DUMPFILE=schema_exp.dmp SCHEMAS=<schema1>,<schema2> LOGFILE=expSCHEMA.log

Table Export Mode
expdp <schema_owner>/<password>@<db_name> DIRECTORY=expdp_dir DUMPFILE=tables_exp.dmp TABLES=<table1>,<table2>,<table3> LOGFILE=expTABLES.log


Data Pump Import
Full Import Mode
impdp system/<password>@<db_name> DIRECTORY=expdp_dir DUMPFILE=expfull.dmp FULL=y LOGFILE=impfull.log

Schema Import Mode
impdp <schema_owner/system>/<password>@<db_name> DIRECTORY=expdp_dir DUMPFILE=expfull.dmp SCHEMAS=<schema1>,<schema2> LOGFILE=impSCHEMA.log

Table Import Mode
impdp <schema_owner>/<password>@<db_name> DIRECTORY=expdp_dir DUMPFILE=expfull.dmp TABLES=<table1>,<table2>,<table3> LOGFILE=impTABLES.log

Thursday, August 19, 2010

Oracle Tips: Writing to File

Need to have these executed before you can write to files on server

1. CREATE DIRECTORY utl_dir1 AS '<path>';
2. GRANT ALL ON DIRECTORY utl_dir1 TO <owner>;

The following code demonstrates how to write the contents of a table to a file.
Declare
f utl_file.file_type
indx number:=1;
f  := utl_file.fopen('UTL_DIR1',<file_name>,'W');

CURSOR <cursor_name>
  IS
    SELECT *
    FROM <table_name>;

BEGIN
indx:=1;
FOR <row_variable> IN <cursor_name>
LOOP
  utl_file.put_line(f,convert_row_to_delim_str(fxd_loan_row,','));
  indx:=indx+1;
END LOOP;

utl_file.fclose(f);

END
/

Oracle Tips: Speeding up Index Creation

3 Steps to create indexes faster

1. CREATE INDEX on <table_name>(<column1>, <column2>) UNUSABLE;
2. ALTER INDEX REBUILD parallel 16 NOLOGGING;
-- Does FFS rather than FTS when using Create statement
3. ALTER INDEX NOPARALLEL;


Monday, August 16, 2010

Microsoft Word Spell Check Issues

My Microsoft Office spell checks stopped to work. I tried all possible methods listed in Microsoft help - like Proofing options in Word, Set Proofing options and so on. But nothing worked except the one below.

1. Go to "Start"->"Run", then type "regedit" and follow the link as below:
"HKEY_CURRENT_USER\Software\Microsoft\Shared Tools\Proofing
Tools\1.0\Override"

2. Remove Override folder.

3. Spell Check will work as its meant to.