易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle 常用性能查询SQL分享

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 dictionary  t where t.table_name like 'V$%';
select * from dba_constraints;
select * from dba_cons_columns;
select * from dba_tablespaces t where t.tablespace_name='SIM002';
CREATE TABLESPACE SS DATAFILE 'D:\ORACLE\ORADATA\BSTO\SS.DBF' SIZE 1M;
SELECT T.tablespace_name, T.status from DBA_TABLESPACES T;
SELECT T.TABLESPACE_NAME,T.FILE_NAME from DBA_DATA_FILES T;
ALTER TABLESPACE SIM002 OFFLINE;
ALTER TABLESPACE SIM002 ONLINE;
SELECT T.os_username,
       T.username,
       T.terminal,
       DECODE(T.returncode,
              '0',
              'Connected',
              '1005',
              'failedNull',
              '1017',
              'failed'),
       to_char(t.timestamp, 'dd-mon-yy hh24:mi:ss'),
       to_char(t.logoff_time, 'dd-mon-yy hh24:mi:ss')
  from DBA_AUDIT_SESSION T;--尝试登陆审计
select t.action,t.name  from audit_actions t;
select * from dba_audit_object;
select * from v$sesstat;
select a.sid,a.value "total cpu time" from v$sesstat a ,v$statname b
where a.STATISTIC#=b.STATISTIC# and b.NAME='cpu used by this session'
order by a.sid;--会话级服务时间值
select sum(time_waited) &quo


相关文档:

Oracle多行记录合并/连接/聚合字符串的几种方法

什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......

玩转Oracle(5)

||-------  数据库管理  -------||
//显示初始化参数
show parameter;
//数据库表的逻辑备份与恢复
//导出
1.导出表
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.导出其他方案的表,首先要确认自己是sysdba身份
exp userid=system@919959ORCL tables=(scott.emp) file=d:\e1.d ......

玩转Oracle(6)

||-------  维护数据完整性  -------||
【约束】
//约束
not null //非空
unique  //唯一 不能重复,但可以为空
primary key //主键
foreign key //外键
check  //满足条件
//商店售货系统表设计案例(1)
//goods 商品表
goodsid   ......

玩转Oracle(7)

||-------  pl/sql 基础 -------||
pl/procedural language 过程语言
//创建表
SQL> create table mytest(
  2  name varchar2(30),
  3  pwd varchar2(30));
//创建过程
create procedure sp_pro1 is
create or replace procedure sp_pro1 is --如果存在即 ......

SQL server2005中用pivot实现行列转换

 --> --> (Roy)生成测试数据
if not object_id('Class') is null
drop table Class
Go
Create table Class([Student] nvarchar(2),[Course] nvarchar(2),[Score] int)
Insert Class
select N'张三',N'语文',78 union all
select N'张三',N'数学',87 union all
select N'张三',N'英语',82 union all
sel ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号