日期:2014-05-16  浏览次数:20651 次

oracle数据库管理常用语句

1.删除用户及其用户下面的所有对象
drop user branch cascade;
2.
删除表空间及其表空间里的所有内容
drop tablespace center INCLUDING CONTENTS;

3.删除表空间同时删除外键

drop tablespace center? INCLUDING CONTENTS cascade constraints ;

4.删除表空间前已删除数据文件解决方法

SQL> shutdown abort??? // abort 中止(强制中止)
SQL> startup mount
?SQL> alter database datafile 'filename' offline drop;
?SQL> alter database open;
?SQL> drop tablesp
Bace tablespace_name including contents;

5.创建表空间,指定数据文件,初始化100M 自增加5M
create tablespace? test datafile 'C:/test.dbf' size 100m autoextend on next 5m maxsize unlimited;
6.
创建用户,指定表空间
create user test identified by pwd default tablespace test;
7.
改变用户表空间
alter user test default tablespace tablespace_name;

8.查看各表空间大小

select
?b.file_name
物理文件名,
b.tables