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
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
相关文章推荐
- oracle 20130916
- oracle 20130914
- oracle 20130913级联
- CRS-4639: Could not contact Oracle High Availability Services
- ORACLE的JDBC简单写法
- oracle 20130913plsql
- oracle 20130913
- oracle 20130912
- oracle 20130911
- 对外键的一点探究
- oracle 20130910
- ORacle截取时间字段中的时、分
- oracle中的外连接,包含另一种+号的写法
- Oracle Hint(/* ..... */)的用法
- Oracle 参数文件
- 修改统计信息改变执行计划(ORACLE)
- oracle和postgresql数据库差异对比
- ORACLE中的Number数据类型
- Oracle锁机制
- oracle查看系统存储过程