1.实验环境:oracle9i+centos4.7
2.实验目的:学会添加表空间,调整表空间,查看表空间的内容(permanent,undo,temporary)
3.实验步骤:
3-1:创建userdata表空间:
create tablespace userdata datafile '/u01/oradata/wilson/userdata01.dbf' size 100m automaize management local;
3-2:创建临时表空间:
create temporary tablespace tempuser tempfile '/u01/oradata/wilson/tempdata01.dbf' size 5m;
3-3:创建UNDO表空间:
create undo tablespace undo01 datafile '/u01/oradata/wilson/undo01.dbf ' size 50m;
3-4:把mytemp改为临时的默认表空间:
alter database default temporary tablespace mytemp;
3-5:把userdata表空间改为自动增长:
alter database datafile 'userdata.dbf' AUTOEXTEND ON NEXT 20M MAXSIZE 1000M;
create database userdata datafile '/u01/oradata/userdata01.dbf' size 200M AUTOEXTENT ON NEXT 10M MAXSIZE 500M;
alter tablespace userdata add datafile '/u01/oradata/userdata02.dbf' size 20m autoextend on next 10m maxsize 100m;
alter database datafile userdata01.dbf' resize 300m;
4-1: renname表空间
1:alter tablespace userdata offline;
mv userdata01.dbf /data1/oradata/wilson/userdata01.dbf
alter tablespace userdata rename datafile
'/u01/oradata/wilson/userdata01.dbf' to '/data1/oradata/wilson/userdata01.dbf';
alter tablespace userdata online;
5-1:删除表空间:
drop tablespace userdata including contents and datafiles;
6-1:查看表空间:
dba_tablespace,dba_data_files,dba_temp_files;
v$tablespace,v$datafile,v$tempfile;
阅读(1354) | 评论(0) | 转发(0) |