Tuesday, March 15, 2011

What are the process states in Unix?

As a process executes it changes state according to its circumstances. Unix processes have the following states:

Running : The process is either running or it is ready to run .

Waiting  : The process is waiting for an event or for a resource.

Stopped : The process has been stopped, usually by receiving a signal.

Zombie   : The process is dead but have not been removed from the process table.

When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to check the child's exit status.

To be able to get this information, the parent calls wait() In the interval between the child terminating and the parent calling wait() , the child is said to be a “zombie” state.
while using ps command, the child will have status  Z for Zombie.


Friday, February 18, 2011

Common Errors while performing DML Operations on a table.

Primary key  Constraints
Equivalent to a unique constraints, both sets of rules apply.
ORA-00001: unique constraint (SCOTT.PK_DEPT) violated


Foreign key Constraints
INSERT and UPDATE on the child table: the value must exist in the parent table.
ORA-02291: integrity constraint (SCOTT.FK_DEPTNO) violated - parent key not found
UPDATE and DELETE on the parent table,
there must be no dependent rows in the child table.
ORA-02292: integrity constraint (SCOTT.FK_DEPTNO) violated – child record found

Not null Constraints
INSERT and UPDATE: cannot insert without a value, or modify the value to null.
ORA-01400: cannot insert NULL into (“SCOTT”.“EMP”.“EMPNO”)

Unique Constraints
INSERT and UPDATE: cannot have any value that already exists in the table. 
Multiple nulls are permitted.
ORA-00001: unique constraint (SCOTT.PK_DEPT) violated