JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Administration Guide
search filter icon
search icon

Document Information

Preface

1.  Overview of GlassFish Server Administration

Default Settings and Locations

Configuration Tasks

Administration Tools

Instructions for Administering GlassFish Server

Part I Runtime Administration

2.  General Administration

3.  Administering Domains

About Administering Domains

GlassFish Server Instances

Domains for Administering GlassFish Server

Domain Administration Server (DAS)

Creating, Logging In To, and Deleting a Domain

To Create a Domain

To Create a Domain From a Custom Template

To List Domains

To Log In to a Domain

To Delete a Domain

Starting and Stopping a Domain

To Start a Domain

To Stop a Domain

To Restart a Domain

Configuring a DAS or a GlassFish Server Instance for Automatic Restart

To Configure a DAS or an Instance for Automatic Restart on Windows

To Configure a DAS or an Instance for Automatic Restart on Linux

To Configure a DAS or an Instance for Automatic Restart on Oracle Solaris

To Prevent Service Shutdown When a User Logs Out on Windows

Suspending and Resuming a Domain

To Suspend a Domain

To Resume a Domain

Setting Up Automatic Backups of a Domain

To Create a Backup Configuration

To List Backup Configurations

To Enable a Backup Configuration

To Disable a Backup Configuration

To Delete a Backup Configuration

To Create a Schedule

To List Schedules

To Delete a Schedule

Backing Up and Restoring a Domain

To Back Up a Domain

To Restore a Domain

To List Domain Backups

Re-Creating the Domain Administration Server (DAS)

To Migrate the DAS

Additional Domain Tasks

To Display Domain Uptime

To Switch a Domain to Another Supported Java Version

To Change the Administration Port of a Domain

4.  Administering the Virtual Machine for the Java Platform

5.  Administering Thread Pools

6.  Administering Web Applications

7.  Administering the Logging Service

8.  Administering the Monitoring Service

9.  Writing and Running JavaScript Clients to Monitor GlassFish Server

10.  Administering Life Cycle Modules

11.  Extending and Updating GlassFish Server

Part II Resources and Services Administration

12.  Administering Database Connectivity

13.  Administering EIS Connectivity

14.  Administering Internet Connectivity

15.  Administering the Object Request Broker (ORB)

16.  Administering the JavaMail Service

17.  Administering the Java Message Service (JMS)

18.  Administering the Java Naming and Directory Interface (JNDI) Service

19.  Administering Transactions

Part III Appendixes

A.  Subcommands for the asadmin Utility

Index

Setting Up Automatic Backups of a Domain

Creating backups is part of regular administrative duties, and GlassFish Server supports two ways to perform this duty:

To set up automatic backups, you provide the following information:

To provide this information, you create and administer backup configurations. You can create multiple backup configurations, and so set up automatic backups that serve different purposes. For example, you could create one backup configuration that backs up the entire content of the domain's directory once every month, and another backup configuration that backs up just the domain's config subdirectory once every week.

When you create a backup configuration, you provide information about when to perform automatic backups by specifying the name of a schedule that defines a single event at a specified date and time or a series of events occurring with a specified frequency. Therefore, you must create a backup configuration's schedule before you create the backup configuration itself. Alternatively, you can use an existing schedule that meets your needs, such as one of the schedules predefined in GlassFish Server: daily, weekly and monthly.

The domain must be running when a backup configuration's schedule triggers an automatic backup; otherwise, the backup operation will not occur. Additionally, if a scheduled automatic backup is missed because the domain was stopped, the backup is not performed when the domain is started.

By default, when GlassFish Server performs an automatic backup, it suspends the domain before performing the backup operation and resumes the domain after completing the backup operation. You can override this suspension of the domain by using the --activebackupenabled option of the create-backup-config(1) subcommand.

To create and manage backup configurations and schedules in the Administration Console, click the Domain node in the navigation tree and then click the Backup tab on the Domain Attributes page.

The following topics are addressed here:

To Create a Backup Configuration

Use the create-backup-config subcommand in remote mode to create a backup configuration.

By default, a backup configuration is enabled when it is created.

Before You Begin

When creating a backup configuration, you specify the name of the schedule that determines when automatic backups are to be performed. Use the list-schedules --full subcommand to find out whether an existing schedule meets your needs. If necessary, use the create-schedule subcommand to create a schedule.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create the backup configuration by using the create-backup-config(1) subcommand:
    asadmin> create-backup-config --schedule schedule-name --backupdir backup-directory --configonly=true-or-false --activebackupenabled=true-or-false --autobackupenabled=true-or-false
    --recyclelimit recycle-limit backup-config-name
    --schedule

    Specifies the name of the schedule that determines when automatic backups are to be performed.

    --backupdir

    Optionally specifies a directory other than the default as-install/domains/domain-name/backups where automatic backups are to be stored.

    --configonly

    Optionally specifies whether automatic backups are to contain only the config subdirectory of the domain or all subdirectories of the domain. The default value is false.

    --activebackupenabled

    Optionally specifies whether the automatic backups are to be performed without suspending the domain during the backup operation. The default value is false.

    --autobackupenabled

    Optionally specifies whether automatic backups are enabled. The default value is true.

    --recyclelimit

    Optionally specifies how many backup files to keep. After this limit is reached, the oldest existing backup is deleted when a new backup needs to be created. The default value is 25.

Example 3-16 Creating a Backup Configuration

This example creates the backup configuration monthly-full.

asadmin> create-backup-config --schedule monthly --backupdir /net/backups.example.com/glassfish monthly-full
Command create-backup-config executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-backup-config at the command line.

To List Backup Configurations

Use the list-backup-configs subcommand in remote mode to list backup configurations defined in the domain.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List backup configurations by using the list-backup-configs(1) subcommand.

Example 3-17 Listing All Backup Configurations

This example lists all backup configurations.

asadmin> list-backup-configs
weekly-config
quarterly-full
Command list-backup-configs executed successfully.

Example 3-18 Listing Details for a Backup Configuration

This example lists details for the quarterly-full backup configuration.

asadmin> list-backup-configs --long quarterly-full
Name of Backup Config   :quarterly-full
Auto Backup Enabled     :true
Schedule                :quarterly
Recycle Limit           :25
Config Only backup      :false
Active Backup Enabled   :false
Backup Directory        :/net/backups.example.com/glassfish
Last Backup Attempt     :Sat Jan 01 00:00:01 PST 2011
Last Successful Backup  :Sat Jan 01 00:00:01 PST 2011

Schedule Details:
NAME       SECOND  MINUTE  HOUR  DAY OF WEEK  DAY OF MONTH  MONTH     YEAR
quarterly  0       0       0     *            1             1,4,7,10  *
Command list-backup-configs executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help list-backup-configs at the command line.

To Enable a Backup Configuration

Use the enable-backup-config subcommand in remote mode to enable automatic backups triggered by a specified backup configuration.

Using the enable-backup-config subcommand is equivalent to using the set subcommand to set the auto-backup-enabled attribute of a backup configuration to true.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Enable the backup configuration by using the enable-backup-config(1) subcommand:
    asadmin> enable-backup-config backup-config-name

Example 3-19 Enabling a Backup Configuration

This example enables the backup configuration quarterly-full.

asadmin> enable-backup-config quarterly-full
Command enable-backup-config executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help enable-backup-config at the command line.

To Disable a Backup Configuration

Use the disable-backup-config subcommand in remote mode to disable automatic backups triggered by a specified backup configuration.

Using the disable-backup-config subcommand is equivalent to using the set subcommand to set the auto-backup-enabled attribute of a backup configuration to false.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Disable the backup configuration by using the disable-backup-config(1) subcommand:
    asadmin> disable-backup-config backup-config-name

Example 3-20 Disabling a Backup Configuration

This example disables the backup configuration quarterly-full.

asadmin> disable-backup-config quarterly-full
Command disable-backup-config executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help disable-backup-config at the command line.

To Delete a Backup Configuration

Use the delete-backup-config subcommand in remote mode to delete a specified backup configuration.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Delete the backup configuration by using the delete-backup-config(1) subcommand:
    asadmin> delete-backup-config backup-config-name

Example 3-21 Deleting a Backup Configuration

This example deletes the backup configuration quarterly-full.

asadmin> delete-backup-config quarterly-full
Command delete-backup-config executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help delete-backup-config at the command line.

To Create a Schedule

Use the create-schedule subcommand in remote mode to create a schedule.

A schedule defines a single event at a specified date and time, such as “on January 1, 2012 at 8:00:00”, or a series of events occurring with a specified frequency, such as “on the first and sixteenth of every month as midnight”.

The create-schedule subcommand uses an event-specification model similar to EJB timers to define a single event or a recurring event. It provides event control for year, month, hour, minute and second units directly, and for day units in terms of both days of the week and days of the month. See create-schedule(1) for complete information about recurrence options for each unit.

GlassFish Server provides three predefined schedules:

You can use these schedules just as they are defined, or you can edit them to suit your needs.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create the schedule by using the create-schedule(1) subcommand.

Example 3-22 Creating a Schedule

This example creates the schedule quarterly, which specifies a recurring frequency of “on the first day of every quarter at midnight”.

asadmin> create-schedule --dayofmonth 1 --month 1,4,7,10 quarterly
Command create-schedule executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-schedule at the command line.

To List Schedules

Use the list-schedules subcommand in remote mode to list schedules defined in the domain.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List schedules by using the list-schedules(1) subcommand.

Example 3-23 Listing Schedules

This example lists all schedules using the --long option to display details for each schedules.

asadmin> list-schedules --long
NAME         SECOND  MINUTE  HOUR   DAY OF WEEK  DAY OF MONTH  MONTH     YEAR
daily        0       0       0      *            *             *         *
weekly       0       0       0      Sun          *             *         *
monthly      0       0       0      *            1             *         *
quarterly    0       0       0      *            1             1,4,7,10  *
Command list-schedules executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help list-schedules at the command line.

To Delete a Schedule

Use the delete-schedule subcommand in remote mode to delete a specified schedule.


Note - If you attempt to delete a schedule that is in use by a backup configuration, the delete-schedule subcommand fails.


  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Delete the schedule by using the delete-schedule(1) subcommand:
    asadmin> delete-schedule schedule-name

Example 3-24 Deleting a Schedule

This example deletes the schedule quarterly.

asadmin> delete-schedule quarterly
Command delete-schedule executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help delete-schedule at the command line.