ORACLE 去除重复记录
delete from tbl_talbe
where (col1,col2,col3) in
(select col1,col2,col3
from tbl_table
group by col1,col2,col3
having count(*)>1)
and rowid not in
(
select max(rowid)
from tbl_table
group by col1,col2,col3
having count(*) >1
)
相关文档:
在/etc/rc.d/init.d/ 创建oracle10g文件
touch oracle10g
chmod a+x oracle10g
[root@test~]# vi /etc/rc.d/init.d/oracle10g
#!/bin/bash
#chkconfig:345 51 49
#description:starts the oracle database deamons
#
ORACLE_HOME=/oracle/product/10.2.0/db_1
ORACLE_OWNER=oracle
case "$1" in
start)
echo ......
.Frm644 { display:none; }
1。已经检验的语句和已在共享池中的语句之间要完全一样
2。变量名称尽量一致
3。合理使用外联接
4。少
用多层嵌套
5。多用并发
语句的优化步骤一般有:
1。调整sga区,使得sga区的是用最优。
2。sql语句本身的优化,工具有explain,sql trace ......
1)从使用上来说,oci必须在客户机上安装oracle客户端或才能连接,而thin就不需要,因此从使用上来讲thin还是更加方便,这也是thin比较常见的原因。
2)原理上来看,thin是纯java实现tcp/ip的c/s通讯;而oci方式,客户端通过native java method调用c library访问服务端,而这个c library就是oci(oracle called interface ......
Create [or replace] trigger [模式.]触发器名
Before| after |instead of insert|delete|(update of 列名)
{insert|delete|(update of 列名) }
On 表名|视图|模式名|数据库名
[for each row]
When 条件
PL/SQL块
说明:
......
1、su – oracle 不是必需,适合于没有DBA密码时使用,可以不用密码来进入sqlplus界面。
2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus system/manager@ora9i;
3、SQL>connect / as sysdba ;(as sysoper)或
connect internal/oracle AS SYSDBA ;(scott/tiger)
conn sys/change_on_install as sysd ......