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 :: mysql on terminal mac 
Sql :: rename table snowflake 
Sql :: Disabling foreign key checks while performing Sqlalchemy Upgrade 
Sql :: encoding UTF8 has no equivalent in encoding WIN1252 
Sql :: bigquery get current date 
Sql :: load mysql dumb 
Sql :: how to check even or odd in sql 
Sql :: mysql find foreign key references 
Sql :: oracle apex prevent initial load 
Sql :: mysql drop column 
Sql :: Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. 
Sql :: Are NULL values in a database the same as that of blank space or zero? 
Sql :: get ddl materialized view oracle 
Sql :: oracle apex who is connected 
Sql :: mysql return if it contains 
Sql :: how to see all table partition in oracle 
Sql :: postgresql difference between two dates in days 
Sql :: sql get number of days between two dates 
Sql :: postgresql CREATE EXTENSION pgcrypto 
Sql :: postgres make sql dump 
Sql :: how to add not null constraint in sql 
Sql :: mysql delete 
Sql :: sysdate in sql 
Sql :: oracle ORA-00054 origin 
Sql :: pl sql asynchronous procedure calls 
Sql :: insert multiple rows in sql workbench 
Sql :: where clause for child record apex 
Sql :: not operator in oracle 
Sql :: connecting to mysql database using python 
Sql :: foreign key sqlite3 python 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =