oracle数据库经典SQL查询 .查看表空间的名称及大小 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; .查看表空间物理文件的名称及大小 select tablespace_name,
本文来源:huang_xw 的<Oracle数据库的状态查询> 1 状态查询 启动状态 SQL语句 结果 nomount select status from v$instance; STARTED select open_mode from v$database; ERROR at line 1: ORA-01507: database not mounted mount select status from v$instance; MOUNTED select open_mode from
参考文档:http://database.51cto.com/art/201108/288058.htm Oracle数据库日期范围查询有两种方式:to_char方式和to_date方式,接下来我们通过一个实例来介绍这一过程.我们假设要查询2011-05-02到2011-05-30之间的数据,实现方式如下: to_date方式: select * from tablename where time>= to_date('2011-05-02','yyyy-mm-dd') and time<=t
工作中很多时候都会遇到需要将两个不同的表空间甚至数据库的表进行联合查询或者建立视图的情况. 不同的表空间查询我们可以通过在将要查询的表前面加上 表空间的对应的用户名来实现,如有两个表空间分别对应两个用户,一个是sa一个是ckq: create or replace view saAndckqUsers as select * from sa.users union select * from ckq.users; 当然,这需要有足够的权限. 那么oracle数据库中如何实现不同的数据库之间的视图
查询当前用户:show user 查看当前用户下的表:select *from tab; 设置行宽: show linesize;(查看行宽) set linesize 120;(设置行宽) 设置列宽:col 列名 for a8; (设置字符串) col 列名 for 9999;(设置数字的) 查看表的结构:dese emp; 查询所有的员工信息:select * from emp; 投影:select empno,ename,sal from emp; 滤空函数:select emp