1. 程式人生 > >NC 創建表空間數據庫

NC 創建表空間數據庫

dir local 創建表空間 replace 導出 管理 目錄 導入數據 direct

1、首先創建表空間

CREATE SMALLFILE

TABLESPACE "NNC_DATA01"

LOGGING

DATAFILE ‘D:\NCOracle\nc633sd\NNC_DATA01.ora‘ SIZE 500M AUTOEXTEND

ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

CREATE SMALLFILE

TABLESPACE "NNC_DATA02"

LOGGING

DATAFILE ‘D:\NCOracle\nc633sd\NNC_DATA02.ora‘ SIZE 500M AUTOEXTEND

ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

CREATE SMALLFILE

TABLESPACE "NNC_DATA03"

LOGGING

DATAFILE ‘D:\NCOracle\nc633sd\NNC_DATA03.ora‘ SIZE 500M AUTOEXTEND

ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

CREATE SMALLFILE

TABLESPACE "NNC_INDEX01"

LOGGING

DATAFILE ‘D:\NCOracle\nc633sd\NNC_INDEX01.ora‘ SIZE 300M AUTOEXTEND

ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

CREATE SMALLFILE

TABLESPACE "NNC_INDEX02"

LOGGING

DATAFILE ‘D:\NCOracle\nc633sd\NNC_INDEX02.ora‘ SIZE 300M AUTOEXTEND

ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

CREATE SMALLFILE

TABLESPACE "NNC_INDEX03"

LOGGING

DATAFILE ‘D:\NCOracle\nc633sd\NNC_INDEX03.ora‘ SIZE 300M AUTOEXTEND

ON NEXT 10M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

2、創建用戶

用系統管理員賬號登陸,執行語句

CREATE 用戶名username IDENTIFIED BY 密碼

賦予權限

grant dba to 用戶名;

再執行數據泵還原目錄語句

create or replace directory BACKUP

as ‘C:\app\admin\orcl\backup‘;

要先把數據庫dmp文件放入此目錄中

4、導入數據庫

運行—CMD—>impdp [email protected] DUMPFILE=20161109.DMP remap_schema=NC633_20160415:nc633sd directory=backup

>impdp [email protected] DUMPFILE=20161109.DMP remap_schema=導出數據庫用戶:導入數據用戶 directory=backup

NC 創建表空間數據庫