Use the MDS commands listed in Table 4-2 to manage the MDS repository. In the Use with WLST column, online means the command can only be used when connected to a running Administration Server. Offline means the command can only be used when not connected to a running server. Online or offline means the command can be used in both situations.
Table 4-2 Repository Management Commands
Use this command... | To... | Use with WLST... |
---|---|---|
Create a metadata repository partition. |
Online |
|
Delete a metadata repository partition. |
Online |
|
Deregister a database-based MDS repository. |
Online |
|
Register a database-based MDS repository. |
Online |
Note:
Note the following if you invoke the following WLST commands or comparable MBeans in a script:
registerMetadataDBRepository
deregisterMetadataDBRepository
In this release and previous releases, the commands or MBeans, have the following behavior:
Starts an Oracle WebLogic Server editing session.
Registers or deregisters the repository.
Activates the changes.
However, you can start an editing session explicitly. If you do, the automatic activation of the changes are deprecated.
Command Category: Repository Management
Use with WLST: Online
Description
A metadata repository is used as a common repository for managing metadata of different applications. Many applications use the MDS repository to manage their metadata. Each deployed application uses a logical partition in metadata repository. This logical partition also helps in maintaining the metadata lifecycle. Before deploying a application, you create a partition for it in MDS repository. This command creates a partition with the given name in the specified repository.
Syntax
createMetadataPartition(repository, partition)
Argument | Definition |
---|---|
repository |
The name of the repository where the partition will be created. |
partition |
The name of the partition to create in the repository. |
Example
The following example creates the metadata partition partition1
in the repository mds-myrepos
:
wls:/weblogic/serverConfig> createMetadataPartition(repository='mds-myrepos', partition='partition1') Executing operation: createMetadataPartition Metadata partition created: partition1 "partition1"
Command Category: Repository Management
Use with WLST: Online
Description
Deletes a metadata partition in the specified repository. When you delete a repository partition, all of the metadata in that partition is lost.
Syntax
deleteMetadataPartition(repository, partition)
Argument | Definition |
---|---|
repository |
The name of the repository that contains the partition. |
partition |
The name of the partition to delete in the repository. |
Example
The following example deletes the metadata partition partition1
from the repository mds-myrepos
:
wls:/weblogic/serverConfig> deleteMetadataPartition(repository='mds-myrepos', partition='partition1') Executing operation: deleteMetadataPartition Metadata partition deleted: partition1
Command Category: Repository Management
Use with WLST: Online
Description
Removes the database metadata repository registration as a System JDBC data source in the domain. After this command completes successfully, applications can no longer use this repository.
Syntax
deregisterMetadataDBRepository(name)
Argument | Definition |
---|---|
name |
The name of the repository to deregister. |
Example
The following example deregisters the metadata repository mds-myrepos
:
wls:/weblogic/serverConfig> deregisterMetadataDBRepository('mds-myrepos')
Executing operation: deregisterMetadataDBRepository.
Metadata DB repository "mds-myrepos" was deregistered successfully.
Command Category: Repository Management
Use with WLST: Online
Description
A database metadata repository should be registered with WebLogic Server instances before the application can use it. This command registers a System JDBC data source with the domain for use as database-based metadata repository.
Syntax
registerMetadataDBRepository(name, dbVendor, host, port, dbName, user, password [, targetServers])
Argument | Definition |
---|---|
name |
The name of the repository to register. If the name you supply does not begin with mds-, the commands adds the prefix mds-. |
dbVendor |
The database vendor. The acceptable values are ORACLE, MSSQL, IBMDB2, and MYSQL. |
host |
The host name or the IP address of the database. |
port |
The port number used by the database. |
dbName |
The service name of the database. For example, orcl.hostname.com |
user |
The database user name. |
password |
The password for the database user. |
targetServers |
Optional. The WebLogic Server instances to which this repository will be registered. If this argument is not specified, then the repository will be registered only to the Administration Server. To specify multiple servers, separate the names with a comma. Register the repository with all Managed Servers to which the application will be deployed. |
Example
The following example registers the metadata repository myrepos
to two servers, and specifies the database parameters:
wls:/weblogic/serverConfig> registerMetadataDBRepository('myrepos','ORACLE', 'test.oracle.com','1521','mds', 'user1','x','server1, server2') Executing operation: registerMetadataDBRepository. Metadata DB repository "mds-myrepos" was registered successfully. 'mds-myrepos'