|
下载实验用补丁:
[url=http://124.16.180.178:8080/studentguide_sec_O11g/]http://124.16.180.178:8080/studentguide_sec_O11g/[/url]
密码同“活动第28/29次”MOS视频下载的链接。
学习opatch第一步:
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch -h
- Invoking OPatch 11.2.0.1.7
- Oracle 中间补丁程序安装程序版本 11.2.0.1.7
- 版权所有 (c) 2011, Oracle Corporation。保留所有权利。
- Usage: opatch [ -help ] [ -r[eport] ] [ command ]
- command := apply
- lsinventory
- napply
- nrollback
- rollback
- query
- version
- prereq
- util
-
- <global_arguments> := -help Displays the help message for the command.
- -report Print the actions without executing.
- example:
- 'opatch -help'
- 'opatch -help -fmw'
- 'opatch auto -help'
- 'opatch apply -help'
- 'opatch lsinventory -help'
- 'opatch napply -help'
- 'opatch nrollback -help'
- 'opatch rollback -help'
- 'opatch prereq -help'
- 'opatch util -help'
- OPatch succeeded.
复制代码- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch version
- Invoking OPatch 11.2.0.1.7
- OPatch Version: 11.2.0.1.7
- OPatch succeeded.
复制代码
有时候,甚至需要先升级opatch本身(看某个要打的patch的README,这个patch可以是Intrerim Patch,也可以是CPU也可以是PSU(PSU会升级第5位版本号)):
- [oracle@station90 dbhome_1]$ mv OPatch OPatch.11.2.0.1.7
- [oracle@station90 dbhome_1]$ mv /home/oracle/OPatch/ ./
- [oracle@station90 dbhome_1]$ ls
- apex csmig dv j2ee md OPatch.11.2.0.1.7 plsql sqlj utl
- assistants css emcli javavm mesg opmn precomp sqlplus wwg
- bin ctx EMStage jdbc mgw oracore racg srvm xdk
- ccr cv has jdev network oraInst.loc rdbms station90.example.com_orcl
- cdata dbs hs jdk nls ord relnotes sysman
- cfgtoollogs dc_ocm ide jlib oc4j oui root.sh timingframework
- clone deinstall install ldap odbc owb scheduler ucp
- config demo instantclient lib olap owm slax uix
- crs diagnostics inventory log OPatch perl sqldeveloper usm
- [oracle@station90 dbhome_1]$ cd
- [oracle@station90 ~]$ ls
- 13906496 dbclone3.rcv osb.txt physical-block.sh.zip update_t04209_uname.sql 下载
- backup dir1 p13906496_112030_Linux-x86-64.zip revertape-root.sh 公共的 音乐
- copytape-root.sh dir2 p6880880_112000_Linux-x86-64.zip select_t04209_uname.sql 模板 桌面
- create_t04209_uname.sql filename.log physical-block11.2.0.1.sh t05310.sql 视频
- dbclone1.rcv mail physical-block11.2.0.1.sh.zip ttio.rcv 图片
- dbclone2.rcv oradiag_oracle physical-block.sh update2_t04209_uname.sql 文档
- [oracle@station90 ~]$ cd 13906496
- [oracle@station90 13906496]$ ls
- etc files online README.txt
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch -h
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Usage: opatch [ -help ] [ -report ] [ command ]
- command := apply
- lsinventory
- lspatches
- napply
- nrollback
- rollback
- query
- version
- prereq
- util
-
- <global_arguments> := -help Displays the help message for the command.
- -report Print the actions without executing.
- example:
- 'opatch -help'
- 'opatch -help -fmw'
- 'opatch auto -help'
- 'opatch apply -help'
- 'opatch lsinventory -help'
- 'opatch lspatches -help'
- 'opatch napply -help'
- 'opatch nrollback -help'
- 'opatch rollback -help'
- 'opatch prereq -help'
- 'opatch util -help'
- OPatch succeeded.
复制代码 1. 查看当前database环境:
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-10-15上午_1.log
- Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-10-15上午.txt
- --------------------------------------------------------------------------------
- 已安装的顶级产品 (1):
- Oracle Database 11g 11.2.0.3.0
- 此 Oracle 主目录中已安装 1 个产品。
- 此 Oracle 主目录中未安装任何中间补丁程序。
- --------------------------------------------------------------------------------
- OPatch succeeded.
复制代码 2. 查看补丁的特性:
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch query -h
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- DESCRIPTION
- This operation loads and prints out various information about a patch.
- Parameter patch_location points to where a patch is located.
- For example, if you specify "path", there should be sub-dir.
- "etc/config" under "path".
- SYNTAX
- opatch query [-all] [-is_auto_patch] [-is_translatable_patch]
- [-get_base_bugs] [-get_component] [-get_os] [-get_date]
- [-get_patch_language] [-get_patch_type] [-get_patching_model]
- [-get_product_family] [-get_update_components] [-has_sql]
- [-is_online_patch] [-is_patchset_update]
- [-is_portal_patch] [-is_rolling_patch]
- [-jre <LOC> ] [-oh <LOC> ]
- [ <patch_location> ]
- OPTIONS
- -all
- Get everything available about a patch. This is equivalent
- to setting all available options.
- -is_auto_patch
- This option says 'true' if the patch is auto-enabled,
- 'false' otherwise.
- -is_translatable_patch
- This option says 'true' if the patch is translatable,
- 'false' otherwise.
- -get_base_bug
- Get bugs fixed by the patch
- -get_component
- Get components touched by the patch.
-
- -get_update_components
- Get all components to be upgraded in a Patchset Update.
-
- -get_date
- Get patch creation date and time.
- -get_os
- Get platforms for which this patch could be applied.
- -get_patch_type
- Get the patch type.
-
- -get_patching_model
- Get the patching model.
- -get_patch_language
- Get the language supported by the patch.
- -get_product_family
- Get the product family to which the patch belongs.
- -has_sql
- This option says 'true' if the patch has sql related actions,
- 'false' otherwise.
- -is_online_patch
- This option says 'true' if the patch is a online patch,
- 'false' otherwise.
- -is_patchset_update
- This option says 'true' if the patch is a Patchset Update,
- 'false' otherwise.
-
- -is_portal_patch
- This option says 'true' if the patch has portal actions,
- 'false' otherwise.
- -is_rolling_patch
- This option says 'true' if the patch is a rolling patch,
- 'false' otherwise.
- -jre
- This option tells OPatch to use JRE (java) from the specified
- location instead of the default location under Oracle Home.
- -oh
- The oracle home to work on. This takes precedence over the
- environment variable ORACLE_HOME.
- PARAMETERS
- The location of the patch to be queried.
- If the patch location is not specified, then the current directory
- is taken as the patch location.
- OPatch succeeded.
复制代码- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch query -is_online_patch
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-12-39上午_1.log
- --------------------------------------------------------------------------------
- Patch is an online patch: false
- OPatch succeeded.
复制代码- [oracle@station90 13906496]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.3.0 Production on Sat Jun 23 10:13:12 2018
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> shutdown immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
- SQL> exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
- With the Partitioning, Automatic Storage Management, OLAP, Data Mining
- and Real Application Testing options
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply -h
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- DESCRIPTION
- This operation applies an interim patch to an ORACLE_HOME from
- the current directory. The patch location can specified using
- the parameter patch_location.
- SYNTAX
- opatch apply [-connectString <List of connect strings>]
- [-delay <value> ] [ -force ] [ -force_conflict ]
- [-init <parameters for the init script in escaped double
- quotes> [-opatch_init_end] ]
- [-invPtrLoc <Path to oraInst.loc> ]
- [-jre <LOC> ] [-local ] [-local_node <Local node name>]
- [-minimize_downtime ] [-no_bug_superset ] [-no_inventory ]
- [-no_relink] [-no_sysmod] [-ocmrf <Response file location> ]
- [-oh <ORACLE_HOME> ]
- [-post <parameters for the post script in escaped
- quotes> [-opatch_post_end] ]
- [-pre <parameters for the pre script
- in escaped double quotes> [-opatch_pre_end] ]
- [-profile_mask <Name of profile>]
- [-property_file <Path to property file>]
- [-ptlConnect <portal connect string>]
- [-ptlPassword <portal password>]
- [-ptlSchema <portal schema>]
- [-remote_nodes <List of remote nodes (node1,node2)>]
- [-retry <value ] [-runSql ]
- [silent ] [-sqlScript <path of the sql file>] [-verbose ]
- [ <Patch Location> ]
- OPTIONS
- -all_nodes
- Apply the patch using all-node mode.
- -connectString
- This option can be used to specify the list of database
- instances on which the patch needs to be applied. The
- value for this option is specified as per the following
- syntax "SID:User:Passwd:Node". The SID is a must, others
- can be ignored, OPatch takes default values for it.
- Ex: oracle:dba:dba:mymachine,oracle1:::
- NOTE: If the system is not part of RAC setup, then to
- patch just the local node, provide the node name as
- empty string.
- -delay
- If -retry is specified, this options tells OPatch how
- many seconds it should wait before attempting to lock
- inventory again in case of a previous failure.
- -force
- This option is meaningful with 'silent' option and is used
- to override the behavior of silent under specific
- circumstances.
- -force_conflict
- If a conflict exist which prevents the patch from being
- applied, the -force_conflict flag can be used to apply the
- patch. OPatch will remove all the conflicting patches before
- applying the current patch. This will override the 'silent'
- behavior for conflicts and hence is meaningful only when used
- with 'silent' option.
- -init
- This option is used to pass parameters to the init
- script. This script is executed before prerequisite checks
- are run. The value for this option have to be enclosed
- in double quotes. This option should be ended by option
- 'opatch_init_end'.
- -invPtrLoc
- Used to locate the oraInst.loc file. Needed when the
- installation used the -invPtrLoc flag. This should be
- the path to the oraInst.loc file
- -jre
- This option tells OPatch to use JRE (java) from the
- specified location instead of the default location
- under Oracle Home.
- -local
- Patch the local node, then update inventory of the
- local node. Do not propagate the patch or inventory
- update to other nodes.
- -local_node
- This option can be used to specify to OPatch the local
- node name to be used for RAC mode application of the patch
- -minimize_downtime
- Only applied to RAC instances. User supplies the
- order of nodes to be patched. This option cannot be
- used in conjunction with -local option with a rolling
- patch.
- -no_bug_superset
- This option tells OPatch to error out if the current
- patch's bugs-to-fix is a super-set (or same set) of an
- installed patch's bugs-fixed in the Oracle Home.
- -no_inventory
- This option specifies not to update the inventory, it
- just updates the files in the system.
- If inventory is readable, then OPatch tries to read the
- inventory.
- -no_relink
- The nolink option does not perform any make operations.
- This option can be used during multiple patch
- applications and perform the linking step only once.
- OPatch does not keep track of the make operations it
- did not perform. It is the job of the OPatch users to
- make sure the execute OPatch without this option at
- the end, so that compilation happens once
- -no_sysmod
- This option specifies not to update the files in the
- system. It just updates the inventory. It also will not
- execute the pre and post scripts
- -ocmrf
- Give OPatch the absolute path to the OCM response file
- to be used for OCM configuration. -silent must be used
- in conjunction with -ocmrf if Oracle Home doesn't have
- OCM installed and configured.
- -oh
- The oracle home to work on. This takes precedence over
- the environment variable ORACLE_HOME
- -opatch_init_end
- This option is used to mark the end of init options.
- Without this option everything after init till end of
- the command is passed into init. This option is
- meaningless without -init option.
- -opatch_post_end
- This option is used to mark the end of post options.
- Without this option everything after post till end of
- the command is passed into post. This option is
- meaningless without -post option.
- -opatch_pre_end
- This option is used to mark the end of pre options.
- Without this option everything after pre till end of
- the command is passed into pre. This option is
- meaningless without -pre option.
- -post
- This option is used to pass parameters to the post script.
- This script is executed after application of the patch.
- The value for this option have to be enclosed in double
- quotes. This option should be ended by option
- 'opatch_post_end'.
- -pre
- This option is used to pass parameters to the pre
- script. This script is executed before application of
- the patch. The value for this option have to be enclosed
- in double quotes. This option should be ended by option
- 'opatch_pre_end'.
-
- -profile_mask
- If the patch to be applied specifies WLS patch/patchset
- as prerequisites, OPatch will read the WLS default patch
- profile. To have OPatch read non-default patch profile,
- specify the patch profile name with this option.
- -property_file
- The user defined property file for OPatch to use. The
- path to the property file should be absolute. This
- property file takes precedence over the one that is
- supplied with OPatch
- -ptlConnect
- This option can be used to specify the connect string of the
- portal schema
-
- -ptlPassword
- This option can be used to specify the password of the portal
- schema
- -ptlSchema
- This option can be used to specify the schema of the portal
- repository patch
- -remote_nodes
- This option can be used to specify to OPatch the list
- of remote nodes to be used for RAC mode application of
- the patch. The node names are comma separated and
- without spaces
- -report
- Just prints out the actions without executing
- -retry
- This option tells OPatch how many times it should retry
- in case of an inventory lock failure.
- -runSql
- This option can be used to specify OPatch to run the
- sql scripts and sql procedures if they are present in the
- given patch.
- -silent
- This suppresses any user-interaction
- -sqlScript
- This option can be used to specify the custom sql script
- to be run by OPatch after patching is completed
- -verbose
- This option prints more OPatch output to the screen as
- well as to the log file
- PARAMETERS
- Patch Location
- Path to the location for the patch. If the patch
- location is not specified, then the current directory
- is taken as the patch location.
- OPatch succeeded.
- [oracle@station90 13906496]$
复制代码
打冷补丁的过程:
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_15_02/apply2018-06-23_10-15-02上午_1.log
- Applying interim patch '13906496' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
- Verifying environment and performing prerequisite checks...
- All checks passed.
- 提供电子邮件地址以用于接收有关安全问题的通知, 安装 Oracle Configuration Manager 并启动它。如果您使用 My Oracle
- Support 电子邮件地址/用户名, 操作将更简单。
- 有关详细信息, 请访问 http://www.oracle.com/support/policies.html。
- 电子邮件地址/用户名:
- 尚未提供电子邮件地址以接收有关安全问题的通知。
- 是否不希望收到有关安全问题 (是 [Y], 否 [N]) [N] 的通知: Y
- 请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
- (Oracle 主目录 = '/u01/app/oracle/product/11.2.0/dbhome_1')
- 本地系统是否已准备打补丁? [y|n]
- y
- User Responded with: Y
- Backing up files...
- 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
- Verifying the update...
- Patch 13906496 successfully applied
- Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_15_02/apply2018-06-23_10-15-02上午_1.log
- OPatch succeeded.
- [oracle@station90 13906496]$
复制代码
检查冷补丁的情况:
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-17-33上午_1.log
- Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-17-33上午.txt
- --------------------------------------------------------------------------------
- 已安装的顶级产品 (1):
- Oracle Database 11g 11.2.0.3.0
- 此 Oracle 主目录中已安装 1 个产品。
- 中间补丁程序 (1) :
- Patch 13906496 : applied on Sat Jun 23 10:16:11 CST 2018
- Unique Patch ID: 17324986
- Created on 22 Jul 2014, 12:09:07 hrs PST8PDT
- Bugs fixed:
- 13906496
- --------------------------------------------------------------------------------
- OPatch succeeded.
复制代码
回退冷补丁:
- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch rollback -h
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- DESCRIPTION
- Roll back an existing patch indicated by the reference-id.
- SYNTAX
- opatch rollback -id <ID> [-connectString <List of connect strings>]
- [-delay <value>]
- [-init <parameters for the init script in escaped double
- quotes> [-opatch_init_end] ]
- [-invPtrLoc <Path to oraInst.loc> ]
- [-jre <LOC> ] [-local]
- [-local_node <Local node name>] [-no_inventory]
- [-no_relink] [-no_sysmod]
- [-oh <ORACLE_HOME>] [-ph <Patch Location>]
- [-post <parameters for the post script in escaped
- double quotes>[ -opatch_post_end] ]
- [-pre <parameters for the pre
- script in escaped double quotes> [-opatch_pre_end] ]
- [-property_file <path to property file>]
- [-ptlConnect <portal connect string>]
- [-ptlPassword <portal password>]
- [-ptlSchema <portal schema>]
- [-remote_nodes <List of remote nodes (node1,node2)>]
- [-retry <value>] [-runSql] [-silent]
- [-sqlScript <path of the sql file>] [-verbose]
- [all_subpatches]
- OPTIONS
- -all_nodes
- Roll back the patch using all-nodes mode.
- -connectString
- This option can be used to specify the list of database
- instances on which the patch needs to be applied. The
- value for this option is specified as per the following
- syntax "SID:User:Passwd:Node". The SID is a must, others
- can be ignored, OPatch takes default values for it.
- Ex: oracle:dba:dba:mymachine,oracle1:::
- NOTE: If the system is not part of RAC setup, then to
- patch just the local node, provide the node name as
- empty string.
- -delay
- If -retry is specified, this option tells OPatch how
- many seconds it should wait before attempting to lock
- inventory again in case of a previous failure.
- -id
- Use 'lsinventory' option to display all patch id's.
- Each one-off patch is indicated by its id. To roll back
- a patch the id for that patch must be supplied. For
- translation patches, Please specify <id>/<language code>
- (ex: 1234/fr)
- -init
- This option is used to pass parameters to the init
- script. This script is executed before prerequisite checks
- are run. The value for this option have to be enclosed
- in double quotes. This option should be ended by
- option 'opatch_init_end'.
- -invPtrLoc
- Used to locate the oraInst.loc file. Needed when the
- installation used the invPtrLoc flag. This should be
- the path to the oraInst.loc file
- -jre
- This option tells OPatch to use JRE (java) from the
- specified location instead of the default location
- under Oracle Home.
- -local
- Roll back then update inventory of the local node.
- Do not propagate the patch or inventory update to other
- nodes
- -local_node
- This option can be used to specify to OPatch the local
- node name to be used for RAC mode rollback of the patch
- -no_inventory
- This option specifies not to update the inventory, it
- just updates the files in the system.
- If inventory is readable, then OPatch tries to read the
- inventory.
- NOTE: ph has to be used to specify the patch location.
- -no_relink
- Do not perform the make operations in the patch. This
- option can be used during multiple patch removals and
- perform the compilation step only once
- -no_sysmod
- This option specifies not to update the files in the
- system. It just updates the inventory. It also will not
- execute the pre and post scripts
- -oh
- The oracle home to work on. This takes precedence over
- the environment variable ORACLE_HOME
- -opatch_init_end
- This option is used to mark the end of init options.
- Without this option everything after init till end of
- the command is passed into init. This option is
- meaningless without -init option.
- -opatch_post_end
- This option is used to mark the end of post options.
- Without this option everything after post till end of
- the command is passed into post. This option is
- meaningless without -post option.
- -opatch_pre_end
- This option is used to mark the end of pre options.
- Without this option everything after pre till end of
- the command is passed into pre. This option is
- meaningless without -pre option.
- -ph
- Specify the valid patch directory area. Rollback will
- use the command types found in the patch directory to
- identify what commands are to be used for the current
- operating system
- -post
- This option is used to pass parameters to the post
- script. This script is executed after removal of the
- patch. The value for this option have to be enclosed
- in double quotes. This option should be ended by
- option 'opatch_post_end'.
- -pre
- This option is used to pass parameters to the pre
- script. This script is executed before removal of the
- patch. The value for this option have to be enclosed in
- double quotes. This option should be ended by option
- 'opatch_pre_end'.
- -property_file
- The user defined property file for OPatch to use. The
- path to the property file should be absolute. This
- property file takes precedence over the one that is
- supplied with OPatch
- -ptlConnect
- This option can be used to specify the connect string of the
- portal schema
- -ptlPassword
- This option can be used to specify the password of the portal
- schema
-
- -ptlSchema
- This option can be used to specify the schema of the portal
- repository patch
- -remote_nodes
- This option can be used to specify to OPatch the list
- of remote nodes to be used for RAC mode rollback of
- the patch. The node names are comma separated and
- without spaces
- -report
- Just prints out the actions, without executing
- -retry
- This option tells OPatch how many times should retry in
- case of an inventory lock failure.
- -runSql
- This option can be used to specify OPatch to run the
- sql scripts and sql procedures if they are present in the
- given patch.
- -silent
- This suppresses any user-interaction and defaults any
- Y|N question to Y. This option is not supported on
- RAC yet
- -sqlScript
- This option can be used to specify the custom sql script
- to be run by OPatch after patching is completed
- -verbose
- This option prints more OPatch output to the screen
- as well as to the log file
- -all_subpatches
- This option is valid ONLY for composite patches. It allows
- the user to rollback all subpatches of a composite series
- in one shot.
- PARAMETERS
- Patch ID of the patch to be rolled back unless the command is
- invoked within a patch area. For translation patches, it will
- be <Patch ID>/<Language code>.
- OPatch succeeded.
复制代码- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch rollback -id 13906496
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_22_19/rollback2018-06-23_10-22-19上午_1.log
- RollbackSession 从 OH '/u01/app/oracle/product/11.2.0/dbhome_1' 回退中间补丁程序 '13906496'
- 请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
- (Oracle 主目录 = '/u01/app/oracle/product/11.2.0/dbhome_1')
- 本地系统是否已准备打补丁? [y|n]
- y
- User Responded with: Y
- 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
- RollbackSession 从产品清单中删除中间补丁程序 '13906496'
- Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_22_19/rollback2018-06-23_10-22-19上午_1.log
- OPatch succeeded.
复制代码- [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-24-21上午_1.log
- Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-24-21上午.txt
- --------------------------------------------------------------------------------
- 已安装的顶级产品 (1):
- Oracle Database 11g 11.2.0.3.0
- 此 Oracle 主目录中已安装 1 个产品。
- 此 Oracle 主目录中未安装任何中间补丁程序。
- --------------------------------------------------------------------------------
- OPatch succeeded.
- [oracle@station90 13906496]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.3.0 Production on Sat Jun 23 10:24:32 2018
- Copyright (c) 1982, 2011, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected to an idle instance.
- SQL> startup
- ORACLE instance started.
- Total System Global Area 6664212480 bytes
- Fixed Size 2240944 bytes
- Variable Size 3556773456 bytes
- Database Buffers 3087007744 bytes
- Redo Buffers 18190336 bytes
- Database mounted.
- Database opened.
- SQL>
复制代码
热补丁:
- [oracle@station90 13906496]$ ls
- etc files online README.txt
- [oracle@station90 13906496]$ cd online/
- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch query -is_online_patch
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-25-44上午_1.log
- --------------------------------------------------------------------------------
- Patch is an online patch: true
- OPatch succeeded.
复制代码
打热补丁时,要研究参数:
- -connectString
- This option can be used to specify the list of database
- instances on which the patch needs to be applied. The
- value for this option is specified as per the following
- syntax "SID:User:Passwd:Node". The SID is a must, others
- can be ignored, OPatch takes default values for it.
- Ex: oracle:dba:dba:mymachine,oracle1:::
- NOTE: If the system is not part of RAC setup, then to
- patch just the local node, provide the node name as
- empty string.
复制代码- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply -connectString orcl::: -connectString rcat:::
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_29_42/apply2018-06-23_10-29-42上午_1.log
- 补丁程序只应在 '-all_nodes' 模式下应用/回退。
- 将 RAC 模式转换为 '-all_nodes' 模式。
- Applying interim patch '13906496' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
- Verifying environment and performing prerequisite checks...
- All checks passed.
- 提供电子邮件地址以用于接收有关安全问题的通知, 安装 Oracle Configuration Manager 并启动它。如果您使用 My Oracle
- Support 电子邮件地址/用户名, 操作将更简单。
- 有关详细信息, 请访问 http://www.oracle.com/support/policies.html。
- 电子邮件地址/用户名:
- 尚未提供电子邮件地址以接收有关安全问题的通知。
- 是否不希望收到有关安全问题 (是 [Y], 否 [N]) [N] 的通知: Y
- Backing up files...
- 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
- 正在数据库 'rcat' 上安装和启用联机补丁程序 'bug13906496.pch'。
- Verifying the update...
- Patch 13906496 successfully applied
- Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_29_42/apply2018-06-23_10-29-42上午_1.log
- OPatch succeeded.
- [oracle@station90 online]$
复制代码- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-30-58上午_1.log
- Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-30-58上午.txt
- --------------------------------------------------------------------------------
- 已安装的顶级产品 (1):
- Oracle Database 11g 11.2.0.3.0
- 此 Oracle 主目录中已安装 1 个产品。
- 中间补丁程序 (1) :
- Patch (online) 13906496: applied on Sat Jun 23 10:30:05 CST 2018
- Unique Patch ID: 17324986
- Created on 22 Jul 2014, 12:09:07 hrs PST8PDT
- Bugs fixed:
- 13906496
- --------------------------------------------------------------------------------
- OPatch succeeded.
复制代码- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch rollback -id 13906496 -connectString orcl::: -connectString rcat:::
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_31_32/rollback2018-06-23_10-31-32上午_1.log
- RollbackSession 从 OH '/u01/app/oracle/product/11.2.0/dbhome_1' 回退中间补丁程序 '13906496'
- 补丁程序只应在 '-all_nodes' 模式下应用/回退。
- 将 RAC 模式转换为 '-all_nodes' 模式。
- 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
- The patch will be removed from database instances.
- 正在数据库 'rcat' 上禁用和删除联机补丁程序 'bug13906496.pch'
- RollbackSession 从产品清单中删除中间补丁程序 '13906496'
- Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jun_23_2018_10_31_32/rollback2018-06-23_10-31-32上午_1.log
- OPatch succeeded.
复制代码- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-32-02上午_1.log
- Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-32-02上午.txt
- --------------------------------------------------------------------------------
- 已安装的顶级产品 (1):
- Oracle Database 11g 11.2.0.3.0
- 此 Oracle 主目录中已安装 1 个产品。
- 此 Oracle 主目录中未安装任何中间补丁程序。
- --------------------------------------------------------------------------------
- OPatch succeeded.
复制代码 专项检查块I/O:
出现坏块之后的应激性体检反应:
出现坏块之后,仍然坚持备份:
- RMAN> run {
- 2> set maxcorrupt for datafile 5 to 1;
- 3> backup datafile 5;
- 4> }
- executing command: SET MAX CORRUPT
- Starting backup at 23-JUN-18
- allocated channel: ORA_SBT_TAPE_1
- channel ORA_SBT_TAPE_1: SID=204 device type=SBT_TAPE
- channel ORA_SBT_TAPE_1: Oracle Secure Backup
- allocated channel: ORA_SBT_TAPE_2
- channel ORA_SBT_TAPE_2: SID=75 device type=SBT_TAPE
- channel ORA_SBT_TAPE_2: Oracle Secure Backup
- channel ORA_SBT_TAPE_1: starting full datafile backup set
- channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
- input datafile file number=00005 name=+DATA/orcl/datafile/example.268.979556715
- channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
- channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
- piece handle=2ft65mn8_1_1 tag=TAG20180623T111136 comment=API Version 2.0,MMS Version 10.4.0.4
- channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
- Finished backup at 23-JUN-18
- Starting Control File and SPFILE Autobackup at 23-JUN-18
- piece handle=c-1343950367-20180623-02 comment=API Version 2.0,MMS Version 10.4.0.4
- Finished Control File and SPFILE Autobackup at 23-JUN-18
复制代码 要避免failover备份怎么办:
RMAN> recover corruption list ;
Starting recover at 23-JUN-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=142 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=193 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=19 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=73 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=143 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=205 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=18 device type=DISK
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_1: restoring block(s)
channel ORA_SBT_TAPE_1: specifying block(s) to restore from backup set
restoring blocks of datafile 00005
channel ORA_SBT_TAPE_1: reading from backup piece 2ft65mn8_1_1
channel ORA_SBT_TAPE_1: piece handle=2ft65mn8_1_1 tag=TAG20180623T111136
channel ORA_SBT_TAPE_1: restored block(s) from backup piece 1
channel ORA_SBT_TAPE_1: block restore complete, elapsed time: 00:00:30
failover to previous backup
channel ORA_SBT_TAPE_1: restoring block(s) from datafile copy +DATA/orcl/datafile/example.265.978971073
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 23-JUN-18
RMAN>
- [oracle@station90 ~]$ rman target /
- Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jun 23 11:19:50 2018
- Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1343950367)
- RMAN> backup validate datafile 5;
- Starting backup at 23-JUN-18
- using target database control file instead of recovery catalog
- allocated channel: ORA_SBT_TAPE_1
- channel ORA_SBT_TAPE_1: SID=139 device type=SBT_TAPE
- channel ORA_SBT_TAPE_1: Oracle Secure Backup
- allocated channel: ORA_SBT_TAPE_2
- channel ORA_SBT_TAPE_2: SID=15 device type=SBT_TAPE
- channel ORA_SBT_TAPE_2: Oracle Secure Backup
- channel ORA_SBT_TAPE_1: starting full datafile backup set
- channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
- input datafile file number=00005 name=+DATA/orcl/datafile/example.268.979557535
- channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
- List of Datafiles
- =================
- File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
- ---- ------ -------------- ------------ --------------- ----------
- 5 OK 1 1689 12805 1731900
- File Name: +DATA/orcl/datafile/example.268.979557535
- Block Type Blocks Failing Blocks Processed
- ---------- -------------- ----------------
- Data 0 6598
- Index 0 1261
- Other 0 3252
- Finished backup at 23-JUN-18
复制代码 RMAN> recover corruption list restore until time 'sysdate-100' ;
Starting recover at 23-JUN-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=140 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=201 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=16 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=77 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=141 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=202 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=17 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=78 device type=DISK
using channel ORA_SBT_TAPE_1
using channel ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_1: restoring block(s)
channel ORA_SBT_TAPE_1: specifying block(s) to restore from backup set
restoring blocks of datafile 00005
channel ORA_SBT_TAPE_1: reading from backup piece 12s4ih4j_1_1
channel ORA_SBT_TAPE_1: piece handle=12s4ih4j_1_1 tag=0T_INCR0_WHOLE
channel ORA_SBT_TAPE_1: restored block(s) from backup piece 1
channel ORA_SBT_TAPE_1: block restore complete, elapsed time: 00:00:25
starting media recovery
archived log for thread 1 with sequence 20 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_20.262.978718451
archived log for thread 1 with sequence 21 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_21.261.978719657
archived log for thread 1 with sequence 22 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_22.263.978724859
archived log for thread 1 with sequence 23 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_23.264.978728945
archived log for thread 1 with sequence 24 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_24.265.978730009
archived log for thread 1 with sequence 25 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_25.266.978730159
archived log for thread 1 with sequence 26 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_26.267.978730217
archived log for thread 1 with sequence 27 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_27.268.978730301
archived log for thread 1 with sequence 28 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_28.269.978730343
archived log for thread 1 with sequence 29 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_29.270.978730365
archived log for thread 1 with sequence 30 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_30.271.978730413
archived log for thread 1 with sequence 31 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_31.272.978730479
archived log for thread 1 with sequence 32 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_32.273.978730497
archived log for thread 1 with sequence 33 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_33.274.978730509
archived log for thread 1 with sequence 34 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_34.275.978730537
archived log for thread 1 with sequence 35 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_35.276.978730583
archived log for thread 1 with sequence 36 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_36.277.978730655
archived log for thread 1 with sequence 37 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_37.278.978730707
archived log for thread 1 with sequence 38 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_38.279.978730769
archived log for thread 1 with sequence 39 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_39.280.978730815
archived log for thread 1 with sequence 40 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_40.281.978730845
archived log for thread 1 with sequence 41 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_41.282.978730885
archived log for thread 1 with sequence 42 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_42.283.978730909
archived log for thread 1 with sequence 43 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_43.284.978730937
archived log for thread 1 with sequence 44 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_44.285.978730955
archived log for thread 1 with sequence 45 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_45.286.978730973
archived log for thread 1 with sequence 46 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_46.287.978730981
archived log for thread 1 with sequence 47 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_47.288.978731003
archived log for thread 1 with sequence 48 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_48.289.978731025
archived log for thread 1 with sequence 49 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_49.290.978731037
archived log for thread 1 with sequence 50 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_50.291.978731057
archived log for thread 1 with sequence 51 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_51.292.978731099
archived log for thread 1 with sequence 52 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_52.293.978731141
archived log for thread 1 with sequence 53 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_53.294.978731171
archived log for thread 1 with sequence 54 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_54.295.978731197
archived log for thread 1 with sequence 55 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_55.296.978731241
archived log for thread 1 with sequence 56 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_56.297.978731263
archived log for thread 1 with sequence 57 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_57.298.978731289
archived log for thread 1 with sequence 58 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_58.299.978731337
archived log for thread 1 with sequence 59 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_59.300.978731375
archived log for thread 1 with sequence 60 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_60.301.978731389
archived log for thread 1 with sequence 61 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_61.302.978731401
archived log for thread 1 with sequence 62 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_62.303.978731423
archived log for thread 1 with sequence 63 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_63.304.978731441
archived log for thread 1 with sequence 64 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_64.305.978731457
archived log for thread 1 with sequence 65 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_65.306.978731471
archived log for thread 1 with sequence 66 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_66.307.978731491
archived log for thread 1 with sequence 67 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_67.308.978731541
archived log for thread 1 with sequence 68 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_68.309.978731571
archived log for thread 1 with sequence 69 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_69.310.978731613
archived log for thread 1 with sequence 70 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_70.311.978731669
archived log for thread 1 with sequence 71 is already on disk as file +FRA/orcl/archivelog/2018_06_13/thread_1_seq_71.312.978731711
archived log for thread 1 with sequence 72 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_72.313.978944869
archived log for thread 1 with sequence 73 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_73.314.978945111
archived log for thread 1 with sequence 74 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_74.315.978945125
archived log for thread 1 with sequence 75 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_75.316.978945145
archived log for thread 1 with sequence 76 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_76.317.978945161
archived log for thread 1 with sequence 77 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_77.318.978945181
archived log for thread 1 with sequence 78 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_78.319.978945203
archived log for thread 1 with sequence 79 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_79.320.978945227
archived log for thread 1 with sequence 80 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_80.321.978955239
archived log for thread 1 with sequence 81 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_81.322.978959293
archived log for thread 1 with sequence 82 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_82.323.978963551
archived log for thread 1 with sequence 83 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_83.326.978971083
archived log for thread 1 with sequence 84 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_84.327.978971181
archived log for thread 1 with sequence 85 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_85.328.978971217
archived log for thread 1 with sequence 86 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_86.329.978971227
archived log for thread 1 with sequence 87 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_87.330.978971233
archived log for thread 1 with sequence 88 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_88.331.978971239
archived log for thread 1 with sequence 89 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_89.332.978971251
archived log for thread 1 with sequence 90 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_90.333.978971541
archived log for thread 1 with sequence 91 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_91.334.978971583
archived log for thread 1 with sequence 92 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_92.335.978971603
archived log for thread 1 with sequence 93 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_93.336.978971629
archived log for thread 1 with sequence 94 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_94.337.978971647
archived log for thread 1 with sequence 95 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_95.339.978972203
archived log for thread 1 with sequence 96 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_96.338.978973541
archived log for thread 1 with sequence 97 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_97.340.978972205
archived log for thread 1 with sequence 98 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_98.341.978972277
archived log for thread 1 with sequence 99 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_99.342.978972311
archived log for thread 1 with sequence 100 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_100.343.978972319
archived log for thread 1 with sequence 101 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_101.344.978972327
archived log for thread 1 with sequence 102 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_102.345.978972333
archived log for thread 1 with sequence 103 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_103.346.978972343
archived log for thread 1 with sequence 104 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_104.347.978972431
archived log for thread 1 with sequence 105 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_105.348.978972483
archived log for thread 1 with sequence 106 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_106.349.978972493
archived log for thread 1 with sequence 107 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_107.350.978972519
archived log for thread 1 with sequence 108 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_108.351.978972537
archived log for thread 1 with sequence 109 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_109.352.978972561
archived log for thread 1 with sequence 110 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_110.353.978972591
archived log for thread 1 with sequence 111 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_111.354.978972609
archived log for thread 1 with sequence 112 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_112.355.978972635
archived log for thread 1 with sequence 113 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_113.356.978972669
archived log for thread 1 with sequence 114 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_114.357.978972831
archived log for thread 1 with sequence 115 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_115.358.978973981
archived log for thread 1 with sequence 116 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_116.359.978974233
archived log for thread 1 with sequence 117 is already on disk as file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_117.360.978983839
archived log for thread 1 with sequence 118 is already on disk as file +FRA/orcl/archivelog/2018_06_23/thread_1_seq_118.361.979549471
archived log for thread 1 with sequence 119 is already on disk as file +FRA/orcl/archivelog/2018_06_23/thread_1_seq_119.362.979555043
archived log for thread 1 with sequence 120 is already on disk as file +FRA/orcl/archivelog/2018_06_23/thread_1_seq_120.365.979556725
archived log for thread 1 with sequence 121 is already on disk as file +FRA/orcl/archivelog/2018_06_23/thread_1_seq_121.368.979557547
channel ORA_SBT_TAPE_1: starting archived log restore to default destination
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=19
channel ORA_SBT_TAPE_1: reading from backup piece 14s4ih5n_1_1
channel ORA_SBT_TAPE_1: piece handle=14s4ih5n_1_1 tag=0T_INCR0_WHOLE
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:33
channel ORA_SBT_TAPE_1: deleting archived log(s)
archived log file name=+FRA/orcl/archivelog/2018_06_23/thread_1_seq_19.369.979557707 RECID=115 STAMP=979557712
media recovery complete, elapsed time: 00:01:41
Finished recover at 23-JUN-18
RMAN>
逻辑坏块的应激性响应:
ADRCI是文本形式的support workbench:
- adrci> set homepath diag/rdbms/orcl/orcl
- adrci> show incidents
- ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
- *************************************************************************
- INCIDENT_ID PROBLEM_KEY CREATE_TIME
- -------------------- ----------------------------------------------------------- ----------------------------------------
- 17065 ORA 1578 2018-06-16 16:26:41.722000 +08:00
- 17073 ORA 600 [1433] 2018-06-16 16:38:01.032000 +08:00
- 17145 ORA 600 [1433] 2018-06-16 16:38:01.821000 +08:00
- 17066 ORA 600 [1433] 2018-06-16 16:38:02.710000 +08:00
- 17057 ORA 600 [1433] 2018-06-16 16:38:03.540000 +08:00
- 17081 ORA 600 [1433] 2018-06-16 16:38:04.465000 +08:00
- 21962 ORA 1578 2018-06-16 16:52:47.458000 +08:00
- 21842 ORA 1578 2018-06-16 17:10:46.702000 +08:00
- 21834 ORA 1578 2018-06-16 17:16:11.056000 +08:00
- 23109 ORA 1578 2018-06-23 08:50:24.098000 +08:00
- 23110 ORA 1578 2018-06-23 08:50:25.093000 +08:00
- 23269 ORA 1578 2018-06-23 09:02:57.444000 +08:00
- 23270 ORA 1578 2018-06-23 09:02:58.243000 +08:00
- 26777 ORA 1578 2018-06-23 11:05:48.425000 +08:00
- 26953 ORA 1578 2018-06-23 11:15:59.534000 +08:00
- 26954 ORA 1578 2018-06-23 11:16:00.294000 +08:00
- 16 rows fetched
- adrci> help show incidents
- Usage: SHOW INCIDENT [-p <predicate_string>]
- [-mode BASIC|BRIEF|DETAIL]
- [-last <num> | -all]
- [-orderby (field1, field2, ...) [ASC|DSC]]
- Purpose: Show the incident information. By default, this command will
- only show the last 50 incidents which are not flood controlled.
- Options:
- [-p <predicate_string>]: The predicate string must be double-quoted.
- [-mode BASIC|BRIEF|DETAIL]: The different modes of showing incidents.
- BASIC will show the basic information of non-flooded controlled
- incidents, which is the default mode. In this mode, only the following
- fields can be used in the predicate clause:
- INCIDENT_ID number
- PROBLEM_KEY text(550)
- CREATE_TIME timestamp
- BRIEF will display incident information from the incident relation.
- In this mode, the fields can appear in the predicate are:
- INCIDENT_ID number
- PROBLEM_ID number
- CREATE_TIME timestamp
- CLOSE_TIME timestamp
- STATUS number
- FLAGS number
- FLOOD_CONTROLLED number
- ERROR_FACILITY text(10)
- ERROR_NUMBER number
- ERROR_ARG1 text(64)
- ERROR_ARG2 text(64)
- ERROR_ARG3 text(64)
- ERROR_ARG4 text(64)
- ERROR_ARG5 text(64)
- ERROR_ARG6 text(64)
- ERROR_ARG7 text(64)
- ERROR_ARG8 text(64)
- SIGNALLING_COMPONENT text(64)
- SIGNALLING_SUBCOMPONENT text(64)
- SUSPECT_COMPONENT text(64)
- SUSPECT_SUBCOMPONENT text(64)
- ECID text(64)
- IMPACT number
- DETAIL will display all incident-related information, such as incident
- files. The fields can appear in the predicate is the same as the ones
- in the brief mode.
- [-last <num> | -all]: This option allows users to either select
- the last <num> of qualified incidents to show or to show all the
- qualified incidents. If this option is not specified, this command
- will only show 50 incidents.
- [-orderby (field1, field2, ...) [ASC|DSC]]: If specified, the results
- will be ordered by the specified fields' values. By default, it will be
- in the ascending order unless "DSC" is specified. Note that the field
- names that can be specified here are from the "INCIDENT" relation.
- Examples:
- show incident
- show incident -mode detail
- show incident -mode detail -p "incident_id=123"
- adrci> show incident -mode detail -p "incident_id=26954"
- ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
- *************************************************************************
- **********************************************************
- INCIDENT INFO RECORD 1
- **********************************************************
- INCIDENT_ID 26954
- STATUS ready
- CREATE_TIME 2018-06-23 11:16:00.294000 +08:00
- PROBLEM_ID 1
- CLOSE_TIME <NULL>
- FLOOD_CONTROLLED none
- ERROR_FACILITY ORA
- ERROR_NUMBER 1578
- ERROR_ARG1 6
- ERROR_ARG2 136
- ERROR_ARG3 <NULL>
- ERROR_ARG4 <NULL>
- ERROR_ARG5 <NULL>
- ERROR_ARG6 <NULL>
- ERROR_ARG7 <NULL>
- ERROR_ARG8 <NULL>
- ERROR_ARG9 <NULL>
- ERROR_ARG10 <NULL>
- ERROR_ARG11 <NULL>
- ERROR_ARG12 <NULL>
- SIGNALLING_COMPONENT CACHE_RCV
- SIGNALLING_SUBCOMPONENT <NULL>
- SUSPECT_COMPONENT <NULL>
- SUSPECT_SUBCOMPONENT <NULL>
- ECID <NULL>
- IMPACTS 0
- PROBLEM_KEY ORA 1578
- FIRST_INCIDENT 17065
- FIRSTINC_TIME 2018-06-16 16:26:41.722000 +08:00
- LAST_INCIDENT 26954
- LASTINC_TIME 2018-06-23 11:16:00.294000 +08:00
- IMPACT1 34668552
- IMPACT2 34668545
- IMPACT3 0
- IMPACT4 0
- KEY_NAME ProcId
- KEY_VALUE 68.1
- KEY_NAME PQ
- KEY_VALUE (16777216, 1529723760)
- KEY_NAME SID
- KEY_VALUE 20.59
- KEY_NAME Client ProcId
- KEY_VALUE oracle@station90.example.com (TNS V1-V3).28784_139936914835200
- OWNER_ID 1
- INCIDENT_FILE /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_28784.trc
- OWNER_ID 1
- INCIDENT_FILE /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_26954/orcl_ora_28784_i26954.trc
- 1 rows fetched
- adrci> ips create package incident 26954;
- Created package 2 based on incident id 26954, correlation level typical
- adrci>
复制代码
- adrci>
- adrci> ips SHOW PACKAGE;
- PACKAGE_ID 1
- PACKAGE_NAME ORA1578_datafile6_block136
- PACKAGE_DESCRIPTION ORA1578_datafile6_block136
- DRIVING_PROBLEM 1
- DRIVING_PROBLEM_KEY ORA 1578
- DRIVING_INCIDENT 17065
- DRIVING_INCIDENT_TIME 2018-06-16 16:26:41.722000 +08:00
- STATUS Generated (4)
- CORRELATION_LEVEL Typical (2)
- PROBLEMS 1 main problems, 0 correlated problems
- INCIDENTS 4 main incidents, 0 correlated incidents
- INCLUDED_FILES 154
- PACKAGE_ID 2
- PACKAGE_NAME ORA1578_20180623113922
- PACKAGE_DESCRIPTION
- DRIVING_PROBLEM 1
- DRIVING_PROBLEM_KEY ORA 1578
- DRIVING_INCIDENT 26954
- DRIVING_INCIDENT_TIME 2018-06-23 11:16:00.294000 +08:00
- STATUS New (0)
- CORRELATION_LEVEL Typical (2)
- PROBLEMS 1 main problems, 1 correlated problems
- INCIDENTS 1 main incidents, 1 correlated incidents
- INCLUDED_FILES 6
- adrci> help ips GENERATE PACKAGE
- Usage: IPS GENERATE PACKAGE <package_id> [IN <path>]
- [COMPLETE | INCREMENTAL]
- Purpose: Create a physical package (zip file) in target directory.
- Arguments:
- <package_id>: ID of package to create physical package file for.
- <path>: Path where the physical package file should be generated.
- Options:
- COMPLETE: The package will include all package files, even if a
- previous package sequence has been generated.
- This is the default.
- INCREMENTAL: The package will only include files that have been added
- or changed since the last package generation.
- Notes:
- If no target path is specified, the physical package file is generated
- in the current working directory.
- Example:
- ips generate package 12 in /tmp
- adrci> ips generate package 2 ;
- Generated package 2 in file /home/oracle/ORA1578_20180623113922_COM_1.zip, mode complete
- adrci>
复制代码- select * from v$hm_check where name ='Block IO Revalidation Check';
- select * from v$hm_check_param where check_id=21 ;
- select * from v$tablespace;
- begin
- dbms_hm.run_check(check_name => 'Block IO Revalidation Check',
- run_name => 'MYRUN2',
- input_params => 'FILE_NUM=6;FILE_BLOCKSIZE=8192;BLOCK_NUM=136');
- end;
-
复制代码- select * from v$hm_check where name ='Dictionary Integrity Check';
- select * from v$hm_check_param where check_id=24 ;
- begin
- dbms_hm.run_check(check_name => 'Dictionary Integrity Check',
- run_name => 'MYRUN2',
- input_params => 'TABLE_NAME=tab
- 文本看报告:
- [code]select dbms_hm.get_run_report(run_name => 'MYRUN2') from dual;
复制代码 ADRCI文本看报告:
- **********************************************************
- HM RUN RECORD 22
- **********************************************************
- RUN_ID 867
- RUN_NAME MYRUN2
- CHECK_NAME Dictionary Integrity Check
- NAME_ID 24
- MODE 0
- START_TIME 2018-06-23 14:36:51.946092 +08:00
- RESUME_TIME <NULL>
- END_TIME 2018-06-23 14:36:52.067610 +08:00
- MODIFIED_TIME 2018-06-23 14:39:37.289516 +08:00
- TIMEOUT 0
- FLAGS 0
- STATUS 5
- SRC_INCIDENT_ID 0
- NUM_INCIDENTS 0
- ERR_NUMBER 0
- REPORT_FILE /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_MYRUN2.hm
- 22 rows fetched
- adrci> create report hm_run MYRUN2
- adrci> show report hm_run MYRUN2
- <?xml version="1.0" encoding="US-ASCII"?>
- <HM-REPORT REPORT_ID="MYRUN2">
- <TITLE>HM Report: MYRUN2</TITLE>
- <RUN_INFO>
- <CHECK_NAME>Dictionary Integrity Check</CHECK_NAME>
- <RUN_ID>867</RUN_ID>
- <RUN_NAME>MYRUN2</RUN_NAME>
- <RUN_MODE>MANUAL</RUN_MODE>
- <RUN_STATUS>COMPLETED</RUN_STATUS>
- <RUN_ERROR_NUM>0</RUN_ERROR_NUM>
- <SOURCE_INCIDENT_ID>0</SOURCE_INCIDENT_ID>
- <NUM_INCIDENTS_CREATED>0</NUM_INCIDENTS_CREATED>
- <RUN_START_TIME>2018-06-23 14:36:51.946092 +08:00</RUN_START_TIME>
- <RUN_END_TIME>2018-06-23 14:36:52.067610 +08:00</RUN_END_TIME>
- </RUN_INFO>
- <RUN_PARAMETERS>
- <RUN_PARAMETER>TABLE_NAME=tab[ DISCUZ_CODE_508 ]lt;/RUN_PARAMETER>
- <RUN_PARAMETER>CHECK_MASK=ALL</RUN_PARAMETER>
- </RUN_PARAMETERS>
- <RUN-FINDINGS/>
- </HM-REPORT>
- adrci>
复制代码 文本看报告:
- select dbms_hm.get_run_report(run_name => 'MYRUN2') from dual;
复制代码 ADRCI文本看报告:
- **********************************************************
- HM RUN RECORD 22
- **********************************************************
- RUN_ID 867
- RUN_NAME MYRUN2
- CHECK_NAME Dictionary Integrity Check
- NAME_ID 24
- MODE 0
- START_TIME 2018-06-23 14:36:51.946092 +08:00
- RESUME_TIME <NULL>
- END_TIME 2018-06-23 14:36:52.067610 +08:00
- MODIFIED_TIME 2018-06-23 14:39:37.289516 +08:00
- TIMEOUT 0
- FLAGS 0
- STATUS 5
- SRC_INCIDENT_ID 0
- NUM_INCIDENTS 0
- ERR_NUMBER 0
- REPORT_FILE /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_MYRUN2.hm
- 22 rows fetched
- adrci> create report hm_run MYRUN2
- adrci> show report hm_run MYRUN2
- <?xml version="1.0" encoding="US-ASCII"?>
- <HM-REPORT REPORT_ID="MYRUN2">
- <TITLE>HM Report: MYRUN2</TITLE>
- <RUN_INFO>
- <CHECK_NAME>Dictionary Integrity Check</CHECK_NAME>
- <RUN_ID>867</RUN_ID>
- <RUN_NAME>MYRUN2</RUN_NAME>
- <RUN_MODE>MANUAL</RUN_MODE>
- <RUN_STATUS>COMPLETED</RUN_STATUS>
- <RUN_ERROR_NUM>0</RUN_ERROR_NUM>
- <SOURCE_INCIDENT_ID>0</SOURCE_INCIDENT_ID>
- <NUM_INCIDENTS_CREATED>0</NUM_INCIDENTS_CREATED>
- <RUN_START_TIME>2018-06-23 14:36:51.946092 +08:00</RUN_START_TIME>
- <RUN_END_TIME>2018-06-23 14:36:52.067610 +08:00</RUN_END_TIME>
- </RUN_INFO>
- <RUN_PARAMETERS>
- <RUN_PARAMETER>TABLE_NAME=tab[ DISCUZ_CODE_508 ]lt;/RUN_PARAMETER>
- <RUN_PARAMETER>CHECK_MASK=ALL</RUN_PARAMETER>
- </RUN_PARAMETERS>
- <RUN-FINDINGS/>
- </HM-REPORT>
- adrci>
复制代码 逻辑坏块的修复:
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'REPAIR_TABLE',
- table_type => DBMS_REPAIR.REPAIR_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from REPAIR_TABLE;
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'ORPHAN_KEY_TABLE',
- table_type => DBMS_REPAIR.ORPHAN_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from ORPHAN_KEY_TABLE;
- DECLARE
- num_corrupt INT;
- BEGIN
- num_corrupt := 0;
- DBMS_REPAIR.CHECK_OBJECT (
- schema_name => 'HR',
- object_name => 'TLOGICAL',
- repair_table_name => 'REPAIR_TABLE',
- corrupt_count => num_corrupt);
- dbms_output.put_line( 'Find '|| num_corrupt||' Bolcks.' );
- END;
- select * from REPAIR_TABLE;
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'ILOGICAL_A',
- object_type => DBMS_REPAIR.INDEX_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- orphan_table_name => 'ORPHAN_KEY_TABLE',
- key_count => num_orphans);
- DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
- END;
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'ILOGICAL_B',
- object_type => DBMS_REPAIR.INDEX_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- orphan_table_name => 'ORPHAN_KEY_TABLE',
- key_count => num_orphans);
- DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
- END;
- select * from ORPHAN_KEY_TABLE;
- select o.index_name, key from orphan_key_table o where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
- and o.index_name='ILOGICAL_B';
-
-
-
- select o.index_name, key from orphan_key_table o where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
- and o.index_name='ILOGICAL_A';
-
- ----
- begin
- dbms_repair.skip_corrupt_blocks(schema_name => 'HR',object_name => 'TLOGICAL');
- end;
- ----
- select o.index_name, key , dump(key) from orphan_key_table o where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
- and o.index_name='ILOGICAL_B';
-
- 4,195,4,23,86
- 100^(195-193-0)*(4-1)+
- 100^(195-193-1)*(23-1)+
- 100^(195-193-2)*(86-1)
- =30000+2200+85=32285
-
-
-
- select o.index_name, key, dump(key) from orphan_key_table o where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
- and o.index_name='ILOGICAL_A';
- 7,98b,97a,99c,107k,97a,114r,101e
- select dump(1) from dual;
- 193,2
- 100^(193-193-0)*(2-1)=1
- select dump(10) from dual;
- 193,11
- 100^(192-193-0)*(11-1)=10
- select dump(100) from dual;
- 194,2
- 100^(194-193-0)*(2-1)=100
- select dump(1000) from dual;
- 194,11
- 100^(194-193-0)*(11-1)=1000
- select dump(110) from dual;
- 194,2,11
- 100^(194-193-0)*(2-1) +100^(194-193-1)*(11-1)=100+10=110
- select dump(123456.789) from dual;
- 195,13,35,57,79,91
- 100^(195-193-0)*(13-1) +
- 100^(195-193-1)*(35-1) +
- 100^(195-193-2)*(57-1) +
- 100^(195-193-3)*(79-1) +
- 100^(195-193-4)*(91-1)
- = 120000+3400+56+0.78+0.009=123456.789
- -----------------------
- select dump(0) from dual;
- 128
- select dump(-1) from dual;
- 62,100,102
- 100^(62-62-0)*(101-100)=1
- select dump(-10) from dual;
- 62,91,102
- 100^(62-62-0)*(101-91)=10
- select dump(-100) from dual;
- 61,100,102
- 100^(62-61)*(101-100)=100
- select dump(-123456.789) from dual;
- 60,89,67,45,23,11,102
- 100^(62-60-0)*(101-89)+
- 100^(62-60-1)*(101-67)+
- 100^(62-60-2)*(101-45)+
- 100^(62-60-3)*(101-23)+
- 100^(62-60-4)*(101-11)
- =12000+3400+56+0.78+0.009
- select dump(-123456.78901) from dual;
- 60,89,67,45,23,11,91,102
- ---------------------------------------------------------------------
复制代码- SQL> drop index ilogical_a;
- Index dropped.
- SQL> create index ilogical_a on tlogical(a) ;
- Index created.
- SQL> drop index ilogical_b;
- Index dropped.
- SQL> create index ilogical_b on tlogical(b) ;
- Index created.
复制代码
1. 文件对应通道的RMAN调优:
- [oracle@station90 asm_to_disk]$ rman target /
- Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jun 23 16:14:48 2018
- Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1343950367, not open)
- RMAN> run {
- 2> allocate channel c1 device type disk format '/home/oracle/asm_to_disk/system01.dbf';
- 3> backup as copy datafile 1;
- 4> release channel c1;
- 5> allocate channel c1 device type disk format '/home/oracle/asm_to_disk/sysaux01.dbf';
- 6> backup as copy datafile 2;
- 7> release channel c1;
- 8> }
- using target database control file instead of recovery catalog
- allocated channel: c1
- channel c1: SID=131 device type=DISK
- Starting backup at 23-JUN-18
- channel c1: starting datafile copy
- input datafile file number=00001 name=+DATA/orcl/datafile/system.256.816169553
- output file name=/home/oracle/asm_to_disk/system01.dbf tag=TAG20180623T161600 RECID=9 STAMP=979575364
- channel c1: datafile copy complete, elapsed time: 00:00:07
- Finished backup at 23-JUN-18
- Starting Control File and SPFILE Autobackup at 23-JUN-18
- piece handle=+FRA/orcl/autobackup/2018_06_23/s_979575263.370.979575369 comment=NONE
- Finished Control File and SPFILE Autobackup at 23-JUN-18
- released channel: c1
- allocated channel: c1
- channel c1: SID=131 device type=DISK
- Starting backup at 23-JUN-18
- channel c1: starting datafile copy
- input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.816169553
- output file name=/home/oracle/asm_to_disk/sysaux01.dbf tag=TAG20180623T161610 RECID=10 STAMP=979575374
- channel c1: datafile copy complete, elapsed time: 00:00:07
- Finished backup at 23-JUN-18
- Starting Control File and SPFILE Autobackup at 23-JUN-18
- piece handle=+FRA/orcl/autobackup/2018_06_23/s_979575263.371.979575379 comment=NONE
- Finished Control File and SPFILE Autobackup at 23-JUN-18
- released channel: c1
- RMAN> run {
- 2> allocate channel c1 device type disk format '/home/oracle/asm_to_disk/system01.dbf';
- 3> allocate channel c2 device type disk format '/home/oracle/asm_to_disk/sysaux01.dbf';
- 4> backup as copy
- 5> (datafile 1 channel c1)
- 6> (datafile 2 channel c2);
- 7> }
- allocated channel: c1
- channel c1: SID=131 device type=DISK
- allocated channel: c2
- channel c2: SID=194 device type=DISK
- Starting backup at 23-JUN-18
- channel c1: starting datafile copy
- input datafile file number=00001 name=+DATA/orcl/datafile/system.256.816169553
- channel c2: starting datafile copy
- input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.816169553
- output file name=/home/oracle/asm_to_disk/system01.dbf tag=TAG20180623T161801 RECID=12 STAMP=979575488
- channel c1: datafile copy complete, elapsed time: 00:00:07
- output file name=/home/oracle/asm_to_disk/sysaux01.dbf tag=TAG20180623T161801 RECID=11 STAMP=979575486
- channel c2: datafile copy complete, elapsed time: 00:00:07
- Finished backup at 23-JUN-18
- Starting Control File and SPFILE Autobackup at 23-JUN-18
- piece handle=+FRA/orcl/autobackup/2018_06_23/s_979575263.372.979575489 comment=NONE
- Finished Control File and SPFILE Autobackup at 23-JUN-18
- released channel: c1
- released channel: c2
- RMAN>
复制代码
rman定位:
- SELECT OPNAME, CONTEXT, SOFAR, TOTALWORK,
- ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
- FROM V$SESSION_LONGOPS
- WHERE OPNAME LIKE 'RMAN%'
- AND OPNAME NOT LIKE '%aggregate%'
- AND TOTALWORK != 0
- AND SOFAR <> TOTALWORK
- and sid in ( select sid from v$session where terminal=(select s.TERMINAL from v_$session s
- where s.CLIENT_INFO like '%xxxxx%') );
复制代码
查同步或异步RMAN通道:
- select * from v$backup_async_io where status <> 'FINISHED'
- and status <> 'UNKNOWN';
- select * from v$backup_sync_io where status <> 'FINISHED'
- and status <> 'UNKNOWN';
复制代码 控制通道:
- RMAN> run {
- 2> set command id to 'zzzzzz';
- 3> backup database filesperset 1 ;
- 4> }
- executing command: SET COMMAND ID
- Starting backup at 23-JUN-18
- using channel ORA_SBT_TAPE_1
- using channel ORA_SBT_TAPE_2
- channel ORA_SBT_TAPE_1: starting full datafile backup set
- channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
- input datafile file number=00001 name=+DATA/orcl/datafile/system.256.816169553
- channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
- channel ORA_SBT_TAPE_2: starting full datafile backup set
- channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
- input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.816169553
- channel ORA_SBT_TAPE_2: starting piece 1 at 23-JUN-18
- channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
- piece handle=3ft66bbc_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
- channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
- channel ORA_SBT_TAPE_1: starting full datafile backup set
- channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
- input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.258.816169553
- channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
- channel ORA_SBT_TAPE_2: finished piece 1 at 23-JUN-18
- piece handle=3gt66bbc_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
- channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:25
- channel ORA_SBT_TAPE_2: starting full datafile backup set
- channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
- input datafile file number=00005 name=+DATA/orcl/datafile/example.268.979557535
- channel ORA_SBT_TAPE_2: starting piece 1 at 23-JUN-18
- channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
- piece handle=3ht66bc5_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
- channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:16
- channel ORA_SBT_TAPE_1: starting full datafile backup set
- channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
- input datafile file number=00006 name=+DATA/orcl/datafile/tbslogical.267.978972737
- channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
- channel ORA_SBT_TAPE_2: finished piece 1 at 23-JUN-18
- piece handle=3it66bc5_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
- channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:17
- channel ORA_SBT_TAPE_2: starting full datafile backup set
- channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
- input datafile file number=00004 name=+DATA/orcl/datafile/users.259.816169553
- channel ORA_SBT_TAPE_2: starting piece 1 at 23-JUN-18
- channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
- piece handle=3jt66bcl_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
- channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:16
- channel ORA_SBT_TAPE_2: finished piece 1 at 23-JUN-18
- piece handle=3kt66bcm_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
- channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:15
- Finished backup at 23-JUN-18
- Starting Control File and SPFILE Autobackup at 23-JUN-18
- piece handle=c-1343950367-20180623-0d comment=API Version 2.0,MMS Version 10.4.0.4
- Finished Control File and SPFILE Autobackup at 23-JUN-18
复制代码
控制备份的时间:
- RMAN> backup duration 00:10 minimize load tablespace users ;
- Starting backup at 23-JUN-18
- allocated channel: ORA_SBT_TAPE_1
- channel ORA_SBT_TAPE_1: SID=139 device type=SBT_TAPE
- channel ORA_SBT_TAPE_1: Oracle Secure Backup
- allocated channel: ORA_SBT_TAPE_2
- channel ORA_SBT_TAPE_2: SID=76 device type=SBT_TAPE
- channel ORA_SBT_TAPE_2: Oracle Secure Backup
- channel ORA_SBT_TAPE_1: starting full datafile backup set
- channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
- input datafile file number=00004 name=+DATA/orcl/datafile/users.259.816169553
- channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
复制代码
游客,本帖隐藏的内容需要积分高于 50 才可浏览,您当前积分为 0
|
|