One .1  BLOG Document structure chart

 

wps2FDA.tmp 

 

One .2   Preface

 

One .2.1   Guidance and notes

Technology enthusiasts , After reading this article , You can master the following skills , You can also learn something else you don't know ,~O(∩_∩)O~:

①  Implementation of transfer table space on heterogeneous platform

②  Transfer table space is based on table space read only and rman2 Ways of planting

③  Platform byte order 、 The concept of self inclusion

④ expdp/impdp Application

 

  Tips:

       ① If the article code format is wrong , It is recommended to use Sogou or 360 browser , You can also download pdf Format to view ,pdf Document download address :http://yunpan.cn/cdEQedhCs2kFz ( Extraction code :ed9b) 

       ②  This article BLOG I use gray background and pink font to show the output part of the command that needs special attention , For example, in the following example ,thread 1 The maximum archive log number for is 33,thread 2 The maximum archive log number for is 43 It's something that needs special attention ; Commands are usually marked with yellow background and red font ; Comments on the code or the output part of the code are generally in blue font .

 

  List of Archived Logs in backup set 11

  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time

  ---- ------- ---------- ------------------- ---------- ---------

  1    32      1621589    2015-05-29 11:09:52 1625242    2015-05-29 11:15:48

  1    33      1625242    2015-05-29 11:15:48 1625293    2015-05-29 11:15:58

  2    42      1613951    2015-05-29 10:41:18 1625245    2015-05-29 11:15:49

  2    43      1625245    2015-05-29 11:15:49 1625253    2015-05-29 11:15:53

 

 

 

 

[ZFXDESKDB1:root]:/>lsvg -o

T_XDESK_APP1_vg

rootvg

[ZFXDESKDB1:root]:/>

00:27:22 SQL> alter tablespace idxtbs read write;

 

 

====》2097152*512/1024/1024/1024=1G 

 

 

 

 

 

 

 

If there are any mistakes or imperfections in this article, please correct them ,ITPUB Message or QQ All can , Your criticism is the biggest motivation of my writing .

 

 

One .2.2   Links to related reference articles

Other heterogeneous platform migration article reference :

【 recommend 】 oracle  An example of transport table space for heterogeneous platform migration  http://blog.itpub.net/26736162/viewspace-1391913/

【 recommend 】 oracle  An example of transfer table space  http://blog.itpub.net/26736162/viewspace-1375260/

【 recommend 】 utilize rman To achieve linux Copy the platform database to windows Platform database  http://blog.itpub.net/26736162/viewspace-1352436/

【 recommend 】 Directly copy data files to achieve linux Copy the platform database to windows Platform database  http://blog.itpub.net/26736162/viewspace-1352243/

【TTS】 Transfer table space Linux asm -> AIX asm  http://blog.itpub.net/26736162/viewspace-1987949/

【TTS】 Transfer table space Linux asm -> AIX asm  be based on rman  http://blog.itpub.net/26736162/viewspace-1987953/

 

One .3   Related knowledge points literacy

The feature of transportable table space is mainly used for library to library table space replication , The table space to be transferred must be placed in read-only Pattern . If the production library does not allow the table space to be set to read-only mode , No problem , There are ways , adopt RMAN Backup can also create a set of transportable table spaces . To use the features of transportable table spaces ,oracle At least 8i Enterprise version or higher . If it is the same operating system platform import each other , be 8i And above can support , But if it's a different operating system platform , Database version at least 10g. The transferred table space can be dictionary management , It can also be local management . And since the oracle9i Start , Transferred table space block size Can be linked to the target database block size Different .

 

Transportable tablespace ( There's also a collection ) The biggest advantage is the speed ratio export/import or unload/load Much faster . Because transportable table space mainly copies data files to the target path , And then use export/import or Data Pump export/import And so on / Import metadata of table space object to new database .

About transportable table spaces , There's also a collection (Transportable Tablespace Sets) The creation of , They all mentioned a very important point , That is, the transferred table space must be set to  read-only. And in the actual operation , For some production databases , Set the table space to  read-only  It's a very complicated thing, not even allowed at all , With  RMAN  Of  Transportable Tablespace, All this has been avoided .RMAN  Create a set of transportable table spaces from backup , It doesn't need to access active data files , Accordingly, there is no need to set the table space to  read-only. therefore , Improved database availability , Especially for very large table spaces , Because the transferred table space can still read and write during this period , And set the table space to  read-only  Patterns can take a long time ,

Use  RMAN  Create a set of transportable table spaces , Allows you to specify a target recovery time point or  SCN, In this way, the data can be transmitted more flexibly , You don't have to copy existing table spaces completely , As long as it's in the backup , You can selectively recover data . for example , Your backup strategy is to keep it for a week , The data in the transportable table space you want to create is the data as of the last day at the end of this month , Then you can transfer any time in the first week of next month, regardless of whether there will be write operations in the production library during this period .

 

 

One .3.1   matters needing attention

 

 

 

*  Be careful :

 

① source and target database It's better to have consistent database versions , Otherwise, it will be because of db time zone Inconsistency results in the following error , But if source Greater than or equal to target It's ok if you want to , Downward compatible

ORA-39002: invalid operation

ORA-39322: Cannot use transportabletablespace with timestamp with timezone columns and different timezone version.

 

② source and target The character set at the end must be consistent , For example, an error is reported in the following case :

source by ZHS16GBK,target by AL32UTF8

ORA-39123: Data Pump transportable tablespace job aborted

ORA-29345: cannot plug a tablespace into a database using an incompatible character set

 

Tartget db char set AL32UTF8 is not a superset of ZHS16GBK.

Failed to plug in a tablespace due to incompatible

  database character set"AL32UTF8" and

  transportable set database character set "ZHS16GBK"

 

  ③ source and target database Of compatible The parameters should be consistent , but source If less than or equal to target It's ok if it's on the end , for example source by 11.2.0.4.0,target by 11.2.0.0.0 No way. ,impdp It's a mistake :

ORA-39123: Data Pump transportable tablespace job aborted

ORA-00721: changes by release 11.2.0.4.0 cannot be used by release 11.2.0.0.0

 

 

 

 

One .4   Experimental part

 

One .4.1   Introduction to the experimental environment

 

project

source db

target  db

db  type

Single instance

Single instance

db version

11.2.0.3

11.2.0.3

db  Storage

ASM

ASM

ORACLE_SID

ora11g

orclasm

db_name

ora11g

orclasm

host IP Address

22.188.139.33

192.168.59.30

OS Version and kernel edition

AIX 64 position  5.3.0.0

RHEL6.5 64 position ,2.6.32-504.16.2.el6.x86_64

OS hostname

ZFXDESKDB2

rhel6_lhr

platform_name

AIX-Based Systems (64-bit)

Linux x86 64-bit

db time zone

14

14

Character set

ZHS16GBK

ZHS16GBK

compatible

11.2.0.0.0

11.2.0.0.0

Archiving mode

Archive Mode

Archive Mode

 

 

One .4.2   The goal of the experiment

 

To implement the application table space that will be customized app1tbs,app2tbs,idxtbs From the source platform to the target platform , And in the actual work process , Need to put AIX The database on is migrated to Linux, Or will Linux The database on is migrated to AIX On , except exp/imp and expdp/impdp Outside , The most common is to transfer table space , If the whole library is migrated , What we need to do is to migrate the data of business users and business table space ,Undo、temp、system You don't have to wait , The whole process is similar to that of this document , What we need to pay attention to is the number of business objects 、 size 、 State, etc .

wps2FEB.tmp 

One .4.3   Experimental process

 

 

-------------------------------------------------------------------------------------------------------------

One .5  source End environment preparation

wps2FFC.tmp 

 

One .5.1   Create... On the source library 3 A table space applied by a user , And create tables and indexes in the corresponding table space

 

 

oracle@ZDMTRAIN2:/oracle$ echo $ORACLE_SID

ora11g

oracle@ZDMTRAIN2:/oracle$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Sat Feb 18 10:51:00 2017

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

 

SYS@ora11g> select name from v$datafile;

 

NAME

--------------------------------------------------

+DATA1/ora11g/datafile/system.379.936264859

+DATA1/ora11g/datafile/sysaux.378.936264861

+DATA1/ora11g/datafile/undotbs1.380.936264861

+DATA1/ora11g/datafile/users.382.936264861

+DATA1/ora11g/datafile/example.391.936264979

 

SYS@ora11g> create tablespace app1tbs DATAFILE '+DATA1' size 10m;

 

Tablespace created.

 

SYS@ora11g> create tablespace app2tbs DATAFILE '+DATA1' size 10m;

 

Tablespace created.

 

SYS@ora11g> CREATE TABLESPACE IDXTBS DATAFILE '+DATA1' SIZE 10M;

 

Tablespace created.

 

SYS@ora11g> create user user_app1 identified by user_app1 default tablespace app1tbs;

 

User created.

 

SYS@ora11g> create user user_app2 identified by user_app2 default tablespace app2tbs;

 

User created.

 

SYS@ora11g> grant connect , resource to user_app1;

 

Grant succeeded.

 

SYS@ora11g> grant connect , resource to user_app2;

 

Grant succeeded.

 

SYS@ora11g> create table user_app1.app1_tab tablespace app1tbs as select * from scott.emp;

 

Table created.

 

SYS@ora11g> create table user_app2.app2_tab tablespace app2tbs as select * from scott.dept;

 

Table created.

 

SYS@ora11g> create index user_app1.idx_emp_ename on user_app1.app1_tab(ename) tablespace idxtbs;

 

Index created.

 

SYS@ora11g> create index user_app2.idx_dept_dname on user_app2.app2_tab(dname) tablespace idxtbs;

 

Index created.

 

SYS@ora11g> set line 9999 pagesize 9999

SYS@ora11g> SELECT   a.NAME,  b.NAME FROM vtablespacea,vtablespacea,vdatafile b WHERE a.TS#=b.TS#  ;

 

NAME            NAME

--------------  -----------------------------------------------

SYSTEM          +DATA1/ora11g/datafile/system.379.936264859

SYSAUX          +DATA1/ora11g/datafile/sysaux.378.936264861

UNDOTBS1        +DATA1/ora11g/datafile/undotbs1.380.936264861

USERS           +DATA1/ora11g/datafile/users.382.936264861

EXAMPLE         +DATA1/ora11g/datafile/example.391.936264979

APP1TBS         +DATA1/ora11g/datafile/app1tbs.393.936269553

APP2TBS         +DATA1/ora11g/datafile/app2tbs.394.936269559

IDXTBS          +DATA1/ora11g/datafile/idxtbs.395.936269565

 

8 rows selected.

 

SYS@ora11g>

 

 

One .6   Judge the platform support and determine the byte order

If you transfer table space sets to different platforms , Make sure that this cross platform table space is supported for both source and target platforms , Also determine the byte order for each platform , If the platform has the same byte order , There is no need to transform , Otherwise, you have to do a table space set conversion , Either at the source or at the target , Use at source convert  tablespace, Use... On the target side convert datafile.

 

 

SYS@ora11g> col platform_name for a40

SYS@ora11g> select tp.platform_name, tp.endian_format

  2   from v$transportable_platform tp

  3   where tp.platform_name in ('Linux x86 64-bit', 'AIX-Based Systems (64-bit)');

 

PLATFORM_NAME                            ENDIAN_FORMAT

---------------------------------------- ----------------------------

AIX-Based Systems (64-bit)               Big

Linux x86 64-bit                         Little

 

SQL>

 

Source platform and target platform Endian_format  Different ,source intention Big,target intention Little, So you need to do table space set conversion , As mentioned above, conversion can be carried out at both the source side and the target side , Here we choose to transform on the target side .

 

One .7   Select the set of self-contained table spaces

One .7.1   Inspection

Indicates whether a full or partial dependency check is required. If TRUE, treats all IN and OUT pointers(dependencies) and captures them as violations if they are not self-contained in the transportable set.

execute sys.dbms_tts.transport_set_check('app1tbs,app2tbs,idxtbs',true);

select * from sys.transport_set_violations;

 

First try to transmit app1tbs and idxtbs this 2 Table spaces :

SYS@ora11g> execute sys.dbms_tts.transport_set_check('app1tbs,idxtbs',true);

 

PL/SQL procedure successfully completed.

 

SQL> col violations for a70

SYS@ora11g> select * from sys.transport_set_violations;

 

VIOLATIONS

----------------------------------------------------------------------

ORA-39907: Index USER_APP2.IDX_DEPT_DNAME in tablespace IDXTBS points

to table USER_APP2.APP2_TAB in tablespace APP2TBS.

 

 

SQL>

Conclusion : stay idxtbs Tablespace IDX_DEPT_DNAME The index points to user_app2.APP2_TAB surface , So here we choose app1tabs,app2tabs,idxtbs Check again as a new set of table spaces

 

 

SYS@ora11g> execute sys.dbms_tts.transport_set_check('app1tbs,app2tbs,idxtbs',true);

 

PL/SQL procedure successfully completed.

 

 

SYS@ora11g>  select * from sys.transport_set_violations;

 

no rows selected

 

SYS@ora11g>

Conclusion : At this point, the set of table spaces no longer violates the condition of self inclusion , Can be determined as a set of transportable table spaces

 

One .8   Generate a set of transportable table spaces

One .8.1   Make all the table spaces in the self-contained table space set read-only

SYS@ora11g> alter tablespace app1tbs read only;

 

Tablespace altered.

 

SYS@ora11g> alter tablespace app2tbs read only;

 

Tablespace altered.

 

SYS@ora11g> alter tablespace idxtbs read only;

 

Tablespace altered.

SYS@ora11g> select tablespace_name,status from dba_tablespaces;

 

TABLESPACE_NAME          STATUS

------------------------ ---------------------------

SYSTEM                   ONLINE

SYSAUX                   ONLINE

UNDOTBS1                 ONLINE

TEMP                     ONLINE

USERS                    ONLINE

EXAMPLE                  ONLINE

APP1TBS                  READ ONLY

APP2TBS                  READ ONLY

IDXTBS                   READ ONLY

 

9 rows selected.

 

SYS@ora11g>

 

 

 

One .8.2   Use the data pump export tool , Export the metadata of each table space to be transferred

One .8.2.1   Confirm the export directory

 

SYS@ora11g> set line 9999

SYS@ora11g> col directory_name for a28

SYS@ora11g> col directory_path for a100

SYS@ora11g> select directory_name,directory_path from dba_directories;

 

DIRECTORY_NAME               DIRECTORY_PATH

---------------------------- ----------------------------------------------------------------------------------------------------

SUBDIR                       /oracle/app/oracle/product/11.2.0/db/demo/schema/order_entry//2002/Sep

SS_OE_XMLDIR                 /oracle/app/oracle/product/11.2.0/db/demo/schema/order_entry/

LOG_FILE_DIR                 /oracle/app/oracle/product/11.2.0/db/demo/schema/log/

MEDIA_DIR                    /oracle/app/oracle/product/11.2.0/db/demo/schema/product_media/

XMLDIR                       /oracle/app/oracle/product/11.2.0/db/rdbms/xml

DATA_FILE_DIR                /oracle/app/oracle/product/11.2.0/db/demo/schema/sales_history/

DATA_PUMP_DIR                /oracle/app/oracle/admin/ora11g/dpdump/

ORACLE_OCM_CONFIG_DIR        /oracle/app/oracle/product/11.2.0/db/ccr/state

 

8 rows selected.

 

SYS@ora11g>

 

 

 

One .8.2.2   Start exporting

 

oracle@ZDMTRAIN2:/oracle$ expdp \'/ as sysdba \' dumpfile=expdat_tts_read_20160203.dmp directory=DATA_PUMP_DIR transport_tablespaces=app1tbs,app2tbs,idxtbs logfile=expdat_20160201.log

 

Export: Release 11.2.0.3.0 - Production on Sat Feb 18 11:03:07 2017

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

Starting "SYS"."SYS_EXPORT_TRANSPORTABLE_01":  "/******** AS SYSDBA" dumpfile=expdat_tts_read_20160203.dmp directory=DATA_PUMP_DIR transport_tablespaces=app1tbs,app2tbs,idxtbs logfile=expdat_20160201.log

Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK

Processing object type TRANSPORTABLE_EXPORT/TABLE

Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX

Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS

Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK

Master table "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SYS.SYS_EXPORT_TRANSPORTABLE_01 is:

  /oracle/app/oracle/admin/ora11g/dpdump/expdat_tts_read_20160203.dmp

******************************************************************************

Datafiles required for transportable tablespace APP1TBS:

  +DATA1/ora11g/datafile/app1tbs.393.936269553

Datafiles required for transportable tablespace APP2TBS:

  +DATA1/ora11g/datafile/app2tbs.394.936269559

Datafiles required for transportable tablespace IDXTBS:

  +DATA1/ora11g/datafile/idxtbs.395.936269565

Job "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 11:04:49

 

oracle@ZDMTRAIN2:/oracle$

 

 

 

see file , Use asmcmd in copy Command the data file copy To file system , You need to give permission to the directory :

root@ZDMTRAIN2:/# chmod 777 /oracle/app/oracle/admin/ora11g/dpdump

root@ZDMTRAIN2:/oracle/app/oracle/admin/ora11g/dpdump# l

total 224

-rw-r--r--    1 oracle   asmadmin       1597 Feb 18 11:04 expdat_20160201.log

-rw-r-----    1 oracle   asmadmin     110592 Feb 18 11:04 expdat_tts_read_20160203.dmp

root@ZDMTRAIN2:/oracle/app/oracle/admin/ora11g/dpdump# su - grid

grid@ZDMTRAIN2:/home/grid$ asmcmd

ASMCMD> cd +DATA1/ora11g/datafile/

ASMCMD> ls -lt

Type      Redund  Striped  Time             Sys  Name

DATAFILE  UNPROT  COARSE   FEB 18 10:00:00  Y    UNDOTBS1.380.936264861

DATAFILE  UNPROT  COARSE   FEB 18 10:00:00  Y    SYSAUX.378.936264861

DATAFILE  UNPROT  COARSE   FEB 18 10:00:00  Y    IDXTBS.395.936269565

DATAFILE  UNPROT  COARSE   FEB 18 10:00:00  Y    APP2TBS.394.936269559

DATAFILE  UNPROT  COARSE   FEB 18 10:00:00  Y    APP1TBS.393.936269553

DATAFILE  UNPROT  COARSE   FEB 18 09:00:00  Y    USERS.382.936264861

DATAFILE  UNPROT  COARSE   FEB 18 09:00:00  Y    SYSTEM.379.936264859

DATAFILE  UNPROT  COARSE   FEB 18 09:00:00  Y    EXAMPLE.391.936264979

ASMCMD> cp IDXTBS.395.936269565 /oracle/app/oracle/admin/ora11g/dpdump

copying +DATA1/ora11g/datafile/IDXTBS.395.936269565 -> /oracle/app/oracle/admin/ora11g/dpdump/IDXTBS.395.936269565

ASMCMD> cp APP2TBS.394.936269559  /oracle/app/oracle/admin/ora11g/dpdump

copying +DATA1/ora11g/datafile/APP2TBS.394.936269559 -> /oracle/app/oracle/admin/ora11g/dpdump/APP2TBS.394.936269559

ASMCMD> cp  APP1TBS.393.936269553 /oracle/app/oracle/admin/ora11g/dpdump

copying +DATA1/ora11g/datafile/APP1TBS.393.936269553 -> /oracle/app/oracle/admin/ora11g/dpdump/APP1TBS.393.936269553

ASMCMD>

 

 

 

One .9   Restore the table space in the source library to read / Write mode

 

SYS@ora11g> alter tablespace app1tbs read write;

 

Tablespace altered.

 

SYS@ora11g> alter tablespace app2tbs read write;

 

Tablespace altered.

 

SYS@ora11g> alter tablespace idxtbs read write;

 

Tablespace altered.

 

 

SYS@ora11g> col tablespace_name format a20

SYS@ora11g> select tablespace_name,status from dba_tablespaces;

 

TABLESPACE_NAME      STATUS

-------------------- ---------------------------

SYSTEM               ONLINE

SYSAUX               ONLINE

UNDOTBS1             ONLINE

TEMP                 ONLINE

USERS                ONLINE

EXAMPLE              ONLINE

APP1TBS              ONLINE

APP2TBS              ONLINE

IDXTBS               ONLINE

 

9 rows selected.

 

SYS@ora11g>

 

thus , There is no relationship between source and library .

One .10   Transfer files

Here we need to transfer the metadata file and data file to the target database

 

One .10.1   View the target library data file location and Import Directory

[oracle@rhel6 ~]$ export ORACLE_SID=orclasm

 

[oracle@rhel6_lhr dpdump]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Wednesday 2 month 3 20:17:58 2016

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

 

Connect to :

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

 

SQL> select name from v$datafile;

 

NAME

--------------------------------------------------------------------------------

+DATA/orclasm/datafile/system.256.868235071

+DATA/orclasm/datafile/sysaux.257.868235073

+DATA/orclasm/datafile/undotbs1.258.868235073

+DATA/orclasm/datafile/users.259.868235073

13 rows selected.

 

SQL> set line 9999

SQL> col directory_name for a28

SQL> col directory_path for a100

SQL> select directory_name,directory_path from dba_directories;

 

DIRECTORY_NAME   DIRECTORY_PATH

------------------------- ----------------------------------------------------------------------------------------------------

XMLDIR        /ade/b/2125410156/oracle/rdbms/xml

DATA_PUMP_DIR        /u01/app/oracle/admin/orclasm/dpdump/

ORACLE_OCM_CONFIG_DIR   /u01/app/oracle/product/11.2.0/dbhome_1/ccr/state

3 rows selected.

 

SQL>

One .10.2   utilize ftp The tool transfers meta files and data files to the target library DATA_PUMP_DIR Directory and modify permissions

wps300C.tmp 

 

 

[root@rhel6_lhr ~]# cd /u01/app/oracle/admin/orclasm/dpdump

[root@rhel6_lhr dpdump]# ll

total 30856

-rw-r--r-- 1 root root 10493952 Feb 18  2017 APP1TBS.393.936269553

-rw-r--r-- 1 root root 10493952 Feb 18  2017 APP2TBS.394.936269559

-rw-r--r-- 1 root root     1597 Feb 18  2017 expdat_20160201.log

-rw-r--r-- 1 root root   110592 Feb 18  2017 expdat_tts_read_20160203.dmp

-rw-r--r-- 1 root root 10493952 Feb 18  2017 IDXTBS.395.936269565

[root@rhel6_lhr dpdump]# chown oracle:dba *

[root@rhel6_lhr dpdump]# ll

total 30856

-rw-r--r-- 1 oracle dba 10493952 Feb 18  2017 APP1TBS.393.936269553

-rw-r--r-- 1 oracle dba 10493952 Feb 18  2017 APP2TBS.394.936269559

-rw-r--r-- 1 oracle dba     1597 Feb 18  2017 expdat_20160201.log

-rw-r--r-- 1 oracle dba   110592 Feb 18  2017 expdat_tts_read_20160203.dmp

-rw-r--r-- 1 oracle dba 10493952 Feb 18  2017 IDXTBS.395.936269565

[root@rhel6_lhr dpdump]#

 

 

 

One .11   Convert byte order

The conversion byte order can be in sorce It can also be carried out in target End of , We choose to target End execution :

 

 

[oracle@rhel6_lhr dpdump]$ rman target /

 

Recovery Manager : Release 11.2.0.3.0 - Production on Wednesday 2 month 3 20:22:52 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

Connected to target database : ORCLASM (DBID=3424884828)

 

RMAN> CONVERT DATAFILE

2> "/u01/app/oracle/admin/orclasm/dpdump/APP1TBS.393.936269553",

3> "/u01/app/oracle/admin/orclasm/dpdump/APP2TBS.394.936269559",

4> "/u01/app/oracle/admin/orclasm/dpdump/IDXTBS.395.936269565"

5> TO PLATFORM="Linux x86 64-bit"

6> FROM PLATFORM="AIX-Based Systems (64-bit)"

7> FORMAT '+DATA';

 

start-up conversion at target On 2016-02-03 20:22:54

Replace the recovery directory with the target database control file

Assigned channels : ORA_DISK_1

passageway ORA_DISK_1: SID=10 Device type =DISK

Assigned channels : ORA_DISK_2

passageway ORA_DISK_2: SID=11 Device type =DISK

passageway ORA_DISK_1: Start data file conversion

Input file name =/u01/app/oracle/admin/orclasm/dpdump/APP1TBS.393.936269553

passageway ORA_DISK_2: Start data file conversion

Input file name =/u01/app/oracle/admin/orclasm/dpdump/APP2TBS.394.936269559

Converted data file = +DATA/orclasm/datafile/app1tbs.299.902866977

passageway ORA_DISK_1: Data file conversion complete , After time : 00:00:02

passageway ORA_DISK_1: Start data file conversion

Input file name =/u01/app/oracle/admin/orclasm/dpdump/IDXTBS.395.936269565

Converted data file = +DATA/orclasm/datafile/app2tbs.300.902866977

passageway ORA_DISK_2: Data file conversion complete , After time : 00:00:01

Converted data file = +DATA/orclasm/datafile/idxtbs.301.902866979

passageway ORA_DISK_1: Data file conversion complete , After time : 00:00:03

complete conversion at target On 2016-02-03 20:23:01

 

RMAN>

 

 

One .12  target The end starts importing data

One .12.1   establish source Library 2 Users and permissions

If the user is not created, the following error will be reported :

ORA-39123: Data Pump transportable tablespace job aborted

ORA-29342: user USER_APP1 does not exist in the database

 

create user user_app1 identified by user_app1;

create user user_app2 identified by user_app2;

grant connect , resource to user_app1;

grant connect , resource to user_app2;

 

 

SYS@orclasm> create user user_app1 identified by user_app1;

 

User created.

 

SYS@orclasm> create user user_app2 identified by user_app2;

 

User created.

 

SYS@orclasm> grant connect , resource to user_app1;

 

Grant succeeded.

 

SYS@orclasm>  grant connect , resource to user_app2;

 

Grant succeeded.

 

SYS@orclasm>  exit

 

 

One .12.2   Start import

Import metadata , Notice the TRANSPORT_DATAFILES For the new file name after conversion :

 

[oracle@rhel6_lhr dpdump]$ impdp \'/ as sysdba \' DUMPFILE=expdat_tts_read_20160203.dmp DIRECTORY=DATA_PUMP_DIR TRANSPORT_DATAFILES='+DATA/orclasm/datafile/app1tbs.299.902866977','+DATA/orclasm/datafile/app2tbs.300.902866977','+DATA/orclasm/datafile/idxtbs.301.902866979' LOGFILE=impdp_tts_read_20160203.log

 

Import: Release 11.2.0.3.0 - Production on Wednesday 2 month 3 20:24:52 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

Connect to : Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

Successfully loaded / The main table is unloaded "SYS"."SYS_IMPORT_TRANSPORTABLE_01"

start-up "SYS"."SYS_IMPORT_TRANSPORTABLE_01":  "/******** AS SYSDBA" DUMPFILE=expdat_tts_read_20160203.dmp DIRECTORY=DATA_PUMP_DIR TRANSPORT_DATAFILES=+DATA/orclasm/datafile/app1tbs.299.902866977,+DATA/orclasm/datafile/app2tbs.300.902866977,+DATA/orclasm/datafile/idxtbs.301.902866979 LOGFILE=impdp_tts_read_20160203.log

Handle object types TRANSPORTABLE_EXPORT/PLUGTS_BLK

Handle object types TRANSPORTABLE_EXPORT/TABLE

Handle object types TRANSPORTABLE_EXPORT/INDEX/INDEX

Handle object types TRANSPORTABLE_EXPORT/INDEX_STATISTICS

Handle object types TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK

Homework "SYS"."SYS_IMPORT_TRANSPORTABLE_01" Has been in 20:25:20 Successfully completed

 

[oracle@rhel6_lhr dpdump]$

[oracle@rhel6 ~]$

 

One .12.3   see target End table spatial information

 

 

[oracle@rhel6_lhr dpdump]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Wednesday 2 month 3 20:27:41 2016

 

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 

 

Connect to :

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

 

SYS@orclasm >  select tablespace_name,status from dba_tablespaces;

 

TABLESPACE_NAME                STATUS

------------------------------ ---------

SYSTEM                         ONLINE

SYSAUX                         ONLINE

UNDOTBS1                       ONLINE

TEMP                           ONLINE

USERS                          ONLINE

EXAMPLE                        ONLINE

TS_LHR                         ONLINE

ENCRYPTED_TS                   ONLINE

GOLDENGATE                     ONLINE

APP1TBS                        READ ONLY

APP2TBS                        READ ONLY

IDXTBS                         READ ONLY

 

Have chosen 12 That's ok .

 

SYS@orclasm >

 

SYS@orclasm > alter tablespace APP1TBS read write;

 

The table space has changed .

 

SYS@orclasm > alter tablespace APP2TBS read write;

 

The table space has changed .

 

SYS@orclasm > alter tablespace IDXTBS read write;

 

The table space has changed .

 

SYS@orclasm > select tablespace_name,status from dba_tablespaces;

 

TABLESPACE_NAME                STATUS

------------------------------ ---------

SYSTEM                         ONLINE

SYSAUX                         ONLINE

UNDOTBS1                       ONLINE

TEMP                           ONLINE

USERS                          ONLINE

EXAMPLE                        ONLINE

TS_LHR                         ONLINE

ENCRYPTED_TS                   ONLINE

GOLDENGATE                     ONLINE

APP1TBS                        ONLINE

APP2TBS                        ONLINE

IDXTBS                         ONLINE

 

Have chosen 12 That's ok .

 

SYS@orclasm >

 

SYS@orclasm> set line 9999 pagesize 9999

SYS@orclasm> select * from scott.app1_tab;

 

     EMPNO ENAME      JOB              MGR HIREDATE              SAL       COMM     DEPTNO

---------- ---------- --------- ---------- -------------- ---------- ---------- ----------

      9000 lastwiner

      9001 lastwiner

      7369 SMITH      CLERK           7902 17-12 month -80            800                    20

      7499 ALLEN      SALESMAN        7698 20-2 month -81           1600        300         30

      7521 WARD       SALESMAN        7698 22-2 month -81           1250        500         30

      7566 JONES      MANAGER         7839 02-4 month -81           2975                    20

      7654 MARTIN     SALESMAN        7698 28-9 month -81           1250       1400         30

      7698 BLAKE      MANAGER         7839 01-5 month -81           2850                    30

      7782 CLARK      MANAGER         7839 09-6 month -81           2450                    10

      7788 SCOTT      ANALYST         7566 19-4 month -87           3000                    20

      7839 KING       PRESIDENT            17-11 month -81           5000                    10

      7844 TURNER     SALESMAN        7698 08-9 month -81           1500          0         30

      7876 ADAMS      CLERK           7788 23-5 month -87           1100                    20

      7900 JAMES      CLERK           7698 03-12 month -81            950                    30

      7902 FORD       ANALYST         7566 03-12 month -81           3000                    20

      7934 MILLER     CLERK           7782 23-1 month -82           1300                    10

 

Have chosen 16 That's ok .

 

SYS@orclasm> select * from scott.app2_tab;

 

    DEPTNO DNAME          LOC

---------- -------------- -------------

        10 ACCOUNTING     NEW YORK

        20 RESEARCH       DALLAS

        30 SALES          CHICAGO

        40 OPERATIONS     BOSTON

 

SYS@orclasm > select D.owner,D.index_name,D.table_name,D.tablespace_name from dba_indexes d WHERE d.table_name in ('APP1_TAB','APP2_TAB');

 

OWNER                          INDEX_NAME                     TABLE_NAME                     TABLESPACE_NAME

------------------------------ ------------------------------ ------------------------------ ------------------------------

USER_APP1                      IDX_EMP_ENAME                  APP1_TAB                       IDXTBS

USER_APP2                      IDX_DEPT_DNAME                 APP2_TAB                       IDXTBS

 

SYS@orclasm >

SYS@orclasm > SELECT   a.NAME,  b.NAME FROM vtablespacea,vtablespacea,vdatafile b WHERE a.TS#=b.TS#  ;

 

NAME                           NAME

------------------------------ ---------------------------------------------------------------

SYSTEM                         +DATA/orclasm/datafile/system.256.850260145

SYSAUX                         +DATA/orclasm/datafile/sysaux.257.850260145

UNDOTBS1                       +DATA/orclasm/datafile/undotbs1.258.851526539

USERS                          +DATA/orclasm/datafile/users.259.850260147

EXAMPLE                        +DATA/orclasm/datafile/example.265.850260295

APP1TBS                        +DATA/orclasm/datafile/app1tbs.299.902866977

APP2TBS                        +DATA/orclasm/datafile/app2tbs.300.902866977

TS_LHR                         +DATA/orclasm/datafile/ts_lhr.269.852632495

ENCRYPTED_TS                   +DATA/orclasm/datafile/encrypted_ts.272.854650889

GOLDENGATE                     +DATA/orclasm/datafile/goldengate.273.862829891

IDXTBS                         +DATA/orclasm/datafile/idxtbs.301.902866979

TS_LHR                         +DATA/orclasm/datafile/ts_lhr.284.869738273

USERS                          +FRA/orclasm/datafile/users.449.880121199

SYSTEM                         +FRA/orclasm/datafile/system.349.880121287

 

Have chosen 14 That's ok .

 

SYS@orclasm >

 

 

 

So far 3 The table spaces are completely composed of AIX Platform migration to Linux On the platform .

 

 

 

 

 

 

-------------------------------------------------------------------------------------------------------------

 

 

One .13   summary

 

So far, all the processing is basically finished , The process is simple , But there are many ways to deal with different scenes , We should learn to be flexible .