Tuesday, December 10, 2013

Guidelines for Configuring a JDBC Store

The following sections provide guidelines for using JDBC store prefixes, recommended WebLogic JDBC data source settings for JDBC stores, and handling JMS transactions with JDBC stores.

Using Prefixes with a JDBC Store

The JDBC store database contains a database table, named WLStore, that is generated automatically and is used internally by WebLogic Server. The JDBC store provides an optional Prefix Name parameter, which can be used to provide more precise access to the database table.
It is always a best practice to configure a prefix for the JDBC WLStore table name, especially when:
  • The database requires fully-qualified names. (You should verify this with your database administrator.)
  • There is more than one JDBC store instance sharing a database, since no two JDBC stores can share the same table.
  • There are many tables in the database. Setting the prefix reduces the number of tables the JDBC store must search through to find its table during boot.

JDBC Store Table Rules

To avoid potential data loss, follow these rules:
  • Each JDBC store table name must be unique.
  • If multiple JDBC stores share a table, the behavior is undefined and data loss is likely.
  • There is no procedure for combining two database tables into a single table.

Prefix Name Format Guidelines

For most databases, the Prefix Name option for the JDBC store's backing database table should be set in the following format for each configured JDBC store, which will result in a valid table name when prepended to the JDBC store table name:
Note that each period in the [[[catalog.]schema.]prefix] format is significant. Generally, catalog identifies the set of system tables being referenced by the DBMS, andschema generally corresponds to ID of the table owner (username). When no prefix is specified, the JDBC store table name is simply WLStore and the database implicitly determines the schema according the current user of the JDBC connection.
For example, in a production database, the database administrator could maintain a unique table for the Sales department, as follows:
The resulting table will be created in the Production catalog, under the JMSAdmin schema, and will be named SalesWLStore.
For some DBMS vendors, such as Oracle, there is no catalog to set or choose, so the format simplifies to [[schema.]prefix]. For more information, refer to your DBMS documentation for instructions on fully-qualified table names, but note that the syntax specified by the DBMS may differ from the format required for this option.
If the Prefix Name setting is changed, but the WLStore database table already exists in the database, take care to preserve existing table data. In this case, the existing database table must be renamed by a database administrator to match the new configured table name.

Recommended JDBC Data Source Settings for JDBC Stores

The following settings are recommended when you use a JDBC data source or multi data source for JDBC stores.

Automatic Reconnection to Failed Databases

WebLogic Server provides robust JDBC data sources that can automatically reconnect to failed databases after they come back online, without requiring you to restart WebLogic Server. To take advantage of this capability, and make your use of JDBC stores more robust, configure the following options on the JDBC data source associated with the JDBC store:
For more information about JDBC default Test Table Names, see "Connection Testing Options for a Data Source" in the Configuring and Managing JDBC for Oracle WebLogic Server. For more information about setting the number of database reconnection attempts, see the "Enabling Connection Creation Retries" section in Configuring and Managing JDBC for Oracle WebLogic Server.

Required Setting for Oracle DB2 Type 4 JDBC Drivers

For data sources used as a JDBC store that use the Oracle Type 4 JDBC driver for DB2, the BatchPerformanceWorkaround property must be set to "true" due to internal JMS batching requirements.
For more information, see the "Performance Considerations" in Type 4 JDBC Drivers for Oracle WebLogic Server.

Handling JMS Transactions with JDBC Stores

You cannot configure a JDBC store to use a JDBC data source that is configured to support global (XA) transactions. The JDBC store must use a JDBC data source that uses a non-XA JDBC driver. In addition, you cannot enable Logging Last Resource or Emulate Two-Phase Commit in the data source. This limitation does not remove the XA capabilities of layered subsystems that use JDBC stores. For example, WebLogic JMS is fully XA-capable regardless of whether it uses a file store or any JDBC store.
Because the JDBC store implements the XAResource interface, it acts as it's own resource manager and handles the transactions above the JDBC driver level. That is, the store itself implements the XAResource and handles the transactions without depending on the database (even when the messages are stored in the database).
This means that whenever you are using a JDBC store and a database (even if it is the same database where the JMS messages are stored), then it is two-phase commit transaction.
For more information about using JMS transactions with a JDBC store, see "Using Transactions with WebLogic JMS" in Programming JMS for Oracle WebLogic Server.
From a performance perspective, you may also boost your performance as follows:
  • Ensure that the JDBC data source used for the database work exists on the same server instance as the JMS destination—the transaction will still be two-phase, but it will be handled with less network overhead.
  • Use file stores rather than JDBC stores.
  • Configure multiple services to share the same store if they will commonly be invoked within the same transaction.
  • If an application directly performs database operations in addition to invoking store services (such as JMS) within the same transaction, consider using a JDBC data source with Logging Last Resource (LLR) enabled for the database operations.
    With the LLR optimization, the transaction will follow the two-phase commit protocol, but the database operations will be handled in a single local transaction, which may improve overall transaction performance. For more information on using the LLR optimization, see "Understanding the Logging Last Resource Transaction Option"in Configuring and Managing JDBC for Oracle WebLogic Server.

Monitoring a Persistent Store

You can monitor statistics for each existing persistent store and for each open store connection.

Monitoring Stores

Each persistent store is represented at run time by an instance of the PersistentStoreRuntimeMBean, which provides the following options.
Table 6-6 Persistent Store Run-time Options
OptionWhat It Does
CreateCountNumber of create requests issued to this persistent store.
ReadCountNumber of read requests issued to this persistent store.
UpdateCountNumber of update requests issued by this persistent store.
DeleteCountNumber of delete requests issued by this persistent store.
ObjectCountNumber of objects contained in the persistent store.
ConnectionsNumber of active connections in the persistent store.
PhysicalWriteCountNumber of times the persistent store flushes its data to durable storage.

Monitoring Store Connections

For each open persistent store connection, the persistent store also registers a PersistentStoreConnectionRuntimemMBean, which provides the following options.
Table 6-7 Persistent Store Connection Runtime Options
OptionWhat It Does
CreateCountNumber of create requests issued to this connection.
ReadCountNumber of read requests issued to this connection.
UpdateCountNumber of update requests issued by this connection.
DeleteCountNumber of delete requests issued by this connection.
ObjectCountNumber of objects contained in the connection.
Table 6-8 defines most of the run-time prefix names of the WebLogic services and subsystems that can create a connection to the persistent store.
Table 6-8 Persistent Store Run-Time Prefix Names
Subsystem/ServiceRun-Time Prefix Name
where internal is the name of the deployment connection
Diagnostic Service
where internal is the logical name of the diagnostic archive connection
EJB Timer Services
where internal uniquely identifies EJB deployments in a server instance
JMS ServiceJMS server:
where internal is the name of the JMS server connection
JMS durable subscriber:
where internal is the name of the durable subscriber connection
JTA Transaction Log (TLOG)
where internal is the name of the TLOG connection
Path Service
where internal is the name of the path service connection
SAF ServiceSAF agent
where internal is the name of the SAF agent's connection
SAF durable subscriber:
where internal is the name of the durable subscriber connection
Web Services
where internal is the name of the Web Service's connection

Administering a Persistent Store

The WebLogic Store administration utility enables administrators to troubleshoot a WebLogic persistent store. The store utility operates only on a store that is not currently opened by a running server instance. This utility can be run from a Java command line or from WebLogic Scripting Tool (WLST), as described in Store Administration Using a Java Command Line and Store Administration Using WLST.
The most common uses-cases for store administration are for compacting a file store to reduce its size and for dumping the contents of a file store of JDBC store to an XML file for troubleshooting purposes. Examples of these use cases are provided later in this section.
Table 6-9 defines the available store administration commands for Java and WLST.
Table 6-9 Persistent Store Administration Options
Java CommandWLST MethodWhat It Does
Displays available commands, usage, and examples.
Compacts and defragments the space occupied by a file store. This command only works offline and does not work for JDBC stores.
Note: Compacting a file store is usually not necessary if you know that file store will likely grow to the current size again. File stores automatically re-use space freed by deleted records and expand only when there is insufficient internal space for new records. Also, file stores do not normally become fragmented as most persistent records are short-lived.
Opens an existing file store for further operations. If a file store does not exist, a new one is created in an open state using the -create parameter.
Opens an existing JDBC store for further operations. If a JDBC store does not exist, a new one is created in an open state
Dumps store or connection contents in a human-readable format to user-specified XML file. The XML file format is the same format used by the diagnostic image of the persistent store.
Lists store names, open stores, or connections in a store.
Returns a list of connections in the specified store (for script access)
Returns a list of opened stores (for script access).
Lists invocation options for the store administration tool.
Controls display of additional information, such as stack traces.
Closes a previously opened store.
Ends the store administration session.
A persistent store can be backed by the file system (file store) or by a JDBC-capable database (JDBC store). Except for the openfile/openfilestore() andopenjdbc/openjdbcstore() options, there is no difference in the options to operate on these two different types of stores.
Most commands and methods work in terms of store names, while others also work in terms of connection names. Store connections are logical groups of records within persistent stores. For example, the JMS and JTA subsystems persist their respective records in different connections in the same store.

Store Administration Using a Java Command Line

To open the persistent store administration utility from a Java command line, type the following:
> java weblogic.store.Admin
> storeadmin->

Accessing Store Administration Help

Type help for detailed descriptions on available store administration commands, as well as examples of typical command usage. For example, the following comprehensive help is provided for the list command, which lists store names, open stores, or connections in a store.
storeadmin->help list
    lists store names, open stores, or connections in a store
    list [-store storename|-dir dir]
    list #lists all opened stores by storename
    list -store store1 #lists all connections in store1
    list -dir dir1 #lists all storenames found in dir1

Dumping the Contents of a File Store

Here's an example of using a series of store administration commands to ultimately export the contents of a file store named myfilestore into a human-readable XML file format in a temporary directory. This does not include store connection names or the actual record contents, which require the optional -conn and -deep parameters.
> storeadmin-> list -dir .
> storeadmin-> openfile -store myfilestore -dir .
> storeadmin-> dump -store myfilestore -out d:\tmp\filestore1-out
> storeadmin-> close -store myfilestore
The list command shows all the store names in the current directory. The openfile and openjdbc commands must be used to open and/or create a file or JDBC store first before calling certain administration functions, like dump and list (only when listing open stores). After administering an open store, you must close it using the closecommand.

Compacting a File Store

Here is an example of using the compact command to compact the space occupied by a file store in the mystores directory.
> storeadmin->compact -dir c:\mystores -tempdir c:\tmp
Since the compact command can only be used on an unopened file store, none of the stores that have files in the source -dir directory should be open. Also, the temporary-tempdir directory should have at least enough extra space as the source directory and should also not be under the source directory. When compact successfully completes, the newly compacted store files will be in the mystores directory. In addition, a new, uniquely-named directory will be created under tmp containing the original uncompacted store files.

Store Administration Using WLST

The WLST interface has a couple of additional methods (compared to the Java command line) such as getopenstores and getstoreconns, that return relevant Java objects and can be used for scripting in WLST.

Accessing Store Administration Help

To access the persistent store administration utility from WLST, type the following command:
> java weblogic.WLST
Type helpstore() for detailed descriptions on available store administration commands, as well as examples of typical command usage. For example, the following help is provided for the list command, which lists store names, open stores, or connections in a store.
> wls:/offline> helpstore(liststore)
  lists storenames, opened stores, or connections (for interactive access)
  Parameters store and dir cannot both be specified concurrently.

  Usage: liststore(store='null',dir='null')

  @param store [optional] a previously opened JDBC or File store's name.
      If store is specified, all connections in the store are listed.
  @param dir [optional] directory for which to list available store names
      If dir is specified, all store names in the directory are listed.

  If neither store nor dir are specified, all open store names are listed.
  @return 1 on success, 0 on failure
Note that the parameters with an equal sign "=" are optional. For example, the compactstore method can be invoked as either compactstore(dir='storename', tempdir='/tmp') or compactstore(store='storename'), where tempdir takes the default value. Default values for optional parameters are listed in the command-specific help.


oakleyses said...

louis vuitton handbags, oakley sunglasses, louboutin, longchamp outlet, nike shoes, louis vuitton outlet stores, chanel handbags, burberry outlet, prada outlet, jordan shoes, tiffany and co, michael kors outlet, tory burch outlet, louis vuitton outlet, longchamp handbags, nike free, true religion jeans, michael kors outlet, kate spade outlet, polo ralph lauren outlet, tiffany and co, prada handbags, polo ralph lauren outlet, michael kors outlet, michael kors outlet, longchamp handbags, oakley sunglasses, ray ban sunglasses, kate spade handbags, burberry outlet, louis vuitton outlet, louboutin outlet, louboutin, coach factory outlet, air max, air max, coach outlet, gucci outlet, christian louboutin shoes, michael kors outlet, coach purses, ray ban sunglasses, michael kors outlet, louis vuitton, coach outlet store online, true religion jeans, oakley sunglasses cheap

oakleyses said...

ralph lauren, lululemon, air max, hollister, north face, nike air max, polo lacoste, vanessa bruno, timberland, vans pas cher, louboutin, louis vuitton, oakley pas cher, air max pas cher, nike roshe run, air max, true religion outlet, barbour, sac longchamp, air force, hollister, sac louis vuitton, nike free, polo ralph lauren, nike trainers, louis vuitton uk, nike roshe, sac hermes, longchamp, michael kors, sac burberry, sac guess, mulberry, new balance pas cher, converse pas cher, sac louis vuitton, hogan outlet, nike tn, north face, true religion outlet, ray ban pas cher, michael kors, air jordan, nike blazer, nike free pas cher, michael kors pas cher, abercrombie and fitch, ray ban sunglasses

oakleyses said...

mac cosmetics, mont blanc, marc jacobs, canada goose outlet, nike huarache, vans shoes, soccer jerseys, hollister, giuseppe zanotti, beats by dre, abercrombie and fitch, longchamp, insanity workout, celine handbags, bottega veneta, ghd, nfl jerseys, north face outlet, chi flat iron, ugg boots, birkin bag, ugg australia, canada goose, herve leger, ugg pas cher, rolex watches, valentino shoes, canada goose uk, canada goose, ferragamo shoes, canada goose, ugg boots, uggs outlet, north face jackets, soccer shoes, asics running shoes, new balance shoes, p90x, lululemon outlet, canada goose jackets, mcm handbags, instyler, babyliss pro, ugg, wedding dresses, jimmy choo outlet, reebok outlet, nike roshe run

oakleyses said...

parajumpers, karen millen, air max, converse, pandora charms, moncler, louboutin, moncler, links of london, lancel, juicy couture outlet, oakley, hollister, pandora charms, supra shoes, thomas sabo, canada goose, gucci, wedding dresses, timberland boots, swarovski crystal, air max, coach outlet store online, moncler, ray ban, canada goose, moncler, ugg, louis vuitton, swarovski, hollister, montre homme, moncler, hollister clothing store, ralph lauren, rolex watches, moncler outlet, moncler, iphone 6 cases, baseball bats, juicy couture outlet, toms shoes, vans, pandora jewelry, ugg, converse shoes

Zheng junxai5 said...

ralph lauren
jordan 3s
oakley sunglasses
kate spade
pandora jewelry
coach outlet
ralph lauren outlet
cheap jerseys
celine handbags
hermes bags
ladies cartier watches
nike air huarache
louis vuitton handbags
adidas nmd
nike air max
coach outlet
tory burch boots
nfl jerseys
michael kors outlet clearance
cheap oakley sunglasses
coach outlet
nike blazers shoes
michael kors outlet online
coach outlet
cheap air jordans
louis vuitton purses
toms outlet
michael kors purses
louis vuitton
tory burch shoes
marc jacobs outlet
louboutin shoes
adidas uk
montblanc pens
michael kors handbags
toms wedges
christian louboutin sale
louis vuitton outlet
toms wedges
concord 11

raybanoutlet001 said...

yeezy sneakers
basketball shoes
michael kors factory outlet
fitflops sale clearance
air jordan retro
links of london sale
cheap uggs
discount sunglasses
cheap nfl jerseys
true religion sale
michael kors handbags
tiffany jewellery
ralph lauren polo shirts
nike dunks
tiffany online
oakley store online
oakley sunglasses,oakley outlet sunglasses
cheap real jordans
adidas nmd
ray ban uk,cheap ray ban sunglasses