Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Transportable Tablespace

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

/* THE SYS USER TABLE IS NOT TRANSPORTABLE FROM ONE PLATFORM TO ANOTHER PLATFORM

*/
SQL> select tablespace_name,autoextensible
2 from dba_data_files;
TABLESPACE_NAME AUT
------------------------------ ---
USERS YES
SYSAUX YES
UNDOTBS1 YES
SYSTEM YES
SQL>
SQL> create tablespace tbs
2 datafile '/u01/app/oracle/oradata/orcl/tbs01.dbf'
3 size 5m
autoextend on;
Tablespace created.
SQL> select tablespace_name,autoextensible
2 from dba_data_files;
TABLESPACE_NAME AUT
------------------------------ ---
USERS YES
SYSAUX YES
UNDOTBS1 YES
SYSTEM YES
TBS YES
SQL>
SQL> create table scott.test
2 tablespace tbs
3 as select * from scott.emp;
Table created.
SQL> alter tablespace tbs read only;
Tablespace altered.
SQL> exec dbms_tts.transport_set_check('tbs',true);
PL/SQL procedure successfully completed.
SQL> select * from transport_set_violations;
no rows selected
SQL> select * from v$transportable_platform;
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
----------- -------------------- --------------------
1 Solaris[tm] OE (32-b Big
it)
2 Solaris[tm] OE (64-b Big
it)
7 Microsoft Windows IA Little
(32-bit)
10 Linux IA (32-bit) Little
6 AIX-Based Systems (6 Big
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
----------- -------------------- --------------------
4-bit)
3 HP-UX (64-bit) Big
5 HP Tru64 UNIX Little
4 HP-UX IA (64-bit) Big
11 Linux IA (64-bit) Little
15 HP Open VMS Little
8 Microsoft Windows IA Little
(64-bit)
9 IBM zSeries Based Li Big
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
----------- -------------------- --------------------
nux
13 Linux 64-bit for AMD Little
16 Apple Mac OS Big
12 Microsoft Windows 64 Little
-bit for AMD
17 Solaris Operating Sy Little
stem (x86)
18 IBM Power Based Linu Big
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
----------- -------------------- --------------------
x
17 rows selected.
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 2
Next log sequence to archive 4
Current log sequence 4
SQL>
SQL> host
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Oct 17 10:34:01 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1292065057)
RMAN> convert tablespace tbs to platform='Microsoft Windows IA (32-bit)' db_file
_name_convert=
'/u01/app/oracle/oradata/orcl/tbs01.dbf','/u02/tbs01.dbf';
Starting backup at 17-OCT-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=153 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00005 name=/u01/app/oracle/oradata/orcl/tbs01.dbf
converted datafile=/u02/tbs01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Finished backup at 17-OCT-11
RMAN> exit
Recovery Manager complete.
[oracle@localhost ~]$ exit
exit
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS ADMIN_DIR
/ade/aime_10.2_lnx_push/oracle/md/admin
SYS DATA_PUMP_DIR
/u01/app/oracle/product/10.2.0/db_1/rdbms/log/
SYS WORK_DIR
/ade/aime_10.2_lnx_push/oracle/work
SQL> !mkdir /u02/dir
SQL> create directory dir as '/u02/dir';
Directory created.
SQL> grant read,write on directory dir to system;
Grant succeeded.
SQL> host
[oracle@localhost ~]$ expdp transport_tablespaces=tbs directory=dir dumpfile=tbs
01.dmp
Export: Release 10.2.0.1.0 - Production on Monday, 17 October, 2011 10:41:53
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Username: system/sys
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01": system/******** transport_tabl
espaces=tbs directory=dir dumpfile=tbs01.dmp
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
/u02/dir/tbs01.dmp
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 10:42:19
================================================================================
==========================
ON WINDOWS PLATFORM RMAN BACKUP COPY AT THIS LOCATION- 'C:\oracle\product\10.2.0
\oradata\orcl\tbs01.dbf'
AND EXPDP BACKUP FROM /u02/dir AT THIS LOCATION 'D' DRIVE AND GIVE PERMISION TO
READ,WRITE ON DIRECTORY.
================================================================================
=========================
SQL> create directory data as 'd:\dir';
Directory created.
SQL> grant read,write on directory data to system;
Grant succeeded.
SQL> host
cmd prompt open
-----------------
c:\>impdp transport_datafiles='c:\oracle\product\10.2.0\oradata\orcl\tbs01.dbf'
dumpfile=tbs01.dmp directory=dir
username: system/sys
SQL> select * from dba_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
------------------------------ ------------------------------ ------------------
--------------------
SYS DATA d:\dir
SYS SUBDIR C:\oracle\product\
10.2.0\db_1\demo\schema\order_entry\/2002/Sep
SYS XMLDIR C:\oracle\product\
10.2.0\db_1\demo\schema\order_entry\
SYS MEDIA_DIR C:\oracle\product\
10.2.0\db_1\demo\schema\product_media\
SYS LOG_FILE_DIR C:\oracle\product\
10.2.0\db_1\demo\schema\log\
SYS WORK_DIR C:\ADE\aime_vista_
ship\oracle/work
SYS DATA_FILE_DIR C:\oracle\product\
10.2.0\db_1\demo\schema\sales_history\
SYS DATA_PUMP_DIR C:\oracle\product\
10.2.0\admin\orcl\dpdump\
SYS ADMIN_DIR C:\ADE\aime_vista_
ship\oracle/md/admin
9 rows selected.
SQL>
SQL> select tablespace_name
2 from dba_data_files;
TABLESPACE_NAME
------------------------------
USERS
SYSAUX
UNDOTBS1
SYSTEM
EXAMPLE
TBS
6 rows selected.
SQL> alter tablespace tbs read write;
SQL> select * from scott.test;
EMPNO ENAME JOB MGR HIREDATE SAL COMM D
EPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- -----
-----
7369 SMITH CLERK 7902 17-DEC-80 800
20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500
30
7566 JONES MANAGER 7839 02-APR-81 2975
20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400
30
7698 BLAKE MANAGER 7839 01-MAY-81 2850
30
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7788 SCOTT ANALYST 7566 19-APR-87 3000
20
7839 KING PRESIDENT 17-NOV-81 5000
10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0
30
7876 ADAMS CLERK 7788 23-MAY-87 1100
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM D
EPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- -----
-----
7900 JAMES CLERK 7698 03-DEC-81 950
30
7902 FORD ANALYST 7566 03-DEC-81 3000
20
7934 MILLER CLERK 7782 23-JAN-82 1300
10
14 rows selected.

You might also like