用bsu命令行为weblogic安装或者卸载补丁

时间:2022-02-09 17:39:50

关于bsu使用的官方解释:

并且可以参考这篇文档:

Oracle WebLogicServer PSU(补丁集更新)公告 (文档 ID 1600822.1)


Oracle® Smart Update Applying Patches to Oracle WebLogic Server
Release 3.3.0

Part Number E14143-12
用bsu命令行为weblogic安装或者卸载补丁
Home
用bsu命令行为weblogic安装或者卸载补丁
Contents
用bsu命令行为weblogic安装或者卸载补丁
Contact Us

用bsu命令行为weblogic安装或者卸载补丁
Previous
用bsu命令行为weblogic安装或者卸载补丁
Next
View PDF

8 Using the Command-Line Interface

This section describes the Smart Update bsu command, which you can use to apply patches, interactively or through a script, that have been downloaded into a patch download directory. When you use bsu commands in a script, you can create a mechanism for replicating a specific maintenance level of a product that is installed on multiple systems. This capability is especially valuable in production environments, in which the distribution of software updates to systems must be implemented in a controlled, reliable, and reproducible manner.

The following topics are included:

  • About the bsu Command

  • bsu Command Reference

  • Command-Line Interface Examples

About the bsu Command

When using the bsu command, either interactively or through a script, note that this command:

  • Runs the bsu script (bsu.cmd on Windows systems, bsu.sh on UNIX systems) that is located in the MW_HOME\utils\bsu directory. When running the bsu command, first change to this directory on the system from which you are running it.

  • Can be executed from a command file (on Windows) or shell script (on UNIX).

  • Contains the subset of Smart Update functionality that enables you to:

    • Apply and remove patches that are located in an accessible patch download directory

    • View patches that are in the download directory, applied to a product installation on the current system, or applied to a specific patch profile for the current system

    • Generate reports listing the patches applied to a product installation

    The bsu command can also invoke the Smart Update graphical interface and send messages to a log file.

  • Can apply patches to, or view patches on, only those products installed from the system on which this command is run, as follows:

    • If the current system contains a product that was installed by a different system, you cannot apply patches to that installation or view them.

    • If the current system was used to install a product located on a remote-mounted disk drive, you can use the bsu command with that installation.

    Therefore, the restrictions regarding the specific product installations that can be maintained through the bsu command is the same as for Smart Update's graphical interface.

  • Cannot be used for the following:

    • Creating custom patch profiles

    • Locating start scripts to modify

    These capabilities are available only from Smart Update's graphical interface.

    Note:

    If you run the Smart Update command-line interface simultaneously with the graphical interface, changes you make to patch profiles through the command-line interface are not visible from the graphical interface when you refresh the view of those patch profiles.

bsu Command Reference

This section describes the bsu command syntax. Square brackets appearing with a parameter argument indicate that the argument is optional.

The bsu command has the parameters and arguments listed and described in Table 8-1.

Note:

In Table 8-1, the square brackets, [..], represent arguments that are optional. For example, [-profile=profile_name] is an optional argument for the -install parameter

Table 8-1 bsu Command Parameters and Arguments

Parameter Description Arguments

-help

Displays a summary of bsu parameters and arguments

None.

-install

Applies specified patches to the target installation. You must specify a valid profile name.

[-patchlist=patch1[,patch2,patch3]

Specifies the identifier of each patch to be applied, represented as patch1patch2, and patch3.

[-profile=profile_name]Specifies the patch profile to which the patches are to be applied, represented asprofile_name.See the note at the end of the table.[-patch_download_dir=path]Specifies the patch download directory from which the patches are to be applied, represented as path. If you do not specify a patch download directory, the patch download directory designated in the Preference dialog box in the Smart Update graphical interface is used by default. (If none is designated in the Preference dialog box, MW_HOME\utils\bsu\cache_dir is used.)[-verbose]Displays the full set of details associated with each patch applied.[-prod_dir=path]Specifies the target installation to which the patches are to be applied, represented as path. For example, MW_HOME\wlserver_10.3 for WebLogic Server and Portal.

-gui

Starts the Smart Update graphical interface.

None.

-log

Creates a file, in the specified location, in which the correspondingbsu command logging information is to be sent.

Note: The -log parameter logs only bsu command activity, and not activity related to patches or profiles.

=path

Specifies the file name and location of the log file to be created, represented as path.

[-log_priority= {trace|debug|info|warn|error|fatal}]

Specifies the priority of log information to be captured. The default priority is debug.

-remove

Removes specified patches from the profile.

[-patchlist=patch1[,patch2,patch3]

Specifies the identifier of each patch to be applied, represented as patch1[,patch2, and patch3.[-profile=profile_name]Specifies the patch profile from which the patches are to be removed, represented asprofile_name. See the note at the end of the table.[-prod_dir=path]Specifies the target installation from which the patches are to be removed, represented as path.[-verbose]Displays the full set of details associated with each patch applied.

-report

Generates a report showing the applied patches and associated file changes in a Middleware home directory.

-BEA_HOME=path

Specifies the target installation where the patches are applied, represented as path. If no path is specified, this option generates report for all product installations. Specify the appropriate Middleware home directory.[-product_mask=regexp]Limits the report to the matching product(s), represented by the regular expression regexp.

Note: The regular expression is used to delimit multiple arguments. For example, -product_mask=WebLogic.* filters all products starting with WebLogic.[-release_mask=regexp]Limits the report to the matching product release(s), represented by the regular expression regexp.[-profile_mask=regexp]Limits the report to the matching patch profile(s), represented by the regular expression regexp.[-patch_id_mask=regexp]Limits the report to the matching patch(es), represented by the regular expression regexp.[-output_format=text|xml]Specifies the format of the report. Options available are text and xml. Default: text.[-output_file=path]Specifies the directory where the report is saved, represented as path. If no path is specified for the report output, stdout is used.

-version

Displays version information.

For example:

Oracle Smart Update. Version: 3.3.3.0

None.

-view

Displays the identifiers of patches that are either applied or in the patch download directory

[-profile=profile_name]

Displays identifiers of patches applied to the profile represented as profile_name. If you do not specify this argument, the default patch profile is used by default.

See the note at the end of the table.[-patch_download_dir=path]Displays the identifiers of patches that have been downloaded into the patch download directory represented as path. If you do not specify a patch download directory, the patch download directory designated in the Preference dialog box is used by default. (If none is designated in the Preference dialog box, MW_HOME\utils\bsu\cache_dir is used.)[-status={applied|downloaded}Displays the current status of the patches viewed. If you specify applied for this argument, bsu displays identifiers of patches that have been applied to the target installation. Use this argument, with -profile, to create a maintenance snapshot for the specific profile. If you specify downloadedbsu displays identifiers of patches in the download directory but not yet applied

.[-verbose]Displays the full set of details associated with each patch displayed.-prod_dir=path

Displays the identifiers of patches applied to the target installation in the location represented as path.


Note:

If profile is not specified, the Default profile is used.

If the profile argument is used and an invalid profile is specified, it is not set to default; it displays the error:

$ bsu -view -status=applied -prod_dir=C:/10_WLP/wlserver_version-profile=profile3The specified profile could not be found.[profile_name] 

Command-Line Interface Examples

This section includes the following bsu command examples:

  • Installation Example

  • View Patches Example

  • Another View Patches Example

  • Display Maintenance Snapshot

  • Report of Applied Patches

Installation Example

The following command installs the patch IRZ2 from the patch download directory that has been established for the current system:

bsu -prod_dir=c:\Oracle\Middleware\wlserver_10.3 -patchlist=IRZ2 -verbose -install

When executed, the preceding command displays the following output showing that the patch was successfully applied:

Checking for conflicts.No conflict(s) detectedStarting installation of Patch ID: IRZ2Installing C:\Oracle\Middleware\download-dir\IRZ2.jarResult: Success

View Patches Example

The following command displays a list of patches that exist in the patch download directory, c:\patchdir:

bsu -view -status=downloaded -prod_dir=C:\Oracle\Middleware\wlserver_10.3 -patch_download_dir=C:\patchdir

When executed, the preceding command generates a display similar to the following:

C:\Oracle\Middleware\utils\bsu>bsu -view -status=downloaded -prod_dir=C:\Oracle\Middleware\wlserver_10.3 –patch_download_dir=C:\patchdirProductName:     WebLogic PlatformProductVersion:  10.3Components:      WebLogic Platform/WebLogic Server,WebLogic Platform/Workshopfor WebLogic Platform,WebLogic Platform/WebLogic PortalBEA_HOME:         C:\Oracle\MiddlewareProductHome:     C:\Oracle\Middleware\wlserver_10.3PatchSystemDir:  C:\Oracle\Middleware\utils\bsuPatchDir:    C:\Oracle\Middleware\patch_wls_1032Profile:         DefaultDownloadDir:     C:\patchdirJavaHome:        C:\Oracle\Middleware\jrockit160_14_R27.6.5-32JavaVersion:     160_14_R27.6.5-32JavaVendor:      ORACLEPatch ID:        9A5T (10131320)Patch ID:        585H (10201173)Patch ID:        8LU6 (10106400)Patch ID:        AFJ5 (10111681)Patch ID:        Q8K5 (10085296)

Another View Patches Example

The following command displays the set of patches for a target installation that have been downloaded to the system's designated patch download directory:

bsu -view -prod_dir=C:\Oracle\Middleware\wlserver_10.3 -status=downloaded -verbose 

When executed, the preceding command generates a display similar to the following:

ProductName:       WebLogic PlatformProductVersion:    10.3Components:        WebLogic Server/Server,WebLogic Server/Server Examples,AquaLogic Service Bus/Service BusBEA_HOME:           C:\Oracle\MiddlewareProductHome:       C:\Oracle\Middleware\wlserver_10.3DownloadDir:       C:\Oracle\Middleware\download-dirJavaHome:        C:\Oracle\Middleware\jrockit160_14_R27.6.5-32JavaVersion:     160_14_R27.6.5-32JavaVendor:        ORACLEPatch ID:          FZN2PatchContainer:    FZN2.jarChecksum:          -174938558Component:         WebLogic ServerSeverity:          criticalCategory:          SecurityCR:                CRxxyyzzRestart:           falseDescription:       ATN fix for xxxxPatch ID:          GWQRPatchContainer:    GWQR.jarChecksum:          1170817068Component:         AquaLogic Service BusSeverity:          optionalCategory:          MultipleCR:                CRxxyyzzRestart:           trueDescription:       One more ALSB patch

Display Maintenance Snapshot

The following command displays a maintenance snapshot of the default patch profile:

bsu -view -status=applied -prod_dir=c:\BEA\wlserver_10.0

When executed, the preceding command generates a display similar to the following:

C:\Oracle\Middleware\utils\bsu>bsu -view -status=applied -prod_dir=C:\Oracle\Middleware\wlserver_10.0ProductName:       WebLogic ServerProductVersion:    10.0Components:        WebLogic Server/Server,WebLogic Server/Server Examples,WebLogic Server/ServerBEA_HOME:   C:\Oracle\MiddlewareProductHome:       C:\Oracle\Middleware\wlserver_10.0PatchSystemDir:    C:\Oracle\Middleware\utils\bsuPatchDir:          C:\Oracle\Middleware\patch_wls1000Profile:           DefaultDownloadDir:       C:\Oracle\Middleware\utils\bsu\cache_dirJavaHome:          c:\Oracle\Middleware\jdk150_06JavaVersion:       1.5.0_06JavaVendor:        SunPatch ID:          PBLW (CR838734)ProductName:       WebLogic PortalProductVersion:    10.0Components:        WebLogic Portal/Portal Server,WebLogic Portal/WebLogic Works                  WebLogic Portal/Portal ExamplesBEA_HOME:   C:\Oracle\MiddlewareProductHome:       C:\Oracle\Middleware\wlserver_10.0PatchSystemDir:    C:\Oracle\Middleware\utils\bsuPatchDir:          C:\Oracle\Middleware\patch_wlp1000Profile:           DefaultDownloadDir:       C:\Oracle\Middleware\utils\bsu\cache_dirPatch ID:          FJTH (CR861234)C:\Oracle\Middleware\utils\bsu>C:\Oracle\Middleware\utils\bsu>bsu -view -status=applied -prod_dir=C:\10_WLP_0320\workshop_10.0ProductName:       Workshop for WebLogicProductVersion:    10.0Components:        Workshop for WebLogic Platform/Workshop,Workshop for WebLogic Platform/Workshop ExamplesBEA_HOME:          C:\Oracle\MiddlewareProductHome:       C:\Oracle\Middleware\workshop_10.0PatchSystemDir:    C:\Oracle\Middleware\utils\bsuPatchDir:          C:\Oracle\Middleware\patch_wlw1000Profile:           DefaultDownloadDir:       C:\Oracle\Middleware\utils\bsu\cache_dirPatch ID:          8K9T (CR873456)

Report of Applied Patches

The following command generates a report of patches applied to an MW_HOME, where the first character of the patch IDs is "6":

bsu -report -patch_id_mask=6.*

When executed, the preceding command generates a display similar to the following:

Patch Report============Report InfoReport OptionBEA_HOME ### OPTION NOT SETproduct_mask.. ### OPTION NOT SETrelease_mask.. ### OPTION NOT SETprofile_mask.. ### OPTION NOT SETpatch_id_mask. 6.*Report MessagesBEA_HOME D:\Platform92\BEA_HOMEProduct DescriptionProduct Name.. WebLogic PlatformProduct Version.. 9.2.0.0Installed Components WebLogic Server, Workshop for WebLogic Platform, WebLogic Integration, WebLogic PortalProduct Install Directory. D:\Platform92\BEA_HOME\weblogic92Java Home.. D:\Platform92\BEA_HOME\jrockit90_150_04Jave Vendor BEAJava Version.. 1.5.0_04Patch Directory.. D:\Platform92\BEA_HOME\patch_weblogic920Profile. DefaultPatch ID 6L1HCR(s) CR285988Description Fix P13N processing of Platform Domain Upgrade.  Intended for use with WLI 9.2ClasspathClasspath type SYSTEMClasspath control jar.. weblogic_patch.jarJar.. CR285988_920.jarFile.com/BEA/p13n/upgrade/LibraryModuleConfigProcessor.classFile. com/BEA/p13n/upgrade/P13nDatabasePlugIn.classFile. resources/p13n-upgrade.xmlFile. resources/P13nCommonPlugIn-definition.xmlFile. resources/portal-upgrade.xmlFile. META-INF/MANIFEST.MFPatch ID 6MK8CR(s) CR262488Description Allow WLI Domains to be upgraded by Domain Upgrade WizardClasspathClasspath type SYSTEMClasspath control jar.. weblogic_patch.jarJar.. CR262488_920.jarFile.weblogic/upgrade/domain/directoryselection/DomainDirectorySelectionPlugIn.classFile.weblogic/upgrade/domain/directoryselection/i18n_DomainDirectorySelectionPlugIn.propertiesFile. META-INF/MANIFEST.MF



2、删除补丁实例:

背景:需要安装weblogic 10.3.6.0.7PSU,但是检查到补丁冲突


[appl02@vs150 bsu]$ bsu.sh \ -prod_dir=/u01/test2/app/fs1/FMW_Home/wlserver_10.3 \ -patchlist=FCX7 -verbose -install
Checking for conflicts...
Conflict(s) detected - resolve conflict condition and execute patch installation again
Conflict condition details follow:
Patch FCX7 is mutually exclusive and cannot coexist with patch(es): LL4G,YIJF,D33T,VFS8

需要先卸载以上4个补丁:

[appl02@vs150 bsu]$ bsu.sh \ -prod_dir=/u01/test2/app/fs1/FMW_Home/wlserver_10.3 \ -patchlist=LL4G -verbose -remove
Checking for conflicts...
No conflict(s) detected

Starting removal of Patch ID: LL4G
Removing /u01/test2/app/fs1/FMW_Home/patch_wls1036/patch_jars/BUG13572948_1036.jar
Updating /u01/test2/app/fs1/FMW_Home/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar
Old manifest value: Class-Path= ../../../patch_jars/AppsAdapter.jar ../../../patch_jars/bpm-infra.jar ../../../patch_jars/DBAdapter.jar ../../../patch_jars/dbws.jar ../../../patch_jars/jca-binding-api.jar ../../../patch_jars/BUG13729611_103604.jar ../../../patch_jars/BUG16083651_1036.jar ../../../patch_jars/com.bea.core.stax2_2.0.0.0_3-0-3.jar ../../../patch_jars/BUG14597598_1036.jar ../../../patch_jars/BUG13572948_1036.jar ../../../patch_jars/com.bea.core.management.core_2.9.0.1.jar ../../../patch_jars/BUG14272383_1036.jar ../../../patch_jars/BUG13845626_1036.jar
New manifest value: Class-Path= ../../../patch_jars/AppsAdapter.jar ../../../patch_jars/bpm-infra.jar ../../../patch_jars/DBAdapter.jar ../../../patch_jars/dbws.jar ../../../patch_jars/jca-binding-api.jar ../../../patch_jars/BUG13729611_103604.jar ../../../patch_jars/BUG16083651_1036.jar ../../../patch_jars/com.bea.core.stax2_2.0.0.0_3-0-3.jar ../../../patch_jars/BUG14597598_1036.jar ../../../patch_jars/BUG13572948_1036.jar ../../../patch_jars/com.bea.core.management.core_2.9.0.1.jar ../../../patch_jars/BUG14272383_1036.jar ../../../patch_jars/BUG13845626_1036.jar
Result: Success