Oracle创建表空间及用户

软件工程师有时候也必须是数据库管理员,这不,不任务下来了,创建数据库。

--创建临时表空间

CREATE TEMPORARY TABLESPACE test_temp
TEMPFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\test_temp.dbf'
SIZE 256M
AUTOEXTEND ON
NEXT 256M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;

--创建用户表空间

CREATE TABLESPACE test_data
LOGGING
DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEST_DATA01.DBF'
SIZE 512M
AUTOEXTEND ON
NEXT 512M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;

--创建用户并指定表空间

-- Create the user
create user TEST
  identified by test
  default tablespace TEST_DATA
  temporary tablespace TEST_TEMP
  profile DEFAULT
  quota unlimited on TEST_DATA
  quota 20m on users;
-- Grant/Revoke role privileges
grant connect to TEST;
grant dba to TEST;
grant resource to TEST;
-- Grant/Revoke system privileges
grant select any dictionary to TEST;
grant select any table to TEST;
grant unlimited tablespace to TEST;


--导入数据


--仅作为本人工作记录
impdp test/test version=10.2 schemas=RITA_10G dumpfile=R416639_RITA_1.0.1_10G.dmp logfile=test.imp.log REMAP_SCHEMA=RITA_10G:test remap_tablespace=RITA:TEST_DATA

你可能感兴趣的:(oracle,工作)