日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Oracle的resouce、unlimited tablespace 及如何把数据导入不同的表空间

發布時間:2023/12/10 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Oracle的resouce、unlimited tablespace 及如何把数据导入不同的表空间 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

resouce是角色,unlimited tablespace是權限。

很多人在進行數據遷移時,希望把數據導入不同于原系統的表空間,在導入之后卻往往發現,數據被導入了原表空間。
本例舉例說明解決這個問題:
1.如果缺省的用戶具有DBA權限
那么導入時會按照原來的位置導入數據,即導入到原表空間

$?imp?bjbbs/passwd?file=bj_bbs.dmp?fromuser=jive?touser=bjbbs?grants=n

Import:?Release?
8.1.7.4.0?-?Production?on?Mon?Sep?22?11:49:41?2003

(c)?Copyright?
2000?Oracle?Corporation.??All?rights?reserved.


Connected?
to:?Oracle8i?Enterprise?Edition?Release?8.1.7.4.0?-?64bit?Production
With?the?Partitioning?option
JServer?Release?
8.1.7.4.0?-?64bit?Production

Export?
file?created?by?EXPORT:V08.01.07?via?conventional?path

Warning:?the?objects?were?exported?
by?JIVE,?not?by?you

import?done?
in?ZHS16GBK?character?set?and?ZHS16GBK?NCHAR?character?set
.?.?importing?
table????????????????"HS_ALBUMINBOX"?????????12?rows?imported
.?.?importing?
table????????????????"HS_ALBUM_INFO"?????????47?rows?imported
.?.?importing?
table???????????????????"HS_CATALOG"?????????13?rows?imported
.?.?importing?
table??????????"HS_CATALOGAUTHORITY"??????????5?rows?imported
.?.?importing?
table?????????"HS_CATEGORYAUTHORITY"??????????0?rows?imported
.
.?.?importing?
table?????????????????"JIVEUSERPROP"??????????4?rows?imported
.?.?importing?
table????????????????????"JIVEWATCH"??????????0?rows?imported
.?.?importing?
table???????????????????"PLAN_TABLE"??????????0?rows?imported
.?.?importing?
table???????????????????"TMZOLDUSER"??????????3?rows?imported
.?.?importing?
table??????????????????"TMZOLDUSER2"??????????3?rows?imported
About?
to?enable?constraints
Import?terminated?successfully?without?warnings.

查詢發現仍然導入了USER表空間

$?sqlplus?bjbbs/passwd

SQL
*Plus:?Release?8.1.7.0.0?-?Production?on?Mon?Sep?22?11:50:03?2003

(c)?Copyright?
2000?Oracle?Corporation.??All?rights?reserved.


Connected?
to:
Oracle8i?Enterprise?Edition?Release?
8.1.7.4.0?-?64bit?Production
With?the?Partitioning?option
JServer?Release?
8.1.7.4.0?-?64bit?Production

SQL
>?select?table_name,tablespace_name?from?user_tables;

TABLE_NAME?????????????????????TABLESPACE_NAME
------------------------------?------------------------------
HS_ALBUMINBOX??????????????????USERS
HS_ALBUM_INFO??????????????????USERS
HS_CATALOG?????????????????????USERS
HS_CATALOGAUTHORITY????????????USERS
HS_CATEGORYAUTHORITY???????????USERS
HS_CATEGORYINFO????????????????USERS
HS_DLF_DOWNLOG?????????????????USERS

JIVEWATCH??????????????????????USERS
PLAN_TABLE?????????????????????USERS
TMZOLDUSER?????????????????????USERS

TABLE_NAME?????????????????????TABLESPACE_NAME
------------------------------?------------------------------
TMZOLDUSER2????????????????????USERS

45?rows?selected.

2.回收用戶unlimited tablespace權限
這樣就可以導入到用戶缺省表空間
SQL>?create?user?bjbbs?identified?by?passwd
??
2??default?tablespace?bjbbs
??
3??temporary?tablespace?temp
??
4??/
SQL>?grant?connect,resource?to?bjbbs;

Grant?succeeded.

SQL
>?grant?dba?to?bjbbs;

Grant?succeeded.

SQL
>?revoke?unlimited?tablespace?from?bjbbs;

Revoke?succeeded.

SQL
>?alter?user?bjbbs?quota?0?on?users;

User?altered.

SQL
>?alter?user?bjbbs?quota?unlimited?on?bjbbs;

User?altered.

SQL
>?exit
Disconnected?
from?Oracle8i?Enterprise?Edition?Release?8.1.7.4.0?-?64bit?Production
With?the?Partitioning?option
JServer?Release?
8.1.7.4.0?-?64bit?Production
重新導入數據
$?imp?bjbbs/passwd?file=bj_bbs.dmp?fromuser=jive?touser=bjbbs?grants=n

Import:?Release?
8.1.7.4.0?-?Production?on?Mon?Sep?22?12:00:51?2003

(c)?Copyright?
2000?Oracle?Corporation.??All?rights?reserved.


Connected?
to:?Oracle8i?Enterprise?Edition?Release?8.1.7.4.0?-?64bit?Production
With?the?Partitioning?option
JServer?Release?
8.1.7.4.0?-?64bit?Production

Export?
file?created?by?EXPORT:V08.01.07?via?conventional?path

Warning:?the?objects?were?exported?
by?JIVE,?not?by?you

import?done?
in?ZHS16GBK?character?set?and?ZHS16GBK?NCHAR?character?set
.?.?importing?
table????????????????"HS_ALBUMINBOX"?????????12?rows?imported
.?.?importing?
table????????????????"HS_ALBUM_INFO"?????????47?rows?imported
.?.?importing?
table???????????????????"HS_CATALOG"?????????13?rows?imported
.?.?importing?
table??????????"HS_CATALOGAUTHORITY"??????????5?rows?imported
.?.?importing?
table?????????"HS_CATEGORYAUTHORITY"??????????0?rows?imported
.?.?importing?
table??????????????"HS_CATEGORYINFO"??????????9?rows?imported
.?.?importing?
table???????????????"HS_DLF_DOWNLOG"??????????0?rows?imported
.
.?.?importing?
table?????????????????????"JIVEUSER"????????102?rows?imported
.?.?importing?
table?????????????????"JIVEUSERPERM"?????????81?rows?imported
.?.?importing?
table?????????????????"JIVEUSERPROP"??????????4?rows?imported
.?.?importing?
table????????????????????"JIVEWATCH"??????????0?rows?imported
.?.?importing?
table???????????????????"PLAN_TABLE"??????????0?rows?imported
.?.?importing?
table???????????????????"TMZOLDUSER"??????????3?rows?imported
.?.?importing?
table??????????????????"TMZOLDUSER2"??????????3?rows?imported
About?
to?enable?constraints
Import?terminated?successfully?without?warnings.

SQL
>?select?table_name,tablespace_name?from?user_tables;

TABLE_NAME?????????????????????TABLESPACE_NAME
------------------------------?------------------------------
HS_ALBUMINBOX??????????????????BJBBS
HS_ALBUM_INFO??????????????????BJBBS
HS_CATALOG?????????????????????BJBBS
HS_CATALOGAUTHORITY????????????BJBBS
.
JIVETHREAD?????????????????????BJBBS
JIVETHREADPROP?????????????????BJBBS
JIVEUSER???????????????????????BJBBS
JIVEUSERPERM???????????????????BJBBS
JIVEUSERPROP???????????????????BJBBS
JIVEWATCH??????????????????????BJBBS
PLAN_TABLE?????????????????????BJBBS
TMZOLDUSER?????????????????????BJBBS

TABLE_NAME?????????????????????TABLESPACE_NAME
------------------------------?------------------------------
TMZOLDUSER2????????????????????BJBBS

45?rows?selected.

轉載于:https://www.cnblogs.com/killkill/archive/2008/10/21/1316135.html

總結

以上是生活随笔為你收集整理的Oracle的resouce、unlimited tablespace 及如何把数据导入不同的表空间的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。