botang 发表于 2019-8-5 20:49:59

课程第37次

2019-08-05
# cd /u01/app/oracle/product/11.2.0/dbhome_1/station76.example.com_orcl/sysman/emd/state/
# ls
0000.dlt
0001.dlt
0002.dlt
0003.dlt
0004.dlt
0005.dlt
83E3D3D75900957545AA951F730DF856_failedLogin.log
83E3D3D75900957545AA951F730DF856_seg_adv_count.log
adr
corr.save
ORA1578_20190805125138_COM_1.zip
parse-log-D3C70AD90DF7BEA3EF4DCCC90D151E5D
progResUtil.log
snapshot
storage
# stat ORA1578_20190805125138_COM_1.zip
File: `ORA1578_20190805125138_COM_1.zip'
Size: 7751825         Blocks: 15144      IO Block: 4096   regular file
Device: fb00h/64256d    Inode: 2376966   Links: 1
Access: (0640/-rw-r-----)Uid: (602/oracle)   Gid: (602/oinstall)
Access: 2019-08-05 12:53:15.845424387 +0800
Modify: 2019-08-05 12:53:15.845424387 +0800
Change: 2019-08-05 12:53:15.845424387 +0800
#
# ls
HMREPORT_HM_RUN_6351.hmHMREPORT_HM_RUN_6511.hmHMREPORT_HM_RUN_6591.hm
HMREPORT_HM_RUN_6431.hmHMREPORT_HM_RUN_6531.hmHMREPORT_HM_RUN_6611.hm
HMREPORT_HM_RUN_6451.hmHMREPORT_HM_RUN_6571.hm
# vim HMREPORT_HM_RUN_6611.hm

# cd hm/
# ls
HMREPORT_HM_RUN_6351.hmHMREPORT_HM_RUN_6531.hmHMREPORT_MYRUN1.hm
HMREPORT_HM_RUN_6431.hmHMREPORT_HM_RUN_6571.hmHMREPORT_MYRUN2.hm
HMREPORT_HM_RUN_6451.hmHMREPORT_HM_RUN_6591.hm
HMREPORT_HM_RUN_6511.hmHMREPORT_HM_RUN_6611.hm

RMAN>run {
2>set newname for datafile 5 to '/home/oracle/example.dbf';
3>restore datafile 5 from tag '1T-WHOLE-INCR0';
4> }

executing command: SET NEWNAME

Starting restore at 2019-08-05:13:08:59
using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1

channel ORA_SBT_TAPE_1: starting datafile backup set restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
channel ORA_SBT_TAPE_1: restoring datafile 00005 to /home/oracle/example.dbf
channel ORA_SBT_TAPE_1: reading from backup piece 3au8bfd9_1_1
channel ORA_SBT_TAPE_1: piece handle=3au8bfd9_1_1 tag=1T-WHOLE-INCR0
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:35
Finished restore at 2019-08-05:13:09:35

https://www.botangdb.com/forum.php?mod=viewthread&tid=80


关于OPatch:
$ unzip p13906496_112030_Linux-x86-64.zip
Archive:p13906496_112030_Linux-x86-64.zip
   creating: 13906496/
   creating: 13906496/etc/
   creating: 13906496/etc/xml/
inflating: 13906496/etc/xml/GenericActions.xml
inflating: 13906496/etc/xml/ShiphomeDirectoryStructure.xml
   creating: 13906496/etc/config/
inflating: 13906496/etc/config/actions.xml
inflating: 13906496/etc/config/inventory.xml
inflating: 13906496/etc/config/deploy.xml
   creating: 13906496/online/
   creating: 13906496/online/files/
   creating: 13906496/online/files/hpatch/
inflating: 13906496/online/files/hpatch/bug13906496.pch
   creating: 13906496/online/etc/
   creating: 13906496/online/etc/config/
inflating: 13906496/online/etc/config/actions.xml
inflating: 13906496/online/etc/config/inventory.xml
inflating: 13906496/online/etc/config/deploy.xml
   creating: 13906496/online/etc/xml/
inflating: 13906496/online/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 13906496/online/etc/xml/GenericActions.xml
inflating: 13906496/README.txt
   creating: 13906496/files/
   creating: 13906496/files/lib/
   creating: 13906496/files/lib/libserver11.a/
inflating: 13906496/files/lib/libserver11.a/qertqo.o
inflating: 13906496/files/lib/libserver11.a/kxfq.o
$ ls
13906496               Music
backup                   ORA1578_20190805125138_COM_1.zip
backup1                  ORA1578_20190805125139_COM_1.zip
backup2                  oradiag_oracle
backupusers.rcv          p13906496_112030_Linux-x86-64.zip
control10d-after.sql   p6880880_112000_Linux-x86-64.zip
control10d-before.sql    pb.sh
control11b.sql         Pictures
control11c.sql         Public
create_t04209_uname.sqlRMasmcmd.sh
datapumpdir            Templates
Desktop                  test
Documents                test2
Downloads                Videos
example.dbf
$ cd 13906496
$ ls
etcfilesonlineREADME.txt
$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opat                                                                           ch-h
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.All rights reserved.


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

            command := apply
                     lsinventory
                     lspatches
                     napply
                     nrollback
                     rollback
                     query
                     version
                     prereq
                     util

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

example:
   'opatch -help'
   'opatch -help -fmw'
   'opatch auto -help'
   'opatch apply -help'
   'opatch lsinventory -help'
   'opatch lspatches -help'
   'opatch napply -help'
   'opatch nrollback -help'
   'opatch rollback -help'
   'opatch prereq -help'
   'opatch util -help'


OPatch succeeded.
$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opat                                                                           chquery-h
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.All rights reserved.


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

SYNTAX
      opatch query[-all] [-is_auto_patch] [-is_translatable_patch]
                      [-get_base_bugs] [-get_component] [-get_os] [-get_date]
                      [-get_patch_language] [-get_patch_type] [-get_patching_mod                                                                           el]
                      [-get_product_family] [-get_update_components] [-has_sql]                                                                              
                      [-is_online_patch][-is_patchset_update]
                      [-is_portal_patch] [-is_rolling_patch]
                      [-jre <LOC> ] [-oh <LOC> ]
                      [ <patch_location> ]

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

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

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

         -get_base_bug
                Get bugs fixed by the patch

         -get_component
                Get components touched by the patch.

         -get_update_components
                Get all components to be upgraded in a Patchset Update.

         -get_date
                Get patch creation date and time.

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

         -get_patch_type
                Get the patch type.

         -get_patching_model
                Get the patching model.

         -get_patch_language
                Get the language supported by the patch.

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

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

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

         -is_patchset_update
                This option says 'true' if the patch is a Patchset Update,
                'false' otherwise.

         -is_portal_patch
                This option says 'true' if the patch has portal actions,
                'false' otherwise.

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

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

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


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



OPatch succeeded.
$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opat                                                                           chquery-is_online_patch
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from         : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/o                                                                           patch2019-08-05_14-08-01PM_1.log

--------------------------------------------------------------------------------
Patch is an online patch: false



OPatch succeeded.
$ cd online
$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch                                                                               query-is_online_patch
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from         : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/o                                                                           patch2019-08-05_14-08-12PM_1.log

--------------------------------------------------------------------------------
Patch is an online patch: true



OPatch succeeded.
$

$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatchapply-connectStringorcl:::-connectStringrcat:::$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatchrollback -i 55555 -connectString orcl::: -connectString rcat:::

页: [1]
查看完整版本: 课程第37次