oracle 12.2.0.1 使用 sqlplus 搭建 active dataguard

oracle 12.2.0.1 使用 sqlplus 搭建 active dataguardoracle 12.2.0.1 使用 sqlplus 搭建 active dataguard 数据库人生 2018-07-08 10:12:27 490 收藏 分类专栏: # oracle ha d…

oracle 12.2.0.1 使用 sqlplus 搭建 active dataguard

oracle 12.2.0.1 使用 sqlplus 搭建 active dataguard
数据库人生 2018-07-08 10:12:27 490 收藏
分类专栏: # oracle ha data guard 文章标签: active dataguard dataguard duplicate db_name db_unique_name
版权
postgresql ha patroni
patroni
数据库人生
¥9.90

os: centos 7.4
database:12.2.0.1 + dbf

本次是以 oracle database 12.2.0.1 + dbf 的形式部署的,后面会记录 rac + asm 的形式。

任何时候都要说下三种模式:

最大保护:maximize protection
最高性能:maximize performance
最高可用:maximize availability

alter database set standby to maximize protection;
alter database set standby to maximize performance;
atler database set standby to maximize availability;

规划如下

                    maser             slave
$ORACLE_SID          orcl              orcl

db_name:             orcl              orcl
db_unique_name:     orclp            orcls1

    1
    2
    3
    4
    5
    6

acitive dataguard 要求所有成员的 db_name 必须保持一致,通过 db_unique_name 区分各成员。

下面这个图比较常见且经典.
在这里插入图片描述
oradb-node1 192.168.56.101 master

adb-node1 192.168.56.101 master
安装好了12.2.0.1 的软件,并创建了数据库
主库name相关

db_name:            orcl
db_unique_name:     orclp
net service name:   tns_orclp

    1
    2
    3
    4

修改 db_unique_name

SQL> show parameter db_name;

NAME                     TYPE     VALUE
———————————— ———– ——————————
db_name                  string     orcl

SQL> alter system set db_unique_name=”orclp” scope=spfile;

System altered.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

增加静态监听

$ vi listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
      (SID_NAME = orcl)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = orclp_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
      (SID_NAME = orcl)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
 

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

修改 net service name

$ vi tnsnames.ora

# for duplicate
tns_orclp_dgmgrl =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orclp_dgmgrl)
    )
  )

# for duplicate
tns_orcls1_dgmgrl =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcls1_dgmgrl)
    )
  )

tns_orclp =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orclp)
    )
  )

tns_orcls1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcls1)
    )
  )
      

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40

主库启用 force logging

SQL> alter database force logging;

Database altered.

    1
    2
    3
    4

主库启用 archivelog

SQL> archive log list;
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           /u01/app/oracle/product/12.2.0/db_1/dbs/arch
Oldest online log sequence     1
Current log sequence           2

SQL> alter system set log_archive_config=”dg_config=(orclp,orcls1)” scope=spfile;
alter system set log_archive_dest_1=”location=/u01/app/oracle/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orclp” scope=spfile;
alter system set log_archive_dest_2=”service=tns_orcls1 valid_for=(online_logfiles,primary_role) lgwr affirm sync db_unique_name=orcls1″ scope=spfile;

SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

执行 open pdb,确保处于 read write

SQL> show pdbs;

    CON_ID CON_NAME              OPEN MODE  RESTRICTED
———- —————————— ———- ———-
     2 PDB$SEED              READ ONLY  NO
     3 ORCLPDB              MOUNTED
    
SQL> alter pluggable database ORCLPDB open;

Pluggable database altered.

SQL> show pdbs;

    CON_ID CON_NAME              OPEN MODE  RESTRICTED
———- —————————— ———- ———-
     2 PDB$SEED              READ ONLY  NO
     3 ORCLPDB              READ WRITE NO

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

主库创建 standby redo logfile

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE      MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME      NEXT_CHANGE# NEXT_TIME           CON_ID
———- ———- ———- ———- ———- ———- — —————- ————- ——————- ———— ——————- ———-
     1        1           4  209715200       512        1 NO  CURRENT             1572343 2018-07-07 14:47:20   1.8447E+19                   0
     2        1           2  209715200       512        1 YES INACTIVE             1429048 2018-07-07 11:45:32      1472300 2018-07-07 14:44:53       0
     3        1           3  209715200       512        1 YES INACTIVE             1472300 2018-07-07 14:44:53      1572343 2018-07-07 14:47:20       0

SQL> col MEMBER format a40;
SQL> select * from v$logfile;

    GROUP# STATUS  TYPE    MEMBER                                    IS_ CON_ID
———- ——- ——- —————————————- — ———-
     3       ONLINE  /u01/app/oracle/oradata/orcl/redo03.log          NO         0
     2       ONLINE  /u01/app/oracle/oradata/orcl/redo02.log          NO         0
     1       ONLINE  /u01/app/oracle/oradata/orcl/redo01.log          NO         0

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

最少添加n+1个standby redo logfile,完全可以比n+1多,如下面

SQL> alter database add standby logfile “/u01/app/oracle/oradata/orcl/standby_redo01.log” size 200M;
alter database add standby logfile “/u01/app/oracle/oradata/orcl/standby_redo02.log” size 200M;
alter database add standby logfile “/u01/app/oracle/oradata/orcl/standby_redo03.log” size 200M;
alter database add standby logfile “/u01/app/oracle/oradata/orcl/standby_redo04.log” size 200M;
alter database add standby logfile “/u01/app/oracle/oradata/orcl/standby_redo05.log” size 200M;

    1
    2
    3
    4
    5
    6

主库创建 pfile,并修改

*.audit_file_dest=”/u01/app/oracle/admin/orcl/adump”
*.audit_trail=”db”
*.compatible=”12.2.0″
*.control_files=”/u01/app/oracle/oradata/orcl/control01.ctl”,”/u01/app/oracle/oradata/orcl/control02.ctl”
*.db_block_size=8192
*.diagnostic_dest=”/u01/app/oracle”
*.dispatchers=”(PROTOCOL=TCP) (SERVICE=orclXDB)”
*.enable_pluggable_database=true
*.local_listener=”LISTENER_ORCL”
*.log_archive_dest_1=”location=/u01/app/oracle/archivelog”
*.nls_language=”AMERICAN”
*.nls_territory=”AMERICA”
*.open_cursors=300
*.pga_aggregate_target=597m
*.processes=300
*.remote_login_passwordfile=”EXCLUSIVE”
*.sga_target=1788m
*.undo_tablespace=”UNDOTBS1″

*.db_name=”orcl”
*.db_unique_name=”orclp”
*.log_archive_config=”dg_config=(orclp,orcls1)”
*.log_archive_dest_1=”location=/u01/app/oracle/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orclp”
*.log_archive_dest_2=”service=tns_orcls1 valid_for=(online_logfiles,primary_role) lgwr affirm sync db_unique_name=orcls1″
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format=”%t_%s_%r.dbf”
*.standby_file_management=”auto”
*.fal_server=”orcls1″
*.fal_client=”orclp”
*.db_file_name_convert=”/u01/app/oracle/”,”/u01/app/oracle/”
*.log_file_name_convert=”/u01/app/oracle/”,”/u01/app/oracle/”
*.remote_login_passwordfile=”EXCLUSIVE”

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34

oradb-node2 192.168.56.102 physical standby

安装好了12.2.0.1 的软件,不创建数据库,用duplicate命令从master拉过来
备库name相关

db_name:            orcl
db_unique_name:     orcls1
net service name:   tns_orcls1

    1
    2
    3
    4

添加静态监听

$ vi listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
      (SID_NAME = orcl)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = orcls1_DGMGRL)
      (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
      (SID_NAME = orcl)
    )
  )
 

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

修改 net service name

$ vi tnsnames.ora

# for duplicate
tns_orclp_dgmgrl =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orclp_dgmgrl)
    )
  )

# for duplicate
tns_orcls1_dgmgrl =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcls1_dgmgrl)
    )
  )

tns_orclp =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orclp)
    )
  )

tns_orcls1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oradb-node2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcls1)
    )
  )
   

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40

备库目录相关

参考主库创建必要的目录

$ mkdir -p $ORACLE_BASE/admin/orcl/adump;
mkdir -p $ORACLE_BASE/archivelog;
mkdir -p $ORACLE_BASE/audit;
mkdir -p $ORACLE_BASE/fast_recovery_area/orcl;
mkdir -p $ORACLE_BASE/oradata/orcl;
mkdir -p $ORACLE_BASE/oradata/orcl/pdbseed;
mkdir -p $ORACLE_BASE/oradata/orcl/orclpdb;

    1
    2
    3
    4
    5
    6
    7
    8

备库拷贝master 的password file、pfile

$ scp oracle@192.168.56.101:/u01/app/oracle/product/12.2.0/db_1/dbs/orapworcl  ./

$ scp oracle@192.168.56.101:/u01/app/oracle/product/12.2.0/db_1/dbs/initorcl.ora  ./

    1
    2
    3
    4

备库spfile内容如下

*.audit_file_dest=”/u01/app/oracle/admin/orcl/adump”
*.audit_trail=”db”
*.compatible=”12.2.0″
*.control_files=”/u01/app/oracle/oradata/orcl/control01.ctl”,”/u01/app/oracle/oradata/orcl/control02.ctl”
*.db_block_size=8192
*.diagnostic_dest=”/u01/app/oracle”
*.dispatchers=”(PROTOCOL=TCP) (SERVICE=orclXDB)”
*.enable_pluggable_database=true
*.local_listener=”LISTENER_ORCL”
*.nls_language=”AMERICAN”
*.nls_territory=”AMERICA”
*.open_cursors=300
*.pga_aggregate_target=597m
*.processes=300
*.sga_target=1788m
*.undo_tablespace=”UNDOTBS1″

*.db_name=”orcl”
*.db_unique_name=”orcls1″
*.log_archive_config=”dg_config=(orclp,orcls1)”
*.log_archive_dest_1=”location=/u01/app/oracle/archivelog valid_for=(all_logfiles,all_roles) db_unique_name=orcls1″
*.log_archive_dest_2=”service=tns_orclp valid_for=(online_logfiles,primary_role) lgwr affirm sync db_unique_name=orclp”
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format=”%t_%s_%r.dbf”
*.standby_file_management=”auto”
*.fal_server=”orclp”
*.fal_client=”orcls1″
*.db_file_name_convert=”/u01/app/oracle/”,”/u01/app/oracle/”
*.log_file_name_convert=”/u01/app/oracle/”,”/u01/app/oracle/”
*.remote_login_passwordfile=”EXCLUSIVE”

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32

备库启动到nomount状态

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1879048192 bytes
Fixed Size            8794072 bytes
Variable Size          553648168 bytes
Database Buffers     1308622848 bytes
Redo Buffers            7983104 bytes

    1
    2
    3
    4
    5
    6
    7
    8
    9

备库开始active duplicate

$ rman target sys/oracleoracle@tns_orclp  auxiliary sys/oracleoracle@tns_orcls1

RMAN> duplicate target database for standby from active database nofilenamecheck dorecover;

    1
    2
    3
    4

备库打开

SQL> select open_mode from v$database;

OPEN_MODE
————————————————————
MOUNTED

SQL> alter database open;

Database altered.

SQL> select open_mode,log_mode,open_mode ,database_role from v$database;

OPEN_MODE         LOG_MODE      OPEN_MODE           DATABASE_ROLE
——————– ———— ——————– —————-
READ ONLY         ARCHIVELOG   READ ONLY           PHYSICAL STANDBY

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

此时查看 pdb

SQL> show pdbs;

    CON_ID CON_NAME              OPEN MODE  RESTRICTED
———- —————————— ———- ———-
     2 PDB$SEED              READ ONLY  NO
     3 ORCLPDB              MOUNTED
SQL> alter pluggable database ORCLPDB open;

Pluggable database altered.

SQL> show pdbs;

    CON_ID CON_NAME              OPEN MODE  RESTRICTED
———- —————————— ———- ———-
     2 PDB$SEED              READ ONLY  NO
     3 ORCLPDB              READ ONLY  NO
    

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

备库开始real-time apply

SQL> alter database recover managed standby database using current logfile disconnect from session;

    1
    2

验证
备库查看日志

$ tail -f -n 1000 /u01/app/oracle/diag/rdbms/orcls1/orcl/trace/alert_orcl.log

    1
    2

主库查看

select
      dbms_flashback.get_system_change_number() as master_current_scn,
      ad.APPLIED_SCN,
      ad.*
from v$archive_dest ad
where 1=1
;

select *
from v$archive_dest_status
;

select *
from v$archive_gap
;

select *
from v$archive_processes
;

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

此时可以把 tnsnames.ora 的 tns_orclp_dgmgrl、tns_orcls1_dgmgrl 屏蔽掉。
需要注意的是记得操作pdb

参考:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/high-availability.html

下面是 duplicate 时输出,自己分析,博友可以忽略

$ rman target sys/oracleoracle@tns_orclp  auxiliary sys/oracleoracle@tns_orcls1

Recovery Manager: Release 12.2.0.1.0 – Production on Sat Jul 7 17:21:13 2018

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

connected to target database: ORCL (DBID=1508635741)
connected to auxiliary database: ORCL (not mounted)

RMAN> duplicate target database for standby from active database nofilenamecheck dorecover;

Starting Duplicate Db at 2018-07-07 17:21:30
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=36 device type=DISK
current log archived

contents of Memory Script:
{
   backup as copy reuse
   targetfile  “/u01/app/oracle/product/12.2.0/db_1/dbs/orapworcl” auxiliary format
 “/u01/app/oracle/product/12.2.0/db_1/dbs/orapworcl”   ;
}
executing Memory Script

Starting backup at 2018-07-07 17:21:31
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=69 device type=DISK
Finished backup at 2018-07-07 17:21:32

contents of Memory Script:
{
   restore clone from service  “tns_orclp” standby controlfile;
}
executing Memory Script

Starting restore at 2018-07-07 17:21:32
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/orcl/control01.ctl
output file name=/u01/app/oracle/oradata/orcl/control02.ctl
Finished restore at 2018-07-07 17:21:34

contents of Memory Script:
{
   sql clone “alter database mount standby database”;
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 “/u01/app/oracle/oradata/orcl/temp01.dbf”;
   set newname for tempfile  2 to
 “/u01/app/oracle/oradata/orcl/pdbseed/temp012018-07-07_11-44-06-982-AM.dbf”;
   set newname for tempfile  3 to
 “/u01/app/oracle/oradata/orcl/orclpdb/temp01.dbf”;
   switch clone tempfile all;
   set newname for datafile  1 to
 “/u01/app/oracle/oradata/orcl/system01.dbf”;
   set newname for datafile  3 to
 “/u01/app/oracle/oradata/orcl/sysaux01.dbf”;
   set newname for datafile  4 to
 “/u01/app/oracle/oradata/orcl/undotbs01.dbf”;
   set newname for datafile  5 to
 “/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf”;
   set newname for datafile  6 to
 “/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf”;
   set newname for datafile  7 to
 “/u01/app/oracle/oradata/orcl/users01.dbf”;
   set newname for datafile  8 to
 “/u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf”;
   set newname for datafile  9 to
 “/u01/app/oracle/oradata/orcl/orclpdb/system01.dbf”;
   set newname for datafile  10 to
 “/u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf”;
   set newname for datafile  11 to
 “/u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf”;
   set newname for datafile  12 to
 “/u01/app/oracle/oradata/orcl/orclpdb/users01.dbf”;
   restore
   from  nonsparse   from service
 “tns_orclp”   clone database
   ;
   sql “alter system archive log current”;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/orcl/temp01.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/orcl/pdbseed/temp012018-07-07_11-44-06-982-AM.dbf in control file
renamed tempfile 3 to /u01/app/oracle/oradata/orcl/orclpdb/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 2018-07-07 17:21:39
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/orcl/orclpdb/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2018-07-07 17:22:29

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  “tns_orclp”
           archivelog from scn  1585893;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 2018-07-07 17:22:30
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service tns_orclp
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2018-07-07 17:22:32

datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=980875352 file name=/u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=980875353 file name=/u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=980875353 file name=/u01/app/oracle/oradata/orcl/orclpdb/users01.dbf

contents of Memory Script:
{
   set until scn  1586097;
   recover
   standby
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 2018-07-07 17:22:33
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 6 is already on disk as file /u01/app/oracle/archivelog/1_6_980855007.dbf
archived log for thread 1 with sequence 7 is already on disk as file /u01/app/oracle/archivelog/1_7_980855007.dbf
archived log file name=/u01/app/oracle/archivelog/1_6_980855007.dbf thread=1 sequence=6
archived log file name=/u01/app/oracle/archivelog/1_7_980855007.dbf thread=1 sequence=7
media recovery complete, elapsed time: 00:00:00
Finished recover at 2018-07-07 17:22:34
Finished Duplicate Db at 2018-07-07 17:22:43

————————————————
版权声明:本文为CSDN博主「数据库人生」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ctypyb2002/java/article/details/80957130

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/7169.html

(0)
上一篇 2023-03-25
下一篇 2023-03-25

相关推荐

  • 使用Python输出网页标题

    使用Python输出网页标题Python是一种非常流行的编程语言,具有简单易学、语法简洁、可读性强、灵活性高等优点,所以越来越受到程序员和爱好者的欢迎。其中,使用Python输出网页标题是许多人都热衷于学习的标志性功能之一。

    2024-05-14
    68
  • 腾讯短网址怎么在线生成[亲测有效]

    腾讯短网址怎么在线生成[亲测有效]短网址生成指的是把帮您把冗长的URL地址缩短成8个字符以内的短网址。 那为什么要生成短链接呢? 最基础的,日常在用到微信朋友圈、qq说说、短信、微博等,都有字数的限制。如果链接长度较长,链接发送不全…

    2023-04-04
    169
  • Python图标是重要标志

    Python图标是重要标志Python图标是指Python编程语言所使用的蟒蛇形象,这个图标一般被用于Python的宣传、推广、文档以及网站等方面。Python图标的设计师是荷兰人Guido van Rossum,Python图标的设计理念是“简单、明了、友好”。

    2024-07-09
    53
  • JavaScript中向数组指定位置添加元素详解

    JavaScript中向数组指定位置添加元素详解在JavaScript中,我们常常需要对数组进行操作,包括添加、删除、修改等。其中,向数组指定位置添加元素是一种比较常见的操作,它可以在数组的任意位置插入元素,从而具有很重要的意义。

    2024-08-23
    25
  • TIDB在win10安装_sql语句慢查询

    TIDB在win10安装_sql语句慢查询关系型数据库的 DBA 日常肯定遇到过这样的一种场景:SQL 执行计划选择错误,这类问题的危害是很大的,常常导致业务突然卡顿,数据库过载等不良后果。 举个例子,假设我们有这么一张表: 其中,姓名和性…

    2023-02-10
    164
  • 思维进阶 查询连续签到几天的用户「终于解决」

    思维进阶 查询连续签到几天的用户「终于解决」select user_name,sign_date,IF(@pre=user_name,@rownum:=@rownum+1,@rownum:=1), @pre:=user_name from (…

    2023-03-09
    150
  • 如何在cmd中运行Python程序

    如何在cmd中运行Python程序Python已成为当前最受欢迎和使用的编程语言之一。如今,它在各种领域中的使用越来越广泛,包括Web应用程序、数据科学、机器学习等。接下来,我们将介绍如何在Windows操作系统的命令提示符(cmd)下运行Python程序。

    2024-09-17
    25
  • Python 中 dict.update 的用法详解

    Python 中 dict.update 的用法详解a href=”https://www.python100.com/a/sm.html”font color=”red”免责声明/font/a a href=”https://beian.miit.gov.cn/”苏ICP备2023018380号-1/a Copyright www.python100.com .Some Rights Reserved.

    2024-06-17
    46

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注