oracle 匯入 預留 檢視

2021-08-31 08:11:28 字數 2134 閱讀 4244

準備工作(匯出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匯入資料

oracle匯入資料 在sql plus中 1.c test.sql 2.imp 3.impdp server端 a.conn sys sys as sysdba b.creat directory dumpin idr as d dump c.grant read,write on directo...

oracle匯出,匯入

匯出,在dos下執行 1.exp username userpassword databasename 可以是資料庫也可是遠端的,如username userpassword caac135 2.enter array fetch buffer size 4096 回車 3.export file ...

oracle匯入資料

create the user create user user identified by 123456 default tablespace users temporary tablespace temp profile default password expire grant revoke ...