oracle database tablespace operations

oracle database tablespace operations

/*

* New tablespace statement

*/

 

create tablespace myspace 

file 'd:\oracle\data\mydata01.dbf'

size 300M

autoextend on

next 30M

extent management local;

 

create temporary tablespace mytemp

file 'd:\oracle\data\temp01.dbf'

size 200M

autoextend on

next 20M

extent management local;

 

/*

* Change the default tablespace

*/

 

alter user xq default tablespace myspace;

 

alter user xq temporary tablespace mytemp;

 

/*

* Modify tablespace

*/

 

alter tablespace xqspace add datafile 'd:\oracle\data\myspace01.dbf'; --Add datafile to tablespace

alter tablespace xqspace drop datafile 'd:\oracle\data\myspace01.dbf'; -- delete datafile for tablespace

 

 

 

/*

* View the user table space situation

*/

 

select * from user_users;

select username,default_tablespace,temporary_tablespace from user_users;

 

select * from user_tablespaces;

select * from dba_tablespaces;

select * from dba_data_files;

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326737465&siteId=291194637