Manage Templates in Oracle 10g

Posted on 2006-04-12
Last Modified: 2013-12-03
I have created a template from computer A. Can I create a db in Computer B using the template from computer A instead of using RMAN ?
Question by:Cosine_Consultants
    1 Comment
    LVL 47

    Accepted Solution

    DBCA Templates:

    a. Templates are used by the DBCA to create new databases or make clones of
       existing databases.

       DBCA Templates are XML files containing information required to create a
       database.  This includes:
       - database options
       - init.ora parameters
       - storage attributes (datafiles, tablespaces, controlfiles and redologs)

    b. These templates reside in the "$ORACLE_HOME/assistants/dbca/templates"
       directory.  In this directory you can see the following:

       - Data_Warehouse.dbc          
       - General_Purpose.dbc
       - Transaction_Processing.dbc
       - New_Database.dbt            

    c. Types of Templates

       1. Seed Templates (files with a '.dbc' extension)
          -> Contain information about a clone database.
          -> Data files and redo logs are stored in zipped format in another file
             with a '.dfj' extension.
          -> Usually the corresponding '.dfj' of a '.dbc' has the same file name:
                 Data_Warehouse.dfj and Data_Warehouse.dbc,
                 Transaction_Processing.dfj and Transaction_Processing.dbc
          -> But it is not necessary to have the same name since the '.dfj' file is
             referred by a <Location> tag under <DataFiles> within the '.dbc file'.

        2. Non-Seed Templates (files with a '.dbt' extension)
           -> Are used to create new databases from scratch.
           -> Contain characteristics of the database to be created.
           -> Are more flexible compared to their seed counter parts since all
              datafiles and redo logs are created from scratch. The file names,
              sizes, and other attributes can be changed as required.

    Creating Templates Using the DBCA:
    Users can create their own custom templates from:

    a. An existing database:  
       -> Structure only, i.e. using a non-seed template.
          You can run DBCA from remote machines.

        -> Structure as well as data, i.e. using a seed template.
           Run DBCA from the same machine where the database is running.

        You can choose an option to translate file paths into OFA (Oracle Flexible
        Architecture) or maintain the file paths. OFA is recommended if the machine
        where you create the database using this template has a different directory
        structure (ORACLE_HOME, etc.). Non-OFA (maintaining file paths) can be used
        if the target machine has a similar structure.

    - OR -                              
    b. An existing template using the Manage Templates option of the DBCA
       operations page:        
       -> seed to seed template                
       -> non-seed to non-seed template

    Running DBCA:
    The DBCA can be run in three modes:  
    -> Interactive
    -> Silent
    -> Progress Only
    In Silent and Progress_Only modes, you can only create databases (both new and
    clone) and templates (both seed and non-seed). Other options like 'Configuring
    Database' and 'Deleting Database' are available in Interactive mode only.
    Here are some examples on how to use DBCA in different modes. To get all
    available options, type 'dbca -help' at the command line.

    a. Interactive Mode
       By default (without any parameters) DBCA runs in interactive mode.
       It presents the Wizard to:
       -> Create/Delete/Configure Databases
       -> Create/Delete Templates

    b. Progress Only Mode

       Progress only mode is typically used by other tools to create a database.
       - The Installer uses DBCA to create initial database
       - EMCA and OID Assistants use DBCA to create databases.
       In this mode, only the progress bar is shown.

    c. Silent Mode

       Silent mode does not provide any User interface or User interaction. It
       outputs all messages including information, error and warnings into log
       ********* **************************************************
       Example1  Creating a clone database from a non-seed template
       ********* **************************************************
       % dbca -silent -createDatabase \
                      -templateName New_Database.dbt \
                      -gdbname V901 -sid V901 \
                      -characterset WE8ISO8859P1 \
                      -continueOnNonFatalErrors true

        where -continueOnNonFatalErrors allows the DBCA to go on when a non fatal
        error occurs such as not enough space left on device (/ora9i/oradata).
        You can view the error messages in the file:

        Errors that prevent the database from being created are logged in the
        "$ORACLE_HOME/admin/<DBNAME>/create" directory:

            characterSet.log, CloneDBCreation.log, lockAccount.log,
            <DBNAME>.log, postDBCreation.log, postScripts.log

        Logs reporting that the database is created are also in the
        $ORACLE_HOME/admin/<DBNAME>/create" directory:

            CreateDBCatalog.log, CreateDBFiles.log, CreateDB.log

        ********* **************************************************
        Example2  Creating a seed template from an existing database
        ********* **************************************************
        % dbca -silent -createCloneTemplate \
                       -sourceDB V901
                       -sysDBAUserName sys -sysDBAPassword change_on_install \
                       -templateName copy_of_ora9i \
                       -datafileJarLocation /ora9i/assistants/dbca/templates
        When completed:
        -> a log file is generated, such as "/ora9i/assistants/dbca/logs/1.log"
           that contains a message similar to:
           "The generation of the clone database template "copy_of_ora9i"
           is successful."
         -> a large binary zipped format file copy_of_ora9i.dfj is created in
            the datafileJarLocation directory "/ora9i/assistants/dbca/templates".

        ********* ******************************************************
        Example3  Creating a non-seed template from an existing database
        ********* ******************************************************

        % dbca -silent -createTemplateFromDB \
                       -sourceDB V901 \
                       -sysDBAUserName sys -sysDBAPassword change_on_install \
                       -templateName copy_of_ora901
        When completed:
        -> a log file is generated, such as "/ora9i/assistants/dbca/logs/17.log",
           that contains a message similar to:
           "The template "copy_of_ora901" creation completed."
        -> a small text file copy_of_ora901.dbt is created in datafileJarLocation
           directory "/ora9i/assistants/dbca/templates".


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
    This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now