oracle建數據庫,建用戶,導入dmp文件

一:創建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

發佈了15 篇原創文章 · 獲贊 12 · 訪問量 19萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章