oracle
select * from user_source
where upper(text) like upper('%하하하%')
p.loginame,
P.login_time,
P.last_batch,
P.status,
p.hostname,
P.program_name,
P.cmd,
C.client_net_address
FROM sys.sysprocesses AS P, sys.dm_exec_connections AS C
WHERE P.spid = C.session_id
select * From INFORMATION_SCHEMA.TABLES
select * From INFORMATION_SCHEMA.COLUMNS
select name,
object_id,
type,
object_definition(object_id)
from sys.all_objects
where upper(object_definition(object_id)) like upper('%하하하%');
select a.name,
b.text
from sysobjects as a
left join syscomments as b
on a.id = b.id
where a.xtype = 'P'
and b.text like '%하하하%' ;
sp_helptext procedure_name;
select text
from syscomments
where object_name(id) = 'procedure_name';
select
a.name as tbnm
,b.name as conm
,case when upper(c.name) in ('DATETIME','INT','FLOAT','REAL','IMAGE') then upper(c.name) else
upper(c.name)+
case when b.prec is not null then '('+convert(varchar,isnull(b.prec,'')) else '' end +
case when b.scale is not null then ',' else '' end +
case when b.scale is not null then convert(varchar,isnull(b.scale,0)) else '' end +
case when b.prec is not null or b.scale is not null then ')' else '' end
end as ctype
,case when b.isnullable = 1 then 'NULL' else 'NOT NULL' end nullable
,c.name as coty
,b.prec as coln1
,b.scale as scale
,a.id as tbid
,b.colid as colid
,(
select 'PK'+convert(varchar,keyno)
from sysindexkeys
where indid in (select index_id from sys.indexes where object_id=a.id and is_primary_key = 1)
and id = a.id
and colid = b.colid
) as pk_yn
,(
select TOP 1 'IX'+convert(varchar,indid)+' '+convert(varchar,keyno)
from sysindexkeys
where indid in (select index_id from sys.indexes where object_id=a.id and is_primary_key <> 1)
and id = a.id
and colid = b.colid
) as ix
,CAST(d.[value] as varchar) as comments
,ISNULL((
select definition
from sys.default_constraints
where parent_object_id = a.id
and parent_column_id = b.colid
),'') as default_value
,NULL as note
,(
select
x.row_count
from sys.dm_db_partition_stats x , sys.tables y
where x.object_id = y.object_id
and y.name = a.name
and x.index_id < 2
) as row_count
,b.name as org_conm
from sysobjects a inner join syscolumns b on a.id = b.id
inner join systypes c on b.xtype = c.xusertype
left outer join sys.extended_properties d on d.major_id = b.id
AND d.minor_id = b.colid
AND d.class = 1
AND d.name = 'MS_Description'
where 1=1
--and lower(a.name) like '%하하하%'
and lower(b.name) like '%하하하%'
order by b.colorder
'Oracle(DB관련)' 카테고리의 다른 글
oracle string util package (0) | 2018.12.28 |
---|---|
oracle audit (0) | 2018.11.22 |
Oracle Bulk SQL and Bulk Binding (bulk collect) (0) | 2018.06.12 |
Oracle table function (0) | 2018.06.12 |
Identity Columns in Oracle Database 12c (0) | 2018.05.08 |