Tag Archives: tts

RMAN Convert between different platforms (Solaris -> Linux)

https://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmxplat.htm#BRADV89983
For this, I created a tablespace in a SUN Solaris 12c environment and did an export tts.

Tablespace name: TS_TEST
Schema Objects : HR
Objects : T1, T2, T3 tables, to checked inside of PDBPROD3 after the import
TARGET : CDBPROD:PDBPROD3 
All tables have 39 rows

Export:

BANNER CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0
PL/SQL Release 12.1.0.2.0 - Production 0
CORE 12.1.0.2.0 Production 0
TNS for Solaris: Version 12.1.0.2.0 - Production 0
NLSRTL Version 12.1.0.2.0 - Production 0

SQL> SELECT PLATFORM_NAME
FROM V$TRANSPORTABLE_PLATFORM
WHERE PLATFORM_ID =
 ( SELECT PLATFORM_ID
 FROM V$DATABASE ); 2 3 4 5

PLATFORM_NAME
-----------------------------------------------------------------------------------------------------
Solaris Operating System (x86-64)

SQL> alter tablespace ts_test read only;
Tablespace altered.

PDB: PDDPOC01
oracle@vdds-racdb-01:~$ expdp hr/hr@PDDPOC01 directory=dir_tmp transport_tablespaces=ts_test

Export: Release 12.1.0.2.0 - Production on Thu Nov 30 16:09:10 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
Starting "HR"."SYS_EXPORT_TRANSPORTABLE_01": hr/********@PDDPOC01 directory=dir_tmp transport_tablespaces=ts_test
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "HR"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for HR.SYS_EXPORT_TRANSPORTABLE_01 is:

/tmp/expdat.dmp

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

Datafiles required for transportable tablespace TS_TEST:
 +DATA/DDDSRACDB0/5926684743AC6B8BE054020820FA629A/DATAFILE/ts_test.dbf

Job "HR"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at Thu Nov 30 16:10:03 2017 elapsed 0 00:00:42

ORACLE_SID = [DDDSRACD1] ? +ASM1
The Oracle base remains unchanged with value /u01/oracle
oracle@vdds-racdb-01:~$ asmcmd cp +DATA/DDDSRACDB0/5926684743AC6B8BE054020820FA629A/DATAFILE/ts_test.dbf /tmp

copying +DATA/DDDSRACDB0/5926684743AC6B8BE054020820FA629A/DATAFILE/ts_test.dbf -> /tmp/ts_test.dbf




racle@racdb01:/tmp$ ls -ltr
total 20968
drwxr----- 2 oracle oinstall 178 Nov 30 10:53 hsperfdata_oracle
drwxrwxrwx 2 root root 117 Nov 30 16:30 oracle
-rw-r----- 1 oracle oinstall 229376 Nov 30 16:36 test.dmp
-rw-r----- 1 oracle oinstall 10493952 Nov 30 16:37 ts_test.dbf
drwxr-xr-x 2 root root 302 Nov 30 16:37 hsperfdata_root

ON VM1:

-rwxr-x---. 1 oracle oinstall 229376 Nov 30 16:39 test.dmp
-rwxr-x---. 1 oracle oinstall 10493952 Nov 30 16:39 ts_test.dbf

[oracle@vm1 dba]$ pwd

/home/oracle/dba

Copy the files to an existent directory into the server or create a new directory to be used during the import:

SQL> !ls -ltr /home/oracle/dba
total 10476
-rw-r--r--. 1 oracle oinstall 137 Nov 27 16:53 afiedt.buf
drwxrwxrwx. 2 oracle oinstall 64 Nov 30 10:56 scripts
-rwxr-x---. 1 oracle oinstall 229376 Nov 30 16:39 test.dmp
-rwxr-x---. 1 oracle oinstall 10493952 Nov 30 16:39 ts_test.dbf

SQL> create or replace directory dir_dba as '/home/oracle/dba';

Directory created.

SQL> grant read,write on directory dir_dba to public;

Grant succeeded.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
 5 PDBPROD3 READ WRITE NO

Convert the datafile:

SELECT PLATFORM_NAME, ENDIAN_FORMAT
FROM V$TRANSPORTABLE_PLATFORM;

Convert to the same directory where the datafiles are placed.

rman target /

RMAN> CONVERT DATAFILE '/home/oracle/dba/ts_test.dbf'
DB_FILE_NAME_CONVERT '/home/oracle/dba', '/u02/oradata/cdbprod/pdbprod3'
FROM PLATFORM 'Solaris Operating System (x86-64)';
2> 3>

Starting conversion at target at 30-NOV-17
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
channel ORA_DISK_1: starting datafile conversion
input file name=/home/oracle/dba/ts_test.dbf
converted datafile=/u02/oradata/cdbprod/pdbprod3/ts_test.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Finished conversion at target at 30-NOV-17

Starting Control File and SPFILE Autobackup at 30-NOV-17
piece handle=/u03/fra/CDBPROD/autobackup/2017_11_30/o1_mf_s_961435712_f20dfjv3_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 30-NOV-17

[oracle@vm1 datafile]$ ls -ltr /u02/oradata/cdbprod/pdbprod3/ts_test.dbf
-rw-r-----. 1 oracle oinstall 10493952 Nov 30 17:28 /u02/oradata/cdbprod/pdbprod3/ts_test.dbf

Check the TNS entry for PDBPROD3

PDBPROD3 =
 (DESCRIPTION =
 (ADDRESS_LIST =
 (ADDRESS = (PROTOCOL = TCP)(HOST = vm1)(PORT = 1521))
 )
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = pdbprod3)
 )
 )

--> Import the datafile

impdp system/oracle@pdbprod3 dumpfile=test.dmp directory=dir_dba transport_datafiles=/u02/oradata/cdbprod/pdbprod3/ts_test.dbf

Import: Release 12.1.0.2.0 - Production on Thu Nov 30 17:34:50 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Source time zone is +02:00 and target time zone is +00:00.

Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01": system/********@pdbprod3 dumpfile=test.dmp directory=dir_dba transport_datafiles=/u02/oradata/cdbprod/pdbprod3/ts_test.dbf
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Thu Nov 30 17:35:34 2017 elapsed 0 00:00:41

--> Check the information

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
 2 PDB$SEED READ ONLY NO
 3 PDBPROD1 READ WRITE NO
 4 PDBPROD2 READ WRITE NO
 5 PDBPROD3 READ WRITE NO
 6 PDBPROD4 READ WRITE NO

SQL> alter session set container=PDBPROD3;

Session altered.

SQL> SELECT COUNT(*) FROM HR.T1;
 COUNT(*)
----------
 39

SQL> SELECT COUNT(*) FROM HR.t2;
 COUNT(*)
----------
 39

SQL> SELECT COUNT(*) FROM HR.t3;
 COUNT(*)
----------
 39
Advertisements