botang 发表于 2019-7-22 19:58:55

课程第30次

2019-07-22

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

allocated channel: c1
channel c1: SID=46 device type=DISK

allocated channel: c2
channel c2: SID=47 device type=DISK

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

RMAN>

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

allocated channel: c1
channel c1: SID=46 device type=DISK

allocated channel: c2
channel c2: SID=47 device type=DISK

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

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

released channel: c1

released channel: c2

RMAN>
------------------------------------------------------------------------------------一个备份集下面两个以上备份片的情况:

1. maxpiecesize
2. copies

RMAN> backup copies 2 datafile 4;

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

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

RMAN> list backup;


List of Backup Sets
===================


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

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

    List of Backup Pieces for backup set 70 Copy #1
    BP KeyPc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    91      1   AVAILABLE   RMAN-DEFAULT-000001   2au7am9c_1_1

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

    List of Backup Pieces for backup set 70 Copy #2
    BP KeyPc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    92      1   AVAILABLE   RMAN-DEFAULT-000002   2au7am9c_1_2

BS KeyType LV Size
------- ---- -- ----------
71      Full    9.75M
SPFILE Included: Modification time: 2019-07-22:19:58:37
SPFILE db_unique_name: ORCL
Control File Included: Ckp SCN: 1277835      Ckp time: 2019-07-22:20:32:25

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

    List of Backup Pieces for backup set 71 Copy #1
    BP KeyPc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    93      1   AVAILABLE   RMAN-DEFAULT-000001   c-1541741703-20190722-01

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

    List of Backup Pieces for backup set 71 Copy #2
    BP KeyPc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    94      1   AVAILABLE   RMAN-DEFAULT-000002   c-1541741703-20190722-02

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

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

$ sqlplus /nolog

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

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

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

System altered.

SQL>
关闭和打开钱包的命令:SQL> alter system set encryption wallet close ;
alter system set encryption wallet close
*
ERROR at line 1:
ORA-28390: auto login wallet not open but encryption wallet may be open


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


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

System altered.

SQL>alter system set encryption walletopen identified by "oracle123";

System altered.


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

Table created.

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


SQL>insert into t05304 values (1);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t05304;

         A
----------
         1

SQL>select * from t05304;
select * from t05304
               *
ERROR at line 1:
ORA-28365: wallet is not open






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