标签:size 导出 mit files oracle commit 空间 extent any
1.创建表空间
导出Oracle数据的指令:exp jds/jds@192.168.99.199/orcl file=C:\jds.dmp owner=jds 导入Oracle数据的指令:imp zcl/zcl@127.0.0.1:1521/orcl file=C:\jds.dmp full=y --第1步:创建临时表空间 CREATE TEMPORARY TABLESPACE User_Temp TEMPFILE ‘E:\OrclData\DataTemp\User_Temp.dbf‘ SIZE 50m AUTOEXTEND ON NEXT 50m MAXSIZE 20480m EXTENT MANAGEMENT LOCAL; --第2步:创建表空间语句(创建表空间名称:User_Data;创建位置:E:\OrclData\DataSpace\User_Data.dbf 初始大小:50m;按50M大小自动增长,最大20480M) CREATE TABLESPACE User_Data DATAFILE ‘E:\OrclData\DataSpace\User_Data.dbf‘SIZE 50m AUTOEXTEND ON NEXT 50m MAXSIZE 20480m EXTENT MANAGEMENT LOCAL; --第3步:创建表空间内的用户(创建用户名和密码 用户名:zcl 密码:zcl;默认的表空间位置:User_Data) CREATE USER zcl IDENTIFIED BY zcl DEFAULT TABLESPACE User_Data TEMPORARY TABLESPACE User_Temp; --第4步:给用户授予权限(赋予用户zcl权限:连接权限,修改权限,最高权限) GRANT CONNECT,RESOURCE,DBA TO zcl;
2.创建用户、表空间并设置权限
//dba账户登录 sqlplus 请输入用户名:dpp_data as sysdba 请输入口令:dpp_data //创建账号 create user techrpt_data identified by techrpt_data; //创建临时表空间 create temporary tablespace TECHRPT_DATA_TEMP tempfile ‘D:\ORACLE\ORADATA\ORCL\TECHRPT_DATA_TEMP.dbf‘ size 32m autoextend on next 32m maxsize 2048m extent management local; //将临时表空间分配给用户 alter user techrpt_data temporary tablespace TECHRPT_DATA_TEMP; //创建表空间 create tablespace TECHRPT_DATA logging datafile ‘D:\ORACLE\ORADATA\ORCL\TECHRPT_DATA.ora‘ size 50m autoextend on next 50m maxsize 2048m extent management local; //将表空间分配给用户 alter user techrpt_data default tablespace TECHRPT_DATA; //授权 grant dba to techrpt_data; grant connect,resource to techrpt_data; grant create session to techrpt_data; grant create any sequence to techrpt_data; grant create any table to techrpt_data; grant delete any table to techrpt_data; grant insert any table to techrpt_data; grant select any table to techrpt_data; grant update any table to techrpt_data; grant unlimited tablespace to techrpt_data; grant execute any procedure to techrpt_data; grant create any view to techrpt_data; grant select on v_$statname to techrpt_data; grant select on v_$sesstat to techrpt_data; grant select on v_$session to techrpt_data; grant select on v_$mystat to techrpt_data; //提交 commit; //退出 quit; //删除用户 drop user techrpt_data cascade; //删除表空间 drop tablespace techrpt_data including contents and datafiles; //修改密码 alter user system identified by system;
标签:size 导出 mit files oracle commit 空间 extent any
原文地址:http://www.cnblogs.com/SuperMetalMax/p/6186437.html