Template Builder Pack and Unpack Command

Ratings:
(4)
Views:0
Banner-Img
  • Share this blog:

At the end of this chapter you will be able to:

  • Overview of the Domain Template Builder
  • Creating Domain Templates by using the Template Builder
  • Creating Domain Templates by using the Pack & Unpack Commands
  • Create and Start Managed Servers Remotely

  Overview of the Domain Template Builder You can create WebLogic domains by using domain and extension templates that contain the key attributes and files required for building or extending a domain. You can create templates by using the Domain Template Builder, a stand-alone Java application that guides you through the process of creating custom domain and extension templates. After you create your domain and add new resources and applications to it, you can use the Domain Template Builder to create a custom domain template. You can also use the Domain Template Builder to customize an existing template. For example, you may want to remove applications or add SQL scripts for additional databases. To do so, select the existing domain or template as the source for your new custom template. When your custom domain templates are complete, you can start using them to create domains by using the Configuration Wizard, WLST Offline, or the unpack command.   Overview of Creating Domain Templates by Using the Domain Template Builder To create a custom domain template by using the Domain Template Builder, select the domain or domain template from which you want to create your new domain template. You then have the option of modifying the following:

  • Basic template information
  • Application and domain directory contents
  • SQL scripts for database configuration
  • Administration server and user configuration
  • Basic security configuration, such as creating users, groups, and global roles and their assignments
  • Start menu entries (Windows only)
  • Customized scripts and variables

  Starting the Domain Template Builder This section describes how to start the Domain Template Builder. Note: The Domain Template Builder can be used only in graphical mode. You can create templates from the command line by using the pack command. For more information, see Creating Templates and Domains Using the Pack and Unpack Commands. To start the Domain Template Builder on a Windows machine, do one of the following:   From the Start menu, choose Start > Programs > Oracle WebLogic > WebLogic Server > Tools > Domain Template Builder.   From a command prompt window:

  1. Go to the common\bin subdirectory of the product installation directory.
  2. Run the config_builder command.

To start the Domain Template Builder on a UNIX machine, do the following: Note: The console attached to the machine on which you are running the Domain Template Builder must support Java-based GUIs.

  1. Open a command shell.
  2. Go to the common/bin subdirectory of the product installation directory.
  3. Run the following script: sh config_builder.sh.

  Creating Domain Templates by Using the Domain Template Builder: 54 Create a New Template: The Create a New Template window is displayed when you start the Domain Template Builder as described in Starting the Domain Template Builder. Select Create a Domain Template and click Next. Then Select a Template Domain Source window is displayed. 55 Select a Template Domain Source The Select a Template Domain Source window prompts you to choose the domain or domain template from which you want to create a domain template. Click Next. The Describe the Template window is displayed. 56 Describe the Template: The Describe the Template window prompts you to provide a description for the template. 57 Add or Omit Applications The Add or Omit Applications window is displayed only if applications are included in the template or domain selected in Select a Template Domain Source. 58 Add SQL Scripts You can add your own SQL scripts to the new template, so that the scripts are available when you create a domain based on the template. 59 Configure the Administration Server: In every domain, one server must be designated as the administration server: the central point from which the whole domain is managed. You can access the administrator server by using the URL protocol://listen-address: listen-port. The protocol can be any of the following: t3, t3s, http, https.   Configure Administrator Username and Password: When you create a domain template, the administrator username and password from the original domain or template are included in your new template. You can modify this username and password if required. 60 Configure Users, Groups, and Global Roles The Configure Users, Groups and Global Roles window is displayed in the Domain Template Builder in the following circumstances:

  • You are creating a domain template and you selected the option to configure users, groups, and global roles in the Configure Administrator Username and Password
  • You are creating an extension template and you selected Yes in the Security Configurations Option

61 Assign Users to Groups: 62 Assign Groups to Groups: 63 64 Specify Start Menu Entries: 65 Prepare Scripts and Files with Replacement Variables Click Next. The Review the Domain Template window is displayed. 66 Review the Domain Template The Review WebLogic Domain Template window allows you to review the settings for the new template before it is created. 67 Create a Template The Create a Template window prompts you to specify the name and directory for the domain template, and launch the process that creates it. After verifying the information displayed in the window, click Create. Click done in the Creating Template window.   Using the pack and unpack Commands The pack and unpack commands provide a simple, one-step method for creating domains and templates from the command line. You cannot, however, use these commands to customize the contents of your domain or template in the same way as the other tools. The pack and unpack commands are available in the \common\bin subdirectory of the product installation directory. Note: In addition to the pack and unpack commands, you can use the Configuration Wizard, Domain Template Builder, or WebLogic Scripting Tool to create domains and templates. You can create the following types of templates by using the pack command, and then use them to create templates by using the unpack command: Domain template: This type of template defines the full set of resources within a domain, including infrastructure components, applications, services, security options, and general environment and operating system options. You can use a domain template as the basis for new domains. Managed server template: This type of template defines the subset of resources within a domain that are required to create a managed server domain directory on a remote machine. You can create a managed server template by using the pack command, with the -managed=true option. Subsequently, when you use the managed server template with the unpack command; the managed server domain directory that is created contains sufficient bootstrap information to start the managed server on the remote machine.   Pack Command: The pack command provides an alternative method for creating a template from the command line in one simple step. Although the pack command does not allow you to customize the contents of your template in the same way as the Domain Template Builder, it helps you do the following tasks quickly: The pack command creates a template archive (.jar) file that contains a snapshot of either an entire domain or a subset of a domain. You can use a template that contains a subset of a domain to create a managed server domain directory hierarchy on a remote machine. Syntax: pack -domain=domain -template=template -template_name=“template_name” [-template_author=“author”][-template_desc=“description”] [-managed={true|false}][-log=log_file] [-log_priority=log_priority] Example: To create a template based on an existing domain named mydomain that is located in the C:\bea\user_projects\domains directory, run the following command: pack -domain=C:\bea\user_projects\domains\mydomain -template=C:\bea\user_templates\mydomain.jar -template_name="My WebLogic Domain" A template file named mydomain.jar is created in the C:\bea\user_templates directory. The name of the template is My WebLogic Domain.   Unpack Command: The unpack command provides a one-step method for creating a domain quickly from an existing template by using the default settings defined in the template. When creating a domain, unpack does not provide the same customization options as the Configuration Wizard or WLST. If, however, you use the unpack command with a domain template, you can do the following: Change the password for the default administrative user defined in the template. By using unpack, you can also create a managed server domain directory based on a managed server template created with the pack command. The managed server uses the settings defined for the administration server; so you cannot change the JDK or the start mode, add administrative users, or change the administrator password.             Note: You cannot use unpack to extend an existing domain. When you use the unpack command with a domain template, it creates a domain containing all of the application and resource files defined in the template. It also creates necessary start scripts, and certain security and configuration files.When you use the unpack command with a managed server template, it creates a managed server domain directory that includes the following:

  • A customized start script for each managed server in the domain
  • xml file (based on the config.xml in the template)
  • properties file
  • dat file

Syntax: unpack -template=template -domain=domain [-user_name=username] [-password=password] [-app_dir=application_directory] [-java_home=java_home_directory] [-server_start_mode={dev|prod}] [-log=log_file] [-log_priority=log_priority] Example To create a domain named mydomain.jar in the C:\bea\user_templates directory, by using the my_new_domain template in the C:\bea\user_projects\domains directory, run the following command: unpack -template=C:\bea\user_templates\mydomain.jar -domain=C:\bea\user_projects\domains\my_new_domain   How Do I Create and Start a Managed Server on a Remote Machine? In some domains, you may want to run a managed server on a machine that is remote from the administration server for the domain. You can do this by performing the following steps:  

  • Create a managed server template by using the pack command. A managed server template, by default, contains only those files that are necessary for creating a managed server on a remote machine.

 

  • Create a managed server domain directory by copying and unpacking the managed server template on a remote machine.

 

  • Start the managed server on the remote machine.

  How Do I Create a Managed Server Template You create a managed server template by executing the pack command on an existing domain that includes the definition of one or more managed servers and contains managed server definitions in the config.xml file.

  1. From the command line on the local machine (that is, the machine that contains the

administration server and the definition of managed servers), navigate to the BEA_HOME\wlserver_10.0\common\bin directory.

  1. Run the following command:

pack -managed=true -domain=domain -template=template.jar -template_name="template_name" For example, the following command creates a managed server template named mydomain_managed.jar from a domain named mydomain. pack -managed=true -domain=C:\bea\user_projects\domains\mydomain -template=C:\bea\user_templates\mydomain_managed.jar -template_name="My Managed Server Domain" How Do I Create a Managed Server on a Remote Machine:

  1. Install WebLogic Server on the machines on which you want to host managed servers for the domain.

Note: All WebLogic Server instances within a domain must run the same version of the WebLogic Server software.

  1. Establish a session with the remote machine. You may use any valid method, such as telnet, to do so.

Note: The IP address and port number of the remote machine must match the definition of the managed servers specified in the managed server template.

  1. Copy the managed server template to the remote machine.
  1. On the remote machine, navigate to the WL_HOME\common\bin directory (WL_HOME is the product directory in which installed WebLogic Server is installed).
  1. Run the following command: unpack -domain=domain -template=template.jar

In this command: – domain is the full or relative path of the domain to be created. – template.jar is the full or relative path of the managed server template that you copied to the machine in step 3. For example, the following command creates a domain named myManagedDomain. unpack -domain=C:\bea\user_projects\domains\myManagedDomain -template=C:\bea\user_templates\mydomain_managed.jar   Summary:

  • Overview of the Domain Template Builder
  • Creating Domain Templates by using the Template Builder
  • Creating Domain Templates by using the Pack & Unpack Commands
  • Create and Start Managed Servers Remotely

  Check out our Related Courses

Introduction to Clustering Weblogic

Oracle Apex Training In Houston

Oracle Weblogic Server Installation      

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox