31 May 2010

SQL revise (part 2)

Union/Union all


The UNION operator returns results from both queries after eliminating duplications.
The UNION ALL operator returns results from both queries, including all duplications.


The INTERSECT operator returns rows that are common to both queries.
The MINUS operator returns rows in the first query that are not present in the second query.

30 May 2010

Oracle Advanced Queue

Process below describes how to organize queue
Create queue user
Check parameters job_queue_processes and aq_tm_processes (al least - 4 for each)
Create queue table in user scheme above. (Check free rooms in the tablespace)
Create queue (dbms_aqadm.create_queue). Check created queue (user_queue)

29 May 2010

English Idioms

Idioms with foot (engvid.com)
cold feet - hesitate about your decision on the edge on the event (getting married)
to get your foot in the door - make an opportunity to do something/ to get inside
to put your foot in your mouth - confusing situation where you should apologize for
shoe's on the other foot - now you're filing what I'm filing. change places in bad situation.

27 May 2010

TOAD Cyrillic alphabet

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Nls\CodePage]
"1252"="c_1251.nls"

Recover database

RECOVER (SQL Plus command) repost
Recover a Database, Tablespace, Data or Log file.

Syntax:
Full recovery:
  
   RECOVER [AUTOMATIC] [FROM 'location']
      [STANDBY] DATABASE 
         [UNTIL CANCEL] | [UNTIL TIME date] | [UNTIL CHANGE int] | [USING BACKUP CONTROLFILE]
              [TEST | ALLOW int CORRUPTION ]

   RECOVER [AUTOMATIC] [FROM 'location']
      [STANDBY] DATABASE 
         CANCEL

Grant privileges on columns

Grant privileges

grant update (column1, column2,column3, ...) on table to user_name

26 May 2010

SQL revise

INNER JOIN - find pair of rows of tables satisfied to join-predicate. When the join-predicate is satisfied, column values for each matched pair of rows of A and B are combined into a result row.
  1.  explicit
  2.  implicit
  • Explicit
select * from emp inner join dept on (emp.deptno=dept.deptno)
  • Impicit
select * from emp, dept where emp.deptno=dept.deptno
The result of both queries is the same.