oracle建数据库,建用户,导入dmp文件

时间:2022-05-05 02:17:48

一:创建ORACLE数据库EAST1

1、  安装好ORACLE10g服务端。

2、  使用ORAHOME目录下的"Configurationand Migration Tools"下的"Database Configuration Assistant"工具

3、  选择"创建数据库"

4、  选择数据库模板

5、  Oracle数据库实例名

6、  设置管理员密码为manager

7、  创建数据库east1

8、  点击退出,完成oracle数据库的创建。


二、导入数据

 1、连接数据库

--连接数据库

conn sys/manager@east1 as sysdba

2、执行以下sql脚本,创建表空间、创建用户。

--创建业务库临时表空间

create temporary tablespace temp01tempfile 'D:\app\oracle\product\10.2.0\oradata\east1\dat\tsp_temp01.dbf' SIZE3G extent management local;

 

--创建业务库STAGE层表空间

create tablespace tsp_east LOGGINGDATAFILE 'D:\app\oracle\product\10.2.0\oradata\east1\dat\east_data01.dbf' SIZE3G EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

    

create tablespace MISDATA LOGGINGDATAFILE 'D:\app\oracle\product\10.2.0\oradata\east1\dat\east_data02.dbf' SIZE3G EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

create tablespace MISINDEX LOGGINGDATAFILE 'D:\app\oracle\product\10.2.0\oradata\east1\dat\east_data03.dbf' SIZE2G EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

create user MIS identified by MISdefault tablespace MISDATA temporary tablespace temp01;

grant connect,resource,unlimited tablespace,selectany table to MIS;

alter user MIS quota unlimited onMISINDEX;

alter user MIS quota unlimited onMISDATA;

 

--管理用户

create user dssadm identified bydssadm default tablespace tsp_east temporary tablespace temp01;

grant connect,resource to dssadm;

--每次下发需申请该用户dba权限

 

--报表查询用户

create user cxwh identified by cxwhdefault tablespace tsp_east temporary tablespace temp01;

grant connect,select any table tocxwh;

 

--应用用户

create user appuser identified byappuser default tablespace tsp_east temporary tablespace temp01;

grant connect,resource,unlimitedtablespace,select any table to appuser;

 

--etl用户

create user etluser identified byetluser default tablespace tsp_east temporary tablespace temp01;

grant execute any procedure,executeany type,global query rewrite,resumable,drop any table,select anysequence,select any transaction,select anydictionary,connect,resource,unlimited tablespace to etluser;

--jobuser用户

create user jobuser identified byjobuser default tablespace tsp_east temporary tablespace temp01;

grant connect,resource,execute anyprocedure,select any table,unlimited tablespace ,drop any table,alter any indexto jobuser;

 

--备份用户

create user bakuser identified bybakuser default tablespace tsp_east temporary tablespace temp01;

grant sysdba to bakuser;

 

--alter database datafile'/oradata/cfpdss/dat/system01.dbf' resize 1G;

--alter database datafile'/oradata/cfpdss/dat/sysaux01.dbf' resize 1G;

--alter database datafile'/oradata/cfpdss/dat/undotbs01.dbf' resize 2G;

alter database default temporarytablespace temp01;

alter user appuser quota unlimitedon tsp_east;

alter user jobuser quota unlimitedon tsp_east;

alter user etluser quota unlimitedon tsp_east;

 

3、导入dmp数据。

--导入数据,其中E:\east.dmpdmp文件路径

  imp appuser/appuser@east1 file=E:\east.dmp FULL=y