Monday 23 July 2012

top 10 engineering colleges in bangalore

1, RV college of engineering.
2. People education society institute of technology(PESIT).
3.BMS college of engineering.
4. Univercity of vishveraiah college of engineering(UVCE).
5.Bangalore institute of technology(BIT).
6.M S Ramaiah institute of technology(MSRIT).
7.Dayananda sagar college of engineering.
8.Sr M Vishveraiah institute of technology.
9.C M R institute of technology.
10.MVJ college of engineering.

displaying only duplicate rows in oracle

select id,name,salary  from employee
group by(id) having count(*) >=2;

DB import, export and DB load commands in Informix

DB Export:
dbexport database name [-o dir]
example:
dbexport sysdbs -o tmp
DB Import:
dbimport [-d dataspace] [-dir] database
example:
dbimport -d workdbs - tmp sysdbs

dbload  command:

dbload [-d database] [-c commandnfile] [-l error log] [-n number of rows after commit] [-e number of rows discarded]

command file:
unlfile *,unl delimiter number of fields;
insert statement;
example:
unlfile a.unl delimiter "|" 10;
insert into employee;

dbload -d sysdb -c a.unl -l error.log -n 100 -e 100

Saturday 21 July 2012

Escape seqence in oracle queries

In oracle database queries '&' has special meaning, while inserting values to table if we give & symbol it will prompt for the input.
example:
insert into employee values(&id,&name,&salary);
It promptsn to enter those values.

If & symbol is there inside the column value then also it will prompt so to avoid that we use escape symbol.
example:
insert into employee(id,name,emil) values (12,'abcd&efg',xyz.gmail.com);

it will prompt like enter efg value. So to avoid this we use escape '\'
insert into employee(id,name,email) values(12,'abcd\&efg',xyz.gmail.com);


joining tables from different database in informix

select t1.column,t2.column from tablename1 t1,dbname@server:tablename2;

example:
select e.name,d.name from employee e,sysdb@linux:department d where e.id=d.id;

Monday 16 July 2012

latest news on technology


What lured Yahoo's new CEO Marissa Mayer away from Google

SAN FRANCISCO: Yahoo lured Marissa Mayer from Google with a lavish pay package that could total $129 million over five years - if she is able to get the company growing.

Yahoo disclosed details of its new chief executive's compensation package in a regulatory filing on Thursday. It is larger than the pay package of the average chief executive in Silicon Valley, but not the largest among chiefs of publicly held technology companies.

Tim Cook, Apple's chief executive, has a compensation package valued at $378 million in salary, bonus and stock award that vests over 10 years. His annual base salary is $900,000.

Mayer's pay package is higher than that of Meg Whitman, her counterpart at Hewlett-Packard. When HP hired Whitman as its chief executive, it offered her a $1 salary and stock options valued at $16.1 million that she cannot exercise unless HP's stock meets certain targets by October 2013. She will also get a $6 million annual bonus if all goes well.

Mayer's former boss at Google, Larry Page, receives only $1 in annual salary. But as a co-founder of the company, he owns more than 26.2 million shares of Google stock, which, at Thursday's closing price of $593.06 a share, is worth about $15.5 billion.

Mayer's package includes a $1 million annual base salary and a bonus of up to $4 million a year, depending on the company's performance. She will receive $12 million in the form of a stock payment this year - half of it in restricted stock, the remainder in options - and comparable awards in subsequent years. Yahoo will also give her a one-time "retention equity award" worth $30 million that vests over five years.

Google never had to disclose Mayer's salary because she was not one of the highest-compensated executives at the company, although she was one of the most visible. But to make up for what she left on the table at Google, Yahoo said it would pay her a one-time "make whole" stock grant of $14 million.

"It's big," said Colin Gillis, an analyst at BGC Partners. "But Yahoo is a multibillion-dollar company. If she can create value, it's a small percentage. If she doesn't, she'll join a long succession of Yahoo CEOs with sizable pay packages who did not add value."

Yahoo offered Mayer more than it had her immediate predecessors, Scott Thompson and Carol Bartz. It offered Thompson a $1 million base salary and stock grants worth about $22.5 million. He left four months into the job, without severance, amid accusations that he had exaggerated his credentials on his resume, but he managed to keep $7 million in cash and stock grants that had already vested.

When Bartz joined Yahoo in 2009, the company offered her a $1 million salary and stock and cash grants worth $19 million, plus options worth 5 million shares that exercised at $11.73.

Mayer, known for holding extravagant parties, collecting expensive art and wearing designer gowns, does not lack for money. As Google's 20th employee, she made millions in Google stock while running its search business and overseeing successful products like Gmail and Google Maps.

Sony Ericsson fined Rs 34,500 for defective mobile


A panel of the Central District Consumer Disputes Redressal Forum has ordered Sony Ericsson to pay Rs 34,500 to a customer. Along with the total cost of the defective phone (Rs 24,500), the bench directed the company to pay the Delhi-based complainant Rs 7,000 as compensation for harassment and Rs 3,000 as legal costs. The panel also ordered the retailer who sold the defective handset to the consumer not to store "hazardous good" in the future.

The customer, Neeraj Arora, had filed a complaint in the consumer court, saying that the Sony Ericsson phone (model U1i) he purchased in July 2010 did not perform well since the beginning and used to 'hang-up'. When he submitted the device for repairs, its ringer ceased to work abruptly. The retailer, which also operated as an authorised service centre for Sony Ericsson, was unable to fix the defects in the handset, said Arora.

The bench, headed by B B Chaudhary, ruled, "We hold that the complainant (Arora) who had purchased the mobile handset of Sony Ericsson, a brand name in the market, from opposite party 2 (retail shop) has established that the opposite parties 1 and 2 (Sony Ericsson and the retail shop) are guilty of selling the defective goods. A consumer cannot be asked to remain at the mercy of service provider in the era of consumers-friendly environment."

The forum gave its decision against the manufacturer and the retailer since neither of them appeared in spite of being subpoenaed. It said that they failed to resolve the customer's concerns, even though it was their duty.




difference between count(*), count(age) and count(distinct age)

1. select count(*) from employee;
        it will select all the rows including null's.
2. select count(age) from employee;
       it will select all the rows excluding null's.
3. select count(distinct age) from employee;
      it will select all the rows excluding null's and similar rows.

case in PL/SQl

case in pl/sql is similar to case in other languages.

select name,case when salary < 10000 then 10*salary
                            when salary = 10000 then  salary
                            else 0.1*salary end "reviced salary"
                             from employee;

dbschema of table in oracle

login to oracle then type below commands to get dbschema of table in oracle.
sql>set pagesize 0
sql>set linesize 32265
sql>set trimspool on
sql>set feedback off
sql>spool $outfile          ($outfile is the outputfile where schema should be saved)
sql>select dbms_metadata.get_ddl('TABLE','tablename','dbname') from dual;
sql>spool off

transaction recovery in Oracle

Instance and Crash Recovery
Crash recovery is used to recover from a failure either when a single-instance database crashes or all instances of an Oracle Real Application Clusters database crashes. Instance recovery refers to the case where a surviving instance recovers a failed instance in an Oracle Real Application Clusters database.
The goal of crash and instance recovery is to restore the data block changes located in the cache of the dead instance and to close the redo thread that was left open. Instance and crash recovery use only online redo log files and current online datafiles. Oracle recovers the redo threads of the dead instances together.
Crash and instance recovery have the following shared characteristics:
  • Redo the changes using the current online datafiles (as left on disk after the crash or SHUTDOWN ABORT)
  • Use only the online redo logs and never require the use of the archived logs
  • Have a recovery time governed by the number of dead instances, amount of redo generated in each dead redo thread since the last checkpoint, and by user-configurable factors such as the number and size of redo log files, checkpoint frequency, and the parallel recovery setting
Oracle performs this recovery automatically on two occasions:
  • At the first database open after the crash of a single-instance database or all instances of an Oracle Real Applications Cluster database (crash recovery).
  • When some but not all instances of an Oracle Real Application Clusters configuration fail (instance recovery). The recovery is performed automatically by a surviving instance in the configuration.
The important point is that in both crash and instance recovery Oracle applies the redo automatically: no user intervention is required to supply redo logs. However, you can set parameters in the database server that can tune the duration of instance and crash recovery performance. Also, you can tune the rolling forward and rolling back phases of instance recovery separately. Finally, you can tune checkpointing so that recovery time is optimized.
Media Recovery
Media recovery is divided into the following types:
  • Datafile media recovery
  • Block media recovery
Typically, the term "media recovery" refers to recovery of datafiles. Block media recovery is a more specialized operation that you can only perform with RMAN.
Datafile Media Recovery
Datafile media recovery is used to recover from a lost or damaged current datafile or control file. It is also used to recover changes that were lost when a tablespace went offline without the OFFLINE NORMAL option. Datafile media recovery and instance recovery have in common the requirement to repair database integrity. However, these types of recovery differ with respect to their additional features. Media recovery has the following characteristics:
  • Applies needed changes using restored backups of damaged datafiles.
  • Can use archived logs as well as the online logs.
  • Requires explicit invocation by a user.
  • Does not detect media failure (that is, the need to restore a backup) automatically. After a backup has been restored, however, detection of the need to recover it through media recovery is automatic.
  • Has a recovery time governed solely by user policy (for example, frequency of backups, parallel recovery parameters) rather than by Oracle internal mechanisms.
The database cannot be opened if any of the online datafiles needs media recovery, nor can a datafile that needs media recovery be brought online until media recovery has been executed. The following scenarios necessitate media recovery:
  • You restore a backup of a datafile.
  • You restore a backup control file (even if all datafiles are current).
  • A datafile is taken offline (either by you or automatically by Oracle) without the OFFLINE NORMAL option.
Unless the database is not open by any instance, datafile media recovery can only operate on offline datafiles. You can initiate datafile media recovery before opening a database even when crash recovery would have sufficed. If so, crash recovery still runs automatically at database open.
Note that when a file requires media recovery, you must perform media recovery even if all necessary changes are contained in the online logs. In other words, you must still run recovery even though the archived logs are not needed. Media recovery may find nothing to do -- and signal the "no recovery required" error -- if invoked for files that do not need recovery.
Block Media Recovery
Block media recovery is a technique for restoring and recovering individual data blocks while all database files remain online and available. If corruption is limited to only a few blocks among a subset of database files, then block media recovery may be preferable to datafile recovery.
The interface to block media recovery is provided by RMAN. If you do not already use RMAN as your principal backup and recovery solution, then you can still perform block media recovery by cataloging into the RMAN repository the necessary user-managed datafile and archived redo log backups.
Redo Application During Recovery
Media recovery proceeds through the application of redo data to the datafiles. Whenever a change is made to a datafile, the change is first recorded in the online redo logs. Media recovery selectively applies the changes recorded in the online and archived redo logs to the restored datafile to roll it forward.
This section contains these topics:
  • About Redo Application
  • Cache Recovery
  • Transaction Recovery
About Redo Application
Database buffers in the buffer cache in the SGA are written to disk only when necessary, using a least-recently-used (LRU) algorithm. Because of the way that the database writer process uses this algorithm to write database buffers to datafiles, datafiles may contain some data blocks modified by uncommitted transactions and some data blocks missing changes from committed transactions.
Two potential problems can result if an instance failure occurs:
  • Data blocks modified by a transaction might not be written to the datafiles at commit time and may only appear in the redo log. Therefore, the redo log contains changes that must be reapplied to the database during recovery.
  • After the roll forward phase, the datafiles may contain changes that had not been committed at the time of the failure. These uncommitted changes must be rolled back to ensure transactional consistency. These changes were either saved to the datafiles before the failure, or introduced during the roll forward phase.
To solve this dilemma, two separate steps are generally used by Oracle for a successful recovery of a system failure: rolling forward with the redo log (cache recovery) and rolling back with the rollback or undo segments (transaction recovery).
Cache Recovery
The online redo log is a set of operating system files that record all changes made to any database buffer, including data, index, and rollback segments, whether the changes are committed or uncommitted. All changes to Oracle blocks are recorded in the online log.
The first step of recovery from an instance or disk failure is called cache recovery or rolling forward, and involves reapplying all of the changes recorded in the redo log to the datafiles. Because rollback data is also recorded in the redo log, rolling forward also regenerates the corresponding rollback segments
Rolling forward proceeds through as many redo log files as necessary to bring the database forward in time. Rolling forward usually includes online redo log files (instance recovery or media recovery) and may include archived redo log files (media recovery only).
After rolling forward, the data blocks contain all committed changes. They may also contain uncommitted changes that were either saved to the datafiles before the failure, or were recorded in the redo log and introduced during cache recovery.
Transaction Recovery
You can run Oracle in either manual undo management mode or automatic undo management mode. In manual mode, you must create and manage rollback segments to record the before-image of changes to the database. In automatic undo management mode, you create one or more undo tablespaces. These undo tablespaces contain undo segments similar to traditional rollback segments. The main difference is that Oracle manages the undo for you.
Undo blocks (whether in rollback segments or automatic undo tablespaces) record database actions that should be undone during certain database operations. In database recovery, the undo blocks roll back the effects of uncommitted transactions previously applied by the rolling forward phase.
After the roll forward, any changes that were not committed must be undone. Oracle applies undo blocks to roll back uncommitted changes in data blocks that were either written before the crash or introduced by redo application during cache recovery. This process is called rolling back or transaction recovery.
Oracle can roll back multiple transactions simultaneously as needed. All transactions systemwide that were active at the time of failure are marked as dead. Instead of waiting for SMON to roll back dead transactions, new transactions can recover blocking transactions themselves to get the row locks they need.
Complete and Incomplete Media Recovery
Media recovery updates a backup to either to the current or to a specified noncurrent time. When performing media recovery, you can recover the whole database, a tablespace, or a datafile. In any case, you always use a restored backup to perform the recovery.
This section contains the follow topics:
  • Complete Recovery
  • Incomplete Recovery
Complete Recovery
Complete recovery involves using redo data or incremental backups combined with a backup of a database, tablespace, or datafile to update it to the most current point in time. It is called complete because Oracle applies all of the redo changes contained in the archived and online logs to the backup. Typically, you perform complete media recovery after a media failure damages datafiles or the control file.
You can perform complete recovery on a database, tablespace, or datafile. If you are performing complete recovery on the whole database, then whether you are using RMAN or SQL*Plus you must:
  • Mount the database
  • Ensure that all datafiles you want to recover are online
  • Restore a backup of the whole database or the files you want to recover
  • Apply online or archived redo logs, or a combination of the two
If you are performing complete recovery on a tablespace or datafile, then you must:
  • Take the tablespace or datafile to be recovered offline if the database is open
  • Restore a backup of the datafiles you want to recover
  • Apply online or archived redo logs, or a combination of the two
Incomplete Recovery
Incomplete recovery uses a backup to produce a noncurrent version of the database. In other words, you do not apply all of the redo records generated after the most recent backup. You usually perform incomplete recovery of the whole database in the following situations:
  • Media failure destroys some or all of the online redo logs.
  • A user error causes data loss, for example, a user inadvertently drops a table.
  • You cannot perform complete recovery because an archived redo log is missing.
  • You lose your current control file and must use a backup control file to open the database.
To perform incomplete media recovery, you must restore all datafiles from backups created prior to the time to which you want to recover and then open the database with the RESETLOGS option when recovery completes. The RESETLOGS operation creates a new incarnation of the database--in other words, a database with a new stream of log sequence numbers starting with log sequence 1.
Tablespace Point-in-Time Recovery
The tablespace point-in-time recovery (TSPITR) feature enables you to recover one or more tablespaces to a point-in-time that is different from the rest of the database. TSPITR is most useful when you want to:
  • Recover from an erroneous drop or truncate table operation
  • Recover a table that has become logically corrupted
  • Recover from an incorrect batch job or other DML statement that has affected only a subset of the database
  • Recover one independent schema to a point different from the rest of a physical database (in cases where there are multiple independent schemas in separate tablespaces of one physical database)
  • Recover a tablespace on a very large database (VLDB) rather than restore the whole database from a backup and perform a complete database roll-forward
Media Recovery Options
Because you are not completely recovering the database to the most current time, you must tell Oracle when to terminate recovery. You can perform the following types of media recovery.
Type of Recovery
Function
Time-based recovery
Recovers the data up to a specified point in time.
Cancel-based recovery
Recovers until you issue the CANCEL statement (not available when using Recovery Manager).
Change-based recovery
Recovers until the specified SCN.
Log sequence recovery
Recovers until the specified log sequence number (only available when using Recovery Manager).
RMAN and User-Managed Restore and Recovery
You have a choice between two basic methods for recovering physical files. You can:
  • Use the RMAN utility to restore and recover the database
  • Restore backups by means of operating system utilities, and then recover by executing the SQL*Plus RECOVER command
Whichever method you choose, you can recover a database, tablespace, or datafile. Before performing media recovery, you need to determine which datafiles to recover. Often you can use the fixed view V$RECOVER_FILE. This view lists all files that require recovery and explains the error that necessitates recovery.
RMAN Restore and Recovery
The basic RMAN recovery commands are RESTORE and RECOVER. Use RESTORE to restore datafiles from backup sets or from image copies on disk, either to their current location or to a new location. You can also restore backup sets containing archived redo logs. Use the RMAN RECOVER command to perform media recovery and apply archived logs or incremental backups.
RMAN automates the procedure for recovering and restoring your backups and copies. For example, run the following commands from within RMAN to restore and recover the database to its current time:
SHUTDOWN IMMEDIATE; # shuts down database
STARTUP MOUNT; # starts and mounts database
RESTORE DATABASE; # restores all datafiles
RECOVER DATABASE; # recovers database using all available redo
ALTER DATABASE OPEN; # reopens the database
User-Managed Restore and Recovery
If you do not use RMAN, then you can restore backups with operating system utilities and then run the SQL*Plus RECOVER command to recover the database. You should follow these basic steps:
  1. After identifying which files are damaged, place the database in the appropriate state for restore and recovery. For example, if some but not all datafiles are damaged, then take the affected tablespaces offline while the database is open.
  1. Restore the files with an operating system utility. If you do not have a backup, it is sometimes possible to perform recovery if you have the necessary redo logs dating from the time when the datafiles were first created and the control file contains the name of the damaged file.
If you cannot restore a datafile to its original location, then relocate the restored datafile and change the location in the control file.
  1. Restore any necessary archived redo log files.
  1. Use the SQL*Plus RECOVER command to recover the datafile backups.
For example, assume that you lose the /oracle/dbs/users1.dbf datafile, which is contained in the users tablespace, to a media failure. Also, assume that you have a backup called /dsk2/backup/users1.dbf on a separate disk drive. You discover that the datafile is missing because a query returns an error saying that the file is missing.
Your first step is to take the users tablespace offline. For example, you run this SQL statement:
SQL> ALTER TABLESPACE users OFFLINE IMMEDIATE;

Then, you restore the backup of users1.dbf using an operating system utility. For example, you run this UNIX command:
% cp /dsk2/backup/users1.dbf /oracle/dbs/users1.dbf

Assuming that you have all necessary archived redo logs, you can recover the datafile with the following SQL*Plus command:
SQL> RECOVER AUTOMATIC DATAFILE '/oracle/dbs/users1.dbf';

Finally, bring the tablespace online as follows:
SQL> ALTER TABLESPACE users ONLINE;

Sunday 15 July 2012

Informix database architecture

Important linux commands

1. display the utilization of each CPU induvisualy.
     > mpstat -P ALL
2. top 10 process which consumes cpu.
     > ps -eo pcpc,pid,user,args | sort -k 1 -r | head -10
3. display memory datails.
     >cat /proc/meminfo
4. display memory usage.
     > free -m
     > vmstat
5. display number of cpu's.
     >cat /proc/cpuinfo | grep processor | wc -l
6. display shared memory parameters.
     > ipcs -m
7. display disk activity.
    > iostat
8. display all users loged into the system.
    > w
9. display how long the system is been running.
    >uptime
10. display which shell is used.
    >ps -p $$
    >echo $shell
11. list all users.
    > cat /etc/passwds
12. version of kernael.
   > cat /proc/version
13. to know swap allocated.
    > cat /proc/swaps
14. shells available in system.
    > cat /etc/shells

dbschema of database in informix

dbschema of table
dbschema -d databasename -t tablename -ss filename
example:
dbschema -d sysdbs -t employee -ss employee.sql
dbschema of database
dbschema -d database -ss filename
example:
dbschema -d sysdbs -ss database.sql
dbschema of procedure
dbschema -d sysdbs -f example -ss example.sql

UPSC exams

UPSC conducts various exams like IAS,IFS,IPS etc..............
click below to see latest  news regarding UPSC.
UPSC exams
For examination applications, altickets and new notifications access:
Latest news

KPSC exams

kpsc conducts various exams every year, please go througth the below link for te latest notifications of KPSC.
KPSC exam's notification

VTU results

click the below links to get the VTU results.
VTU results
VTU results

Civil Technical seminar PPT'S free download

Civil Technical seminar PPT'S free download
noice pollution ppt
Noice swam pollution ppt
GP Noice pollution ppt
Informix database

CS Technical seminar PPT'S free download

CS Technical seminar PPT'S free download

Database transaction management.