透過REMAP_SCHEMA引數來實現不同使用者之間的資料遷移
REMAP_SCHEMA
Default: none
Purpose
Loads all objects from the source schema into a target schema.
Syntax and Description
REMAP_SCHEMA=source_schema:target_schema
Multiple REMAP_SCHEMA lines can be specified, but the source schema must be different for each one. However, different source schemas can map to the same target schema. The mapping may not be 100 percent complete, because there are certain schema references that Import is not capable of finding. For example, Import will not find schema references embedded within the body of definitions of types, views, procedures, and packages.
If the schema you are remapping to does not already exist, the import operation creates it, provided the dump file set contains the necessary CREATE USERmetadata for the source schema and you are importing with enough privileges. For example, the following Export commands would create the dump file sets with the necessary metadata to create a schema, because the user SYSTEM has the necessary privileges:
> expdp SYSTEM/password SCHEMAS=hr > expdp SYSTEM/password FULL=y
If your dump file set does not contain the metadata necessary to create a schema, or if you do not have privileges, then the target schema must be created before the import operation is performed. This is because the unprivileged dump files do not contain the necessary information for the import to create the schema automatically.
If the import operation does create the schema, then after the import is complete, you must assign it a valid password in order to connect to it. The SQL statement to do this, which requires privileges, is:
SQL> ALTER USER [schema_name] IDENTIFIED BY [new_pswd]
Restrictions
Unprivileged users can perform. schema remaps only if their schema is the target schema of the remap. (Privileged users can perform. unrestricted schema remaps.)
For example, SCOTT can remap his BLAKE's objects to SCOTT, but SCOTT cannot remap SCOTT's objects to BLAKE.
Example
Suppose that you execute the following Export and Import commands to remap the hr schema into the scott schema:
> expdp SYSTEM/password SCHEMAS=hr DIRECTORY=dpump_dir1 DUMPFILE=hr.dmp > impdp SYSTEM/password DIRECTORY=dpump_dir1 DUMPFILE=hr.dmp REMAP_SCHEMA=hr:scott
In this example, if user scott already exists before the import, then the Import REMAP_SCHEMA command will add objects from the hr schema into the existingscott schema. You can connect to the scott schema after the import by using the existing password (without resetting it).
If user scott does not exist before you execute the import operation, Import automatically creates it with an unusable password. This is possible because the dump file, hr.dmp, was created by SYSTEM, which has the privileges necessary to create a dump file that contains the metadata needed to create a schema. However, you cannot connect to scott on completion of the import, unless you reset the password for scott on the target database after the import completes.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25373498/viewspace-764757/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【IMPDP】實現不同使用者之間的資料遷移——REMAP_SCHEMA引數REM
- 【IMPDP】不同資料庫例項不同使用者間資料遷移複製——NETWORK_LINK引數資料庫
- 海量資料遷移之透過shell估算資料量
- 不同使用者,不同表空間遷移
- 【IMPDP】同一資料庫例項不同使用者間資料遷移複製——NETWORK_LINK引數資料庫
- 海量資料遷移之透過rowid切分大表
- 利用TRANSPORT_TABLESPACE特性在同一db下不同使用者之間遷移資料!
- 通過oracle10g exp/imp在不同表空間間遷移資料Oracle
- 不同的default tablespace資料遷移
- 使用impdp實現資料在不同使用者、不同例項之間快速複製
- 透過遷移資料庫檔案方式來實現10gR2升級11gR2資料庫
- 同/不同庫遷移資料(在同使用者及表空間)測試
- impdp的remap_schema引數REM
- 伺服器資料遷移的方法-硬體不同如何遷移資料伺服器
- 不同的default tablespace資料遷移(二)
- 透過rman全庫備份遷移資料庫資料庫
- 如實實現不同資料庫之間的 (模型) Eloquent: 關聯資料庫模型
- 【資料遷移】使用傳輸表空間遷移資料
- 資料庫遷移之資料泵實驗資料庫
- 使用 NFS 的資料遷移實驗過程NFS
- 華納雲:如何簡單快速的實現兩臺伺服器之間遷移資料?伺服器
- Mysql百萬級資料遷移,怎麼遷移?實戰過沒?MySql
- 線上資料遷移,數字化時代的必修課 —— 京東雲資料遷移實踐
- ORM實操之資料庫遷移ORM資料庫
- expdp/impdp 使用version引數跨版本資料遷移
- 直播間原始碼,透過Redis實現資料快取原始碼Redis快取
- 海量資料遷移之通過shell估算資料量
- Oracle 不同平臺間表空間遷移Oracle
- exp_imp_遷移_同使用者_不同表空間的小記
- 新老使用者看過來~最實用的 Milvus 遷移手冊來啦!
- 海量資料遷移之傳輸表空間(一)
- 使用SQL SERVER儲存過程實現歷史資料遷移SQLServer儲存過程
- 【實驗】利用可傳輸表空間技術實現資料的高效遷移
- 如何透過動態引數實現週報製作
- Duplicate+NFS資料遷移實驗過程NFS
- 資料遷移(1)——通過資料泵表結構批量遷移
- Rails--方法間透過session傳遞引數AISession
- 實現不同程式之間的通訊