Search
 
SCRIPT & CODE EXAMPLE
 

SQL

show all tables in oracle

SELECT * FROM USER_TABLES;		-- Tables from connected schema
SELECT * FROM ALL_TABLES;		-- Tables available to connected schema
	SELECT * FROM ALL_TABLES WHERE OWNER = 'SCHEMA_NAME';
	SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'TABLE_NAME';
SELECT * FROM DBA_TABLES;		-- All database Tables
Comment

show all tables in oracle

SELECT * FROM ALL_TABLES;
Comment

oracle list tablespaces

SELECT DISTINCT TABLESPACE_NAME FROM DBA_EXTENTS ORDER BY TABLESPACE_NAME;

SELECT TABLESPACE_NAME,
       sum(BYTES / 1024 / 1024) AS MB
FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME;
Comment

oracle tablespace tables list

SELECT e.OWNER, e.SEGMENT_NAME, e.TABLESPACE_NAME, sum(e.bytes) / 1048576 AS Megs
FROM dba_extents e
WHERE
  e.OWNER = 'MY_USER' AND
  e.TABLESPACE_NAME = 'MY_TABLESPACE'
GROUP BY e.OWNER, e.SEGMENT_NAME, e.TABLESPACE_NAME
ORDER BY e.TABLESPACE_NAME, e.SEGMENT_NAME;
Comment

show tablespace oracle

Select t.tablespace_name  "Tablespace",  t.status "Status",  
    ROUND(MAX(d.bytes)/1024/1024,2) "MB Size",
    ROUND((MAX(d.bytes)/1024/1024) - 
    (SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024),2) "MB Used",   
    ROUND(SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024,2) "MB Free", 
    t.pct_increase "% increase", 
    SUBSTR(d.file_name,1,80) "File"  
FROM DBA_FREE_SPACE f, DBA_DATA_FILES d,  DBA_TABLESPACES t  
WHERE t.tablespace_name = d.tablespace_name  AND 
    f.tablespace_name(+) = d.tablespace_name    
    AND f.file_id(+) = d.file_id GROUP BY t.tablespace_name,   
    d.file_name,   t.pct_increase, t.status ORDER BY 1,3 DESC
Comment

PREVIOUS NEXT
Code Example
Sql :: generate sql from specific migration ef core 
Sql :: case insensitive sql 
Sql :: how covert into int in maria db 
Sql :: sum sqlserver 
Sql :: Select with remove white spaces in sql 
Sql :: insert in sql 
Sql :: oracle lock user 
Sql :: mysql into outfile with headers 
Sql :: mysql delete from where like 
Sql :: mysql alter table add column 
Sql :: mysql insert rows to another database 
Sql :: sqrt(i) 
Sql :: not between mysql 
Sql :: mysql last friday of current month 
Sql :: alter table query in mysql 
Sql :: download sql server 2014 
Sql :: Create table with JSON column SQL Server 
Sql :: how to move a column to different spot mysql 
Sql :: mysql generate create table script 
Sql :: else if sql 
Sql :: stored procedure sql 
Sql :: sql rownum 
Sql :: SQL AVG() Function 
Sql :: oracle list chain steps 
Sql :: postgresql isnull with max 
Sql :: postgres between dates 
Sql :: mysql update from n to 100 
Sql :: creating tables in sql with python 
Sql :: mysql uuid 
Sql :: java.sql.sqlexception: the url cannot be null 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =