Saturday, August 23, 2008

Some helpful DOS commands that you might still need today


138 DOS Prompt Commands

1 ANSI.SYS -- Defines functions that change display graphics, control cursor movement, and reassign keys.
2 APPEND -- Causes MS-DOS to look in other directories when editing a file or running a command.
3 ARP -- Displays, adds, and removes arp information from network devices
4 ASSIGN -- Assign a drive letter to an alternate letter
5 ASSOC -- View the file associations
6 AT -- Schedule a time to execute commands or programs.
7 ATMADM -- Lists connections and addresses seen by Windows ATM call manager.
8 ATTRIB -- Display and change file attributes.
9 BATCH -- NRecovery console command that executes a series of commands in a file.
10 BOOTCFG -- Recovery console command that allows a user to view, modify, and rebuild the boot.ini
11 BREAK -- Enable / disable CTRL + C feature.
12 CACLS -- View and modify file ACL's.
13 CALL -- Calls a batch file from another batch file.
14 CD -- Changes directories.
15 CHCP -- Supplement the International keyboard and character set information.
16 CHDIR -- Changes directories.
17 CHKDSK -- Check the hard disk drive running FAT for errors.
18 CHKNTFS -- Check the hard disk drive running NTFS for errors.
19 CHOICE -- Specify a listing of multiple options within a batch file.
20 CLS -- Clears the screen.
21 CMD -- Opens the command interpreter.
22 COLOR -- Easily change the foreground and background color of the MS-DOS window.
23 COMP -- Compares files.
24 COMPACT -- Compresses and uncompress files.
25 CONTROL -- Open control panel icons from the MS-DOS prompt.
26 CONVERT Convert FAT to NTFS.
27 COPY -- Copy one or more files to an alternate location.
28 CTTY -- Change the computers input/output devices.
29 DATE -- View or change the systems date.
30 DEBUG -- Debug utility to create assembly programs to modify hardware settings.
31 DEFRAG -- Re-arrange the hard disk drive to help with loading programs.
32 DEL -- Deletes one or more files.
33 DELETE -- Recovery console command that deletes a file.
34 DELTREE -- Deletes one or more files and/or directories.
35 DIR -- List the contents of one or more directory.
36 DISABLE -- Recovery console command that disables Windows system services or drivers.
37 DISKCOMP -- Compare a disk with another disk.
38 DISKCOPY -- Copy the contents of one disk and place them on another disk.
39 DOSKEY -- Command to view and execute commands that have been run in the past.
40 DOSSHELL -- A GUI to help with early MS-DOS users.
41 DRIVPARM -- Enables overwrite of original device drivers.
42 ECHO -- Displays messages and enables and disables echo.
43 EDIT -- View and edit files.
44 EDLIN -- View and edit files.
45 EMM386 -- Load extended Memory Manager.
46 ENABLE -- Recovery console command to enable a disable service or driver.
47 ENDLOCAL -- Stops the localization of the environment changes
enabled by the setlocal command.
48 ERASE -- Erase files from computer.
49 EXPAND -- Expand a Microsoft Windows file back to it's original format.
50 EXIT -- Exit from the command interpreter.
51 EXTRACT -- Extract files from the Microsoft Windows cabinets.
52 FASTHELP -- Displays a listing of MS-DOS commands and information about them
53 FC -- Compare files.
54 FDISK -- Utility used to create partitions on the hard disk drive.
55 FIND -- Search for text within a file.
56 FINDSTR -- Searches for a string of text within a file.
57 FIXBOOT -- Writes a new boot sector.
59 FIXMBR -- Writes a new boot record to a disk drive.
60 FOR -- Boolean used in batch files.
61 FORMAT -- Command to erase and prepare a disk drive.
62 FTP -- Command to connect and operate on a FTP server.
63 FTYPE -- Displays or modifies file types used in file extension
associations.
64 GOTO -- Moves a batch file to a specific label or location.
65 GRAFTABL -- Show extended characters in graphics mode.
66 HELP -- Display a listing of commands and brief explanation.
67 IF -- Allows for batch files to perform conditional processing.
68 IFSHLP.SYS -- 32-bit file manager.
69 IPCONFIG -- Network command to view network adapter settings and assigned values.
70 KEYB -- Change layout of keyboard.
71 LABEL -- Change the label of a disk drive.
72 LH -- Load a device driver in to high memory.
73 LISTSVC -- Recovery console command that displays the services and drivers.
74 LOADFIX -- Load a program above the first 64k.
75 LOADHIGH -- Load a device driver in to high memory.
76 LOCK -- Lock the hard disk drive.
77 LOGON -- Recovery console command to list installations and enable administrator login.
78 MAP -- Displays the device name of a drive.
79 MD -- Command to create a new directory.
80 MEM -- Display memory on system.
81 MKDIR -- Command to create a new directory.
82 MODE -- Modify the port or display settings.
83 MORE -- Display one page at a time.
84 MOVE -- Move one or more files from one directory to another DIRECTORY
85 MSAV -- Early Microsoft Virus scanner.
86 MSD -- Diagnostics utility.
87 MSCDEX -- Utility used to load and provide access to the CD-ROM.
88 NBTSTAT -- Displays protocol statistics and current TCP/IP connections using NBT
89 NET -- Update, fix, or view the network or network settings
90 NETSH -- Configure dynamic and static network information from MS-DOS.
91 NETSTAT -- Display the TCP/IP network protocol statistics and information.
92 NLSFUNC -- Load country specific information.
93 NSLOOKUP -- Look up an IP address of a domain or host on a network.
94 PATH -- View and modify the computers path location
95 PATHPING -- View and locate locations of network latency
96 PAUSE -- command used in batch files to stop the processing of a command.
97 PING -- Test / send information to another network computer or network device .
98 POPD -- Changes to the directory or network path stored by the pushd command.
99 POWER -- Conserve power with computer portables.
100 PRINT -- Prints data to a printer port.
101 PROMPT -- View and change the MS-DOS prompt.
102 PUSHD -- Stores a directory or network path in memory so it can be returned to at any time.
103 QBASIC -- Open the QBasic.
104 RD -- Removes an empty directory.
105 REN -- Renames a file or directory.
106 RENAME -- Renames a file or directory.
107 RMDIR -- Removes an empty directory.
108 ROUTE -- View and configure windows network route tables.
109 RUNAS -- Enables a user to execute a program on another
computer.
110 SCANDISK -- Run the scandisk utility.
111 SCANREG -- Scan registry and recover registry from errors.
112 SET -- Change one variable or string to another.
113 SETLOCAL -- Enables local environments to be changed without affecting anything else.
114 SHARE -- Installs support for file sharing and locking capabilities.
115 SETVER -- Change MS-DOS version to trick older MS-DOS programs.
116 SHIFT -- Changes the position of replaceable parameters in a batch program.
117 SHUTDOWN -- Shutdown the computer from the MS-DOS prompt.
118 SMARTDRV -- Create a disk cache in conventional memory or extended memory.
119 SORT -- Sorts the input and displays the output to the screen.
120 START -- Start a separate window in Windows from the MS-DOS prompt.
121 SUBST -- Substitute a folder on your computer for another drive letter.
122 SWITCHES -- Remove add functions from MS-DOS.
123 SYS -- Transfer system files to disk drive.
124 TELNET -- Telnet to another computer / device from the prompt.
125 TIME -- View or modify the system time.
126 TITLE -- Change the title of their MS-DOS window.
127 TRACERT -- Visually view a network packets route across a network.
128 TREE -- View a visual tree of the hard disk drive.
129 TYPE -- Display the contents of a file.
130 UNDELETE -- Undelete a file that has been deleted.
131 UNFORMAT -- Unformat a hard disk drive.
132 UNLOCK -- Unlock a disk drive.
133 VER -- Display the version information.
134 VERIFY -- Enables or disables the feature to determine if files have been written properly.
135 VOL -- Displays the volume information about the designated drive.
136 XCOPY -- Copy multiple files, directories, and/or drives from one location to another.
137 TRUENAME -- When placed before a file, will display the whole directory in which it exists
138 TASKKILL -- It allows you to kill those unneeded or locked up applications

Some helpful DOS commands that you might still need today

 

138 DOS Prompt Commands

1 ANSI.SYS -- Defines functions that change display graphics, control cursor movement, and reassign keys.
2 APPEND -- Causes MS-DOS to look in other directories when editing a file or running a command.
3 ARP -- Displays, adds, and removes arp information from network devices
4 ASSIGN -- Assign a drive letter to an alternate letter
5 ASSOC -- View the file associations
6 AT -- Schedule a time to execute commands or programs.
7 ATMADM -- Lists connections and addresses seen by Windows ATM call manager.
8 ATTRIB -- Display and change file attributes.
9 BATCH -- NRecovery console command that executes a series of commands in a file.
10 BOOTCFG -- Recovery console command that allows a user to view, modify, and rebuild the boot.ini
11 BREAK -- Enable / disable CTRL + C feature.
12 CACLS -- View and modify file ACL's.
13 CALL -- Calls a batch file from another batch file.
14 CD -- Changes directories.
15 CHCP -- Supplement the International keyboard and character set information.
16 CHDIR -- Changes directories.
17 CHKDSK -- Check the hard disk drive running FAT for errors.
18 CHKNTFS -- Check the hard disk drive running NTFS for errors.
19 CHOICE -- Specify a listing of multiple options within a batch file.
20 CLS -- Clears the screen.
21 CMD -- Opens the command interpreter.
22 COLOR -- Easily change the foreground and background color of the MS-DOS window.
23 COMP -- Compares files.
24 COMPACT -- Compresses and uncompress files.
25 CONTROL -- Open control panel icons from the MS-DOS prompt.
26 CONVERT Convert FAT to NTFS.
27 COPY -- Copy one or more files to an alternate location.
28 CTTY -- Change the computers input/output devices.
29 DATE -- View or change the systems date.
30 DEBUG -- Debug utility to create assembly programs to modify hardware settings.
31 DEFRAG -- Re-arrange the hard disk drive to help with loading programs.
32 DEL -- Deletes one or more files.
33 DELETE -- Recovery console command that deletes a file.
34 DELTREE -- Deletes one or more files and/or directories.
35 DIR -- List the contents of one or more directory.
36 DISABLE -- Recovery console command that disables Windows system services or drivers.
37 DISKCOMP -- Compare a disk with another disk.
38 DISKCOPY -- Copy the contents of one disk and place them on another disk.
39 DOSKEY -- Command to view and execute commands that have been run in the past.
40 DOSSHELL -- A GUI to help with early MS-DOS users.
41 DRIVPARM -- Enables overwrite of original device drivers.
42 ECHO -- Displays messages and enables and disables echo.
43 EDIT -- View and edit files.
44 EDLIN -- View and edit files.
45 EMM386 -- Load extended Memory Manager.
46 ENABLE -- Recovery console command to enable a disable service or driver.
47 ENDLOCAL -- Stops the localization of the environment changes
enabled by the setlocal command.
48 ERASE -- Erase files from computer.
49 EXPAND -- Expand a Microsoft Windows file back to it's original format.
50 EXIT -- Exit from the command interpreter.
51 EXTRACT -- Extract files from the Microsoft Windows cabinets.
52 FASTHELP -- Displays a listing of MS-DOS commands and information about them
53 FC -- Compare files.
54 FDISK -- Utility used to create partitions on the hard disk drive.
55 FIND -- Search for text within a file.
56 FINDSTR -- Searches for a string of text within a file.
57 FIXBOOT -- Writes a new boot sector.
59 FIXMBR -- Writes a new boot record to a disk drive.
60 FOR -- Boolean used in batch files.
61 FORMAT -- Command to erase and prepare a disk drive.
62 FTP -- Command to connect and operate on a FTP server.
63 FTYPE -- Displays or modifies file types used in file extension
associations.
64 GOTO -- Moves a batch file to a specific label or location.
65 GRAFTABL -- Show extended characters in graphics mode.
66 HELP -- Display a listing of commands and brief explanation.
67 IF -- Allows for batch files to perform conditional processing.
68 IFSHLP.SYS -- 32-bit file manager.
69 IPCONFIG -- Network command to view network adapter settings and assigned values.
70 KEYB -- Change layout of keyboard.
71 LABEL -- Change the label of a disk drive.
72 LH -- Load a device driver in to high memory.
73 LISTSVC -- Recovery console command that displays the services and drivers.
74 LOADFIX -- Load a program above the first 64k.
75 LOADHIGH -- Load a device driver in to high memory.
76 LOCK -- Lock the hard disk drive.
77 LOGON -- Recovery console command to list installations and enable administrator login.
78 MAP -- Displays the device name of a drive.
79 MD -- Command to create a new directory.
80 MEM -- Display memory on system.
81 MKDIR -- Command to create a new directory.
82 MODE -- Modify the port or display settings.
83 MORE -- Display one page at a time.
84 MOVE -- Move one or more files from one directory to another DIRECTORY
85 MSAV -- Early Microsoft Virus scanner.
86 MSD -- Diagnostics utility.
87 MSCDEX -- Utility used to load and provide access to the CD-ROM.
88 NBTSTAT -- Displays protocol statistics and current TCP/IP connections using NBT
89 NET -- Update, fix, or view the network or network settings
90 NETSH -- Configure dynamic and static network information from MS-DOS.
91 NETSTAT -- Display the TCP/IP network protocol statistics and information.
92 NLSFUNC -- Load country specific information.
93 NSLOOKUP -- Look up an IP address of a domain or host on a network.
94 PATH -- View and modify the computers path location
95 PATHPING -- View and locate locations of network latency
96 PAUSE -- command used in batch files to stop the processing of a command.
97 PING -- Test / send information to another network computer or network device .
98 POPD -- Changes to the directory or network path stored by the pushd command.
99 POWER -- Conserve power with computer portables.
100 PRINT -- Prints data to a printer port.
101 PROMPT -- View and change the MS-DOS prompt.
102 PUSHD -- Stores a directory or network path in memory so it can be returned to at any time.
103 QBASIC -- Open the QBasic.
104 RD -- Removes an empty directory.
105 REN -- Renames a file or directory.
106 RENAME -- Renames a file or directory.
107 RMDIR -- Removes an empty directory.
108 ROUTE -- View and configure windows network route tables.
109 RUNAS -- Enables a user to execute a program on another
computer.
110 SCANDISK -- Run the scandisk utility.
111 SCANREG -- Scan registry and recover registry from errors.
112 SET -- Change one variable or string to another.
113 SETLOCAL -- Enables local environments to be changed without affecting anything else.
114 SHARE -- Installs support for file sharing and locking capabilities.
115 SETVER -- Change MS-DOS version to trick older MS-DOS programs.
116 SHIFT -- Changes the position of replaceable parameters in a batch program.
117 SHUTDOWN -- Shutdown the computer from the MS-DOS prompt.
118 SMARTDRV -- Create a disk cache in conventional memory or extended memory.
119 SORT -- Sorts the input and displays the output to the screen.
120 START -- Start a separate window in Windows from the MS-DOS prompt.
121 SUBST -- Substitute a folder on your computer for another drive letter.
122 SWITCHES -- Remove add functions from MS-DOS.
123 SYS -- Transfer system files to disk drive.
124 TELNET -- Telnet to another computer / device from the prompt.
125 TIME -- View or modify the system time.
126 TITLE -- Change the title of their MS-DOS window.
127 TRACERT -- Visually view a network packets route across a network.
128 TREE -- View a visual tree of the hard disk drive.
129 TYPE -- Display the contents of a file.
130 UNDELETE -- Undelete a file that has been deleted.
131 UNFORMAT -- Unformat a hard disk drive.
132 UNLOCK -- Unlock a disk drive.
133 VER -- Display the version information.
134 VERIFY -- Enables or disables the feature to determine if files have been written properly.
135 VOL -- Displays the volume information about the designated drive.
136 XCOPY -- Copy multiple files, directories, and/or drives from one location to another.
137 TRUENAME -- When placed before a file, will display the whole directory in which it exists
138 TASKKILL -- It allows you to kill those unneeded or locked up applications

Eclipse SMS scares Pune

Source-Deccan Chronicle (www.deccan.com)

Pune, Aug. 22:

A police van took rounds with blaring microphones on Thursday night asking people in many localities to go to sleep and ignore the rumours that they could be dead next day morning if kept awake. Thousands of people living particularly in slum colonies in various parts of the city and far flung villages, refrained from retiring to bed, alarmed by an SMS in circulation which spoke of adverse planetary positions subsequent to the August 16 partial eclipse of the moon, spelling doom for those who slept at night.

Confirming the bizarre happening, police said, their control room received a series of calls from panicky residents on Thursday night seeking to know whether people had been dying since the eclipse in their sleep as mentioned in the SMS doing rounds. The fear stricken families sat outside their dwellings with children telling them not to doze off till morning. In addition to the eclipse effect, other natural calamities like earthquakes too figured in the rumour claiming death of hundreds of people.

When the scale of panic triggered by the rumour mill appeared high, the authorities decided to deploy mobile vans fitted with public address system to visit the concerned localities to dispel fears. The night duty workers at many factories in the Pimpri-Chichwad industrial belt avoided going home after their shift hours and remained awake sitting in the work premises, reports said.

The police had a tough time reassuring the people that no untoward incidents had taken place since the eclipse in the entire region. Another irony is that this should happen in Pune, which is regarded as the seat of education and an IT hub.

Wednesday, August 6, 2008

SMS Shayeri

SMS Shayari 1:
Ek Larki Ko Dekha To Aisa Laga
Doosri Larki Ko Dekha To Vaisa Laga
Jab Dono Ne Joote Maarey...To Ek Jaisa Laga!!!

SMS Shayri 2:
Bewafa Tum Ho To Wafadaar Hum Bhi Nahi,
Besharam Tum Ho To Sharamdaar Hum Bhi Nahi,
Pyaar Ke Is Mode Par Aake Kehte Ho Shadishuda Ho
To Kya Hua Darling...Kunware Hum Bhi Nahin!

SMS Shayari 3:
Zamane ke dar se teri tasweer toilet mein chupa rakhi hai!SMS Shayari 1:
Ek Larki Ko Dekha To Aisa Laga
Doosri Larki Ko Dekha To Vaisa Laga
Jab Dono Ne Joote Maarey...To Ek Jaisa Laga!!!

SMS Shayri 2:
Bewafa Tum Ho To Wafadaar Hum Bhi Nahi,
Besharam Tum Ho To Sharamdaar Hum Bhi Nahi,
Pyaar Ke Is Mode Par Aake Kehte Ho Shadishuda Ho
To Kya Hua Darling...Kunware Hum Bhi Nahin!

SMS Shayari 3:
Zamane ke dar se teri tasweer toilet mein chupa rakhi hai!
dedar ho tera bar bar isliye julab ki goli kha rakhi hai

SMS Shayri 4:
Shaam hote hii ye Dil udaas hota hai
Toote khwaboo ke siwa kuch na pass hota hai
Tumahri yaad aise waqt bohat aati hai
Bandar jab koi aas-paas hota hai..

SMS Shayari 5:
When i open my eyes every morning i pray to God
that everyone should have a friend like you....
Why should only i suffer!!!

 
dedar ho tera bar bar isliye julab ki goli kha rakhi hai

SMS Shayri 4:
Shaam hote hii ye Dil udaas hota hai
Toote khwaboo ke siwa kuch na pass hota hai
Tumahri yaad aise waqt bohat aati hai
Bandar jab koi aas-paas hota hai..

SMS Shayari 5:
When i open my eyes every morning i pray to God
that everyone should have a friend like you....
Why should only i suffer!!!

 

Girls are incomplete without Boys

WOMAN has MAN in it .
SHE has HE in it.
Mrs. has Mr. in it.
LADY has LAD in it.
MISTERESS has MISTER in it.
MADAM has ADAM in it.
HOSTESS has HOST in it.
FEMALE has MALE in it
...................and so on the list is never ending

SO NO need to be proud ....Girls
YOU are always incomplete without Boys....

The Login Password Problem....

A new employee calls the Help Desk to complain that there's something wrong with her password.

"The problem is that whenever I type the password, it just shows stars," she says.

"Those asterisks are to protect you," the Help Desk technician explains, "so if someone were standing behind you, they wouldn't be able to read your password."

"Yeah," she says, "but they show up even when there is no one standing behi
 
nd me!"
 
 

Malayalis - Question se Answer tak

ITS JUST FOR FUN… TAKE IT EASY…..


Name the wonly part of the werld where Malayalis don't werk hard?
Kerala.

Why is industrial productivity so low in Kerala?
Because 86% of the shift time is spent on lifting, folding and re-tying the lungi.

Why did the Malayali buy an air-ticket?
To go to Thoobai, to meet his ungle in the Gelff.

Why do Malayali's go to the Gelff?
To yearn menney.

What did the Malayali do when the plane caught fire?
He zimbly jembd out of the vindow.

What is a Malayali management graduate called?
Yem Bee Yay.

Why did his wife divorce him?
Because he was louwing another woman.

Who found out that?
His andy.

What does a Malayali do when he goes to America?
He changes his name from Karunakaran to Kevin Curren.

What does a Malayali use to commute to office everyday?
An Oto.

Who is a Malayali's famous yeactor end yaectress?
Moghan lal, Mammooti, Geedha, Revadhi, Zilgsmidha end Ambiga.

Why is Kerala the most highly literate state in India?
Its easily giving Degree to get rid of the peapals from Kerala.

Why are Arab countries looking only for Keralites?
They are ready to do yennything for menney.

SPECIAL ANNOUNCEMENT:You should at least send this post to:
10 Malayalis and you will receive cokknut oil, 20 Malayalis and you will receive bennena chips, 40 Malayalis you will receive appams,

Send this to 100 Malayalis and you will get free land near the rice
field behind the lungi factory with additional incentive of a whole month's supply of cokknut oil and bennena chips free

=================Courtesy: Shashank Mishra=========================

Job Interview: Candidate's Funny Answer

New job interview, funny Questions and Answers

Thursday, January 05, 2006

When a Mechanical Engineer didn't get Job

Mechanical Engineering method to commit sucide

Tuesday, August 5, 2008

Compression in Oracle

Compress to Impress
By Arup Nanda Oracle ACE

Use Oracle Advanced Compression to conserve resources and improve performance.

John the DBA at Acme Bank is looking at charts and spreadsheets from the company's capacity planning group. Amid all the fancy-looking graphics and numbers, the message is clear—the bank's database size is going to grow incredibly in the near future. There are many reasons—the natural growth of the business, moving existing applications from desktop systems to the enterprise domain, the constant development of new applications, legal requirements to retain data longer, and so on. The data volume is going to grow exponentially, and the processing capacity (CPU, network, and I/O bandwidth) will also grow, but not at the same pace. This poses major challenges for database operations:

1. Storage costs skyrocket. To contain the costs, management has suggested using cheaper (and slower) disks, which will negatively affect performance.

2. More data also means more backup space is required. To contain these costs, one option is to reduce the number of backups to disk, which is not ideal, because it will increase the restore time.

3. More backed-up data means the backup window will be much larger, affecting—and likely conflicting with—other backups.

4. The increase in data volume also means an increase in I/O through components such as host bus adapter (HBA) cards and network-attached storage (NAS) heads, negatively affecting performance.

5. More data in the database means that a larger system global area (SGA) is needed, and a larger SGA means more memory. If more memory is not available, a smaller proportion of the data will be cached, reducing performance.

To address these challenges, the DBAs at Acme have proposed the usual solutions: adding disk space, memory, network capacity, and I/O bandwidth. But, with the financial belt-tightening, these solutions are not going to get approved by management. Jill, the DBA manager, hopes John can find an alternative solution to sustain the current level of performance, if not improve it, while using the same amount of disk space, memory, and I/O—or even less.

Solution: Compression

Even though the problems are many, the root cause can be summed up easily: exponential growth in data volumes. More data requires more disk space, which, in turn, means higher costs for database and backup storage and more I/O. If there were a way to store the current data volume more efficiently on disk, all the other issues would disappear. The question is how to reduce the space consumption without deleting data.

Oracle Advanced Compression, a new option in Oracle Database 11g Enterprise Edition, is the answer to Acme's data growth problem.

Compression is not new in Oracle Database. Oracle8i Database introduced compression in indexes, by eliminating duplicates from index leaves. Oracle9i Database Release 2 added a new table compression feature that eliminated the storage of repeated values in tables. It supported bulk load operations, and it was very powerful in data warehouse environments. The Oracle Advanced Compression option in Oracle Database 11g Enterprise Edition has richer and far more-powerful features, however, suitable even for transaction-intensive online transaction processing (OLTP) databases.

Compression Steps and Disk Space

The steps to enable compression are very simple. To demonstrate, John creates two tables for account holder information—one compressed (ACCOUNTS_COMP) and one "regular" (ACCOUNTS_REG). John creates the ACCOUNTS_COMP compressed table by using the script shown in Listing 1. Note the "compress for all operations" line in the listing, which creates the table as compressed for all data manipulation language (DML) operations—therefore enabling compression for OLTP tables. (The other compression option is "compress for direct_load operations," which enables compression only for direct path loads, such as INSERT /*+ APPEND */ or SQL*Loader with the direct path option.)

Code Listing 1: Creating the ACCOUNTS table

create table accounts_comp ( 		acc_no					number				not null, 		first_name				varchar2(30)			not null, 		last_name				varchar2(30)			not null, 		acc_type				varchar2(15), 		acc_open_dt				date, 		acc_mgr_id				number, 		city					varchar2(30), 		street_name				varchar2(30) ) compress for all operations / 

John creates the ACCOUNTS_REG table by using the script in Listing 1, except that he changes the table name to ACCOUNTS_REG and omits the "compress for all operations" clause. Then he uses the ins_acc.sql script to simulate an ACME application and insert records into both tables.

INS_ACC.SQL Script for loading sample data into ACCOUNTS tables

/* Instruction: This script will load data into both the  ACCOUNTS_REG and ACCOUNTS_COMP tables. At runtime, it will  ask the user for the value of the ®_or_comp variable.  Enter REG or COMP to load data into the regular (ACCOUNTS_REG)  or compressed (ACCOUNTS_COMP) table, respectively. */  begin    for l_acc_no in 1..1000000 loop    insert into accounts_®_or_comp    values    (       l_acc_no,       -- First Name       decode (          floor(dbms_random.value(1,21)),          1, 'Alan',          2, 'Alan',          3, 'Barbara',          4, 'Barbara',          5, 'Charles',          6, 'David',          7, 'Ellen',          8, 'Ellen',          9, 'Ellen',          10, 'Frank',          11, 'Frank',          12, 'Frank',          13, 'George',          14, 'George',          15, 'George',          16, 'Hillary',          17, 'Iris',          18, 'Iris',          19, 'Josh',          20, 'Josh',              'XXX'       ),       -- Last Name       decode (                   floor(dbms_random.value(1,5)),             1,'Smith',                         dbms_random.string ('A',dbms_random.value(4,30))       ),         -- Account Type       decode (                   floor(dbms_random.value (1,5)),               1,'S',2,'C',3,'M',4,'D','X'       ),         -- Folio ID       case                        when dbms_random.value (1,100) < 51 then null       else                         l_acc_no + floor(dbms_random.value(1,100))       end,        -- Sub Acc Type       case                        when dbms_random.value (1,100) < 76 then null       else            decode (floor(dbms_random.value (1,6)),              1,'S',2,'C',3,'C',4,'C',5,'C',null)       end,        -- Acc Opening Date        sysdate - dbms_random.value(1,500),       -- Account Manager ID       decode (                   floor(dbms_random.value (1,11)),                         1,1,2,1,3,1,4,1,5,2,6,3,7,4,8,5,9,5,10,5,0       )    );     end loop;    commit; end; / 

After the inserts, John checks the number of blocks on each table:

select segment_name, blocks from user_segments where segment_name like 'ACCOUNTS_%';  SEGMENT_NAME      BLOCKS ---------         ---- ACCOUNTS_COMP     4096 ACCOUNTS_REG      11264 

The space savings in the ACCOUNTS_COMP table are clear. Both tables have the same number of identical records, but the ACCOUNTS_COMP compressed table has only 4,096 blocks, a space savings of about 64 percent compared to the 11,264 blocks in the ACCOUNTS_REG table. Of course, notes John, the space savings will vary, depending on the nature of the data.

John also tests whether the compression ratio is the same for later manipulations of the table. He runs the ins_acc.sql script once again on both the tables and rechecks the number of blocks:

select segment_name, blocks from user_segments where segment_name like 'ACCOUNTS_%';  SEGMENT_NAME      BLOCKS --------          ---- ACCOUNTS_COMP     8192 ACCOUNTS_REG      22528 

The compression ratio is still around 64 percent (1-(8192/22528)).

I/O and Memory

To demonstrate other savings from Oracle Advanced Compression, John creates a test query against the example tables; he also collects the statistics and the optimizer plan, by issuing the SET AUTOT command, and notes the execution time. Before he runs each test query, he flushes the buffer pool so that the table will be read from the database rather than from the SGA.

First he issues the test query against the regular table, as shown in Listing 2; Listing 3 shows the output. Then he issues the test query in Listing 2 against the compressed table, by replacing ACCOUNT_REG with ACCOUNT_COMP in the FROM clause; Listing 4 shows that output.

Code Listing 2: Test query

set serveroutput on size unlimited alter system flush buffer_cache / col value noprint new_value start_cpu select value from v$sesstat s, v$statname n where sid = (select sid from v$mystat where rownum < 2) and s.statistic# = n.statistic# and n.name in ('CPU used by this session') / col value noprint new_value start_reads select value from v$sesstat s, v$statname n where sid = (select sid from v$mystat where rownum < 2) and s.statistic# = n.statistic# and n.name in ('session logical reads') / set autot on explain stat set timing on select acc_mgr_id, acc_type, 		 avg((sysdate-acc_open_dt)) from accounts_reg   group by acc_mgr_id, acc_type order by acc_mgr_id, acc_type / set autot off select value - &start_cpu cpu_consumed from v$sesstat s, v$statname n where sid = (select sid from v$mystat where rownum < 2) and s.statistic# = n.statistic# and n.name in ('CPU used by this session') / select value - &start_reads logical_reads from v$sesstat s, v$statname n where sid = (select sid from v$mystat where rownum < 2) and s.statistic# = n.statistic# and n.name in ('session logical reads') / 

Code Listing 3: Statistics for regular table

... Elapsed: 00:00:05.33 ...  ---------------------------------------------------------------------------------------- | Id  | Operation		| Name		| Rows	| Bytes	| Cost (%CPU)| Time	| ---------------------------------------------------------------------------------------- |   0 | SELECT STATEMENT	|		|    15	|   285 |  3095   (3)| 00:00:38	| |   1 |  SORT GROUP BY		|		|    15	|   285 |  3095   (3)| 00:00:38	| |   2 |   TABLE ACCESS FULL	| ACCOUNTS_REG	|  1000K|   18M |  3035   (1)| 00:00:37	| ----------------------------------------------------------------------------------------   Statistics --------------------------------       ...       11121  consistent gets       11118  physical reads       ...   CPU_CONSUMED ---------                 354   LOGICAL_READS ---------              11212 

Code Listing 4: Statistics for compressed table

... Elapsed: 00:00:04.24 ... ----------------------------------------------------------------------------------------- | Id  | Operation		| Name		| Rows	| Bytes	| Cost (%CPU) | Time	 | ----------------------------------------------------------------------------------------- |   0 | SELECT STATEMENT	|		|    15	|   285	|  1170   (7) | 00:00:15 | |   1 |  SORT GROUP BY		|		|    15	|   285	|  1170   (7) | 00:00:15 | |   2 |   TABLE ACCESS FULL	| ACCOUNTS_COMP	|  1000K|    18M|  1109   (2) | 00:00:14 | -----------------------------------------------------------------------------------------   Statistics -------------------------------- ...        4031  consistent gets        4025  physical reads ...   CPU_CONSUMED ---------                 304  LOGICAL_READS ---------               4122 

The execution time was 5.33 seconds for the regular table but 4.24 seconds for the compressed table—a 20 percent improvement in execution time. The number of logical reads done explains the improvement: 11,212 in the regular table, as opposed to 4,122 for the compressed table. This resulted in some savings in CPU_CONSUMED (354 for the regular table, to 304 for the compressed table), and although this CPU savings is not substantial (in fact, the documentation states that in some cases, the CPU consumption might be higher), John observes that the savings in I/O are large enough to create a drop in the response time. This performance gain will be more pronounced in large, full-table scans, typically found in Acme's reporting and batch-oriented applications.

Because each block in the compressed table now packs more rows, a smaller SGA can handle the same amount of data. Conversely, the existing memory will accommodate more blocks, reducing the probability that a trip to the disk will be necessary, which further improves I/O and subsequently enables better response time.

John looks at his tests and concludes that space savings are not the only advantage of compression. It also improves memory and I/O efficiencies, resulting in better query performance in many cases. For table scans, there can also be some CPU savings from reduced I/O.

Types of Compression

Oracle Advanced Compression offers more than one type of compression, which is important, because Acme needs to use compression for different types of data processing, data formats, and system usage. John looks at the different types of compression available and how they might address Acme's different needs.

OLTP table compression. With OLTP table compression, the compression occurs at the block level. Data is not compressed as it is inserted; rather, an internal algorithm is used to decide when a block has enough uncompressed data and is ready for compression. When a block is ready, the compression algorithm takes a value from a record and creates a reference to that value in a "symbol table" toward the header of the block. Then the algorithm tries to find an identical value in that block, and for each one it finds, it replaces that value with the symbol from the symbol table. This way the data inside the block is compressed anywhere it occurs—not just in specific columns or rows. Each block is independently compressed with its own symbol table, so the compression is usually faster than it is for non-Oracle algorithms, which normally use a global symbol table. This independent compression at the block level is adaptive to new or modified data—blocks can be compressed and recompressed to update the symbol tables as necessary. A global symbol table, however, is much more difficult to update without locking, meaning that those algorithms are not adaptive to changes in the data, which can reduce compression ratios over time.

Oracle Advanced Compression does not occur the moment data is inserted or changed. Rather, data comes in as is (uncompressed) and when a specific internally defined threshold is reached, the compression algorithm kicks in for all data in the block, in batch mode. So all transactions on a block do not experience the CPU overhead of compression—only the transaction that triggers compression experiences a compression-related wait, which is minimal. This batch algorithm keeps the CPU overhead for DML operations very low, thereby making Oracle Advanced Compression suitable for OLTP systems.

Compression of unstructured data. Acme also stores a lot of nonstructured data, such as XML documents, signatures (as GIF files), and statements (as PDF documents). Due to several regulations governing the bank—Sarbanes-Oxley, the Gramm-Leach-Bliley Act, and so on, Acme must preserve this unstructured data in the database, which takes sizable chunks of storage.

Oracle Advanced Compression is not only for relational data. In Oracle Database 11g, other datatypes can also be compressed, sometimes with slight syntax variants. For instance, Oracle SecureFiles (the next-generation large objects [LOBs] introduced in Oracle Database 11g) has two ways to reduce storage: compression and deduplication. (For more information on Oracle SecureFiles compression, John bookmarks the "SecureFiles: The New LOBs" article on Oracle Technology Network [OTN]. He creates an Oracle SecureFiles test example in which the CONTRACTS_SEC table is altered to include a compressed LOB column—ORIG_FILE:

alter table contracts_sec modify lob  (orig_file) (compress high) 

And if Oracle SecureFiles data repeats in the ORIG_FILE column of the CONTRACTS_SEC table, deduplication will remove the duplicates and store only the pointers to them, eliminating duplicate storage. Thus, if four copies of the same document are stored in the ORIG_FILE column, the file will be stored only once after deduplication, providing a 75 percent reduction in space used.

John confirms the syntax to enable deduplication in the ORIG_FILE column:

alter table contracts_sec modify lob (orig_file) (deduplicate) 

Backup compression. An Oracle Database instance can be backed up in two ways: by using Oracle Data Pump—the logical backup—and Oracle Recovery Manager (Oracle RMAN)—the physical backup. Oracle Advanced Compression comes in handy in both cases. In Oracle RMAN, a new compression algorithm—ZLIB—compresses the data more efficiently (as shown in the "RMAN" article on OTN). In Oracle Data Pump, the dump file can be compressed.

John tests the syntax to create a compressed dump file from the accounts_reg table, using the compression=all clause:

expdp <User>/<Pass> directory=<DirName> tables=accounts_reg dumpfile=reg.dmp compression=all 

This creates a 41MB compressed dump file named reg.dmp. John runs the same expdp command without the compression clause, which produces a 90MB file. So, Oracle Advanced Compression compressed the dump file by more than 50 percent, quite a savings on any scale. When John imports the compressed dump file back into the table, the Oracle Data Pump import reads the compressed file and decompresses it inline, during the import.

Network compression. John continues to explore the benefits of compression. Acme uses Oracle Data Guard as its disaster recovery solution. During a network outage or when a standby server is down for planned or unplanned maintenance, the standby database can fall behind the primary. Oracle Data Guard automatically ships the missing redo data for sync up—a process known as "gap resolution." In Oracle Database 11g, you can compress the redo stream for gap resolution with Oracle Advanced Compression by putting a special clause into the archive destination for the standby database. The archive destination is set in the initialization parameter file:

log_archive_dest_2 = 'service=acmedr  lgwr async  valid_for=(online_logfiles,primary_role)  db_unique_name=acmedr compression=enable' 

John notes the compression=enable clause, which causes the redo stream to be compressed during gap resolution, making the synchronization process faster, which, in turn, reduces the risk to Acme's high-availability environment.

Summing It Up

A reduction in the space used in the database directly translates to reduced space requirements for backups, so Acme does not need to buy additional backup disks. Because fewer blocks are being backed up, the backup finishes faster and the backup window allocated now will also be sufficient for the future.

Next Steps

READ more about
Oracle Advanced Compression
Oracle Advanced Compression white paper

Acme also has a staging database as a copy of the production database. The storage requirements for the staging database as well as other database copies such as QA and development drop too. In short, with Oracle Advanced Compression, there is no need for any additional hardware—disks, I/O capacity, memory, tape, or network bandwidth—when Acme's database grows. John gathers the metrics collected and heads for Jill's office to give her the good news.

Conclusion

The last few years have seen enhancements that were mere imaginings earlier, such as 16-core CPUs and 720GB hard drives. The trend is clearly "up"; we will see more processing power and higher disk capacity in the future, but one thing that hasn't changed much—and isn't likely to change—is disk throughput.

This article showed how a forward-thinking John started looking at how to address exponential data growth and ended up addressing both that growth and the limitations of disk throughput by using Oracle Advanced Compression. He has effectively stored more data in less space, accomplishing more data transfer with the same throughput. Not only does it save Acme storage space, but it increases performance as well.