- 浏览: 122931 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (165)
- 数据库 (45)
- 架构 (0)
- java web前端+框架 (9)
- java web后端+框架 (56)
- Eclipse插件 (1)
- 解题思路 (2)
- Eclipse (2)
- linux (6)
- jquery (4)
- 正则 (3)
- jsp (1)
- javascript (8)
- oracle (39)
- 生活 (1)
- weblogic (5)
- tomcat (3)
- Jrebel (1)
- powerdesigner (1)
- svn (1)
- log4j (1)
- IDE (1)
- POI (2)
- jvm (2)
- ssh (1)
- http (1)
- notepad++ (2)
- 润乾 (1)
- 设计模式 (0)
- 实用类Utils (2)
- 算法 (1)
- xml (1)
- 实用类 (2)
最新评论
--oracle树查询
select * from FUNC T WHERE T.URL = 'examRoom/initExamRoomTicketList';
SELECT *
FROM FUNC
START WITH FUNC_ID = '13-02-03-01'
CONNECT BY PRIOR FUNC_ID = PARENT_ID;
SELECT *
FROM FUNC
START WITH FUNC_ID = '13-02-03-01'
CONNECT BY PRIOR PARENT_ID = FUNC_ID;
--考试信息--8a85f70342c046bd0142c06e49830000
select t.exam_id
,t.code
,t.name
,t.exam_time
,t.*
,t.rowid
from exam t
where t.code = '1403'
and t.exam_time = date '2014-03-02';
--数据库版本
select * from V$INSTANCE;
--所有对象
select T.* from SYS.ALL_OBJECTS T where T.OBJECT_NAME = 'FK_APPLY_NO_CW';
select distinct t.OBJECT_TYPE
from SYS.USER_OBJECTS T
where T.OBJECT_NAME = 'FK_APPLY_NO_CW';
--表名称
select T.*
from USER_TAB_COMMENTS T
where T.table_name like '%FUNC%'
order by T.COMMENTS;
--表注释
select T.*
from USER_TAB_COMMENTS T
where T.COMMENTS like '%考官%'
order by T.COMMENTS;
--列类型
select * from user_tab_cols t where t.DATA_TYPE = 'CLOB';
--列注释
select utc.comments
,t.*
from user_col_comments t
,user_tab_comments utc
where t.table_name = utc.table_name
and t.comments like '%地址%'
and t.table_name not like 'BIN$%';
-- 列名称
select utc.comments
,t.*
from user_col_comments t
,user_tab_comments utc
where t.table_name = utc.table_name
and lower(t.column_name) = lower('political_party')
and t.table_name not like 'BIN$%';
-- 列所属表
select utc.comments
,t.*
from user_col_comments t
,user_tab_comments utc
where t.table_name = utc.table_name
and t.table_name = 'SCORE_COM'
and t.table_name not like 'BIN$%';
--列详细
select *
from sys.dba_tab_columns t
where t.OWNER = 'EMS2'
AND T.DATA_TYPE = 'CLOB';
select t.employee_object from position t;
select * from dict_type t where t.type_name like '%对象%';
select * from dict_item t where t.type_id = '36';
select * from dict_item t where t.type_id = '37';
-- lock info
select /*+ rule */
S.USERNAME
,DECODE(L.TYPE, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', L.TYPE) LOCK_LEVEL
,O.OWNER
,O.OBJECT_NAME
,O.OBJECT_TYPE
,S.SID
,S.SERIAL#
,S.TERMINAL
,S.MACHINE
,S.PROGRAM
,S.OSUSER
from V$SESSION S
,V$LOCK L
,DBA_OBJECTS O
where L.SID = S.SID
and L.ID1 = O.OBJECT_ID(+)
and S.USERNAME = 'EMS'
and o.OBJECT_NAME <> 'ORA$BASE'
--and s.OSUSER = 'vernon.chen'
--and O.OBJECT_NAME = 'POSITION'
--and s.MACHINE = 'kaoshiapp'
order by S.USERNAME
,S.OSUSER
,s.SID;
--杀死锁
--alter system kill session '24,9';
--alter system kill session '125,26';
--29 13961
select * from dict_item t where t.type_id = 36;
----查看约束信息
select UC_1.TABLE_NAME as 从表名称
,UC_1.CONSTRAINT_NAME as 从表约束名称
,UC_1.CONSTRAINT_TYPE as 从表约束类型
,UCC_1.column_name as 从表约束列名称
,UC_2.TABLE_NAME as 主表名称
,UC_2.CONSTRAINT_NAME as 主表约束名称
,UC_2.CONSTRAINT_TYPE as 主表约束类型
,UCC_2.column_name as 主表约束列名称
from user_constraints UC_1
,user_constraints UC_2
,USER_CONS_COLUMNS UCC_1
,USER_CONS_COLUMNS UCC_2
where UC_1.R_CONSTRAINT_NAME = UC_2.CONSTRAINT_NAME
and UC_1.constraint_name = UCC_1.constraint_name
and UC_2.constraint_name = UCC_2.constraint_name
and UC_1.constraint_type = 'R' --从表约束类型
and UC_2.constraint_type = 'P' --主表约束类型
and UC_1.CONSTRAINT_NAME = 'FK_LOG_IMP__REFERENCE_LOG_IMP_';
--查看约束
select * from sys.user_constraints t where t.constraint_name like '%CW';
--查看索引
select t.* from user_indexes t where t.INDEX_NAME = 'INDEX_CRED_APPLY_NO';
select t.* from user_indexes t where t.INDEX_NAME = 'PK_CERT_IMP_LOG';
--查看用户
select *
from user_sequences t
where t.sequence_name like '%面试方式%'
order by t.sequence_name;
--查看表空间
select * from sys.user_tablespaces;
--查看数据文件
select * from sys.dba_data_files;
--删除表空间及其数据文件
--DROP /*temporary*/ TABLESPACE KSYCMS INCLUDING CONTENTS AND DATAFILES;
--oracle查看表空间使用情况
select b.file_name 物理文件名
,b.tablespace_name 表空间
,b.bytes / 1024 / 1024 大小M
,(b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 "已使用M"
,substr((b.bytes - sum(nvl(a.bytes, 0))) / (b.bytes) * 100, 1, 5) "利用率%"
from dba_free_space a
,dba_data_files b
where a.file_id = b.file_id
group by b.tablespace_name
,b.file_name
,b.bytes
order by b.tablespace_name;
--缩减表空间大小
--ALTER DATABASE TEMPFILE '/opt/oracle/oradata/gctwp101/temp02.dbf' RESIZE 3000M;
select * from FUNC T WHERE T.URL = 'examRoom/initExamRoomTicketList';
SELECT *
FROM FUNC
START WITH FUNC_ID = '13-02-03-01'
CONNECT BY PRIOR FUNC_ID = PARENT_ID;
SELECT *
FROM FUNC
START WITH FUNC_ID = '13-02-03-01'
CONNECT BY PRIOR PARENT_ID = FUNC_ID;
--考试信息--8a85f70342c046bd0142c06e49830000
select t.exam_id
,t.code
,t.name
,t.exam_time
,t.*
,t.rowid
from exam t
where t.code = '1403'
and t.exam_time = date '2014-03-02';
--数据库版本
select * from V$INSTANCE;
--所有对象
select T.* from SYS.ALL_OBJECTS T where T.OBJECT_NAME = 'FK_APPLY_NO_CW';
select distinct t.OBJECT_TYPE
from SYS.USER_OBJECTS T
where T.OBJECT_NAME = 'FK_APPLY_NO_CW';
--表名称
select T.*
from USER_TAB_COMMENTS T
where T.table_name like '%FUNC%'
order by T.COMMENTS;
--表注释
select T.*
from USER_TAB_COMMENTS T
where T.COMMENTS like '%考官%'
order by T.COMMENTS;
--列类型
select * from user_tab_cols t where t.DATA_TYPE = 'CLOB';
--列注释
select utc.comments
,t.*
from user_col_comments t
,user_tab_comments utc
where t.table_name = utc.table_name
and t.comments like '%地址%'
and t.table_name not like 'BIN$%';
-- 列名称
select utc.comments
,t.*
from user_col_comments t
,user_tab_comments utc
where t.table_name = utc.table_name
and lower(t.column_name) = lower('political_party')
and t.table_name not like 'BIN$%';
-- 列所属表
select utc.comments
,t.*
from user_col_comments t
,user_tab_comments utc
where t.table_name = utc.table_name
and t.table_name = 'SCORE_COM'
and t.table_name not like 'BIN$%';
--列详细
select *
from sys.dba_tab_columns t
where t.OWNER = 'EMS2'
AND T.DATA_TYPE = 'CLOB';
select t.employee_object from position t;
select * from dict_type t where t.type_name like '%对象%';
select * from dict_item t where t.type_id = '36';
select * from dict_item t where t.type_id = '37';
-- lock info
select /*+ rule */
S.USERNAME
,DECODE(L.TYPE, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', L.TYPE) LOCK_LEVEL
,O.OWNER
,O.OBJECT_NAME
,O.OBJECT_TYPE
,S.SID
,S.SERIAL#
,S.TERMINAL
,S.MACHINE
,S.PROGRAM
,S.OSUSER
from V$SESSION S
,V$LOCK L
,DBA_OBJECTS O
where L.SID = S.SID
and L.ID1 = O.OBJECT_ID(+)
and S.USERNAME = 'EMS'
and o.OBJECT_NAME <> 'ORA$BASE'
--and s.OSUSER = 'vernon.chen'
--and O.OBJECT_NAME = 'POSITION'
--and s.MACHINE = 'kaoshiapp'
order by S.USERNAME
,S.OSUSER
,s.SID;
--杀死锁
--alter system kill session '24,9';
--alter system kill session '125,26';
--29 13961
select * from dict_item t where t.type_id = 36;
----查看约束信息
select UC_1.TABLE_NAME as 从表名称
,UC_1.CONSTRAINT_NAME as 从表约束名称
,UC_1.CONSTRAINT_TYPE as 从表约束类型
,UCC_1.column_name as 从表约束列名称
,UC_2.TABLE_NAME as 主表名称
,UC_2.CONSTRAINT_NAME as 主表约束名称
,UC_2.CONSTRAINT_TYPE as 主表约束类型
,UCC_2.column_name as 主表约束列名称
from user_constraints UC_1
,user_constraints UC_2
,USER_CONS_COLUMNS UCC_1
,USER_CONS_COLUMNS UCC_2
where UC_1.R_CONSTRAINT_NAME = UC_2.CONSTRAINT_NAME
and UC_1.constraint_name = UCC_1.constraint_name
and UC_2.constraint_name = UCC_2.constraint_name
and UC_1.constraint_type = 'R' --从表约束类型
and UC_2.constraint_type = 'P' --主表约束类型
and UC_1.CONSTRAINT_NAME = 'FK_LOG_IMP__REFERENCE_LOG_IMP_';
--查看约束
select * from sys.user_constraints t where t.constraint_name like '%CW';
--查看索引
select t.* from user_indexes t where t.INDEX_NAME = 'INDEX_CRED_APPLY_NO';
select t.* from user_indexes t where t.INDEX_NAME = 'PK_CERT_IMP_LOG';
--查看用户
select *
from user_sequences t
where t.sequence_name like '%面试方式%'
order by t.sequence_name;
--查看表空间
select * from sys.user_tablespaces;
--查看数据文件
select * from sys.dba_data_files;
--删除表空间及其数据文件
--DROP /*temporary*/ TABLESPACE KSYCMS INCLUDING CONTENTS AND DATAFILES;
--oracle查看表空间使用情况
select b.file_name 物理文件名
,b.tablespace_name 表空间
,b.bytes / 1024 / 1024 大小M
,(b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 "已使用M"
,substr((b.bytes - sum(nvl(a.bytes, 0))) / (b.bytes) * 100, 1, 5) "利用率%"
from dba_free_space a
,dba_data_files b
where a.file_id = b.file_id
group by b.tablespace_name
,b.file_name
,b.bytes
order by b.tablespace_name;
--缩减表空间大小
--ALTER DATABASE TEMPFILE '/opt/oracle/oradata/gctwp101/temp02.dbf' RESIZE 3000M;
发表评论
-
oracle sql替换指定范围的字符串
2015-06-18 17:49 1017--oracle替换指定范围的字符串(范围4-6) selec ... -
oracle字符集修改 中文乱码
2015-03-30 15:06 903sqlplus / as sysdba;//操作系统用户认证模 ... -
转:ORACLE表空间管理维护
2015-03-27 11:25 497ORACLE表空间管理维护 2013-11-11 23:2 ... -
oracle表关联层级树查询
2015-03-20 17:27 587select level ,lpad(' ', ( ... -
转:oracle层次查询 树查询 (详细)
2015-03-20 15:03 822oracle层次查询 转自:http://www.2cto. ... -
oracle树查询(叶子、带缩进)
2015-03-17 09:46 1268select t.func_id as func_id --I ... -
ORACLE表空间管理维护
2015-01-22 11:34 402http://www.cnblogs.com/kerrycod ... -
自写函数用于替换wm_concat函数.zip
2015-01-19 16:25 1168-- wm_concat出现在oracle10g版本中,不仅是 ... -
禁用启用所有外键约束.tst
2015-01-12 11:05 547禁用所有外键约束.tst declare cursor c ... -
oracle查询生成列别名
2015-01-06 15:00 400select ',' ,col.COLUMN_NA ... -
linux下重启oracle
2015-01-05 15:44 498oracle/oracle连接ssh后 登录数据库 ... -
分页帮助类-oracle-java
2014-10-09 17:46 423/** * 分页帮助类 * * @author ver ... -
Oracle 列转行函数 Listagg()
2014-09-25 13:54 461Oracle 列转行函数 Listagg() 博客分类: O ... -
oracle删除重复记录
2014-08-22 15:49 320delete from cred_account ca1 w ... -
oracle获取过程的错误异常代码,错误,异常栈信息
2014-08-22 15:19 286得到oracle异常行号,代码,异常栈信息 Sql代码 d ... -
数据库导入导出dump.txt
2014-07-28 10:26 413数据库导入导出dump -
Oracle分组分段统计-sum+case when+group by使用实例
2014-06-13 09:30 1322实例演示: (1)查询表users中的数据。 ... -
oracle表空间管理
2014-04-24 11:15 685--查看修改ORACLE表空间 --1、查看所有表空间信息 s ... -
连接到sqlplus
2014-04-17 11:25 416root/passwd su - oracle sqlplus ... -
ORACLE查看并修改最大连接数
2014-03-26 13:52 523ORACLE查看并修改最大连接数 第一步,在cmd命令行,输入 ...
相关推荐
ORACLE主要的系统表和系统视图.pdf
NULL 博文链接:https://vernonchen163.iteye.com/blog/1963366
描述了ORACLE数据库数据字典中各类视图的功能
Oracle SQL Hand-Oracle工具,是专为Oracle数据库开发人员及操作人员精心打造的一款Oracle开发工具(客户端工具)。 Oracle SQL Hand-Oracle工具特点如下: (1) 跨平台,能运行于平台 Windows(WIN7,XP...)、Linux 、...
oracle DBA 常用系统表和系统视图
视图基于的表称为基表,Oracle的数据库对象分为五种:表,视图,序列,索引和同义词。 视图是存储在数据字典里的一条select语句。通过创建视图可以提取数据的逻辑上的集合或组合。 视图的优点: 1.对数据库的...
日常管理维护一个oracle数据库服务器的时,经常会碰到修改view,table结构的情况,而且由于oracle view,函数,存储过程等对象的相互关联的关系,经常会由于一个view,table,fun,proc的修改而导致相关的对象失效。...
1.2 ORACLE系统结构 4 1.2.2 ORACLE物理结构 4 1.2.3 系统全局区 6 1.2.4 进程 8 1.3 存储管理 9 1.3.2 逻辑结构 10 1.3.3 表(Table) 14 1.3.4 视图(View) 18 1.3.5 索引(Index) 18 1.3.6 同义词(Synonym) ...
Oracle性能视图学习大全。很不错的学习资料
数据字典视图说明: 数据字典视图一般有三套:以存表的视图为例 dba_tables[DBA所有的], all_tables[所有用户所有的],...系统表内的数据基本都是大写,如表明,列名,所有者,源代码除外。 下面的示例都已all系列为代表
数据字典视图说明: 数据字典视图一般有三套:以存表的视图为例 dba_tables[DBA所有的], all_tables[所有用户所有的],...系统表内的数据基本都是大写,如表明,列名,所有者,源代码除外。 下面的示例都已all系列为代表
《Oracle 从入门到精通》中的视频教程和PPT资料。 Oracle 11G从入门到精通视频的PPT 第1章-Oracle 11g数据库简介 认识Oracle 11g 回忆Oracle的产品版本 学习Oracle 11g的新特性 第2章-Oracle 11g的安装与测试...
Oracle SQL Handler,是专为 Oracle 数据库开发人员及操作人员精心打造的一款 Oracle 客户端工具: 超智能的SQL编辑器;超方便的表格操作(可以通过修改表格的单元格数据去更新数据 库表);多种格式的数据导出包括...
利用oracle系统表或视图猜解字段 实验环境请自行搭建
Oracle SQL Handler,是专为 Oracle 数据库开发人员及操作人员精心打造的一款 Oracle 客户端工具 : 超智能的SQL编辑器;超方便的表格操作(可以通过修改表格的单元格数据去更新数据库表 );多种格式的数据导出包括...
Oracle Database 10 g :“g”代表网格 1-6 Oracle 数据库体系结构 1-8 数据库结构 1-9 Oracle 内存结构 1-10 进程结构 1-12 Oracle 实例管理 1-13 服务器进程和数据库缓冲区高速缓存 1-14 物理数据库结构 1-...
│ oracle10g的系统视图(sys、system).txt │ oracle10g系统管理之UNDO表空间 - lvhuiqing的专栏 - CSDN博客.mht │ oracle10g系统管理之序列 - lvhuiqing的专栏 - CSDN博客.mht │ oracle10g系统管理之序列 - ...
大型数据库概论 Introduction of Large Database 实验1 Oracle9i安装配置与基本操作 H155-合集-大型数据库系统概论-实验全文共24页,当前为第1页。 【实验目的】 1. 掌握Oracle9i服务器和客户端软件的安装配置方法。...
Oracle 产品和服务1-5 Oracle Database 10g:“g”代表网格1-6 Oracle 数据库体系结构1-8 数据库结构1-9 Oracle 内存结构1-10 进程结构1-12 Oracle 实例管理1-13 服务器进程和数据库缓冲区高速缓存1-14 物理数据库...