Oracle Database Worst Practices
Oracle Database Worst Practices
query = query =
‘select * ‘select *
from t from t
where x = ? where x = ‘||x||’
And y = ?’ And y = ‘||y
Prepare it Execute it
Bind x
Bind y
Execute it
Close it
Query =
“Select count(*) “ +
“ from user_pw “ +
“ where uname = ‘” + uname + “’” +
“ and pword = ‘” + pword + “’”
Select count(*)
From user_pw
Where uname = ‘tom’ or 1=1 – ‘
And pword ‘i_dont_know’ or 1=1 – ‘
Performance isn’t a concern
• It is not a problem that a large percent of my
program runtime will be spent parsing. That is ok!
SQL> set timing on
SQL> begin
2 for i in 1 .. 100000
3 loop
4 execute immediate
5 'insert into t (x,y)
6 values ( ' || i ||
7 ', ''x'' )';
8 end loop;
9 end;
10 /
• Write Once
– For each database
– They are different
• Deploy Everywhere on anything
– Deploy on specific dot releases
– Of specific databases
– On certain platforms
– (it is a support issue)
• Less Work overall
– More work overall
The Reality
• Write Once
– For each database
– They are different
• Deploy Everywhere on anything
– Deploy on specific dot releases
– Of specific databases
– On certain platforms
– (it is a support issue)
• Less Work overall
– More work overall
The Reality
• Write Once
– For each database
– They are different
• Deploy Everywhere on anything
– Deploy on specific dot releases
– Of specific databases
– On certain platforms
– (it is a support issue)
• Less Work overall
– More work overall
The Reality
• Write Once
– For each database
– They are different
• Deploy Everywhere on anything
– Deploy on specific dot releases
– Of specific databases
– On certain platforms
– (it is a support issue)
• Less Work overall
– More work overall
Probably
You Do Not Need
Configuration
Management Of Any
Sort
We probably do not need CM