expimp資料匯入總是在USERS表空間

2021-12-30 07:50:59 字數 3450 閱讀 6249

關於表空間資料遷移過程

發現exp匯出的檔案,預設來自uses表空間,一番百度後,沒有其他辦法(使用tablespace選項無效),只能使用uses表空間,但考慮到uses表空間需要的儲存量比較大,而其目前所在的位置已經不夠其儲存資料,所以需要遷移到h盤

建立使用者,表空間

create tablespace *** datafile 『h:/***/***01.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***02.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***03.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***04.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***05.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***06.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***07.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***08.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace *** add datafile 『h:/***/***09.dbf』 size 32m autoextend on next 32m maxsize unlimited;

create user *** identified by *** default tablespace ***;

grant resource, create view, create table, connect, dba to ***;

開始imp匯入

時刻注意匯入的目標表空間

中間嘗試過**users表空間的空間,但無效,還是往users裡面插入資料

revoke unlimited tablespace from taxinspect;

alter user taxinspect quota 0 on users;

alter user taxinspect quota unlimited on users;

發現exp匯出的檔案,預設來自uses表空間,一番百度後,沒有其他辦法(使用tablespace選項無效),只能使用uses表空間,但考慮到uses表空間需要的儲存量比較大,而其目前所在的位置已經不夠其儲存資料,所以需要遷移到h盤

select

b.file_name 物理檔名,

b.tablespace_name 表空間,

b.bytes/1024/1024 大小m,

(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用m,

substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率

from dba_free_space a,dba_data_files b

where a.file_id=b.file_id

group by b.tablespace_name,b.file_name,b.bytes

order by b.tablespace_name

查詢到users的表空間檔案位址為:d:\oracle\oradata\orcl\users01.dbf

先將表空間離線操作,停止oracle服務,然後將其拷貝到h盤指定的目錄下面

開啟oracle服務,將users表空間改變路徑後上線

alter tablespace users rename datafile 『d:\oracle\oradata\orcl\users01.dbf』 to 『h:\***\users01.dbf』;

alter tablespace users online;

再次檢視表空間資料檔案位址以確保表空間遷移成功。

鑑於之前建立的表空間無用了,刪除吧

drop tablespace *** including contents and datafiles cascade constraint;

將users表空間加大吧,還是上面類似語句

alter tablespace users add datafile 『h:/***/users02.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace users add datafile 『h:/***/users03.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace users add datafile 『h:/***/users04.dbf』 size 32m autoextend on next 32m maxsize unlimited;

alter tablespace users add datafile 『h:/***/users05.dbf』 size 32m autoextend on next 32m maxsize unlimited;

開始再次匯入!

imp ***@orcl file=***.dmp full=y

用語句隨時監控表空間變化

select

b.file_name 物理檔名,

b.tablespace_name 表空間,

b.bytes/1024/1024 大小m,

(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用m,

substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率

from dba_free_space a,dba_data_files b

where a.file_id=b.file_id and b.tablespace_name=』users』

group by b.tablespace_name,b.file_name,b.bytes

order by b.tablespace_name, b.file_name

為什麼你總是在抱怨

身邊有這樣一類朋友,他們總是對自己身邊的環境有各種各樣的不滿意。有時候抱怨自己的工作太機械重複沒有意思,有時候羨慕身邊的人看起來過著特別幸福的日子,還有的時候責怪自己想要去改變但卻總是沒機會開始。不知道他們有沒有想過這個問題 為什麼我總是在抱怨 其實這並不是乙個容易找到答案的問題,因為當你想要 抱怨...

總是在起頭可是能怎麼辦呢 Python資料分析

前言1 第1章準備工作5 本書主要內容5 為什麼要使用python進行資料分析6 重要的python庫7 安裝和設定10 社群和研討會16 使用本書16 致謝18 第2章引言20 來自bit.ly的1.usa.gov資料21 movielens1m資料集29 1880 2010年間全美嬰兒姓名35 ...

教你如何設定讓Excel視窗總是在最前面

今天在用excel編輯資料,想讓它總在視窗前顯示,上網搜到了解決辦法,試了一下,很有效,分享出來!在使用excel辦公時我們需要讓excel視窗總是顯示在最前面而不被別的視窗擋住,雖然excel並沒有提供這樣的功能,但可以用下面的方法 在vba中使用api函式 setwindowpos 可以讓exc...