Академический Документы
Профессиональный Документы
Культура Документы
You can use the transportable tablespaces feature to move a subset of an Oracle database and "plug" it in to
another Oracle database, essentially moving tablespaces between the databases . Here we’re transporting a
tablespace named “PERFSTAT”
Step 1 :
For a tablespace to be transportable it must be totally self contained. This can be checked using the
DBMS_TTS.TRANSPORT_SET_CHECK procedure .
• An index inside the set of tablespaces is for a table outside of the set of tablespaces.
Note : It is not a violation if a corresponding index for a table is outside of the set of tablespaces
• A partitioned table is partially contained in the set of tablespaces.
• A referential integrity constraint points to a table across a set boundary.
• A table inside the set of tablespaces contains a LOB column that points to LOBs outside the set of tablespaces.
SQL > EXECUTE dbms_tts.transport_set_check('PERFSTAT', TRUE);
no rows selected
It’s mandatory for transporting a tablespace that it should be in READ ONLY mode. If you’re database
is in READ-ONLY mode and tablespace is in READ-WRITE . Then it wont work .
Note: If your database is in READ ONLY mode and tablespace is in READ WRITE. Then you’ll
get the error “ORA-29335: tablespace 'PERFSTAT' is not read only “ .
Step 3 : Export the PERFSTAT tablespace metadata using the export utility:
Username: / as sysdba
..............................................
EXP-00091: Exporting questionable statistics.
. . exporting table STAT_TABLE_BAK
Transport both the datafiles and the export file of the tablespaces to a place accessible to the target database.
You can use any facility for copying flat files (for example, an operating system copy utility, ftp, or publishing on
CDs).
scp /u24/oradata/ilproddata/perf01.dbf oraperf@192.168.20.237:/perf/oradata/perfdata/
scp /u19/oradata/ilproddata/perf02.dbf oraperf@192.168.20.237:/perf/oradata/perfdata/
scp /u32/oradata/ilproddata/perf0* oraperf@192.168.20.237:/perf/oradata/perfdata/
scp /u35/oradata/ilproddata/perf04.dbf oraperf@192.168.20.237:/perf/oradata/perfdata/
scp /u40/oradata/ilproddata/perf0* oraperf@192.168.20.237:/perf/oradata/perfdata/
create the database with same character set as that of source database . Use the following query to find
the character set of a database . If adding / Plug in the tablespace to an existing database , Then change
the characterset of that database .
SQL> select * from NLS_DATABASE_PARAMETERS where parameter in
('NLS_CHARACTERSET','NLS_NCHAR_CHARACTERSET');
PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_CHARACTERSET UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16
Create all the user having any object in the required (PERFSTAT) tablespace. In our case tablespace PERFSTAT
contains the object of 4 user APPS , Perfstat , BIZMAX , DBSNM .
OWNER
------------------------------
APPS
BIZMAX
DBSNMP
KIC
PERFSTAT
TRCANLZR
Username: / as sysdba
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
Step 7 : Take the source tablespace in READ WRITE mode on source database
Soltuion :
This is because of different character set at the destination database. Run the query on source database
PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_CHARACTERSET UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16
Now check the character set at the destination database ( where you’re plugging your tablespace )
PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_CHARACTERSET US7ASCII
NLS_NCHAR_CHARACTERSET AL16UTF16
If it’s different then change the character set of the database using the steps mentioned below .
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM ENABLE RESTRICTED SESSION;
ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
ALTER SYSTEM SET AQ_TM_PROCESSES=0;
ALTER DATABASE OPEN;
select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
---- TRUNCATE TABLE SYS.METASTYLESHEET; ---to get rid of ORA-12716 per Metalink
Note - 213015.1
ALTER DATABASE CHARACTER SET UTF8;
SHUTDOWN IMMEDIATE;
STARTUP;
@$ORACLE_HOME/rdbms/admin/catmet.sql
SHUTDOWN IMMEDIATE;
STARTUP;
Error 2 :
Soltuion :
APPS user is having object in respective tablespace (PERFSTAT in our case) at the source database. But no
APPS user at the destination database. Use the query mentioned below to fine all the users having the object
in PERFSTAT tablespace at source database and need to be created at the destination database , in case if not
present .
SQL> select distinct owner from dba_segments where tablespace_name='PERFSTAT' ;
OWNER
------------------------------
APPS
BIZMAX
DBSNMP
KIC
PERFSTAT
TRCANLZR
Error 3 :
Soltuion :
This is because of the tablespace in READ WRITE mode . Before taking the export of metadata, tablespace
needs to be taken in READ ONLY mode
Note: If your database is in READ ONLY mode and tablespace is in READ WRITE. In that case also,
you’ll get the same error.