Ⅰ oracle数据库如何查询表数据量
1、查看表空间的大小,首先我们要登录到oracle数据库,我们要使用管理员的身份登录,因为管理员的权限要相对的大一些。
Ⅱ 如何知道oracle数据库哪些表是有数据的哪些表是空的没有数据
select * from all_all_tables
这是查询Oracle中的所有的表,包括SYS用户下的,你可以根据表空间和所属用户来限制查询结果
where owenr='' and tablespacename=''
想要查出没数据的话,all_all_tables中有个num_rows字段,记录该表数据是多少行的,rows=‘0’的肯定是没数据的,
select * from all_all_tables
where num_rows='0'
and owenr='所属用户' and tablespacename='所属表空间'
即可。
Ⅲ 如何在shell脚本中判断oracle表的数据
把内部的数据作为一个变量提取出来,然后用这个变量去比对,就可以。
也可以在oracle语句中直接判断,然后输出不同结果。
比如a字段的值>1,那么你就输出1,小于1,那么就输出0,然后还是用变量接收,接收后进行分支,这样直接判断也可以。
Ⅳ 怎么看oracle数据库中的表中数据
查看那些库的话必须用dba权限登录。登陆后可以通过下面的方法来查看。
一、查看有哪些库,你的库理解不准确,应该准确来说是表空间,可以通过下面的命令来实现
SELECT Total.name "Tablespace Name",
Free_space, (total_space-Free_space) Used_space, total_space
FROM
(select tablespace_name, sum(bytes/1024/1024) Free_Space
from sys.dba_free_space
group by tablespace_name
) Free,
(select b.name, sum(bytes/1024/1024) TOTAL_SPACE
from sys.v_$datafile a, sys.v_$tablespace B
where a.ts# = b.ts#
group by b.name
) Total
WHERE Free.Tablespace_name = Total.name
二、查看有哪些表。
select table_name from dba_tables where owner='A';
Ⅳ Oracle中写procere如何判断某个表中有没有数据
create procere 过程名 is
count_data number(8);
定义临时参数;
begin
select count(*) into count_data from 表名;
if count_data > 0 then
select 字段名 into 临时参数 from 表名;
elsif count_data = 0 then
另一步逻辑;
else
dbms_output.put_line("报错");
end if;
end;