Oracle 匯入dmp檔案最安全步驟

2021-05-12 09:17:21 字數 2137 閱讀 8833

準備工作(匯出dmp檔案)

1.使用pl/sql  工具--》匯出使用者物件 ,匯出使用者所有表,檢視,儲存過程等的定義

2.使用pl/sql 工具--> 匯出表,匯出所有表的資料 這就是那個dmp檔案

儲存好匯出的sql指令碼和dmp檔案準備匯入

好了,開始匯入

1.刪除使用者

drop user test cascade;

2.刪除全部表空間

drop tablespace testdb including contents;

drop tablespace testdb_index including contents;

drop tablespace testdb_temp including contents;

3.重新建立表空間和使用者並給使用者授權

create tablespace "db_qqtb"

logging

datafile 'd:/oracle/oradata/db_qqtb01.ora' size 2000m,

'd:/oracle/oradata/db_qqtb02.ora' size 2000m,

'd:/oracle/oradata/db_qqtb03.ora' size 2000m extent management local

segment space management  auto

/create tablespace "db_qqtb_index"

logging

datafile 'd:/oracle/oradata/db_qqtb_index.ora' size 500m extent

management local segment space management  auto

/create

temporary tablespace "db_qqtb_temp" tempfile

'd:/oracle/oradata/db_qqtb_temp.ora' size 200m extent management

local uniform size 1m

/create user fzcx

identified by "fzcx"

default tablespace db_qqtb

temporary tablespace db_qqtb_temp

profile default

quota unlimited on db_qqtb

quota unlimited on db_qqtb_temp;

-- grant/revoke role privileges

grant connect to fzcx;

grant exp_full_database to fzcx;

grant imp_full_database to fzcx;

grant resource to fzcx;

-- grant/revoke system privileges

grant create procedure to fzcx;

grant create trigger to fzcx;

grant execute any procedure to fzcx;

grant grant any privilege to fzcx;

grant restricted session to fzcx;

grant select any table to fzcx;

grant unlimited tablespace to fzcx;

grant create any view to fzcx;

4.開啟sqlplus(不要使用pl/sql,sql指令碼太大),@路徑+檔名.sql 匯入表定義

這時候表的定義已經完成,但表中還沒有資料,現在可以測試一下,表是否存在

5.使用pl/sql 工具-->匯入表-->oracle匯入 選擇dmp檔案 自動啟動sqlplus

成功!!!

錯誤分析:

1.請注意資料檔案的大小是否足夠,否則會出現錯誤,建議設定的大一些,最好分割槽是ntfs格式

2.請注意匯出dmp的使用者是否是當前執行匯入的使用者 出現 使用者名稱: 要求輸入的是fromuser 表示匯出dmp的使用者名稱,必須準確

oracle 匯入 dmp檔案

建立使用者 第一步,進入dos下,輸入sqlplus nolog,登陸sqlplus 第二步,已本地管理員身份連線oracle,conn as sysdba 第三步,建立表空間 create tablespace project datafile f oracle project.dbf size ...

oracle匯入dmp檔案

昨天做了個簡單的oracle匯入dmp檔案,現將經驗總結如下 第一,客戶端如果不在伺服器所在的機器上就不具備匯入許可權。要匯入必須在伺服器端用pl sql等客戶端工具或者直接在命令列中匯入。eg imp username psw databaseninstance file d tobeimport...

dmp檔案匯入oracle

1.建立表空間供使用者使用 create tablespace crmtbs datafile d oracle oradata orcl crmtbs.dbf size 200m autoextend on next 10m maxsize unlimited 2.建立使用者並賦予許可權 crea...