CREATE OR REPLACE PROCEDURE PROC_DROP_TABLE(T_NAME IN VARCHAR2) IS C_TYPE VARCHAR2(20); T_COUNT INT; V_COUNT INT; I_COUNT INT; S_COUNT INT;BEGIN BEGIN SELECT OBJECT_TYPE INTO C_TYPE FROM ALL_OBJECTS WHERE OBJECT_NAME =
//目前使用者為root的情況下以sysdba角色串連Oracle執行個體。# su oracle# sqlplus /nolog# conn / as sysdba //串連後基本操作sql> select username from dba_users; //查看全部使用者名稱sql> select table_name from user_tables; //查看目前使用者所有表sql> select table_name from all_tables;
Oracle Tips by Burleson ConsultingThis is an excerpt from "Oracle 10g New Features for Administrators" by Ahmed Baraka.Undo AdvisorThe Undo Advisor helps you perform the following tasks:o Set the undo retention periodo Set the size of the undo
Oracle Security Tips by Burleson ConsultingThis is an excerpt from the bestselling book "Oracle Privacy Security Auditing", a complete Oracle security reference with working Oracle security scripts. Useful Scripts for AuditingTo see what statement
1. 最好還是利用分析函數row_number() over ( partition by col1 order by col2 )比如想取出100-150條記錄,按照tname排序select tname,tabtype from ( select tname,tabtype,row_number() over ( order by tname ) rn from tab)where rn between 100 and 150;2. 直接使用rownum 虛列select
1:>=代替>2:少用*3:盡量不用having4:含有子查詢的語句中減少對錶的查詢 SELECT TAB_NAME FROM TABLES WHERE (TAB_NAME,DB_VER) = ( SELECT TAB_NAME,DB_VER FROM TAB_COLUMNS WHERE VERSION = 604)5:多使用oracle函數解決問題6:使用別名 Alias7:exists替代in、not exists替代 not in SELECT count(*)