Wednesday, April 22, 2009

Oracle cheat sheets commands part-viii

1)delete

DELETE FROM emp WHERE empid=100;
DELETE FROM emp e WHERE e.rowid >
(SELECT MIN (esub.ROWID) FROM emp esub
WHERE e.empid=esub.empid);

2)drop cluster

DROP CLUSTER scott.emp_cluster
INCLUDING TABLES CASCADE CONSTRAINTS;

3)drop database

DROP DATABASE;

4)drop database link

DROP DATABASE LINK my_db_link;
DROP PUBLIC DATABASE LINK my_db_link;

5)drop directory

DROP DIRECTORY mydir;

6)drop function

DROP FUNCTION find_value_in_table;

7)drop index

DROP INDEX ix_my_tab;

8)drop materialized view

DROP MATERIALIZED VIEW my_mview;
DROP MATERIALIZED VIEW my_mview PRESERVE TABLE;

9)drop materialized view log

DROP MATERIALIZED VIEW LOG ON mytab;

10)drop package/drop package body

DROP PACKAGE scott.my_package
DROP PACKAGE BODY scott.my_package;