Free Newsletters:
Database Journal  
DBAnews  

DBASupport

 The Knowledge Center for Oracle Professionals

Search DBAsupport:
 
HOME 11g Central 10g Central 9i Central 8i Central Oracle News Scripts FAQ OCP Zone Resources Technical Docs Tools & Utilities Forums
internet.com

» HOME
» FEATURES
    11g Central
    10g Central
    9i Central
    8i Central
    Oracle News
» COMMUNITY
    Scripts
    Forums
    FAQ
    OCP Zone
» RESOURCES
    Resources
    Technical Docs
    Tools & Utilities
    Tech Jobs

Marketplace Partners
Become a Marketplace Partner


internet.commerce
Be a Commerce Partner












internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


   DBAsupport.com > Oracle > Oracle 8i Central > Featured Stories




Information Technology Auditor (PA)
Next Step Systems
US-PA-Wayne

Justtechjobs.com Post A Job | Post A Resume

Here comes another wonderful feature in the new release of Oracle 8.1.5. Transportable tablespaces are a lot like cutting a piece of the database and pasting it to another database. Well, you don't need to actually cut it, you can always make a copy of the part of the database and add it to another database.

Introduction and Performing violation checks

The concept is to just copy the datafiles and move the dictionary information to the new server. Since you are exporting only the data dictionary information, the time required to move data between databases is much faster than using the regular import/export. Remember to connect as sys or sysdba while exporting or importing the data dictionary information.

The granularity, at which we can move pieces of a database, using this concept, is a tablespace. You can move as many tablespaces as you want in one shot. But the tablespaces must meet certain criteria.

  • The tablespaces must be self-contained, meaning all the objects in the tablespace must be contained wholly in the tablespace
  • The source and the target database must be on the same platform, you can move between sun & sun but not sun & NT.
  • The source and target must have same database block size.
  • The same tablespace name should not already be in use, by the target database.

You can check whether a tablespace is self-contained or not through a PL/SQL package DBMS_TTS. To check whether tablespaces TSP1 and TSP2 are in violation execute

DBMS_TTS.TRANSPORT_SET_CHECK('TSP1,TSP2', TRUE);

where TSP1, TSP2 are the tablespace names and TRUE specifies that the oracle server also take the constraints, foreign keys etc., into consideration. If it is FALSE the procedure does not bother about the constraints, and raises an error whenever you refer these objects in the destination database.

Now query the view TRANSPORT_SET_VIOLATIONS. This view lists all the objects and tablespace which is not self-contained. If there is no such tablespace, this view will be empty.

Export Tablespace Data Dictionary Info

Set the tablespaces to READ ONLY by issuing the following commands.

alter tablespace tsp1 read only;
alter tablespace tsp2 read only;

Now export the tablespaces using the export utility that is provided with the oracle server. This exports only metadata info pertaining to the tablespaces. Other options like Triggers=y, Grants=y and constraints=y can be used to copy the respective objects.

exp TRANSPORT_TABLESPACE=y TABLESPACES=tsp1,tsp2 FILE=export.dmp

set the tablespaces on the source database back to read write after the export.

alter tablespace tsp1 read write;
alter tablespace tsp2 read write;

Copy Files to New Location and Import Data Dictionary

Copy the export.dmp and the data files for these tablespaces into the destination server using any OS utility. On the destination database invoke the import utility to add the tablespaces to the new database. Once the files have been added, set the tablespaces to read write.

imp TRANSPORT_TABLESPACE=y DATAFILES='/d01/t1.dbf','/d01/t2.dbf' TABLESPACES=tsp1,tsp2 FILE=export.dmp

alter tablespace tsp1 read write;
alter tablespace tsp2 read write;

If you want to change the ownership of the the objects, you can mention TOUSER and FROMUSER options. If you don't specify these options, imp tries to create the objects under the same user from the source database. If the user doesn't exists on the destination database, import will fail.

User Comments on this article

Jodie Mellinger writes... In the article, it lists certain requirements that the tablespace must meet. In my attempts to use transportable tablespaces, I have found another, undocumented requirement. The tablespace can not have any FUNCTION BASED INDEXES. I have not found this in any Oracle documentation, but when I run the check on my tablespace, I get the error " Domain/Functional Index VERTEXID.RATECITY in tablespace VERTEX not allowed in transportable set". The index specified does a DESC sort in the index. Just thought other users may benefit from this information.


DBAsupport.com Home Page





internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES