oracle 创建表空间,修改表空间 ...
--创建临时表空间
create temporary tablespace oldlma_temp
tempfile 'e:\oracle\product\10.2.0\oradata\orcl\oldlma_temp.dbf'
size 200m
autoextend on
next 50m maxsize 20480m
extent management local;
--创建数据表空间
create tablespace oldlma
logging
datafile 'e:\oracle\product\10.2.0\oradata\orcl\oldlma.dbf'
size 200m
autoextend on
next 50m maxsize 20480m
extent management local;
删除表空间和临时空间 包括数据文件
drop tablespace testoa including contents and datafiles;
drop tablespace test_temp including contents and datafiles;
但如果已经把表空间删除了,数据文件没有删除,则可以直接在服务器上物理删除数据文件
alter database
datafile 'D:\oracle tablespace\test.dbf'
autoextend on next 50m maxsize 10240m;
删除表空间
drop tablespace test
including contents and datafiles cascade constraints
including contents:指删除表空间中的segments;
including contents and datafiles :指删除segments和datafiles;
cascade constraints:删除所有与该空间相关的完整性约束条件。
如果你没有通过drop 表空间而是直接从硬盘中删除dbf 文件这样再次登陆的时候就会报
oracle ora-01033:oracle initialization or shutdown in progress
如果你遇到这样的问题你可以访问如下网站
你严格按照这个方法做就可以了。
http://281107072.iteye.com/blog/627359
//创建用户并指定表空间
create user szjx identified by szjx
default tablespace test
temporary tablespace test_temp;
//给用户授予权限
grant connect,dba,resource to szjx;
创建用户,设置DBA角色
CREATE USER MARTIN
IDENTIFIED BY martinpwd
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP;
例如:
--创建新用户
CREATE USER jack
IDENTIFIED BY "123"
DEFAULT TABLESPACE "USERS"
TEMPORARY TABLESPACE "TEMP";
grant connect to jack ;
grant dba to jack ;
grant sysdba to jack ;