Bo's Oracle Station

查看: 2784|回复: 0

课程第30次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-7-22 19:58:55 | 显示全部楼层 |阅读模式
2019-07-22

闪回区里头不能放一模一样的东西。
  1. RMAN> run {
  2. 2> allocate channel c1 device type disk ;
  3. 3> allocate channel c2 device type disk;
  4. 4> backup copies 2 datafile 4;
  5. 5> release channel c1;
  6. 6> release channel c2;
  7. 7> }

  8. allocated channel: c1
  9. channel c1: SID=46 device type=DISK

  10. allocated channel: c2
  11. channel c2: SID=47 device type=DISK

  12. Starting backup at 2019-07-22:20:19:03
  13. channel c1: starting full datafile backup set
  14. channel c1: specifying datafile(s) in backup set
  15. input datafile file number=00004 name=+DATA/orcl/datafile/users.259.1013960885
  16. channel c1: starting piece 1 at 2019-07-22:20:19:03
  17. released channel: c1
  18. released channel: c2
  19. RMAN-00571: ===========================================================
  20. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  21. RMAN-00571: ===========================================================
  22. RMAN-03009: failure of backup command on c1 channel at 07/22/2019 20:19:04
  23. ORA-19806: cannot make duplex backups in recovery area

  24. RMAN>
复制代码
  1. RMAN>  run {
  2. 2>  allocate channel c1 device type disk format '/home/oracle/backup1/%U';
  3. 3> allocate channel c2  device type disk format '/home/oracle/backup2/%U';
  4. 4> backup copies 2 datafile 4;
  5. 5> release channel c1;
  6. 6>  release channel c2;
  7. 7> }

  8. allocated channel: c1
  9. channel c1: SID=46 device type=DISK

  10. allocated channel: c2
  11. channel c2: SID=47 device type=DISK

  12. Starting backup at 2019-07-22:20:25:52
  13. channel c1: starting full datafile backup set
  14. channel c1: specifying datafile(s) in backup set
  15. input datafile file number=00004 name=+DATA/orcl/datafile/users.259.1013960885
  16. channel c1: starting piece 1 at 2019-07-22:20:25:52
  17. channel c1: finished piece 1 at 2019-07-22:20:25:53 with 2 copies and tag TAG20190722T202552
  18. piece handle=/home/oracle/backup1/28u7alug_1_1 comment=NONE
  19. piece handle=/home/oracle/backup1/28u7alug_1_2 comment=NONE
  20. channel c1: backup set complete, elapsed time: 00:00:01
  21. Finished backup at 2019-07-22:20:25:53

  22. Starting Control File and SPFILE Autobackup at 2019-07-22:20:25:53
  23. piece handle=+FRA/orcl/autobackup/2019_07_22/s_1014323153.301.1014323155 comment=NONE
  24. Finished Control File and SPFILE Autobackup at 2019-07-22:20:25:56

  25. released channel: c1

  26. released channel: c2

  27. RMAN>
复制代码
------------------------------------------------------------------------------------一个备份集下面两个以上备份片的情况:

1. maxpiecesize
2. copies

  1. RMAN> backup copies 2 datafile 4;

  2. Starting backup at 2019-07-22:20:31:29
  3. released channel: ORA_DISK_1
  4. released channel: ORA_DISK_2
  5. released channel: ORA_DISK_3
  6. released channel: ORA_DISK_4
  7. released channel: ORA_DISK_5
  8. released channel: ORA_DISK_6
  9. released channel: ORA_DISK_7
  10. released channel: ORA_DISK_8
  11. allocated channel: ORA_SBT_TAPE_1
  12. channel ORA_SBT_TAPE_1: SID=46 device type=SBT_TAPE
  13. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  14. allocated channel: ORA_SBT_TAPE_2
  15. channel ORA_SBT_TAPE_2: SID=47 device type=SBT_TAPE
  16. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  17. channel ORA_SBT_TAPE_1: starting full datafile backup set
  18. channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
  19. input datafile file number=00004 name=+DATA/orcl/datafile/users.259.1013960885
  20. channel ORA_SBT_TAPE_1: starting piece 1 at 2019-07-22:20:31:40
  21. channel ORA_SBT_TAPE_1: finished piece 1 at 2019-07-22:20:32:25 with 2 copies and tag TAG20190722T203139
  22. piece handle=2au7am9c_1_1 comment=API Version 2.0,MMS Version 10.4.0.4
  23. piece handle=2au7am9c_1_2 comment=API Version 2.0,MMS Version 10.4.0.4
  24. channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:45
  25. Finished backup at 2019-07-22:20:32:25

  26. Starting Control File and SPFILE Autobackup at 2019-07-22:20:32:25
  27. piece handle=c-1541741703-20190722-01 comment=API Version 2.0,MMS Version 10.4.0.4
  28. piece handle=c-1541741703-20190722-02 comment=API Version 2.0,MMS Version 10.4.0.4
  29. Finished Control File and SPFILE Autobackup at 2019-07-22:20:33:00

  30. RMAN> list backup;


  31. List of Backup Sets
  32. ===================


  33. BS Key  Type LV Size
  34. ------- ---- -- ----------
  35. 70      Full    3.50M
  36.   List of Datafiles in backup set 70
  37.   File LV Type Ckp SCN    Ckp Time            Name
  38.   ---- -- ---- ---------- ------------------- ----
  39.   4       Full 1228664    2019-07-24:00:04:56 +DATA/orcl/datafile/users.259.1013960885

  40.   Backup Set Copy #1 of backup set 70
  41.   Device Type Elapsed Time Completion Time     Compressed Tag
  42.   ----------- ------------ ------------------- ---------- ---
  43.   SBT_TAPE    00:00:37     2019-07-22:20:32:17 NO         TAG20190722T203139

  44.     List of Backup Pieces for backup set 70 Copy #1
  45.     BP Key  Pc# Status      Media                   Piece Name
  46.     ------- --- ----------- ----------------------- ----------
  47.     91      1   AVAILABLE   RMAN-DEFAULT-000001     2au7am9c_1_1

  48.   Backup Set Copy #2 of backup set 70
  49.   Device Type Elapsed Time Completion Time     Compressed Tag
  50.   ----------- ------------ ------------------- ---------- ---
  51.   SBT_TAPE    00:00:37     2019-07-22:20:32:17 NO         TAG20190722T203139

  52.     List of Backup Pieces for backup set 70 Copy #2
  53.     BP Key  Pc# Status      Media                   Piece Name
  54.     ------- --- ----------- ----------------------- ----------
  55.     92      1   AVAILABLE   RMAN-DEFAULT-000002     2au7am9c_1_2

  56. BS Key  Type LV Size
  57. ------- ---- -- ----------
  58. 71      Full    9.75M
  59.   SPFILE Included: Modification time: 2019-07-22:19:58:37
  60.   SPFILE db_unique_name: ORCL
  61.   Control File Included: Ckp SCN: 1277835      Ckp time: 2019-07-22:20:32:25

  62.   Backup Set Copy #1 of backup set 71
  63.   Device Type Elapsed Time Completion Time     Compressed Tag
  64.   ----------- ------------ ------------------- ---------- ---
  65.   SBT_TAPE    00:00:28     2019-07-22:20:32:53 NO         TAG20190722T203225

  66.     List of Backup Pieces for backup set 71 Copy #1
  67.     BP Key  Pc# Status      Media                   Piece Name
  68.     ------- --- ----------- ----------------------- ----------
  69.     93      1   AVAILABLE   RMAN-DEFAULT-000001     c-1541741703-20190722-01

  70.   Backup Set Copy #2 of backup set 71
  71.   Device Type Elapsed Time Completion Time     Compressed Tag
  72.   ----------- ------------ ------------------- ---------- ---
  73.   SBT_TAPE    00:00:28     2019-07-22:20:32:53 NO         TAG20190722T203225

  74.     List of Backup Pieces for backup set 71 Copy #2
  75.     BP Key  Pc# Status      Media                   Piece Name
  76.     ------- --- ----------- ----------------------- ----------
  77.     94      1   AVAILABLE   RMAN-DEFAULT-000002     c-1541741703-20190722-02

  78. RMAN>
复制代码
  1. [root@station76 stage]# obtool
  2. ob> lsvol -L lib01 -l
  3. Inventory of library lib01:
  4.     in    1:             vacant
  5.     in    2:             vacant
  6.     in    3:             barcode E01003L4, oid 168, 510976 kb remaining
  7.     in    4:             barcode E01004L4, oid 170, 510976 kb remaining
  8.     in    5:             barcode E01005L4, oid 172, 510976 kb remaining
  9.     in    6:             barcode E01006L4, oid 105
  10.     in    7:             barcode E01007L4, oid 106
  11.     in    8:             barcode E01008L4, oid 107
  12.     in    9:             barcode E01009L4, oid 108
  13.     in    10:            barcode E01010L4, oid 109
  14.     in    11:            barcode E01011L4, oid 110
  15.     in    12:            barcode E01012L4, oid 111
  16.     in    13:            barcode E01013L4, oid 112
  17.     in    14:            barcode E01014L4, oid 113
  18.     in    15:            barcode E01015L4, oid 114
  19.     in    16:            barcode E01016L4, oid 115
  20.     in    17:            barcode E01017L4, oid 116
  21.     in    18:            barcode E01018L4, oid 117
  22.     in    19:            barcode E01019L4, oid 118
  23.     in    20:            barcode E01020L4, oid 119
  24.     in    21:            vacant
  25.     in    22:            barcode CLN101L4, oid 120
  26.     in    23:            barcode CLN102L5, oid 121
  27.     in    24:            vacant
  28.     in    25:            vacant
  29.     in    26:            vacant
  30.     in    27:            vacant
  31.     in    28:            vacant
  32.     in    29:            vacant
  33.     in    30:            barcode F01030L5, oid 122
  34.     in    31:            barcode F01031L5, oid 123
  35.     in    32:            barcode F01032L5, oid 124
  36.     in    33:            barcode F01033L5, oid 125
  37.     in    34:            barcode F01034L5, oid 126
  38.     in    35:            barcode F01035L5, oid 127
  39.     in    36:            barcode F01036L5, oid 128
  40.     in    37:            barcode F01037L5, oid 129
  41.     in    38:            barcode F01038L5, oid 130
  42.     in    39:            barcode F01039L5, oid 131
  43.     in    iee1:          vacant
  44.     in    iee2:          vacant
  45.     in    iee3:          vacant
  46.     in    iee4:          vacant
  47.     in    dte1:          vacant
  48.     in    dte2:          vacant
  49.     in    dte3:          volume RMAN-DEFAULT-000001, barcode E01001L4, oid 173,                 510976 kb remaining, content manages reuse, lastse 1
  50.     in    dte4:          volume RMAN-DEFAULT-000002, barcode E01002L4, oid 174,                 510976 kb remaining, content manages reuse, lastse 2
  51. ob>
复制代码

11.2.0.1钱包的路径在这里:
  1. /u01/app/oracle/admin/orcl/wallet
复制代码
11.2.0.4建这个目录:
  1. /u01/app/oracle/wallet/orcl/
复制代码
owm(所有问题回答no)
存ewallet.p12到以上目录

  1. [oracle@station76 orcl]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.4.0 Production on Mon Jul 22 21:41:01 2019

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

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> alter system set encryption key identified by "oracle123";

  7. System altered.

  8. SQL>
复制代码
关闭和打开钱包的命令:
  1. SQL> alter system set encryption wallet close ;
  2. alter system set encryption wallet close
  3. *
  4. ERROR at line 1:
  5. ORA-28390: auto login wallet not open but encryption wallet may be open


  6. SQL>  alter system set encryption wallet close identified by "oracle1234";
  7. alter system set encryption wallet close identified by "oracle1234"
  8. *
  9. ERROR at line 1:
  10. ORA-28391: cannot close wallet or HSM, password mismatch


  11. SQL>  alter system set encryption wallet close identified by "oracle123";

  12. System altered.

  13. SQL>  alter system set encryption wallet  open identified by "oracle123";

  14. System altered.

复制代码

整个数据库只有一个密钥(主密钥),列密钥(dba_encryption_columns)的生成和解密都不需要你去干预。
  1. SQL> conn hr/oracle_4U
  2. Connected.
  3. SQL> create table t05304( a number encrypt ) ;

  4. Table created.

  5. SQL> insert into t05304 values (1);
  6. insert into t05304 values (1)
  7.             *
  8. ERROR at line 1:
  9. ORA-01647: tablespace 'USERS' is read-only, cannot allocate space in it


  10. SQL>  insert into t05304 values (1);

  11. 1 row created.

  12. SQL> commit;

  13. Commit complete.

  14. SQL> select * from t05304;

  15.          A
  16. ----------
  17.          1

  18. SQL>  select * from t05304;
  19. select * from t05304
  20.                *
  21. ERROR at line 1:
  22. ORA-28365: wallet is not open


复制代码




回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-9 14:47 , Processed in 0.039036 second(s), 24 queries .

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