select uc.table_name, uc.r_constraint_name, ucc.table_name, listagg(ucc.column_name, ',') within group (order by ucc.column_name) over (partition by uc.table_name, uc.r_constraint_name) from user_constraints uc, user_cons_columns ucc where uc.r_const…
在上篇ORACLE查看表空间对象中,我介绍了如何查询一个表空间有那些数据库对象,那么我们是否可以查看某个数据文件包含那些数据库对象呢?如下所示 SELECT E.SEGMENT_TYPE AS SEGMENT_TYPE , E.SEGMENT_NAME AS SEGMENT_NAME , F.FILE_NAME AS FILE_NAME , SUM(E.BYTES)/1024/1024 AS SE…
Oracle查看表空间及修改数据文件大小 第一步:查看所有表空间及表空间大小: select tablespace_name ,sum(bytes) / 1024 / 1024 as MB from dba_data_files group by tablespace_name; 第二步:查看所有表空间对应的数据文件: select tablespace_name,file_name from dba_data_files; 第三步:修改数据文件大小 alter database datafil…
select a.constraint_name, a.table_name, b.constraint_name from user_constraints a, user_constraints b where a.constraint_type = 'R' and b.constraint_type = 'P' and a.r_constraint_name = b.constraint_name -- P 代表主键, R 代表外键 查询某一张表的约束: select constrai…
oracle 查看锁表情况与解表 CreateTime--2018年4月27日17:24:37 Author:Marydon 1.锁表查询 --锁表查询 SELECT OBJECT_NAME AS TABLE_NAME, MACHINE, S.SID, S.SERIAL# FROM GV$LOCKED_OBJECT L, DBA_OBJECTS O, GV$SESSION S WHERE L.OBJECT_ID = O.OBJECT_ID AND L.SESSION_ID = S.SID;…