Oracle 创建

一.创建表空间
CREATE SMALLFILE TABLESPACE XZSP DATAFILE '/home/oracle/ora_space/xzsp.dbf'
SIZE 500M AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT
LOCAL SEGMENT SPACE MANAGEMENT AUTO;

CREATE SMALLFILE TABLESPACE XZJC DATAFILE '/home/oracle/ora_space/xzjc.dbf'
SIZE 300M AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT
LOCAL SEGMENT SPACE MANAGEMENT AUTO;



CREATE SMALLFILE TABLESPACE MIDDLE DATAFILE '/home/oracle/ora_space/middle.dbf'
SIZE 300M AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING EXTENT MANAGEMENT
LOCAL SEGMENT SPACE MANAGEMENT AUTO;




二.删除用户
drop user xzsp cascade;
drop user xzjc cascade;
drop user dbweb cascade;


三.创建用户及分权

--create user '用户名' identified by '密码'
--default tablespace '空间指向'
--grant 具体权限(dba,connect,resource) to '用户'; 权限分配
 

create user xzsp identified by xzsp
default tablespace xzsp
temporary tablespace temp;
grant dba,connect to xzsp;

create user xzjc identified by xzjc
default tablespace xzjc
temporary tablespace temp;
grant dba,connect to xzjc;

create user middle identified by middle
default tablespace middle
temporary tablespace temp;
grant dba,connect to middle;

create user userczj identified by userczj
default tablespace middle
temporary tablespace temp;
grant resource,connect to userczj;

create user userwz identified by userwz
default tablespace middle
temporary tablespace temp;
grant resource,connect to userwz;


四.导入数据库
imp system/oracle@xaorcl file=/home/bao/orcl_20100331.dmp log=/home/bao/orcl_20100331.log fromuser=\(xzsp,xzjc,middle\) touser=\(xzsp,xzjc,middle\) ignore=y;

  imp log=plsimp.log file=E:\dbuserforfs.DMP
userid=fsuser/fsuser@orcle_11 fromuser=fsuser touser=fsuser buffer=30720 commit=no grants=yes ignore=yes indexes=yes rows=yes show=no constraints=yes

你可能感兴趣的:(oracle)