您的位置:首页 > 数据库 > Oracle

oracle 表空间、临时表空间、创建用户、导入数据、导出数据

2013-11-12 15:48 711 查看
-- 创建 表空间

CREATE SMALLFILE TABLESPACE tablespacename DATAFILE 'F:\oracle/tablespacename' SIZE 500M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

-- 创建 临时表空间

CREATE SMALLFILE TEMPORARY TABLESPACE temptablespacename TEMPFILE 'F:\oracle/temptablespacename' SIZE 200M AUTOEXTEND ON NEXT 25M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;

--删除表空间 drop tablespace tablespacename including contents and datafiles

--创建用户 确定用户是否存在

DROP USER username CASCADE;

-- Create the user 创建用户

create user username

  identified by "password"

  default tablespace tablespacename

  temporary tablespace temptablespacename

  profile DEFAULT;

-- Grant/Revoke role privileges 为用户赋权限

grant connect to username with admin option;

grant dba to username with admin option;

-- Grant/Revoke system privileges

grant unlimited tablespace to username  with admin option;

--导入数据

imp username/password@orcl full=y file=保存有数据库文件的完整路径.dmp ignore=y

--导出数据

exp username/password@orcl file=存放数据库文件的完整路径.dmp
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: