Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle list tables

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 TABLES_NAME = 'TABLE_NAME';
SELECT * FROM DBA_TABLES;		-- 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 :: connexion mysql 
Sql :: sql find duplicate records in two tables 
Sql :: laravel jwt 
Sql :: mysql change default collation 
Sql :: add column postgres with default value 
Sql :: oracle list grants on procedure 
Sql :: mysql local password denied 
Sql :: how to change the auto increment in existing table mysql 
Sql :: sql server case sensitive search 
Sql :: mysql shell clear screen 
Sql :: ascending order and where in sql 
Sql :: how to select distinct in mysql 
Sql :: docker create postgresql database 
Sql :: python mysql query where 
Sql :: mariadb json select 
Sql :: sql paging query 
Sql :: sql count unique values in one column 
Sql :: postgres duplicate key value violates unique constraint already exists 
Sql :: join multiple tables sql 
Sql :: query to count the number of rows in a table in sqlalchemy 
Sql :: mysql execute file 
Sql :: rename a column in sql server 
Sql :: query by column for substring sql 
Sql :: count number of entires by months sql 
Sql :: WHERE not regex in SQL 
Sql :: how to find special characters in sql 
Sql :: if mysql 
Sql :: sql having clause 
Sql :: expo sqlite 
Sql :: mysql random 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =