通過oracle10g exp/imp在不同表空間間遷移資料
寫這個文章,主要是以前對於quota on語法掌握不牢固,聖人有言,溫故而知新,故寫此文;
大體分為如下幾步:
1,利用exp對zxy使用者進行邏輯資料匯出
[oracle@capitek3 ~]$ exp userid=zxy/system file=~/export_zxy.dmp statistics=none
Export: Release 10.2.0.1.0 - Production on Wed Mar 17 08:00:20 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user ZXY
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user ZXY
About to export ZXY's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export ZXY's tables via Conventional Path ...
. . exporting table MM 0 rows exported
. . exporting table T1 2097152 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
2,執行imp,準備把第1步匯出的資料遷移到另一個表空間part1,在在此之前,請進行如下準備工作,不然imp會把資料匯入原來的表空間喲
可分下面幾小步:
a,以sysdba進入資料庫,alter user zxy quota 0 on zxy;--quota表明是對錶空間的配額許可權,on所跟的zxy為表空間(也就是要遷移使用者所對應的原來表空間);大家發現沒,把quota 設定成0,這樣zxy就對錶空間zxy沒有操作許可權了喲
3,開始進行把zxy使用者(對應表空間zxy)遷移到part 使用者(對應表空間為part),輸入如下命令
[oracle@capitek3 ~]$ imp userid=zxy/system fromuser=zxy touser=part1 file=export_zxy.dmp log=imp_sex.log --切記:imp使用者必須要用system使用者或具有dba角色的使用者
Import: Release 10.2.0.1.0 - Production on Wed Mar 17 08:05:40 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
IMP-00007: must be a DBA to import objects to another user's account
IMP-00000: Import terminated unsuccessfully
[oracle@capitek3 ~]$ imp userid=system/system fromuser=zxy touser=part1 file=export_zxy.dmp log=imp_sex.log --記得新增log選項,這樣一旦出錯,便於你分析問題
Import: Release 10.2.0.1.0 - Production on Wed Mar 17 08:06:02 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
Warning: the objects were exported by ZXY, not by you
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
. importing ZXY's objects into PART1
. . importing table "MM" 0 rows imported
. . importing table "T1" 2097152 rows imported
Import terminated successfully without warnings.
[oracle@capitek3 ~]$ sqlplus part1/system --到遷移目標使用者進行查詢工作成果
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 17 08:06:25 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
N1 TABLE
MM TABLE
T1 TABLE
SQL> select count(*) from t1;
COUNT(*)
----------
2097152
SQL>
大體分為如下幾步:
1,利用exp對zxy使用者進行邏輯資料匯出
[oracle@capitek3 ~]$ exp userid=zxy/system file=~/export_zxy.dmp statistics=none
Export: Release 10.2.0.1.0 - Production on Wed Mar 17 08:00:20 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user ZXY
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user ZXY
About to export ZXY's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export ZXY's tables via Conventional Path ...
. . exporting table MM 0 rows exported
. . exporting table T1 2097152 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
2,執行imp,準備把第1步匯出的資料遷移到另一個表空間part1,在在此之前,請進行如下準備工作,不然imp會把資料匯入原來的表空間喲
可分下面幾小步:
a,以sysdba進入資料庫,alter user zxy quota 0 on zxy;--quota表明是對錶空間的配額許可權,on所跟的zxy為表空間(也就是要遷移使用者所對應的原來表空間);大家發現沒,把quota 設定成0,這樣zxy就對錶空間zxy沒有操作許可權了喲
3,開始進行把zxy使用者(對應表空間zxy)遷移到part 使用者(對應表空間為part),輸入如下命令
[oracle@capitek3 ~]$ imp userid=zxy/system fromuser=zxy touser=part1 file=export_zxy.dmp log=imp_sex.log --切記:imp使用者必須要用system使用者或具有dba角色的使用者
Import: Release 10.2.0.1.0 - Production on Wed Mar 17 08:05:40 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
IMP-00007: must be a DBA to import objects to another user's account
IMP-00000: Import terminated unsuccessfully
[oracle@capitek3 ~]$ imp userid=system/system fromuser=zxy touser=part1 file=export_zxy.dmp log=imp_sex.log --記得新增log選項,這樣一旦出錯,便於你分析問題
Import: Release 10.2.0.1.0 - Production on Wed Mar 17 08:06:02 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
Warning: the objects were exported by ZXY, not by you
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
. importing ZXY's objects into PART1
. . importing table "MM" 0 rows imported
. . importing table "T1" 2097152 rows imported
Import terminated successfully without warnings.
[oracle@capitek3 ~]$ sqlplus part1/system --到遷移目標使用者進行查詢工作成果
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 17 08:06:25 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
N1 TABLE
MM TABLE
T1 TABLE
SQL> select count(*) from t1;
COUNT(*)
----------
2097152
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-629849/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PostgreSQL在不同的表空間移動資料檔案SQL
- 達夢資料庫系統表空間資料檔案遷移過程資料庫
- 用exp、imp遷移包含物化檢視日誌的資料
- impala 資料表在叢集間遷移方案
- 【exp/imp不同版本】Oracle不同版本的exp/imp使用注意事項Oracle
- table/index/LOBINDEX遷移表空間Index
- 用傳輸表空間跨平臺遷移資料
- MySQL 遷移表空間,備份單表MySql
- Oracle中表空間、表、索引的遷移Oracle索引
- Oracle 12cbigfile表空間物件遷移Oracle物件
- 資料遷移(1)——通過資料泵表結構批量遷移
- 【資料遷移】XTTS跨平臺傳輸表空間v4TTS
- 達夢(DM)資料庫的表空間建立和遷移維護資料庫
- mysql共享表空間擴容,收縮,遷移MySql
- 不同版本exp/imp使用注意事項
- 【資料遷移】XTTS跨平臺傳輸表空間(1.傳統方式)TTS
- oracle 表移動表空間Oracle
- Oracle表移動表空間Oracle
- [待整理]oracle10g刪除(釋放)資料檔案/表空間流程Oracle
- Oracle資料庫遷移 - 異構傳輸表空間TTS HP-UX遷移至Redhat Linux 7.7Oracle資料庫TTSRedhatLinux
- PostgreSQL:表空間-->資料庫-->表SQL資料庫
- 2.5.9 在資料庫建立期間支援大檔案表空間資料庫
- oracle資料匯出匯入(exp/imp)Oracle
- oracle建立臨時表空間和資料表空間以及刪除Oracle
- 【MOS】如何利用RMAN可傳輸表空間遷移資料庫到不同位元組序的平臺(文件 ID 1983639.1)資料庫
- 【資料遷移】XTTS跨平臺傳輸表空間v3(3.DFT方式)TTS
- 【資料遷移】XTTS跨平臺傳輸表空間v3(2.RMAN增量)TTS
- 16、表空間 建立表空間
- oracle exp和impOracle
- Oracle臨時表空間檢視、新增臨時表空間資料檔案、修改預設臨時表空間 方法!Oracle
- mysql Innodb表空間解除安裝、遷移、裝載的使用方法MySql
- 達夢資料庫表空間等空間大小查詢方法總結資料庫
- exp和imp詳解
- 表空間和資料檔案的管理
- SciPy 空間資料
- ORA-01652:無法通過128(在表空間TEMP中)擴充套件temp段套件
- 伺服器資料遷移的方法-硬體不同如何遷移資料伺服器
- 對Oracle分割槽表進行表空間遷移並處理ORA-14511問題Oracle
- 地理空間資料Geometry在MySQL中使用MySql