Oracle 脚本(适应各种业务需要)
1. 取A表的数据,更新B表字段
update m_build b
set b.district_id=(
select d.district_id
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
where exists
(select 1
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
相关文档:
select count(1) from dictionary;
select * from dba_data_files;
select count(1) from dba_objects t where t.owner='BESTTONE';
select * from dba_tablespaces t where t.tablespace_name='BESTTONE';
select count(1) from dba_tables t where t.owner='BESTTONE';
select t.table_name,t.comments from diction ......
第一部分:oracle pl/sql实例练习(1)
一、使用scott/tiger用户下的emp表和dept表完成下列练习,表的结构说明如下
emp员工表(empno员工号/ename员工姓名/job工作/mgr上级编号/hiredate受雇日期/sal薪金/comm佣金/deptno部门编号)
dept部门表(deptno部门编号/dname部门名称/loc地点)
工资 = 薪金 + 佣金
也可以通过 ......
常用SQL查询:
1、查看表空间的名称及大小
select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;
2、查看表空间物理文件的名称及大小
select t ......