Skip to content

Instantly share code, notes, and snippets.

@ghsyeung
Created April 30, 2012 15:11
Show Gist options
  • Save ghsyeung/2559116 to your computer and use it in GitHub Desktop.
Save ghsyeung/2559116 to your computer and use it in GitHub Desktop.
Oracle useful commands
select default_tablespace, temporary_tablespace
from dba_users
where username = 'g'
select sum(bytes) from dba_segments where owner='g'
select * from dba_segments where owner='g'
select * from dba_segments where owner='g'
select * from dba_free_space where tablespace_name = 'USERS' order by bytes desc
ALTER TABLESPACE USERS ADD DATAFILE '/oracle/product/11.1.0/oradata/ORA11G/users02.dbf' SIZE 5242880 AUTOEXTEND ON NEXT 268435456 MAXSIZE 65535M
ALTER DATABASE DATAFILE '/oracle/product/11.1.0/oradata/ORA11G/users02.dbf' RESIZE 68719443968
select tablespace_name, block_size from dba_tablespaces
select * from v$version
where banner like 'Oracle%'
select * from dba_tablespaces
select * from v$datafile
CREATE USER g IDENTIFIED BY g
GRANT CONNECT, DBA TO g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment