Oracle查看用户锁表信息
select p.spid,
a.serial#,
c.object_name,
b.session_id,
b.oracle_username,
b.os_user_name
from v$process p,
v$session a,
v$locked_object b,
all_objects c
where p.addr = a.paddr
and a.process = b.process
and c.object_id = b.object_id
相关文档:
Create directory让我们可以在Oracle数据库中灵活的对文件进行读写操作,极大的提高了Oracle的易用性和可扩展性。
其语法为:
CREATE [OR REPLACE] DIRECTORY directory AS 'pathname';
本案例具体创建如下:
create or replace directory exp_dir as '/tmp';
目录创建以后,就可以把读写权限授予特定用户 ......
程序包
包主体/规范名字一样
包主体/规范中的对应参数必须类型及名字一样
只能使用强类型的REF游标
创建程序包规范
create or replace package my_pack
is
procedure find_emp_proc(eno emp.empno%type);
function fin ......
ORACLE数据库对象
——同义词、序列、视图
同义词:同义词是现有对象的别名
简化SQL语句
隐藏对象的名称和所有者
提供对对象的公共访问
同义词分为私有同义词和公有同义词
私有同义词只能在其模式内访问,且不能与当前模式的对象同名。
公有同义词可被所有的数据库用户访问。
以 SYS 用 ......
有表A(字段A1,A2)和表B(字段B1,B2).
字段A2,B2上都有索引.
A,B 表联查
sql1 这个sql 非常快 2秒的样子
select * from A,B where A.A1=B.B1(+) and A2='值1'
sql2 这个sql 慢到让人无法忍受
select * from A,B where A.A1=B.B1(+) and B2='值1'
外联以后 表B上的索引不起作用了.
如果换成内联 速度很快.
sel ......
不错的资料,转过来,方便日后查看使用!!!
--监控索引是否使用
alter index &index_name monitoring usage;
alter index &index_name nomonitoring usage;
select * from v$object_usage where index_name =
&index_name;
--求数据文件的I/O分布
select
df.name,phyrds,phywrts,phyblkrd,phyblkwrt,sin ......