Bo's Oracle Station

查看: 3070|回复: 0

活动第30/31次(2018-06-23星期六上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-6-23 09:55:23 | 显示全部楼层 |阅读模式
下载实验用补丁:
[url=http://124.16.180.178:8080/studentguide_sec_O11g/]http://124.16.180.178:8080/studentguide_sec_O11g/[/url]

密码同“活动第28/29次”MOS视频下载的链接。

学习opatch第一步:

  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch -h
  2. Invoking OPatch 11.2.0.1.7

  3. Oracle 中间补丁程序安装程序版本 11.2.0.1.7
  4. 版权所有 (c) 2011, Oracle Corporation。保留所有权利。


  5. Usage: opatch [ -help ] [ -r[eport] ] [ command ]

  6.             command := apply
  7.                        lsinventory
  8.                        napply
  9.                        nrollback
  10.                        rollback
  11.                        query
  12.                        version
  13.                        prereq
  14.                        util

  15. <global_arguments> := -help       Displays the help message for the command.
  16.                        -report     Print the actions without executing.

  17. example:
  18.    'opatch -help'
  19.    'opatch -help -fmw'
  20.    'opatch auto -help'
  21.    'opatch apply -help'
  22.    'opatch lsinventory -help'
  23.    'opatch napply -help'
  24.    'opatch nrollback -help'
  25.    'opatch rollback -help'
  26.    'opatch prereq -help'
  27.    'opatch util -help'


  28. OPatch succeeded.
复制代码
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch version
  2. Invoking OPatch 11.2.0.1.7

  3. OPatch Version: 11.2.0.1.7

  4. OPatch succeeded.
复制代码

有时候,甚至需要先升级opatch本身(看某个要打的patch的README,这个patch可以是Intrerim Patch,也可以是CPU也可以是PSU(PSU会升级第5位版本号)):
  1. [oracle@station90 dbhome_1]$ mv OPatch OPatch.11.2.0.1.7   
  2. [oracle@station90 dbhome_1]$ mv /home/oracle/OPatch/  ./
  3. [oracle@station90 dbhome_1]$ ls
  4. apex         csmig        dv             j2ee    md       OPatch.11.2.0.1.7  plsql         sqlj                        utl
  5. assistants   css          emcli          javavm  mesg     opmn               precomp       sqlplus                     wwg
  6. bin          ctx          EMStage        jdbc    mgw      oracore            racg          srvm                        xdk
  7. ccr          cv           has            jdev    network  oraInst.loc        rdbms         station90.example.com_orcl
  8. cdata        dbs          hs             jdk     nls      ord                relnotes      sysman
  9. cfgtoollogs  dc_ocm       ide            jlib    oc4j     oui                root.sh       timingframework
  10. clone        deinstall    install        ldap    odbc     owb                scheduler     ucp
  11. config       demo         instantclient  lib     olap     owm                slax          uix
  12. crs          diagnostics  inventory      log     OPatch   perl               sqldeveloper  usm
  13. [oracle@station90 dbhome_1]$ cd
  14. [oracle@station90 ~]$ ls
  15. 13906496                 dbclone3.rcv    osb.txt                            physical-block.sh.zip     update_t04209_uname.sql  下载
  16. backup                   dir1            p13906496_112030_Linux-x86-64.zip  revertape-root.sh         公共的                   音乐
  17. copytape-root.sh         dir2            p6880880_112000_Linux-x86-64.zip   select_t04209_uname.sql   模板                     桌面
  18. create_t04209_uname.sql  filename.log    physical-block11.2.0.1.sh          t05310.sql                视频
  19. dbclone1.rcv             mail            physical-block11.2.0.1.sh.zip      ttio.rcv                  图片
  20. dbclone2.rcv             oradiag_oracle  physical-block.sh                  update2_t04209_uname.sql  文档
  21. [oracle@station90 ~]$ cd 13906496
  22. [oracle@station90 13906496]$ ls
  23. etc  files  online  README.txt
  24. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch  -h

  25. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  26. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  27. Usage: opatch [ -help ] [ -report ] [ command ]

  28.             command := apply
  29.                        lsinventory
  30.                        lspatches
  31.                        napply
  32.                        nrollback
  33.                        rollback
  34.                        query
  35.                        version
  36.                        prereq
  37.                        util

  38. <global_arguments> := -help       Displays the help message for the command.
  39.                        -report     Print the actions without executing.

  40. example:
  41.    'opatch -help'
  42.    'opatch -help -fmw'
  43.    'opatch auto -help'
  44.    'opatch apply -help'
  45.    'opatch lsinventory -help'
  46.    'opatch lspatches -help'
  47.    'opatch napply -help'
  48.    'opatch nrollback -help'
  49.    'opatch rollback -help'
  50.    'opatch prereq -help'
  51.    'opatch util -help'


  52. OPatch succeeded.
复制代码
1. 查看当前database环境:
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory  

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-10-15上午_1.log

  10. Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-10-15上午.txt

  11. --------------------------------------------------------------------------------
  12. 已安装的顶级产品 (1):

  13. Oracle Database 11g                                                  11.2.0.3.0
  14. 此 Oracle 主目录中已安装 1 个产品。


  15. 此 Oracle 主目录中未安装任何中间补丁程序。


  16. --------------------------------------------------------------------------------

  17. OPatch succeeded.
复制代码
2. 查看补丁的特性:
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch query -h

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. DESCRIPTION
  5.         This operation loads and prints out various information about a patch.
  6.         Parameter patch_location points to where a patch is located.  
  7.         For example, if you specify "path", there should be sub-dir.
  8.         "etc/config" under "path".

  9. SYNTAX
  10.         opatch query  [-all] [-is_auto_patch] [-is_translatable_patch]
  11.                       [-get_base_bugs] [-get_component] [-get_os] [-get_date]
  12.                       [-get_patch_language] [-get_patch_type] [-get_patching_model]
  13.                       [-get_product_family] [-get_update_components] [-has_sql]  
  14.                       [-is_online_patch]  [-is_patchset_update]
  15.                       [-is_portal_patch] [-is_rolling_patch]
  16.                       [-jre <LOC> ] [-oh <LOC> ]
  17.                       [ <patch_location> ]

  18. OPTIONS
  19.            -all
  20.                 Get everything available about a patch. This is equivalent
  21.                 to setting all available options.

  22.            -is_auto_patch
  23.                 This option says 'true' if the patch is auto-enabled,
  24.                 'false' otherwise.

  25.            -is_translatable_patch
  26.                 This option says 'true' if the patch is translatable,
  27.                 'false' otherwise.

  28.            -get_base_bug
  29.                 Get bugs fixed by the patch

  30.            -get_component
  31.                 Get components touched by the patch.
  32.   
  33.            -get_update_components
  34.                 Get all components to be upgraded in a Patchset Update.

  35.            -get_date
  36.                 Get patch creation date and time.

  37.            -get_os
  38.                 Get platforms for which this patch could be applied.

  39.            -get_patch_type
  40.                 Get the patch type.

  41.            -get_patching_model
  42.                 Get the patching model.

  43.            -get_patch_language
  44.                 Get the language supported by the patch.

  45.            -get_product_family
  46.                 Get the product family to which the patch belongs.

  47.            -has_sql
  48.                 This option says 'true' if the patch has sql related actions,
  49.                 'false' otherwise.

  50.            -is_online_patch
  51.                 This option says 'true' if the patch is a online patch,
  52.                 'false' otherwise.

  53.            -is_patchset_update
  54.                 This option says 'true' if the patch is a Patchset Update,
  55.                 'false' otherwise.
  56.    
  57.            -is_portal_patch
  58.                 This option says 'true' if the patch has portal actions,
  59.                 'false' otherwise.

  60.            -is_rolling_patch
  61.                 This option says 'true' if the patch is a rolling patch,
  62.                 'false' otherwise.

  63.            -jre
  64.                 This option tells OPatch to use JRE (java) from the specified
  65.                 location instead of the default location under Oracle Home.

  66.            -oh
  67.                 The oracle home to work on. This takes precedence over the
  68.                 environment variable ORACLE_HOME.


  69. PARAMETERS
  70.         The location of the patch to be queried.
  71.         If the patch location is not specified, then the current directory
  72.         is taken as the patch location.



  73. OPatch succeeded.
复制代码
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch query  -is_online_patch

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-12-39上午_1.log

  10. --------------------------------------------------------------------------------
  11. Patch is an online patch: false



  12. OPatch succeeded.
复制代码
  1. [oracle@station90 13906496]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.3.0 Production on Sat Jun 23 10:13:12 2018

  3. Copyright (c) 1982, 2011, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> shutdown immediate
  7. Database closed.
  8. Database dismounted.
  9. ORACLE instance shut down.
  10. SQL> exit
  11. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  12. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  13. and Real Application Testing options
  14. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply -h

  15. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  16. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  17. DESCRIPTION
  18.     This operation applies an interim patch to an ORACLE_HOME from
  19.     the current directory. The patch location can specified using
  20.     the parameter patch_location.

  21. SYNTAX
  22. opatch apply  [-connectString  <List of connect strings>]
  23.               [-delay <value> ] [ -force ] [ -force_conflict ]
  24.               [-init <parameters for the init script in escaped double
  25.                quotes> [-opatch_init_end] ]
  26.               [-invPtrLoc <Path to oraInst.loc> ]
  27.               [-jre <LOC> ] [-local ] [-local_node <Local node name>]
  28.               [-minimize_downtime ] [-no_bug_superset ] [-no_inventory ]
  29.               [-no_relink] [-no_sysmod] [-ocmrf <Response file location> ]
  30.               [-oh <ORACLE_HOME> ]
  31.               [-post <parameters for the post script in escaped
  32.                quotes> [-opatch_post_end] ]
  33.               [-pre <parameters for the pre script
  34.                in escaped double quotes> [-opatch_pre_end] ]
  35.               [-profile_mask <Name of profile>]
  36.               [-property_file <Path to property file>]
  37.               [-ptlConnect <portal connect string>]
  38.               [-ptlPassword <portal password>]
  39.               [-ptlSchema <portal schema>]
  40.               [-remote_nodes <List of remote nodes (node1,node2)>]
  41.               [-retry <value ] [-runSql ]
  42.               [silent ] [-sqlScript <path of the sql file>] [-verbose ]
  43.               [ <Patch Location> ]

  44. OPTIONS
  45.         -all_nodes
  46.               Apply the patch using all-node mode.

  47.         -connectString
  48.               This option can be used to specify the list of database
  49.               instances on which the patch needs to be applied. The
  50.               value for this option is specified as per the following
  51.               syntax "SID:User:Passwd:Node". The SID is a must, others
  52.               can be ignored, OPatch takes default values for it.
  53.               Ex: oracle:dba:dba:mymachine,oracle1:::
  54.               NOTE: If the system is not part of RAC setup, then to
  55.               patch just the local node, provide the node name as
  56.               empty string.

  57.        -delay
  58.               If  -retry is specified, this options  tells OPatch how
  59.               many seconds it should wait before attempting to lock
  60.               inventory again in case of a previous failure.

  61.        -force
  62.               This option is meaningful with 'silent' option and is used
  63.               to override the behavior of silent under specific
  64.               circumstances.

  65.        -force_conflict
  66.               If a conflict exist which prevents the patch from being
  67.               applied, the -force_conflict flag can be used to apply the
  68.               patch. OPatch will remove all the conflicting patches before
  69.               applying the current patch. This will override the 'silent'
  70.               behavior for conflicts and hence is meaningful only when used
  71.               with 'silent' option.

  72.        -init
  73.               This option is used to pass parameters to the init
  74.               script. This script is executed before prerequisite checks
  75.               are run. The value for this option have to be enclosed
  76.               in double quotes. This option should be ended by option
  77.               'opatch_init_end'.

  78.        -invPtrLoc
  79.               Used to locate the oraInst.loc file. Needed when the
  80.               installation used the -invPtrLoc flag. This should be
  81.               the path to the oraInst.loc file

  82.        -jre
  83.               This option tells OPatch to use JRE (java) from the
  84.               specified location instead of the default location
  85.               under Oracle Home.

  86.        -local
  87.               Patch the local node, then update inventory of the
  88.               local node. Do not propagate the patch or inventory
  89.               update to other nodes.

  90.        -local_node
  91.               This option can be used to specify to OPatch the local
  92.               node name to be used for RAC mode application of the patch

  93.        -minimize_downtime
  94.               Only applied to RAC instances. User supplies the
  95.               order of nodes to be patched. This option cannot be
  96.               used in conjunction with -local option with a rolling
  97.               patch.

  98.        -no_bug_superset
  99.               This option tells OPatch to error out if the current
  100.               patch's bugs-to-fix is a super-set (or same set) of an
  101.               installed patch's bugs-fixed in the Oracle Home.


  102.        -no_inventory
  103.               This option specifies not to update the inventory, it
  104.               just updates the files in the system.
  105.               If inventory is readable, then OPatch tries to read the
  106.               inventory.

  107.        -no_relink
  108.               The nolink option does not perform any make operations.
  109.               This option can be used during multiple patch
  110.               applications and perform the linking step only once.
  111.               OPatch does not keep track of the make operations it
  112.               did not perform. It is the job of the OPatch users to
  113.               make sure the execute OPatch without this option at
  114.               the end, so that compilation happens once

  115.        -no_sysmod
  116.               This option specifies not to update the files in the
  117.               system. It just updates the inventory. It also will not
  118.               execute the pre and post scripts

  119.        -ocmrf
  120.               Give OPatch the absolute path to the OCM response file
  121.               to be used for OCM configuration. -silent must be used
  122.               in conjunction with -ocmrf if Oracle Home doesn't have
  123.               OCM installed and configured.

  124.        -oh
  125.               The oracle home to work on. This takes precedence over
  126.               the environment variable ORACLE_HOME

  127.        -opatch_init_end
  128.               This option is used to mark the end of init options.
  129.               Without this option everything after init till end of
  130.               the command is passed into init. This option is
  131.               meaningless without -init option.

  132.        -opatch_post_end
  133.               This option is used to mark the end of post options.
  134.               Without this option everything after post till end of
  135.               the command is passed into post. This option is
  136.               meaningless without -post option.

  137.        -opatch_pre_end
  138.               This option is used to mark the end of pre options.
  139.               Without this option everything after pre till end of
  140.               the command is passed into pre. This option is
  141.               meaningless without -pre option.

  142.        -post
  143.               This option is used to pass parameters to the post script.
  144.               This script is executed after application of the patch.
  145.               The value for this option have to be enclosed in double
  146.               quotes. This option should be ended by option
  147.               'opatch_post_end'.

  148.        -pre
  149.               This option is used to pass parameters to the pre
  150.               script. This script is executed before application of
  151.               the patch. The value for this option have to be enclosed
  152.               in double quotes. This option should be ended by option
  153.               'opatch_pre_end'.

  154.        -profile_mask
  155.               If the patch to be applied specifies WLS patch/patchset
  156.               as prerequisites, OPatch will read the WLS default patch
  157.               profile. To have OPatch read non-default patch profile,
  158.               specify the patch profile name with this option.

  159.        -property_file
  160.               The user defined property file for OPatch to use. The
  161.               path to the property file should be absolute. This
  162.               property file takes precedence over the one that is
  163.               supplied with OPatch

  164.        -ptlConnect
  165.               This option can be used to specify the connect string of the
  166.               portal schema
  167.       
  168.        -ptlPassword
  169.               This option can be used to specify the password of the portal
  170.               schema

  171.        -ptlSchema
  172.               This option can be used to specify the schema of the portal
  173.               repository patch

  174.        -remote_nodes
  175.               This option can be used to specify to OPatch the list
  176.               of remote nodes to be used for RAC mode application of
  177.               the patch. The node names are comma separated and
  178.               without spaces

  179.        -report
  180.               Just prints out the actions without executing

  181.        -retry
  182.               This option tells OPatch how many times it should retry
  183.               in case of an inventory lock failure.

  184.        -runSql
  185.               This option can be used to specify OPatch to run the
  186.               sql scripts and sql procedures if they are present in the
  187.               given patch.

  188.        -silent
  189.               This suppresses any user-interaction

  190.        -sqlScript
  191.               This option can be used to specify the custom sql script
  192.               to be run by OPatch after patching is completed

  193.        -verbose
  194.               This option prints more OPatch output to the screen as
  195.               well as to the log file

  196. PARAMETERS
  197.       Patch Location
  198.               Path to the location for the patch. If the patch
  199.               location is not specified, then the current directory
  200.               is taken as the patch location.


  201. OPatch succeeded.
  202. [oracle@station90 13906496]$
复制代码

打冷补丁的过程:
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. 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

  10. Applying interim patch '13906496' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
  11. Verifying environment and performing prerequisite checks...
  12. All checks passed.
  13. 提供电子邮件地址以用于接收有关安全问题的通知, 安装 Oracle Configuration Manager 并启动它。如果您使用 My Oracle
  14. Support 电子邮件地址/用户名, 操作将更简单。
  15. 有关详细信息, 请访问 http://www.oracle.com/support/policies.html。
  16. 电子邮件地址/用户名:

  17. 尚未提供电子邮件地址以接收有关安全问题的通知。
  18. 是否不希望收到有关安全问题 (是 [Y], 否 [N]) [N] 的通知:  Y



  19. 请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
  20. (Oracle 主目录 = '/u01/app/oracle/product/11.2.0/dbhome_1')


  21. 本地系统是否已准备打补丁? [y|n]
  22. y
  23. User Responded with: Y
  24. Backing up files...

  25. 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...

  26. Verifying the update...
  27. Patch 13906496 successfully applied
  28. 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

  29. OPatch succeeded.
  30. [oracle@station90 13906496]$
复制代码

检查冷补丁的情况:

  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory  

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-17-33上午_1.log

  10. Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-17-33上午.txt

  11. --------------------------------------------------------------------------------
  12. 已安装的顶级产品 (1):

  13. Oracle Database 11g                                                  11.2.0.3.0
  14. 此 Oracle 主目录中已安装 1 个产品。


  15. 中间补丁程序 (1) :

  16. Patch  13906496     : applied on Sat Jun 23 10:16:11 CST 2018
  17. Unique Patch ID:  17324986
  18.    Created on 22 Jul 2014, 12:09:07 hrs PST8PDT
  19.    Bugs fixed:
  20.      13906496



  21. --------------------------------------------------------------------------------

  22. OPatch succeeded.
复制代码

回退冷补丁:
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch rollback -h

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. DESCRIPTION
  5.     Roll back an existing patch indicated by the reference-id.

  6. SYNTAX
  7. opatch rollback -id <ID> [-connectString  <List of connect strings>]
  8.                 [-delay <value>]
  9.                 [-init <parameters for the init script in escaped double
  10.                  quotes> [-opatch_init_end] ]
  11.                 [-invPtrLoc <Path to oraInst.loc> ]
  12.                 [-jre <LOC> ] [-local]
  13.                 [-local_node <Local node name>] [-no_inventory]
  14.                 [-no_relink] [-no_sysmod]
  15.                 [-oh <ORACLE_HOME>] [-ph <Patch Location>]           
  16.                 [-post <parameters for the post script in escaped
  17.                  double quotes>[ -opatch_post_end] ]
  18.                 [-pre <parameters for the pre
  19.                  script in escaped double quotes> [-opatch_pre_end] ]
  20.                 [-property_file <path to property file>]
  21.                 [-ptlConnect <portal connect string>]
  22.                 [-ptlPassword <portal password>]
  23.                 [-ptlSchema <portal schema>]
  24.                 [-remote_nodes <List of remote nodes (node1,node2)>]
  25.                 [-retry <value>] [-runSql] [-silent]
  26.                 [-sqlScript <path of the sql file>] [-verbose]
  27.                 [all_subpatches]


  28. OPTIONS
  29.        -all_nodes
  30.               Roll back the patch using all-nodes mode.

  31.        -connectString
  32.               This option can be used to specify the list of database
  33.               instances on which the patch needs to be applied. The
  34.               value for this option is specified as per the following
  35.               syntax "SID:User:Passwd:Node". The SID is a must, others
  36.               can be ignored, OPatch takes default values for it.
  37.               Ex: oracle:dba:dba:mymachine,oracle1:::
  38.               NOTE: If the system is not part of RAC setup, then to
  39.               patch just the local node, provide the node name as
  40.               empty string.

  41.        -delay
  42.               If -retry is specified, this option tells OPatch how
  43.               many seconds it should wait before attempting to lock
  44.               inventory again in case of a previous failure.

  45.        -id
  46.               Use 'lsinventory' option to display all patch id's.
  47.               Each one-off patch is indicated by its id. To roll back
  48.               a patch the id for that patch must be supplied. For
  49.               translation patches, Please specify <id>/<language code>
  50.               (ex: 1234/fr)

  51.        -init
  52.               This option is used to pass parameters to the init
  53.               script. This script is executed before prerequisite checks
  54.               are run. The value for this option have to be enclosed
  55.               in double quotes. This option should be ended by
  56.               option 'opatch_init_end'.

  57.        -invPtrLoc
  58.               Used to locate the oraInst.loc file. Needed when the
  59.               installation used the invPtrLoc flag. This should be
  60.               the path to the oraInst.loc file

  61.        -jre
  62.               This option tells OPatch to use JRE (java) from the
  63.               specified location instead of the default location
  64.               under Oracle Home.

  65.        -local
  66.               Roll back then update inventory of the local node.
  67.               Do not propagate the patch or inventory update to other
  68.               nodes

  69.        -local_node
  70.               This option can be used to specify to OPatch the local
  71.               node name to be used for RAC mode rollback of the patch

  72.        -no_inventory
  73.               This option specifies not to update the inventory, it
  74.               just updates the files in the system.
  75.               If inventory is readable, then OPatch tries to read the
  76.               inventory.
  77.               NOTE: ph has to be used to specify the patch location.

  78.        -no_relink
  79.               Do not perform the make operations in the patch. This
  80.               option can be used during multiple patch removals and
  81.               perform the compilation step only once

  82.        -no_sysmod
  83.               This option specifies not to update the files in the
  84.               system. It just updates the inventory. It also will not
  85.               execute the pre and post scripts

  86.        -oh
  87.               The oracle home to work on. This takes precedence over
  88.               the environment variable ORACLE_HOME

  89.        -opatch_init_end
  90.               This option is used to mark the end of init options.
  91.               Without this option everything after init till end of
  92.               the command is passed into init. This option is
  93.               meaningless without -init option.

  94.        -opatch_post_end
  95.               This option is used to mark the end of post options.
  96.               Without this option everything after post till end of
  97.               the command is passed into post. This option is
  98.               meaningless without -post option.

  99.        -opatch_pre_end
  100.               This option is used to mark the end of pre options.
  101.               Without this option everything after pre till end of
  102.               the command is passed into pre. This option is
  103.               meaningless without -pre option.

  104.        -ph
  105.               Specify the valid patch directory area. Rollback will
  106.               use the command types found in the patch directory to
  107.               identify what commands are to be used for the current
  108.               operating system

  109.        -post
  110.               This option is used to pass parameters to the post
  111.               script.  This script is executed after removal of the
  112.               patch. The value for this option have to be enclosed
  113.               in double quotes. This option should be ended by
  114.               option 'opatch_post_end'.

  115.        -pre
  116.               This option is used to pass parameters to the pre
  117.               script.  This script is executed before removal of the
  118.               patch. The value for this option have to be enclosed in
  119.               double quotes. This option should be ended by option
  120.               'opatch_pre_end'.

  121.        -property_file
  122.               The user defined property file for OPatch to use. The
  123.               path to the property file should be absolute. This
  124.               property file takes precedence over the one that is
  125.               supplied with OPatch

  126.        -ptlConnect
  127.               This option can be used to specify the connect string of the
  128.               portal schema        

  129.        -ptlPassword
  130.               This option can be used to specify the password of the portal
  131.               schema
  132.       
  133.        -ptlSchema
  134.               This option can be used to specify the schema of the portal
  135.               repository patch

  136.        -remote_nodes
  137.               This option can be used to specify to OPatch the list
  138.               of remote nodes to be used for RAC mode rollback of
  139.               the patch. The node names are comma separated and
  140.               without spaces

  141.        -report
  142.               Just prints out the actions, without executing

  143.        -retry
  144.               This option tells OPatch how many times should retry in
  145.               case of an inventory lock failure.

  146.        -runSql
  147.               This option can be used to specify OPatch to run the
  148.               sql scripts and sql procedures if they are present in the
  149.               given patch.

  150.        -silent
  151.               This suppresses any user-interaction and defaults any
  152.               Y|N question to Y. This option is not supported on
  153.               RAC yet

  154.        -sqlScript
  155.               This option can be used to specify the custom sql script
  156.               to be run by OPatch after patching is completed

  157.        -verbose
  158.               This option prints more OPatch output to the screen
  159.               as well as to the log file

  160.        -all_subpatches
  161.               This option is valid ONLY for composite patches. It allows
  162.               the user to rollback all subpatches of a composite series
  163.               in one shot.

  164. PARAMETERS
  165.        Patch ID of the patch to be rolled back unless the command is
  166.        invoked within a patch area. For translation patches, it will
  167.        be <Patch ID>/<Language code>.


  168. OPatch succeeded.
复制代码
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch rollback -id 13906496

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. 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

  10. RollbackSession 从 OH '/u01/app/oracle/product/11.2.0/dbhome_1' 回退中间补丁程序 '13906496'

  11. 请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
  12. (Oracle 主目录 = '/u01/app/oracle/product/11.2.0/dbhome_1')


  13. 本地系统是否已准备打补丁? [y|n]
  14. y
  15. User Responded with: Y

  16. 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
  17. RollbackSession 从产品清单中删除中间补丁程序 '13906496'
  18. 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

  19. OPatch succeeded.
复制代码
  1. [oracle@station90 13906496]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory  

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-24-21上午_1.log

  10. Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-24-21上午.txt

  11. --------------------------------------------------------------------------------
  12. 已安装的顶级产品 (1):

  13. Oracle Database 11g                                                  11.2.0.3.0
  14. 此 Oracle 主目录中已安装 1 个产品。


  15. 此 Oracle 主目录中未安装任何中间补丁程序。


  16. --------------------------------------------------------------------------------

  17. OPatch succeeded.
  18. [oracle@station90 13906496]$ sqlplus /nolog

  19. SQL*Plus: Release 11.2.0.3.0 Production on Sat Jun 23 10:24:32 2018

  20. Copyright (c) 1982, 2011, Oracle.  All rights reserved.

  21. SQL> conn / as sysdba
  22. Connected to an idle instance.
  23. SQL> startup
  24. ORACLE instance started.

  25. Total System Global Area 6664212480 bytes
  26. Fixed Size                    2240944 bytes
  27. Variable Size                 3556773456 bytes
  28. Database Buffers         3087007744 bytes
  29. Redo Buffers                   18190336 bytes
  30. Database mounted.
  31. Database opened.
  32. SQL>
复制代码

热补丁:
  1. [oracle@station90 13906496]$ ls
  2. etc  files  online  README.txt
  3. [oracle@station90 13906496]$ cd online/
  4. [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch query  -is_online_patch

  5. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  6. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  7. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  8. Central Inventory : /u01/app/oraInventory
  9.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  10. OPatch version    : 11.2.0.3.6
  11. OUI version       : 11.2.0.3.0
  12. Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-25-44上午_1.log

  13. --------------------------------------------------------------------------------
  14. Patch is an online patch: true



  15. OPatch succeeded.
复制代码

打热补丁时,要研究参数:
  1. -connectString
  2.               This option can be used to specify the list of database
  3.               instances on which the patch needs to be applied. The
  4.               value for this option is specified as per the following
  5.               syntax "SID:User:Passwd:Node". The SID is a must, others
  6.               can be ignored, OPatch takes default values for it.
  7.               Ex: oracle:dba:dba:mymachine,oracle1:::
  8.               NOTE: If the system is not part of RAC setup, then to
  9.               patch just the local node, provide the node name as
  10.               empty string.
复制代码
  1. [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply -connectString orcl::: -connectString rcat:::

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. 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


  10. 补丁程序只应在 '-all_nodes' 模式下应用/回退。
  11. 将 RAC 模式转换为 '-all_nodes' 模式。
  12. Applying interim patch '13906496' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
  13. Verifying environment and performing prerequisite checks...
  14. All checks passed.
  15. 提供电子邮件地址以用于接收有关安全问题的通知, 安装 Oracle Configuration Manager 并启动它。如果您使用 My Oracle
  16. Support 电子邮件地址/用户名, 操作将更简单。
  17. 有关详细信息, 请访问 http://www.oracle.com/support/policies.html。
  18. 电子邮件地址/用户名:

  19. 尚未提供电子邮件地址以接收有关安全问题的通知。
  20. 是否不希望收到有关安全问题 (是 [Y], 否 [N]) [N] 的通知:  Y


  21. Backing up files...

  22. 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
  23. 正在数据库 'rcat' 上安装和启用联机补丁程序 'bug13906496.pch'。


  24. Verifying the update...
  25. Patch 13906496 successfully applied
  26. 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

  27. OPatch succeeded.
  28. [oracle@station90 online]$
复制代码
  1. [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory  

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-30-58上午_1.log

  10. Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-30-58上午.txt

  11. --------------------------------------------------------------------------------
  12. 已安装的顶级产品 (1):

  13. Oracle Database 11g                                                  11.2.0.3.0
  14. 此 Oracle 主目录中已安装 1 个产品。


  15. 中间补丁程序 (1) :

  16. Patch (online) 13906496: applied on Sat Jun 23 10:30:05 CST 2018
  17. Unique Patch ID:  17324986
  18.    Created on 22 Jul 2014, 12:09:07 hrs PST8PDT
  19.    Bugs fixed:
  20.      13906496



  21. --------------------------------------------------------------------------------

  22. OPatch succeeded.
复制代码
  1. [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch rollback -id  13906496  -connectString orcl::: -connectString rcat:::

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. 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

  10. RollbackSession 从 OH '/u01/app/oracle/product/11.2.0/dbhome_1' 回退中间补丁程序 '13906496'

  11. 补丁程序只应在 '-all_nodes' 模式下应用/回退。
  12. 将 RAC 模式转换为 '-all_nodes' 模式。

  13. 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
  14. The patch will be removed from database instances.
  15. 正在数据库 'rcat' 上禁用和删除联机补丁程序 'bug13906496.pch'

  16. RollbackSession 从产品清单中删除中间补丁程序 '13906496'
  17. 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

  18. OPatch succeeded.
复制代码
  1. [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory  

  2. Oracle 中间补丁程序安装程序版本 11.2.0.3.6
  3. 版权所有 (c) 2013, Oracle Corporation。保留所有权利。


  4. Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
  5. Central Inventory : /u01/app/oraInventory
  6.    from           : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
  7. OPatch version    : 11.2.0.3.6
  8. OUI version       : 11.2.0.3.0
  9. Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-06-23_10-32-02上午_1.log

  10. Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-06-23_10-32-02上午.txt

  11. --------------------------------------------------------------------------------
  12. 已安装的顶级产品 (1):

  13. Oracle Database 11g                                                  11.2.0.3.0
  14. 此 Oracle 主目录中已安装 1 个产品。


  15. 此 Oracle 主目录中未安装任何中间补丁程序。


  16. --------------------------------------------------------------------------------

  17. OPatch succeeded.
复制代码
专项检查块I/O:
  1. [oracle@station90 ~]$ rman target /

  2. Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jun 23 10:55:08 2018

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1343950367)

  5. RMAN> validate tablespace tbslogical ;

  6. Starting validate at 23-JUN-18
  7. using target database control file instead of recovery catalog
  8. allocated channel: ORA_DISK_1
  9. channel ORA_DISK_1: SID=11 device type=DISK
  10. allocated channel: ORA_DISK_2
  11. channel ORA_DISK_2: SID=77 device type=DISK
  12. allocated channel: ORA_DISK_3
  13. channel ORA_DISK_3: SID=140 device type=DISK
  14. allocated channel: ORA_DISK_4
  15. channel ORA_DISK_4: SID=199 device type=DISK
  16. allocated channel: ORA_DISK_5
  17. channel ORA_DISK_5: SID=15 device type=DISK
  18. allocated channel: ORA_DISK_6
  19. channel ORA_DISK_6: SID=78 device type=DISK
  20. allocated channel: ORA_DISK_7
  21. channel ORA_DISK_7: SID=141 device type=DISK
  22. allocated channel: ORA_DISK_8
  23. channel ORA_DISK_8: SID=202 device type=DISK
  24. channel ORA_DISK_1: starting validation of datafile
  25. channel ORA_DISK_1: specifying datafile(s) for validation
  26. input datafile file number=00006 name=+DATA/orcl/datafile/tbslogical.267.978972737
  27. channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
  28. List of Datafiles
  29. =================
  30. File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
  31. ---- ------ -------------- ------------ --------------- ----------
  32. 6    OK     1              1144         1280            2078535   
  33.   File Name: +DATA/orcl/datafile/tbslogical.267.978972737
  34.   Block Type Blocks Failing Blocks Processed
  35.   ---------- -------------- ----------------
  36.   Data       0              5               
  37.   Index      0              0               
  38.   Other      0              131            

  39. Finished validate at 23-JUN-18

  40. RMAN> backup validate  tablespace tbslogical ;

  41. Starting backup at 23-JUN-18
  42. released channel: ORA_DISK_1
  43. released channel: ORA_DISK_2
  44. released channel: ORA_DISK_3
  45. released channel: ORA_DISK_4
  46. released channel: ORA_DISK_5
  47. released channel: ORA_DISK_6
  48. released channel: ORA_DISK_7
  49. released channel: ORA_DISK_8
  50. allocated channel: ORA_SBT_TAPE_1
  51. channel ORA_SBT_TAPE_1: SID=11 device type=SBT_TAPE
  52. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  53. allocated channel: ORA_SBT_TAPE_2
  54. channel ORA_SBT_TAPE_2: SID=77 device type=SBT_TAPE
  55. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  56. channel ORA_SBT_TAPE_1: starting full datafile backup set
  57. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  58. input datafile file number=00006 name=+DATA/orcl/datafile/tbslogical.267.978972737
  59. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
  60. List of Datafiles
  61. =================
  62. File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
  63. ---- ------ -------------- ------------ --------------- ----------
  64. 6    OK     1              1144         1280            2078535   
  65.   File Name: +DATA/orcl/datafile/tbslogical.267.978972737
  66.   Block Type Blocks Failing Blocks Processed
  67.   ---------- -------------- ----------------
  68.   Data       0              5               
  69.   Index      0              0               
  70.   Other      0              131            

  71. Finished backup at 23-JUN-18

  72. RMAN> backup validate   check logical   tablespace tbslogical ;

  73. Starting backup at 23-JUN-18
  74. using channel ORA_SBT_TAPE_1
  75. using channel ORA_SBT_TAPE_2
  76. channel ORA_SBT_TAPE_1: starting full datafile backup set
  77. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  78. input datafile file number=00006 name=+DATA/orcl/datafile/tbslogical.267.978972737
  79. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
  80. List of Datafiles
  81. =================
  82. File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
  83. ---- ------ -------------- ------------ --------------- ----------
  84. 6    OK     1              1144         1280            2078535   
  85.   File Name: +DATA/orcl/datafile/tbslogical.267.978972737
  86.   Block Type Blocks Failing Blocks Processed
  87.   ---------- -------------- ----------------
  88.   Data       0              5               
  89.   Index      0              0               
  90.   Other      0              131            

  91. Finished backup at 23-JUN-18

  92. RMAN> validate   check logical   tablespace tbslogical ;

  93. Starting validate at 23-JUN-18
  94. released channel: ORA_SBT_TAPE_1
  95. released channel: ORA_SBT_TAPE_2
  96. allocated channel: ORA_DISK_1
  97. channel ORA_DISK_1: SID=11 device type=DISK
  98. allocated channel: ORA_DISK_2
  99. channel ORA_DISK_2: SID=77 device type=DISK
  100. allocated channel: ORA_DISK_3
  101. channel ORA_DISK_3: SID=140 device type=DISK
  102. allocated channel: ORA_DISK_4
  103. channel ORA_DISK_4: SID=199 device type=DISK
  104. allocated channel: ORA_DISK_5
  105. channel ORA_DISK_5: SID=15 device type=DISK
  106. allocated channel: ORA_DISK_6
  107. channel ORA_DISK_6: SID=78 device type=DISK
  108. allocated channel: ORA_DISK_7
  109. channel ORA_DISK_7: SID=141 device type=DISK
  110. allocated channel: ORA_DISK_8
  111. channel ORA_DISK_8: SID=202 device type=DISK
  112. channel ORA_DISK_1: starting validation of datafile
  113. channel ORA_DISK_1: specifying datafile(s) for validation
  114. input datafile file number=00006 name=+DATA/orcl/datafile/tbslogical.267.978972737
  115. channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
  116. List of Datafiles
  117. =================
  118. File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
  119. ---- ------ -------------- ------------ --------------- ----------
  120. 6    OK     1              1144         1280            2078535   
  121.   File Name: +DATA/orcl/datafile/tbslogical.267.978972737
  122.   Block Type Blocks Failing Blocks Processed
  123.   ---------- -------------- ----------------
  124.   Data       0              5               
  125.   Index      0              0               
  126.   Other      0              131            

  127. Finished validate at 23-JUN-18

  128. RMAN>
复制代码
出现坏块之后的应激性体检反应:

Screenshot.png


出现坏块之后,仍然坚持备份:
  1. RMAN> run {
  2. 2> set maxcorrupt for datafile 5 to 1;
  3. 3> backup datafile 5;
  4. 4> }

  5. executing command: SET MAX CORRUPT

  6. Starting backup at 23-JUN-18
  7. allocated channel: ORA_SBT_TAPE_1
  8. channel ORA_SBT_TAPE_1: SID=204 device type=SBT_TAPE
  9. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  10. allocated channel: ORA_SBT_TAPE_2
  11. channel ORA_SBT_TAPE_2: SID=75 device type=SBT_TAPE
  12. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  13. channel ORA_SBT_TAPE_1: starting full datafile backup set
  14. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  15. input datafile file number=00005 name=+DATA/orcl/datafile/example.268.979556715
  16. channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
  17. channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
  18. piece handle=2ft65mn8_1_1 tag=TAG20180623T111136 comment=API Version 2.0,MMS Version 10.4.0.4
  19. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
  20. Finished backup at 23-JUN-18

  21. Starting Control File and SPFILE Autobackup at 23-JUN-18
  22. piece handle=c-1343950367-20180623-02 comment=API Version 2.0,MMS Version 10.4.0.4
  23. 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>

  1. [oracle@station90 ~]$ rman target /

  2. Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jun 23 11:19:50 2018

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1343950367)

  5. RMAN> backup validate   datafile 5;

  6. Starting backup at 23-JUN-18
  7. using target database control file instead of recovery catalog
  8. allocated channel: ORA_SBT_TAPE_1
  9. channel ORA_SBT_TAPE_1: SID=139 device type=SBT_TAPE
  10. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  11. allocated channel: ORA_SBT_TAPE_2
  12. channel ORA_SBT_TAPE_2: SID=15 device type=SBT_TAPE
  13. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  14. channel ORA_SBT_TAPE_1: starting full datafile backup set
  15. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  16. input datafile file number=00005 name=+DATA/orcl/datafile/example.268.979557535
  17. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
  18. List of Datafiles
  19. =================
  20. File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
  21. ---- ------ -------------- ------------ --------------- ----------
  22. 5    OK     1              1689         12805           1731900   
  23.   File Name: +DATA/orcl/datafile/example.268.979557535
  24.   Block Type Blocks Failing Blocks Processed
  25.   ---------- -------------- ----------------
  26.   Data       0              6598            
  27.   Index      0              1261            
  28.   Other      0              3252            

  29. 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>

逻辑坏块的应激性响应:
Screenshot-1.png

ADRCI是文本形式的support workbench:
  1. adrci> set homepath diag/rdbms/orcl/orcl
  2. adrci> show incidents

  3. ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
  4. *************************************************************************
  5. INCIDENT_ID          PROBLEM_KEY                                                 CREATE_TIME                              
  6. -------------------- ----------------------------------------------------------- ----------------------------------------
  7. 17065                ORA 1578                                                    2018-06-16 16:26:41.722000 +08:00      
  8. 17073                ORA 600 [1433]                                              2018-06-16 16:38:01.032000 +08:00      
  9. 17145                ORA 600 [1433]                                              2018-06-16 16:38:01.821000 +08:00      
  10. 17066                ORA 600 [1433]                                              2018-06-16 16:38:02.710000 +08:00      
  11. 17057                ORA 600 [1433]                                              2018-06-16 16:38:03.540000 +08:00      
  12. 17081                ORA 600 [1433]                                              2018-06-16 16:38:04.465000 +08:00      
  13. 21962                ORA 1578                                                    2018-06-16 16:52:47.458000 +08:00      
  14. 21842                ORA 1578                                                    2018-06-16 17:10:46.702000 +08:00      
  15. 21834                ORA 1578                                                    2018-06-16 17:16:11.056000 +08:00      
  16. 23109                ORA 1578                                                    2018-06-23 08:50:24.098000 +08:00      
  17. 23110                ORA 1578                                                    2018-06-23 08:50:25.093000 +08:00      
  18. 23269                ORA 1578                                                    2018-06-23 09:02:57.444000 +08:00      
  19. 23270                ORA 1578                                                    2018-06-23 09:02:58.243000 +08:00      
  20. 26777                ORA 1578                                                    2018-06-23 11:05:48.425000 +08:00      
  21. 26953                ORA 1578                                                    2018-06-23 11:15:59.534000 +08:00      
  22. 26954                ORA 1578                                                    2018-06-23 11:16:00.294000 +08:00      
  23. 16 rows fetched

  24. adrci> help show incidents

  25.   Usage: SHOW INCIDENT [-p <predicate_string>]
  26.                        [-mode BASIC|BRIEF|DETAIL]
  27.                        [-last <num> | -all]
  28.                        [-orderby (field1, field2, ...) [ASC|DSC]]

  29.   Purpose: Show the incident information. By default, this command will
  30.            only show the last 50 incidents which are not flood controlled.

  31.   Options:
  32.     [-p <predicate_string>]: The predicate string must be double-quoted.

  33.     [-mode BASIC|BRIEF|DETAIL]: The different modes of showing incidents.
  34.     BASIC will show the basic information of non-flooded controlled
  35.     incidents, which is the default mode. In this mode, only the following
  36.     fields can be used in the predicate clause:
  37.         INCIDENT_ID                   number
  38.         PROBLEM_KEY                   text(550)
  39.         CREATE_TIME                   timestamp
  40.     BRIEF will display incident information from the incident relation.
  41.     In this mode, the fields can appear in the predicate are:
  42.         INCIDENT_ID                   number
  43.         PROBLEM_ID                    number
  44.         CREATE_TIME                   timestamp
  45.         CLOSE_TIME                    timestamp
  46.         STATUS                        number
  47.         FLAGS                         number
  48.         FLOOD_CONTROLLED              number
  49.         ERROR_FACILITY                text(10)
  50.         ERROR_NUMBER                  number
  51.         ERROR_ARG1                    text(64)
  52.         ERROR_ARG2                    text(64)
  53.         ERROR_ARG3                    text(64)
  54.         ERROR_ARG4                    text(64)
  55.         ERROR_ARG5                    text(64)
  56.         ERROR_ARG6                    text(64)
  57.         ERROR_ARG7                    text(64)
  58.         ERROR_ARG8                    text(64)
  59.         SIGNALLING_COMPONENT          text(64)
  60.         SIGNALLING_SUBCOMPONENT       text(64)
  61.         SUSPECT_COMPONENT             text(64)
  62.         SUSPECT_SUBCOMPONENT          text(64)
  63.         ECID                          text(64)
  64.         IMPACT                        number

  65.     DETAIL will display all incident-related information, such as incident
  66.     files. The fields can appear in the predicate is the same as the ones
  67.     in the brief mode.

  68.     [-last <num> | -all]: This option allows users to either select
  69.     the last <num> of qualified incidents to show or to show all the
  70.     qualified incidents. If this option is not specified, this command
  71.     will only show 50 incidents.

  72.     [-orderby (field1, field2, ...) [ASC|DSC]]: If specified, the results
  73.     will be ordered by the specified fields' values. By default, it will be
  74.     in the ascending order unless "DSC" is specified. Note that the field
  75.     names that can be specified here are from the "INCIDENT" relation.

  76.   Examples:  
  77.     show incident
  78.     show incident -mode detail
  79.     show incident -mode detail -p "incident_id=123"

  80. adrci> show incident -mode detail -p "incident_id=26954"

  81. ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
  82. *************************************************************************

  83. **********************************************************
  84. INCIDENT INFO RECORD 1
  85. **********************************************************
  86.    INCIDENT_ID                   26954
  87.    STATUS                        ready
  88.    CREATE_TIME                   2018-06-23 11:16:00.294000 +08:00
  89.    PROBLEM_ID                    1
  90.    CLOSE_TIME                    <NULL>
  91.    FLOOD_CONTROLLED              none
  92.    ERROR_FACILITY                ORA
  93.    ERROR_NUMBER                  1578
  94.    ERROR_ARG1                    6
  95.    ERROR_ARG2                    136
  96.    ERROR_ARG3                    <NULL>
  97.    ERROR_ARG4                    <NULL>
  98.    ERROR_ARG5                    <NULL>
  99.    ERROR_ARG6                    <NULL>
  100.    ERROR_ARG7                    <NULL>
  101.    ERROR_ARG8                    <NULL>
  102.    ERROR_ARG9                    <NULL>
  103.    ERROR_ARG10                   <NULL>
  104.    ERROR_ARG11                   <NULL>
  105.    ERROR_ARG12                   <NULL>
  106.    SIGNALLING_COMPONENT          CACHE_RCV
  107.    SIGNALLING_SUBCOMPONENT       <NULL>
  108.    SUSPECT_COMPONENT             <NULL>
  109.    SUSPECT_SUBCOMPONENT          <NULL>
  110.    ECID                          <NULL>
  111.    IMPACTS                       0
  112.    PROBLEM_KEY                   ORA 1578
  113.    FIRST_INCIDENT                17065
  114.    FIRSTINC_TIME                 2018-06-16 16:26:41.722000 +08:00
  115.    LAST_INCIDENT                 26954
  116.    LASTINC_TIME                  2018-06-23 11:16:00.294000 +08:00
  117.    IMPACT1                       34668552
  118.    IMPACT2                       34668545
  119.    IMPACT3                       0
  120.    IMPACT4                       0
  121.    KEY_NAME                      ProcId
  122.    KEY_VALUE                     68.1
  123.    KEY_NAME                      PQ
  124.    KEY_VALUE                     (16777216, 1529723760)
  125.    KEY_NAME                      SID
  126.    KEY_VALUE                     20.59
  127.    KEY_NAME                      Client ProcId
  128.    KEY_VALUE                     oracle@station90.example.com (TNS V1-V3).28784_139936914835200
  129.    OWNER_ID                      1
  130.    INCIDENT_FILE                 /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_28784.trc
  131.    OWNER_ID                      1
  132.    INCIDENT_FILE                 /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_26954/orcl_ora_28784_i26954.trc
  133. 1 rows fetched

  134. adrci> ips create package incident  26954;
  135. Created package 2 based on incident id 26954, correlation level typical
  136. adrci>
复制代码

a.png

  1. adrci>
  2. adrci> ips SHOW PACKAGE;
  3.    PACKAGE_ID             1
  4.    PACKAGE_NAME           ORA1578_datafile6_block136
  5.    PACKAGE_DESCRIPTION    ORA1578_datafile6_block136
  6.    DRIVING_PROBLEM        1
  7.    DRIVING_PROBLEM_KEY    ORA 1578
  8.    DRIVING_INCIDENT       17065
  9.    DRIVING_INCIDENT_TIME  2018-06-16 16:26:41.722000 +08:00
  10.    STATUS                 Generated (4)
  11.    CORRELATION_LEVEL      Typical (2)
  12.    PROBLEMS               1 main problems, 0 correlated problems
  13.    INCIDENTS              4 main incidents, 0 correlated incidents
  14.    INCLUDED_FILES         154

  15.    PACKAGE_ID             2
  16.    PACKAGE_NAME           ORA1578_20180623113922
  17.    PACKAGE_DESCRIPTION   
  18.    DRIVING_PROBLEM        1
  19.    DRIVING_PROBLEM_KEY    ORA 1578
  20.    DRIVING_INCIDENT       26954
  21.    DRIVING_INCIDENT_TIME  2018-06-23 11:16:00.294000 +08:00
  22.    STATUS                 New (0)
  23.    CORRELATION_LEVEL      Typical (2)
  24.    PROBLEMS               1 main problems, 1 correlated problems
  25.    INCIDENTS              1 main incidents, 1 correlated incidents
  26.    INCLUDED_FILES         6

  27. adrci> help ips GENERATE PACKAGE

  28.   Usage:  IPS GENERATE PACKAGE <package_id> [IN <path>]
  29.              [COMPLETE | INCREMENTAL]

  30.   Purpose: Create a physical package (zip file) in target directory.

  31.   Arguments:
  32.     <package_id>: ID of package to create physical package file for.
  33.     <path>:       Path where the physical package file should be generated.

  34.   Options:
  35.     COMPLETE:    The package will include all package files, even if a
  36.                  previous package sequence has been generated.
  37.                  This is the default.
  38.     INCREMENTAL: The package will only include files that have been added
  39.                  or changed since the last package generation.

  40.   Notes:
  41.     If no target path is specified, the physical package file is generated
  42.     in the current working directory.

  43.   Example:
  44.     ips generate package 12 in /tmp

  45. adrci> ips generate package  2 ;
  46. Generated package 2 in file /home/oracle/ORA1578_20180623113922_COM_1.zip, mode complete
  47. adrci>
复制代码
  1. select  * from v$hm_check  where name ='Block IO Revalidation Check';

  2. select  * from v$hm_check_param  where check_id=21 ;

  3. select  * from v$tablespace;

  4. begin
  5.    dbms_hm.run_check(check_name => 'Block IO Revalidation Check',
  6.    run_name => 'MYRUN2',
  7.    input_params => 'FILE_NUM=6;FILE_BLOCKSIZE=8192;BLOCK_NUM=136');
  8. end;
  9.    
复制代码
  1. select  * from v$hm_check  where name ='Dictionary Integrity Check';

  2. select  * from v$hm_check_param  where check_id=24 ;

  3. begin
  4.    dbms_hm.run_check(check_name => 'Dictionary Integrity Check',
  5.    run_name => 'MYRUN2',
  6.    input_params => 'TABLE_NAME=tab
  7. 文本看报告:
  8. [code]select  dbms_hm.get_run_report(run_name => 'MYRUN2') from dual;
复制代码
ADRCI文本看报告:
  1. **********************************************************
  2. HM RUN RECORD 22
  3. **********************************************************
  4.    RUN_ID                        867
  5.    RUN_NAME                      MYRUN2
  6.    CHECK_NAME                    Dictionary Integrity Check
  7.    NAME_ID                       24
  8.    MODE                          0
  9.    START_TIME                    2018-06-23 14:36:51.946092 +08:00
  10.    RESUME_TIME                   <NULL>
  11.    END_TIME                      2018-06-23 14:36:52.067610 +08:00
  12.    MODIFIED_TIME                 2018-06-23 14:39:37.289516 +08:00
  13.    TIMEOUT                       0
  14.    FLAGS                         0
  15.    STATUS                        5
  16.    SRC_INCIDENT_ID               0
  17.    NUM_INCIDENTS                 0
  18.    ERR_NUMBER                    0
  19.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_MYRUN2.hm
  20. 22 rows fetched

  21. adrci> create report hm_run  MYRUN2                                                         
  22. adrci> show report hm_run MYRUN2
  23. <?xml version="1.0" encoding="US-ASCII"?>
  24. <HM-REPORT REPORT_ID="MYRUN2">
  25.     <TITLE>HM Report: MYRUN2</TITLE>
  26.     <RUN_INFO>
  27.         <CHECK_NAME>Dictionary Integrity Check</CHECK_NAME>
  28.         <RUN_ID>867</RUN_ID>
  29.         <RUN_NAME>MYRUN2</RUN_NAME>
  30.         <RUN_MODE>MANUAL</RUN_MODE>
  31.         <RUN_STATUS>COMPLETED</RUN_STATUS>
  32.         <RUN_ERROR_NUM>0</RUN_ERROR_NUM>
  33.         <SOURCE_INCIDENT_ID>0</SOURCE_INCIDENT_ID>
  34.         <NUM_INCIDENTS_CREATED>0</NUM_INCIDENTS_CREATED>
  35.         <RUN_START_TIME>2018-06-23 14:36:51.946092 +08:00</RUN_START_TIME>
  36.         <RUN_END_TIME>2018-06-23 14:36:52.067610 +08:00</RUN_END_TIME>
  37.     </RUN_INFO>
  38.     <RUN_PARAMETERS>
  39.         <RUN_PARAMETER>TABLE_NAME=tab[        DISCUZ_CODE_508        ]lt;/RUN_PARAMETER>
  40.         <RUN_PARAMETER>CHECK_MASK=ALL</RUN_PARAMETER>
  41.     </RUN_PARAMETERS>
  42.     <RUN-FINDINGS/>
  43. </HM-REPORT>
  44. adrci>
复制代码
文本看报告:
  1. select  dbms_hm.get_run_report(run_name =&gt; 'MYRUN2') from dual;
复制代码
ADRCI文本看报告:
  1. **********************************************************
  2. HM RUN RECORD 22
  3. **********************************************************
  4.    RUN_ID                        867
  5.    RUN_NAME                      MYRUN2
  6.    CHECK_NAME                    Dictionary Integrity Check
  7.    NAME_ID                       24
  8.    MODE                          0
  9.    START_TIME                    2018-06-23 14:36:51.946092 +08:00
  10.    RESUME_TIME                   &lt;NULL&gt;
  11.    END_TIME                      2018-06-23 14:36:52.067610 +08:00
  12.    MODIFIED_TIME                 2018-06-23 14:39:37.289516 +08:00
  13.    TIMEOUT                       0
  14.    FLAGS                         0
  15.    STATUS                        5
  16.    SRC_INCIDENT_ID               0
  17.    NUM_INCIDENTS                 0
  18.    ERR_NUMBER                    0
  19.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_MYRUN2.hm
  20. 22 rows fetched

  21. adrci&gt; create report hm_run  MYRUN2                                                         
  22. adrci&gt; show report hm_run MYRUN2
  23. &lt;?xml version="1.0" encoding="US-ASCII"?&gt;
  24. &lt;HM-REPORT REPORT_ID="MYRUN2"&gt;
  25.     &lt;TITLE&gt;HM Report: MYRUN2&lt;/TITLE&gt;
  26.     &lt;RUN_INFO&gt;
  27.         &lt;CHECK_NAME&gt;Dictionary Integrity Check&lt;/CHECK_NAME&gt;
  28.         &lt;RUN_ID&gt;867&lt;/RUN_ID&gt;
  29.         &lt;RUN_NAME&gt;MYRUN2&lt;/RUN_NAME&gt;
  30.         &lt;RUN_MODE&gt;MANUAL&lt;/RUN_MODE&gt;
  31.         &lt;RUN_STATUS&gt;COMPLETED&lt;/RUN_STATUS&gt;
  32.         &lt;RUN_ERROR_NUM&gt;0&lt;/RUN_ERROR_NUM&gt;
  33.         &lt;SOURCE_INCIDENT_ID&gt;0&lt;/SOURCE_INCIDENT_ID&gt;
  34.         &lt;NUM_INCIDENTS_CREATED&gt;0&lt;/NUM_INCIDENTS_CREATED&gt;
  35.         &lt;RUN_START_TIME&gt;2018-06-23 14:36:51.946092 +08:00&lt;/RUN_START_TIME&gt;
  36.         &lt;RUN_END_TIME&gt;2018-06-23 14:36:52.067610 +08:00&lt;/RUN_END_TIME&gt;
  37.     &lt;/RUN_INFO&gt;
  38.     &lt;RUN_PARAMETERS&gt;
  39.         &lt;RUN_PARAMETER&gt;TABLE_NAME=tab[        DISCUZ_CODE_508        ]lt;/RUN_PARAMETER&gt;
  40.         &lt;RUN_PARAMETER&gt;CHECK_MASK=ALL&lt;/RUN_PARAMETER&gt;
  41.     &lt;/RUN_PARAMETERS&gt;
  42.     &lt;RUN-FINDINGS/&gt;
  43. &lt;/HM-REPORT&gt;
  44. adrci&gt;
复制代码
逻辑坏块的修复:

  1. BEGIN
  2.   DBMS_REPAIR.ADMIN_TABLES (
  3.    table_name => 'REPAIR_TABLE',
  4.    table_type => DBMS_REPAIR.REPAIR_TABLE,
  5.    action => DBMS_REPAIR.CREATE_ACTION,
  6.    tablespace => 'USERS');
  7. END;

  8. select  * from  REPAIR_TABLE;

  9. BEGIN
  10. DBMS_REPAIR.ADMIN_TABLES (
  11.    table_name => 'ORPHAN_KEY_TABLE',
  12.    table_type => DBMS_REPAIR.ORPHAN_TABLE,
  13.    action => DBMS_REPAIR.CREATE_ACTION,
  14.    tablespace => 'USERS');
  15. END;


  16. select  * from ORPHAN_KEY_TABLE;

  17. DECLARE
  18. num_corrupt  INT;
  19. BEGIN
  20. num_corrupt := 0;
  21. DBMS_REPAIR.CHECK_OBJECT (
  22.     schema_name => 'HR',
  23.            object_name => 'TLOGICAL',
  24.     repair_table_name => 'REPAIR_TABLE',
  25.     corrupt_count => num_corrupt);
  26.     dbms_output.put_line( 'Find  '|| num_corrupt||' Bolcks.'  );
  27. END;


  28. select  * from  REPAIR_TABLE;

  29. DECLARE
  30.   num_orphans INT;
  31. BEGIN
  32. num_orphans := 0;
  33. DBMS_REPAIR.DUMP_ORPHAN_KEYS (
  34.   schema_name => 'HR',
  35.   object_name => 'ILOGICAL_A',
  36.   object_type => DBMS_REPAIR.INDEX_OBJECT,
  37.   repair_table_name => 'REPAIR_TABLE',
  38.   orphan_table_name => 'ORPHAN_KEY_TABLE',
  39.   key_count => num_orphans);
  40. DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
  41. END;

  42. DECLARE
  43.   num_orphans INT;
  44. BEGIN
  45. num_orphans := 0;
  46. DBMS_REPAIR.DUMP_ORPHAN_KEYS (
  47.   schema_name => 'HR',
  48.   object_name => 'ILOGICAL_B',
  49.   object_type => DBMS_REPAIR.INDEX_OBJECT,
  50.   repair_table_name => 'REPAIR_TABLE',
  51.   orphan_table_name => 'ORPHAN_KEY_TABLE',
  52.   key_count => num_orphans);
  53. DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
  54. END;




  55. select  * from ORPHAN_KEY_TABLE;


  56. select  o.index_name, key from orphan_key_table  o  where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
  57. and o.index_name='ILOGICAL_B';



  58. select  o.index_name, key from orphan_key_table  o  where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
  59. and o.index_name='ILOGICAL_A';

  60. ----
  61. begin
  62.    dbms_repair.skip_corrupt_blocks(schema_name => 'HR',object_name => 'TLOGICAL');
  63. end;  

  64. ----
  65. select  o.index_name, key  , dump(key)  from orphan_key_table  o  where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
  66. and o.index_name='ILOGICAL_B';

  67. 4,195,4,23,86
  68. 100^(195-193-0)*(4-1)+
  69. 100^(195-193-1)*(23-1)+
  70. 100^(195-193-2)*(86-1)
  71. =30000+2200+85=32285



  72. select  o.index_name, key, dump(key)  from orphan_key_table  o  where keyrowid||' '='AAATquAIgAAAIABAAA'||' '
  73. and o.index_name='ILOGICAL_A';
  74. 7,98b,97a,99c,107k,97a,114r,101e


  75. select  dump(1) from dual;
  76. 193,2
  77. 100^(193-193-0)*(2-1)=1


  78. select  dump(10) from dual;
  79. 193,11
  80. 100^(192-193-0)*(11-1)=10

  81. select  dump(100) from dual;
  82. 194,2
  83. 100^(194-193-0)*(2-1)=100

  84. select  dump(1000) from dual;
  85. 194,11
  86. 100^(194-193-0)*(11-1)=1000

  87. select  dump(110) from dual;
  88. 194,2,11
  89. 100^(194-193-0)*(2-1) +100^(194-193-1)*(11-1)=100+10=110

  90. select   dump(123456.789) from dual;
  91. 195,13,35,57,79,91
  92. 100^(195-193-0)*(13-1)  +
  93. 100^(195-193-1)*(35-1) +
  94. 100^(195-193-2)*(57-1)  +
  95. 100^(195-193-3)*(79-1)  +
  96. 100^(195-193-4)*(91-1)
  97. = 120000+3400+56+0.78+0.009=123456.789

  98. -----------------------





  99. select dump(0) from dual;
  100. 128

  101. select  dump(-1) from dual;
  102. 62,100,102
  103. 100^(62-62-0)*(101-100)=1

  104. select dump(-10) from dual;
  105. 62,91,102
  106. 100^(62-62-0)*(101-91)=10

  107. select  dump(-100) from dual;
  108. 61,100,102
  109. 100^(62-61)*(101-100)=100



  110. select   dump(-123456.789) from dual;
  111. 60,89,67,45,23,11,102

  112. 100^(62-60-0)*(101-89)+
  113. 100^(62-60-1)*(101-67)+
  114. 100^(62-60-2)*(101-45)+
  115. 100^(62-60-3)*(101-23)+
  116. 100^(62-60-4)*(101-11)
  117. =12000+3400+56+0.78+0.009

  118. select  dump(-123456.78901) from dual;
  119. 60,89,67,45,23,11,91,102

  120. ---------------------------------------------------------------------
复制代码
  1. SQL> drop index ilogical_a;

  2. Index dropped.

  3. SQL> create index ilogical_a on tlogical(a) ;

  4. Index created.

  5. SQL> drop index ilogical_b;

  6. Index dropped.

  7. SQL> create index ilogical_b on tlogical(b) ;

  8. Index created.
复制代码

1. 文件对应通道的RMAN调优:
  1. [oracle@station90 asm_to_disk]$ rman target /

  2. Recovery Manager: Release 11.2.0.3.0 - Production on Sat Jun 23 16:14:48 2018

  3. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  4. connected to target database: ORCL (DBID=1343950367, not open)

  5. RMAN> run {
  6. 2> allocate channel c1 device type disk format '/home/oracle/asm_to_disk/system01.dbf';
  7. 3> backup as copy datafile 1;
  8. 4> release channel c1;
  9. 5> allocate channel c1 device type disk format '/home/oracle/asm_to_disk/sysaux01.dbf';
  10. 6> backup as copy datafile 2;
  11. 7> release channel c1;
  12. 8> }

  13. using target database control file instead of recovery catalog
  14. allocated channel: c1
  15. channel c1: SID=131 device type=DISK

  16. Starting backup at 23-JUN-18
  17. channel c1: starting datafile copy
  18. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.816169553
  19. output file name=/home/oracle/asm_to_disk/system01.dbf tag=TAG20180623T161600 RECID=9 STAMP=979575364
  20. channel c1: datafile copy complete, elapsed time: 00:00:07
  21. Finished backup at 23-JUN-18

  22. Starting Control File and SPFILE Autobackup at 23-JUN-18
  23. piece handle=+FRA/orcl/autobackup/2018_06_23/s_979575263.370.979575369 comment=NONE
  24. Finished Control File and SPFILE Autobackup at 23-JUN-18

  25. released channel: c1

  26. allocated channel: c1
  27. channel c1: SID=131 device type=DISK

  28. Starting backup at 23-JUN-18
  29. channel c1: starting datafile copy
  30. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.816169553
  31. output file name=/home/oracle/asm_to_disk/sysaux01.dbf tag=TAG20180623T161610 RECID=10 STAMP=979575374
  32. channel c1: datafile copy complete, elapsed time: 00:00:07
  33. Finished backup at 23-JUN-18

  34. Starting Control File and SPFILE Autobackup at 23-JUN-18
  35. piece handle=+FRA/orcl/autobackup/2018_06_23/s_979575263.371.979575379 comment=NONE
  36. Finished Control File and SPFILE Autobackup at 23-JUN-18

  37. released channel: c1

  38. RMAN> run {
  39. 2> allocate channel c1 device type disk format '/home/oracle/asm_to_disk/system01.dbf';
  40. 3> allocate channel c2 device type disk format '/home/oracle/asm_to_disk/sysaux01.dbf';
  41. 4> backup as copy
  42. 5> (datafile 1 channel c1)
  43. 6> (datafile 2 channel c2);
  44. 7> }

  45. allocated channel: c1
  46. channel c1: SID=131 device type=DISK

  47. allocated channel: c2
  48. channel c2: SID=194 device type=DISK

  49. Starting backup at 23-JUN-18
  50. channel c1: starting datafile copy
  51. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.816169553
  52. channel c2: starting datafile copy
  53. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.816169553
  54. output file name=/home/oracle/asm_to_disk/system01.dbf tag=TAG20180623T161801 RECID=12 STAMP=979575488
  55. channel c1: datafile copy complete, elapsed time: 00:00:07
  56. output file name=/home/oracle/asm_to_disk/sysaux01.dbf tag=TAG20180623T161801 RECID=11 STAMP=979575486
  57. channel c2: datafile copy complete, elapsed time: 00:00:07
  58. Finished backup at 23-JUN-18

  59. Starting Control File and SPFILE Autobackup at 23-JUN-18
  60. piece handle=+FRA/orcl/autobackup/2018_06_23/s_979575263.372.979575489 comment=NONE
  61. Finished Control File and SPFILE Autobackup at 23-JUN-18
  62. released channel: c1
  63. released channel: c2

  64. RMAN>
复制代码


rman定位:
Screenshot-2.png

  1. SELECT OPNAME, CONTEXT, SOFAR, TOTALWORK,
  2.     ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
  3.    FROM V$SESSION_LONGOPS
  4.     WHERE OPNAME LIKE 'RMAN%'
  5.    AND OPNAME NOT LIKE '%aggregate%'
  6.     AND TOTALWORK != 0
  7.    AND SOFAR <> TOTALWORK
  8.    and sid in (   select  sid from v$session where terminal=(select  s.TERMINAL  from v_$session  s
  9.                                       where s.CLIENT_INFO like '%xxxxx%')     );
复制代码

查同步或异步RMAN通道:
  1. select  * from v$backup_async_io  where status <> 'FINISHED'
  2.   and status <> 'UNKNOWN';

  3. select  * from v$backup_sync_io    where status <> 'FINISHED'
  4.   and status <> 'UNKNOWN';
复制代码
控制通道:
  1. RMAN> run {
  2. 2> set command id to 'zzzzzz';
  3. 3> backup database  filesperset 1 ;
  4. 4> }

  5. executing command: SET COMMAND ID

  6. Starting backup at 23-JUN-18
  7. using channel ORA_SBT_TAPE_1
  8. using channel ORA_SBT_TAPE_2
  9. channel ORA_SBT_TAPE_1: starting full datafile backup set
  10. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  11. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.816169553
  12. channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
  13. channel ORA_SBT_TAPE_2: starting full datafile backup set
  14. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  15. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.816169553
  16. channel ORA_SBT_TAPE_2: starting piece 1 at 23-JUN-18
  17. channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
  18. piece handle=3ft66bbc_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
  19. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
  20. channel ORA_SBT_TAPE_1: starting full datafile backup set
  21. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  22. input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.258.816169553
  23. channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
  24. channel ORA_SBT_TAPE_2: finished piece 1 at 23-JUN-18
  25. piece handle=3gt66bbc_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
  26. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:25
  27. channel ORA_SBT_TAPE_2: starting full datafile backup set
  28. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  29. input datafile file number=00005 name=+DATA/orcl/datafile/example.268.979557535
  30. channel ORA_SBT_TAPE_2: starting piece 1 at 23-JUN-18
  31. channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
  32. piece handle=3ht66bc5_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
  33. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:16
  34. channel ORA_SBT_TAPE_1: starting full datafile backup set
  35. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  36. input datafile file number=00006 name=+DATA/orcl/datafile/tbslogical.267.978972737
  37. channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
  38. channel ORA_SBT_TAPE_2: finished piece 1 at 23-JUN-18
  39. piece handle=3it66bc5_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
  40. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:17
  41. channel ORA_SBT_TAPE_2: starting full datafile backup set
  42. channel ORA_SBT_TAPE_2: specifying datafile(s) in backup set
  43. input datafile file number=00004 name=+DATA/orcl/datafile/users.259.816169553
  44. channel ORA_SBT_TAPE_2: starting piece 1 at 23-JUN-18
  45. channel ORA_SBT_TAPE_1: finished piece 1 at 23-JUN-18
  46. piece handle=3jt66bcl_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
  47. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:16
  48. channel ORA_SBT_TAPE_2: finished piece 1 at 23-JUN-18
  49. piece handle=3kt66bcm_1_1 tag=TAG20180623T170340 comment=API Version 2.0,MMS Version 10.4.0.4
  50. channel ORA_SBT_TAPE_2: backup set complete, elapsed time: 00:00:15
  51. Finished backup at 23-JUN-18

  52. Starting Control File and SPFILE Autobackup at 23-JUN-18
  53. piece handle=c-1343950367-20180623-0d comment=API Version 2.0,MMS Version 10.4.0.4
  54. Finished Control File and SPFILE Autobackup at 23-JUN-18

复制代码

控制备份的时间:

  1. RMAN> backup duration 00:10 minimize load  tablespace users ;

  2. Starting backup at 23-JUN-18
  3. allocated channel: ORA_SBT_TAPE_1
  4. channel ORA_SBT_TAPE_1: SID=139 device type=SBT_TAPE
  5. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  6. allocated channel: ORA_SBT_TAPE_2
  7. channel ORA_SBT_TAPE_2: SID=76 device type=SBT_TAPE
  8. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  9. channel ORA_SBT_TAPE_1: starting full datafile backup set
  10. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  11. input datafile file number=00004 name=+DATA/orcl/datafile/users.259.816169553
  12. channel ORA_SBT_TAPE_1: starting piece 1 at 23-JUN-18
复制代码

游客,本帖隐藏的内容需要积分高于 50 才可浏览,您当前积分为 0














回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-21 19:17 , Processed in 0.055056 second(s), 28 queries .

快速回复 返回顶部 返回列表