关于bsu使用的官方解释:
并且可以参考这篇文档:
Oracle WebLogicServer PSU(补丁集更新)公告 (文档 ID 1600822.1)
Oracle® Smart Update Applying Patches to Oracle WebLogic Server Release 3.3.0 Part Number E14143-12 |
|
|
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 theMW_HOME
\utils\bsu
directory. When running thebsu
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 |
---|---|---|
|
Displays a summary of |
None. |
|
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 [-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, |
|
Starts the Smart Update graphical interface. |
None. |
|
Creates a file, in the specified location, in which the corresponding Note: The |
=path Specifies the file name and location of the log file to be created, represented as [-log_priority= {trace|debug|info|warn|error|fatal}] Specifies the priority of log information to be captured. The default priority is |
|
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. |
|
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 Note: The regular expression is used to delimit multiple arguments. For example, |
|
Displays version information. For example: Oracle Smart Update. Version: 3.3.3.0 |
None. |
|
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, .[-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=profile3 The 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) detected Starting installation of Patch ID: IRZ2 Installing C:\Oracle\Middleware\download-dir\IRZ2.jar Result: 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:\patchdir ProductName: WebLogic Platform ProductVersion: 10.3 Components: WebLogic Platform/WebLogic Server,WebLogic Platform/Workshop for WebLogic Platform,WebLogic Platform/WebLogic Portal BEA_HOME: C:\Oracle\Middleware ProductHome: C:\Oracle\Middleware\wlserver_10.3 PatchSystemDir: C:\Oracle\Middleware\utils\bsu PatchDir: C:\Oracle\Middleware\patch_wls_1032 Profile: Default DownloadDir: C:\patchdir JavaHome: C:\Oracle\Middleware\jrockit160_14_R27.6.5-32 JavaVersion: 160_14_R27.6.5-32 JavaVendor: ORACLE Patch 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 Platform ProductVersion: 10.3 Components: WebLogic Server/Server,WebLogic Server/Server Examples, AquaLogic Service Bus/Service Bus BEA_HOME: C:\Oracle\Middleware ProductHome: C:\Oracle\Middleware\wlserver_10.3 DownloadDir: C:\Oracle\Middleware\download-dir JavaHome: C:\Oracle\Middleware\jrockit160_14_R27.6.5-32 JavaVersion: 160_14_R27.6.5-32 JavaVendor: ORACLE Patch ID: FZN2 PatchContainer: FZN2.jar Checksum: -174938558 Component: WebLogic Server Severity: critical Category: Security CR: CRxxyyzz Restart: false Description: ATN fix for xxxx Patch ID: GWQR PatchContainer: GWQR.jar Checksum: 1170817068 Component: AquaLogic Service Bus Severity: optional Category: Multiple CR: CRxxyyzz Restart: true Description: 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.0 ProductName: WebLogic Server ProductVersion: 10.0 Components: WebLogic Server/Server,WebLogic Server/Server Examples, WebLogic Server/Server BEA_HOME: C:\Oracle\Middleware ProductHome: C:\Oracle\Middleware\wlserver_10.0 PatchSystemDir: C:\Oracle\Middleware\utils\bsu PatchDir: C:\Oracle\Middleware\patch_wls1000 Profile: Default DownloadDir: C:\Oracle\Middleware\utils\bsu\cache_dir JavaHome: c:\Oracle\Middleware\jdk150_06 JavaVersion: 1.5.0_06 JavaVendor: Sun Patch ID: PBLW (CR838734) ProductName: WebLogic Portal ProductVersion: 10.0 Components: WebLogic Portal/Portal Server,WebLogic Portal/WebLogic Works WebLogic Portal/Portal Examples BEA_HOME: C:\Oracle\Middleware ProductHome: C:\Oracle\Middleware\wlserver_10.0 PatchSystemDir: C:\Oracle\Middleware\utils\bsu PatchDir: C:\Oracle\Middleware\patch_wlp1000 Profile: Default DownloadDir: C:\Oracle\Middleware\utils\bsu\cache_dir Patch ID: FJTH (CR861234) C:\Oracle\Middleware\utils\bsu> C:\Oracle\Middleware\utils\bsu>bsu -view -status=applied -prod_dir=C:\10_WLP_0 320\workshop_10.0 ProductName: Workshop for WebLogic ProductVersion: 10.0 Components: Workshop for WebLogic Platform/Workshop,Workshop for WebLogic Platform/Workshop Examples BEA_HOME: C:\Oracle\Middleware ProductHome: C:\Oracle\Middleware\workshop_10.0 PatchSystemDir: C:\Oracle\Middleware\utils\bsu PatchDir: C:\Oracle\Middleware\patch_wlw1000 Profile: Default DownloadDir: C:\Oracle\Middleware\utils\bsu\cache_dir Patch 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 Info Report Option BEA_HOME ### OPTION NOT SET product_mask.. ### OPTION NOT SET release_mask.. ### OPTION NOT SET profile_mask.. ### OPTION NOT SET patch_id_mask. 6.* Report Messages BEA_HOME D:\Platform92\BEA_HOME Product Description Product Name.. WebLogic Platform Product Version.. 9.2.0.0 Installed Components WebLogic Server, Workshop for WebLogic Platform, WebLogic Integration, WebLogic Portal Product Install Directory. D:\Platform92\BEA_HOME\weblogic92 Java Home.. D:\Platform92\BEA_HOME\jrockit90_150_04 Jave Vendor BEA Java Version.. 1.5.0_04 Patch Directory.. D:\Platform92\BEA_HOME\patch_weblogic920 Profile. Default Patch ID 6L1H CR(s) CR285988 Description Fix P13N processing of Platform Domain Upgrade. Intended for use with WLI 9.2 Classpath Classpath type SYSTEM Classpath control jar.. weblogic_patch.jar Jar.. CR285988_920.jar File.com/BEA/p13n/upgrade/LibraryModuleConfigProcessor.class File. com/BEA/p13n/upgrade/P13nDatabasePlugIn.class File. resources/p13n-upgrade.xml File. resources/P13nCommonPlugIn-definition.xml File. resources/portal-upgrade.xml File. META-INF/MANIFEST.MF Patch ID 6MK8 CR(s) CR262488 Description Allow WLI Domains to be upgraded by Domain Upgrade Wizard Classpath Classpath type SYSTEM Classpath control jar.. weblogic_patch.jar Jar.. CR262488_920.jar File.weblogic/upgrade/domain/directoryselection/DomainDirectorySelectionPlugIn.class File.weblogic/upgrade/domain/directoryselection/i18n_DomainDirectorySelectionPlugIn.properties File. 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