数据库其实就是柜子,柜中的抽屉是表空间,抽屉中的文件夹是数据文件,文件夹中的纸是表,写在纸上的信息就是数据。
一、表空间管理:
1.创建表空间:
create tablespace ams datafile 'e:\app\oracle\oradata\orcl\ams.dbf' size 200m autoextend on next 50m maxsize unlimited logging extent management local segment space management auto;
2.修改表空间名称:
1)使用oracle用户登录执行:
$sqlplus / as sysdba
2) 执行修改表空间命令如下(注:可连续对多个表空间进行重命名)
SQL> alter tablespace TEST rename to TEST1;
3.删除表空间:
drop tablespace tablespace_name including contents and datafiles;
4.查询表空间:
select name from v$tablespace;
5.扩展表空间:(未使用过)
1)增加数据文件
alter tablespace test
add dataf