Oracle 12C ORA-12545 While Connecting to RAC through SCAN Name

操作环境为Oracle Linux 7.1,Oracle 12.2 RAC数据库,SCAN IP是使用GNS方式创建,在使用SCAN IP登录数据库时出现如下错误

SQL> conn sys/abcd@cs as sysdba
ERROR:
ORA-12545: Connect failed because target host or object does not exist

错误信息直译是目标主机或对象不存在。

查看scan的配置信息状态正常

[grid@cs1 ~]$ srvctl config scan
SCAN name: cs-cluster-scan.cs-cluster.jy.net, Network: 1
Subnet IPv4: 10.10.10.0/255.255.255.0/ens160, dhcp
Subnet IPv6: 
SCAN 1 IPv4 VIP: -/scan1-vip/10.10.10.143
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 
SCAN 2 IPv4 VIP: -/scan2-vip/10.10.10.141
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 
SCAN 3 IPv4 VIP: -/scan3-vip/10.10.10.142
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 

查看scan的监听信息状态正常

[grid@cs1 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
Registration invited nodes: 
Registration invited subnets: 
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes: 
SCAN Listener is individually disabled on nodes: 
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
Registration invited nodes: 
Registration invited subnets: 
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes: 
SCAN Listener is individually disabled on nodes: 
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
Registration invited nodes: 
Registration invited subnets: 
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes: 
SCAN Listener is individually disabled on nodes: 

[grid@cs2 ~]$ lsnrctl status LISTENER_SCAN1

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:13

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                12-MAR-2018 19:10:06
Uptime                    0 days 15 hr. 55 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/cs2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.143)(PORT=1521)))
Services Summary...
Service "-MGMTDBXDB" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "66fa07fcd41a56f0e053be828a0abc70" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "cs" has 2 instance(s).
  Instance "cs1", status READY, has 1 handler(s) for this service...
  Instance "cs2", status READY, has 1 handler(s) for this service...
Service "csXDB" has 2 instance(s).
  Instance "cs1", status READY, has 1 handler(s) for this service...
  Instance "cs2", status READY, has 1 handler(s) for this service...
Service "gimr_dscrep_10" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
The command completed successfully

[grid@cs1 ~]$ lsnrctl status LISTENER_SCAN2

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:29

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN2
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                12-MAR-2018 19:08:54
Uptime                    0 days 15 hr. 56 min. 35 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/cs1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.141)(PORT=1521)))
Services Summary...
Service "-MGMTDBXDB" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "66fa07fcd41a56f0e053be828a0abc70" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "cs" has 2 instance(s).
  Instance "cs1", status READY, has 1 handler(s) for this service...
  Instance "cs2", status READY, has 1 handler(s) for this service...
Service "csXDB" has 2 instance(s).
  Instance "cs1", status READY, has 1 handler(s) for this service...
  Instance "cs2", status READY, has 1 handler(s) for this service...
Service "gimr_dscrep_10" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@cs1 ~]$ lsnrctl status LISTENER_SCAN3

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 11:05:32

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN3
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                12-MAR-2018 19:08:52
Uptime                    0 days 15 hr. 56 min. 40 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/product/12.2.0/crs/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/cs1/listener_scan3/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.142)(PORT=1521)))
Services Summary...
Service "-MGMTDBXDB" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "66fa07fcd41a56f0e053be828a0abc70" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "cs" has 2 instance(s).
  Instance "cs1", status READY, has 1 handler(s) for this service...
  Instance "cs2", status READY, has 1 handler(s) for this service...
Service "csXDB" has 2 instance(s).
  Instance "cs1", status READY, has 1 handler(s) for this service...
  Instance "cs2", status READY, has 1 handler(s) for this service...
Service "gimr_dscrep_10" has 1 instance(s).
  Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
The command completed successfully

在通过SCAN Name来连接RAC数据库时,客户端可以解析所有有完整域名的SCAN Name与VIP Name,但是不能解析没有域名的SCAN Name与VIP Name。通过以下操作可以解决这个问题。

1.在数据库级别使用有完整域名的VIP Name或VIP来设置pfile或spfile文件中的local_listener参数

alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.140)(PORT=1521))))' scope=both sid='cs1';

or
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=cs1-vip.jy.net)(PORT=1521))))' scope=both sid='cs1';

and
alter system register;

在RAC的每个节点都执行类似上面的操作,但我的环境中local_listener的设置是正确的

SQL> show parameter local_listener

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      (DESCRIPTION=(ADDRESS_LIST=(AD
                                                 DRESS=(PROTOCOL=TCP)(HOST=10.1
                                                 0.10.140)(PORT=1521))))

2.在客户端的hosts文件中增加tnsnames.ora文件中带完整域名的SCAN Name

[root@cs1 ~]# vi /etc/hosts
....
10.10.10.141 cs-cluster-scan.cs-cluster.jy.net
10.10.10.142 cs-cluster-scan.cs-cluster.jy.net
10.10.10.143 cs-cluster-scan.cs-cluster.jy.net

3.再次登录

[oracle@cs11 ~]$ tnsping cs

TNS Ping Utility for Linux: Version 12.2.0.1.0 - Production on 13-MAR-2018 10:40:15

Copyright (c) 1997, 2016, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cs-cluster-scan.cs-cluster.jy.net)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cs)))
OK (0 msec)


[oracle@cs1 admin]$ sqlplus /nolog

SQL*Plus: Release 12.2.0.1.0 Production on Tue Mar 13 13:12:32 2018

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

SQL> conn sys/abcd@cs as sysdba
Connected.

到此问题解决了,可以使用SCAN Name来登录数据库了。

Linux中两块device的minor number相同而造成RAC不能启动的问题

Oracle Linux 7.1在安装Oracle 12.2 Grid软件在执行root.sh脚本时,当第一个节点执行成功后,在第二个节点执行出现如下错误

[root@cs2 /]# ./u01/app/product/12.2.0/crs/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/product/12.2.0/crs

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/product/12.2.0/crs/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/cs2/crsconfig/rootcrs_cs2_2018-03-09_04-33-22PM.log
2018/03/09 16:34:23 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2018/03/09 16:34:23 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.
2018/03/09 16:34:54 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2018/03/09 16:34:54 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2018/03/09 16:35:03 CLSRSC-363: User ignored prerequisites during installation
2018/03/09 16:35:03 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2018/03/09 16:35:05 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2018/03/09 16:35:06 CLSRSC-594: Executing installation step 5 of 19: 'SaveParamFile'.
2018/03/09 16:35:10 CLSRSC-594: Executing installation step 6 of 19: 'SetupOSD'.
2018/03/09 16:35:12 CLSRSC-594: Executing installation step 7 of 19: 'CheckCRSConfig'.
2018/03/09 16:35:13 CLSRSC-594: Executing installation step 8 of 19: 'SetupLocalGPNP'.
2018/03/09 16:35:16 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2018/03/09 16:35:24 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2018/03/09 16:35:24 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2018/03/09 16:35:26 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2018/03/09 16:35:42 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2018/03/09 16:36:42 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2018/03/09 16:38:08 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'cs2'
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'cs2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2018/03/09 16:38:37 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2018/03/09 16:38:39 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'cs2'
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'cs2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'cs2'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'cs2'
CRS-2677: Stop of 'ora.drivers.acfs' on 'cs2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'cs2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2018/03/09 16:39:07 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
CRS-4123: Starting Oracle High Availability Services-managed resources
CRS-2672: Attempting to start 'ora.mdnsd' on 'cs2'
CRS-2672: Attempting to start 'ora.evmd' on 'cs2'
CRS-2676: Start of 'ora.mdnsd' on 'cs2' succeeded
CRS-2676: Start of 'ora.evmd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'cs2'
CRS-2676: Start of 'ora.gpnpd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'cs2'
CRS-2676: Start of 'ora.gipcd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'cs2'
CRS-2676: Start of 'ora.cssdmonitor' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'cs2'
CRS-2672: Attempting to start 'ora.diskmon' on 'cs2'
CRS-2676: Start of 'ora.diskmon' on 'cs2' succeeded
CRS-2883: Resource 'ora.cssdmonitor' failed during Clusterware stack start.
CRS-4406: Oracle High Availability Services synchronous start failed.
CRS-4000: Command Start failed, or completed with errors.
2018/03/09 16:39:46 CLSRSC-378: Failed to get the configured node role for the local node
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.
2018/03/09 16:39:48 CLSRSC-117: Failed to start Oracle Clusterware stack
Died at /u01/app/product/12.2.0/crs/crs/install/crsinstall.pm line 1494.
The command '/u01/app/product/12.2.0/crs/perl/bin/perl -I/u01/app/product/12.2.0/crs/perl/lib -I/u01/app/product/12.2.0/crs/crs/install /u01/app/product/12.2.0/crs/crs/install/rootcrs.pl ' 

execution failed

出错了,如是再次执行

[root@cs2 /]# ./u01/app/product/12.2.0/crs/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/product/12.2.0/crs

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/product/12.2.0/crs/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/cs2/crsconfig/rootcrs_cs2_2018-03-09_04-51-03PM.log
2018/03/09 16:51:07 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2018/03/09 16:51:07 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.
2018/03/09 16:51:07 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2018/03/09 16:51:08 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2018/03/09 16:51:11 CLSRSC-363: User ignored prerequisites during installation
2018/03/09 16:51:11 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2018/03/09 16:51:12 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2018/03/09 16:51:12 CLSRSC-594: Executing installation step 5 of 19: 'SaveParamFile'.
2018/03/09 16:51:15 CLSRSC-594: Executing installation step 6 of 19: 'SetupOSD'.
2018/03/09 16:51:17 CLSRSC-594: Executing installation step 7 of 19: 'CheckCRSConfig'.
2018/03/09 16:51:18 CLSRSC-594: Executing installation step 8 of 19: 'SetupLocalGPNP'.
2018/03/09 16:51:21 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2018/03/09 16:51:22 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2018/03/09 16:52:09 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2018/03/09 16:52:10 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2018/03/09 16:52:26 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2018/03/09 16:52:48 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2018/03/09 16:52:51 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2018/03/09 16:52:53 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2018/03/09 16:52:55 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'cs2'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'cs2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'cs2'
CRS-2673: Attempting to stop 'ora.evmd' on 'cs2'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'cs2'
CRS-2677: Stop of 'ora.drivers.acfs' on 'cs2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'cs2' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'cs2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'cs2' succeeded
CRS-2673: Attempting to stop 'ora.driver.afd' on 'cs2'
CRS-2673: Attempting to stop 'ora.gipcd' on 'cs2'
CRS-2677: Stop of 'ora.driver.afd' on 'cs2' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'cs2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'cs2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2018/03/09 16:53:14 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
CRS-4123: Starting Oracle High Availability Services-managed resources
CRS-2672: Attempting to start 'ora.mdnsd' on 'cs2'
CRS-2672: Attempting to start 'ora.evmd' on 'cs2'
CRS-2676: Start of 'ora.mdnsd' on 'cs2' succeeded
CRS-2676: Start of 'ora.evmd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'cs2'
CRS-2676: Start of 'ora.gpnpd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'cs2'
CRS-2676: Start of 'ora.gipcd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'cs2'
CRS-2676: Start of 'ora.cssdmonitor' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'cs2'
CRS-2672: Attempting to start 'ora.diskmon' on 'cs2'
CRS-2676: Start of 'ora.diskmon' on 'cs2' succeeded
CRS-1705: Found 0 configured voting files but 1 voting files are required, terminating to ensure data integrity; details at (:CSSNM00021:) in /u01/app/grid/diag/crs/cs2/crs/trace/ocssd.trc
CRS-2883: Resource 'ora.cssdmonitor' failed during Clusterware stack start.
CRS-4406: Oracle High Availability Services synchronous start failed.
CRS-4000: Command Start failed, or completed with errors.
2018/03/09 16:53:53 CLSRSC-378: Failed to get the configured node role for the local node
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.
2018/03/09 16:53:55 CLSRSC-117: Failed to start Oracle Clusterware stack
Died at /u01/app/product/12.2.0/crs/crs/install/crsinstall.pm line 1494.
The command '/u01/app/product/12.2.0/crs/perl/bin/perl -I/u01/app/product/12.2.0/crs/perl/lib -I/u01/app/product/12.2.0/crs/crs/install /u01/app/product/12.2.0/crs/crs/install/rootcrs.pl ' 

execution failed

还是出错了,但错误信息与第一次执行有所不同了,有以下内容

CRS-1705: Found 0 configured voting files but 1 voting files are required, terminating to ensure data integrity; details at (:CSSNM00021:) in /u01/app/grid/diag/crs/cs2/crs/trace/ocssd.trc

如果查看跟踪文件/u01/app/grid/diag/crs/cs2/crs/trace/ocssd.trc

[root@cs2 ~]# more /u01/app/grid/diag/crs/cs2/crs/trace/ocssd.trc
Trace file /u01/app/grid/diag/crs/cs2/crs/trace/ocssd.trc
Oracle Database 12c Clusterware Release 12.2.0.1.0 - Production Copyright 1996, 2016 Oracle. All rights reserved.
 default:2950017088: 1: clskec:has:CLSU:910 4 args[CLSD00302][mod=clsdadr.c][loc=(:CLSD00302:)][msg=clsdAdrInit: Trace file size and number of segments fetched from environemnt variable: 

ORA_DAEMON_TRACE_FILE_OPTIONS filesize=52428800,n
umsegments=10]

    CLSB:2950017088: Argument count (argc) for this daemon is 3
    CLSB:2950017088: Argument 0 is: /u01/app/product/12.2.0/crs/bin/ocssd.bin
    CLSB:2950017088: Argument 1 is: 
    CLSB:2950017088: Argument 2 is: OSD2PORTIF
2018-03-09 16:39:26.799 :    CSSD:2950017088: (TLM) Starting CSS daemon, version 12.2.0.1.0 with uniqueness value 1520584766
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CSSD, LogLevel = 2
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CSSDNMC, LogLevel = 2
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CSSDGMPC, LogLevel = 2
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CSSDGMCC, LogLevel = 2
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CSSDBCMC, LogLevel = 2
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CSSDGNS, LogLevel = 2
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CLSF, LogLevel = 0
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CLSFA, LogLevel = 3
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = SKGFD, LogLevel = 0
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = GPNP, LogLevel = 1
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CLSINET, LogLevel = 1
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CLSNS, LogLevel = 3
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = OCRAPI, LogLevel = 1
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = OCRCLI, LogLevel = 1
2018-03-09 16:39:26.799 :    CSSD:2950017088: clsu_load_ENV_levels: Module = CLSCEVT, LogLevel = 0
2018-03-09 16:39:26.803 :    CSSD:2950017088: clssscInitGlobalCTX: not in a container
    CSSD:2950017088: clsugetconf : Configuration type [4]. 
2018-03-09 16:39:26.809 :    CSSD:2950017088: clssscGetParameterOLR: OLR fetch for parameter auth rep (9) failed with rc 21
2018-03-09 16:39:26.809 :    CSSD:2950017088: clssscagStartAgLsnr: Failed to get auth location from OLR, constructing manually 
2018-03-09 16:39:26.809 :    CSSD:2950017088: clssscagStartAgLsnr: auth location '/u01/app/product/12.2.0/crs/auth/css/' 
2018-03-09 16:39:26.809 :    CSSD:2950017088: clssscGPNPInit: PERF_TIME Initializing GPNP
2018-03-09 16:39:26.810 :    GPNP:2950017088: clsgpnp_Init: HMAC hash type in context is SHA-512
2018-03-09 16:39:26.810 :    GPNP:2950017088: clsgpnp_Init: [at clsgpnp0.c:684] '/u01/app/product/12.2.0/crs' in effect as GPnP home base.
2018-03-09 16:39:26.810 :    GPNP:2950017088: clsgpnp_Init: [at clsgpnp0.c:750] GPnP pid=29348, cli= GPNP comp tracelevel=1, depcomp tracelevel=0, tlsrc:init, apitl:0, tstenv:0, devenv:0, 

envopt:0, flags=3
2018-03-09 16:39:26.815 :    GPNP:2950017088: clsgpnpkwf_initwfloc: [at clsgpnpkwf.c:403] Using FS Wallet Location : /u01/app/product/12.2.0/crs/gpnp/cs2/wallets/peer/

2018-03-09 16:39:26.815 :    GPNP:2950017088: clsgpnpkwf_initwfloc: [at clsgpnpkwf.c:415] Wallet readable. Path: /u01/app/product/12.2.0/crs/gpnp/cs2/wallets/peer/

2018-03-09 16:39:26.817 :    CSSD:2782349056: clssscthrdmain: Starting thread clssscAgListener
2018-03-09 16:39:26.817 :    CSSD:2782349056: clsssclsnrsetup: endp 0x6b for ipc://agent_ag_cs2_
2018-03-09 16:39:26.817 :    CSSD:2782349056: clssscagOpenAgentEndp: listening on ipc://agent_ag_cs2_ (0x6b)
2018-03-09 16:39:26.818 :    CSSD:2782349056: clsssclsnrsetup: endp 0x7c for ipc://monitor_ag_cs2_
2018-03-09 16:39:26.818 :    CSSD:2782349056: clssscagOpenAgentEndp: listening on ipc://monitor_ag_cs2_ (0x7c)
2018-03-09 16:39:26.818 :    CSSD:2782349056: clssscUpdateInitState: Set state to 0x00080000, based on prior state of 0x00000000 and requested change of 0x00080000
2018-03-09 16:39:26.839 :    GPNP:2950017088: clsgpnp_profileCallUrlInt: [at clsgpnp.c:2238] get-profile call to url "ipc://GPNPD_cs2" disco "" [f=0 claimed- host: cname: cguid: cli:gpnp 

p:29348 role: seq: ep: auth: diag:[]] 
2018-03-09 16:39:26.839 : default:2950017088: clsvactversion:4: Retrieving Active Version from local storage.
2018-03-09 16:39:26.842 : default:2950017088: clsvactversion:4: Retrieving Active Version from local storage.
2018-03-09 16:39:26.851 :    GPNP:2950017088: clsgpnp_profileCallUrlInt: [at clsgpnp.c:2381] Result: (0) CLSGPNP_OK. Successful get-profile CALL to remote "ipc://GPNPD_cs2" disco ""
2018-03-09 16:39:26.851 :    CSSD:2950017088: clssscGPNPInit: Successfully initialized GPNP
2018-03-09 16:39:26.851 :    CSSD:2950017088: clssscInitGlobalCTX: PERF_TIME starting CLSFA for Flex
2018-03-09 16:39:26.851 :    CSSD:2950017088: clssscInitGlobalCTX: PERF_TIME started CLSFA for Flex
2018-03-09 16:39:26.851 :    CSSD:2950017088: Starting CSS daemon in big-clustered mode with a role of hub
2018-03-09 16:39:26.851 :    CSSD:2950017088: clssscInitGlobalCTX: Environment is production
2018-03-09 16:39:26.851 :    CSSD:2950017088: clssscInitGlobalCTX: Core file size limit extended
2018-03-09 16:39:26.852 :    CSSD:2950017088: clssscInitGlobalCTX: GIPCHA down 0
2018-03-09 16:39:26.855 :    CSSD:2950017088: clssscqueue_init: queue(0xe708a0), max(0)
2018-03-09 16:39:26.855 :    CSSD:2950017088: clssscUpdateInitState: Set state to 0x00080002, based on prior state of 0x00080000 and requested change of 0x00000002
2018-03-09 16:39:26.855 :    CSSD:2950017088: osdctx->majik=OSD2PORTIF 
2018-03-09 16:39:26.855 :    CSSD:2950017088: ipmi_ipv4 = ()
2018-03-09 16:39:26.855 :    CSSD:2950017088: clssscModifyWalletIP: Running as user grid
2018-03-09 16:39:26.855 :    CSSD:2950017088: clssscModifyEnvironment: unable to update wallet for IPMI
2018-03-09 16:39:26.857 :    CSSD:2950017088: clssscWaitOnInitState: Waiting on requested state 0x00001000, current state 0x00080002, timeout 4294967295
2018-03-09 16:39:26.858 :  CLSDMT:2779895552: PID for the Process [29348], connkey CSSD
2018-03-09 16:39:26.858 :  CLSDMT:2779895552: ERROR: Empty pid name for proc CSSD
2018-03-09 16:39:26.859 :    CSSD:2778318592: clssscthrdmain: Starting thread Alarm
2018-03-09 16:39:26.859 :    CSSD:2778318592: clssscAlarmThread: Thread Spawned
2018-03-09 16:39:26.859 :    CSSD:2778318592: clssscUpdateInitState: Set state to 0x00081002, based on prior state of 0x00080002 and requested change of 0x00001000
2018-03-09 16:39:26.859 :    CSSD:2950017088: clssscWaitOnInitState: returning 1, requested state 0x00001000, current state 0x00081002
2018-03-09 16:39:26.859 :    CSSD:2950017088: clssscqueue_init: queue(0xf1c670), max(0)
2018-03-09 16:39:26.860 :    CSSD:2950017088: clssscStartActivityThread: Waiting for INIT
2018-03-09 16:39:26.860 :    CSSD:2950017088: clssscWaitOnInitState: Waiting on requested state 0x00800000, current state 0x00081002, timeout 4294967295
2018-03-09 16:39:26.860 :    CSSD:2776741632: clssscthrdmain: Starting thread clssscActivityThread
2018-03-09 16:39:26.860 :    CSSD:2776741632: clssscUpdateInitState: Set state to 0x00881002, based on prior state of 0x00081002 and requested change of 0x00800000
2018-03-09 16:39:26.860 :    CSSD:2950017088: clssscWaitOnInitState: returning 1, requested state 0x00800000, current state 0x00881002
2018-03-09 16:39:26.860 :    CSSD:2950017088: clssscGetParameterProfile: profile fetch failed for parameter ocrid (4) with return code CLSGPNP_NOT_FOUND(5)
2018-03-09 16:39:26.860 :    CSSD:2950017088: clssscmain: OCRID is 0
2018-03-09 16:39:26.860 :    CSSD:2950017088: clssscmain: Cluster GUID is 89e968f37e66cf79bf4a5b7353e8e859
2018-03-09 16:39:26.860 :    CSSD:2950017088: clssscUpdateInitState: Set state to 0x00881006, based on prior state of 0x00881002 and requested change of 0x00000004
2018-03-09 16:39:26.860 : CSSDBCM:2950017088: clssbcmInitialize: flags(0)
2018-03-09 16:39:26.860 : CSSDBCM:2950017088: clssbcm_SetGlobal: global(0xe69560)
2018-03-09 16:39:26.860 : CSSDBCM:2950017088: clssbcmContext: context pointer(0x7fff90720590), flags(0)
2018-03-09 16:39:26.861 : CSSDBCM:2950017088: clssbcmNewEvent: event(0xe704c0), name(BCCM State), value(1)
2018-03-09 16:39:26.861 : CSSDBCM:2950017088: clssbcmNewEvent: event(0xe664b0), name(BCCM Work State), value(0)
2018-03-09 16:39:26.861 : CSSDBCM:2950017088: clssbcm_NewWorkThread: Spawn status(1)
2018-03-09 16:39:26.862 :    CSSD:2775164672: clssscthrdmain: Starting thread BCCM_Worker
2018-03-09 16:39:26.862 : CSSDBCM:2775164672: clssbcm_worker: Spawned with thread(0xe673f0)
2018-03-09 16:39:26.862 : CSSDBCM:2950017088: clssbcmContext: context(0xe6bb30) created
2018-03-09 16:39:26.862 : CSSDBCM:2950017088: clssbcmContext: context pointer(0x7fff90720590), flags(0)
2018-03-09 16:39:26.862 : CSSDBCM:2950017088: clssbcmNewEvent: event(0xd07650), name(BCCM State), value(1)
2018-03-09 16:39:26.863 : CSSDBCM:2950017088: clssbcmNewEvent: event(0xd07790), name(BCCM Work State), value(0)
2018-03-09 16:39:26.863 : CSSDBCM:2950017088: clssbcm_NewWorkThread: Spawn status(1)
2018-03-09 16:39:26.864 :    CSSD:2773587712: clssscthrdmain: Starting thread BCCM_Worker
2018-03-09 16:39:26.864 : CSSDBCM:2773587712: clssbcm_worker: Spawned with thread(0xd07a90)
2018-03-09 16:39:26.864 : CSSDBCM:2950017088: clssbcmContext: context(0xd0ecd0) created
2018-03-09 16:39:26.864 : CSSDBCM:2950017088: clssbcmSetGIPCTraceLevel: context(0xe6bb30), trace(2)
2018-03-09 16:39:26.864 : CSSDBCM:2950017088: clssbcmSetGIPCTraceLevel: context(0xd0ecd0), trace(2)
2018-03-09 16:39:26.864 :    CSSD:2950017088: clssscmain: PERF_TIME initializing GNS for Flex
2018-03-09 16:39:26.864 : CSSDGNS:2950017088: clssscBQInitialize: Initialized GNS Work queue

2018-03-09 16:39:26.864 :    CSSD:2950017088: clssscWaitOnInitState: Waiting on requested state 0x00040000, current state 0x00881006, timeout 4294967295
2018-03-09 16:39:26.865 :    CSSD:2772010752: clssscthrdmain: Starting thread GNSWork
2018-03-09 16:39:26.865 :    CSSD:2772010752: clssscUpdateInitState: Set state to 0x008c1006, based on prior state of 0x00881006 and requested change of 0x00040000
2018-03-09 16:39:26.866 :   CLSNS:2772010752: clsns_SetTraceLevel:trace level set to 1.
2018-03-09 16:39:26.866 : CSSDGNS:2772010752: clssgnsCrsQuery: Querying CRS for resource type "ora.gns.type".
2018-03-09 16:39:26.867 :    CSSD:2950017088: clssscWaitOnInitState: returning 1, requested state 0x00040000, current state 0x008c1006
2018-03-09 16:39:26.867 :    CSSD:2950017088: clssscmain: PERF_TIME initialized GNS for Flex
2018-03-09 16:39:26.868 :    CSSD:2950017088: clssscWaitOnInitState: Waiting on requested state 0x00000400, current state 0x008c1006, timeout 4294967295
2018-03-09 16:39:26.869 :    CSSD:2770433792: clssscthrdmain: Starting thread BCNMServer
2018-03-09 16:39:26.869 :    CSSD:2770433792: clssbnmsThread: Spawned
2018-03-09 16:39:26.869 :    CSSD:2770433792: clssbnmInitBCNMCommon: Initialialization complete for comm ctx(0xd0fbb8)
2018-03-09 16:39:26.869 :    CSSD:2770433792: clssscUpdateInitState: Set state to 0x008c1406, based on prior state of 0x008c1006 and requested change of 0x00000400
2018-03-09 16:39:26.869 :    CSSD:2770433792: clssscWaitOnInitState: Waiting on requested state 0x00020000, current state 0x008c1406, timeout 4294967295
2018-03-09 16:39:26.871 :    CSSD:2950017088: clssscWaitOnInitState: returning 1, requested state 0x00000400, current state 0x008c1406
2018-03-09 16:39:26.872 :    CSSD:2950017088: clssscWaitOnInitState: Waiting on requested state 0x00000800, current state 0x008c1406, timeout 4294967295
2018-03-09 16:39:26.873 :    CSSD:2768856832: clssscthrdmain: Starting thread BCNMClient
2018-03-09 16:39:26.873 :    CSSD:2768856832: clssbnmcThread: Thread Spawned
2018-03-09 16:39:26.873 :    CSSD:2768856832: clssbnmInitBCNMCommon: Initialialization complete for comm ctx(0xecc348)
2018-03-09 16:39:26.873 :    CSSD:2768856832: clssscUpdateInitState: Set state to 0x008c1c06, based on prior state of 0x008c1406 and requested change of 0x00000800
2018-03-09 16:39:26.874 : CSSDGNS:2772010752: clssgnsCrsQuery: CRS is not ready. Cannot query GNS resource state.
2018-03-09 16:39:26.874 : CLSCEVT:2772010752: clsce_subscribe 0x7f568011b540 filter='^(CRS_RESOURCE_PROFILE_CHANGE|CRS_RESOURCE_STATE_CHANGE),.*?NAME='ora.gns'', flags=0, handler=0x58fa24, 

arg=0xd082c0
2018-03-09 16:39:26.875 :    CSSD:2950017088: clssscWaitOnInitState: returning 1, requested state 0x00000800, current state 0x008c1c06
2018-03-09 16:39:26.876 :    CSSD:2950017088: clssscGetParameterOLR: OLR fetch for parameter node number hint (6) failed with rc 21
2018-03-09 16:39:26.886 :    CSSD:2950017088: clssgmGMPInitCtx: GMP context init done
2018-03-09 16:39:26.886 :    CSSD:2950017088: clssscUpdateInitState: Set state to 0x008c1e06, based on prior state of 0x008c1c06 and requested change of 0x00000200
2018-03-09 16:39:26.887 : CLSCEVT:2772010752: (:CLSCE0022:)clsce_subscribe 0x7f568011b540 successfully subscribed : 0
2018-03-09 16:39:26.888 :    CSSD:2764130048: clssscthrdmain: Starting thread GM Peer Lsnr
2018-03-09 16:39:26.888 :    CSSD:2764130048: clssgmPeerListener: Spawned for node
2018-03-09 16:39:26.888 :    CSSD:2764130048: clssscWaitOnInitState: Waiting on requested state 0x00000001, current state 0x008c1e06, timeout 4294967295
2018-03-09 16:39:26.890 :    CSSD:2762553088: clssscthrdmain: Starting thread GMC Req Thrd
2018-03-09 16:39:26.890 :    CSSD:2762553088: clssgmGMCRequestThread: Starting
2018-03-09 16:39:26.890 :    CSSD:2950017088: clsswtStartWrkthrds: Workerthread GMPLstnrWorkerThread, thrdnum 1 spawn success
2018-03-09 16:39:26.891 :    CSSD:2950017088: clsswtStartWrkthrds: Workerthread GMPLstnrWorkerThread, thrdnum 2 spawn success
2018-03-09 16:39:26.892 :    CSSD:2950017088: clsswtStartWrkthrds: Workerthread GMPLstnrWorkerThread, thrdnum 3 spawn success
2018-03-09 16:39:26.893 :    CSSD:2950017088: clsswtStartWrkthrds: Workerthread GMCReqWorkerThread, thrdnum 1 spawn success
2018-03-09 16:39:26.893 :    CSSD:2950017088: clsswtStartWrkthrds: Workerthread GMCReqWorkerThread, thrdnum 2 spawn success
2018-03-09 16:39:26.894 :    CSSD:2950017088: clsswtStartWrkthrds: Workerthread GMCReqWorkerThread, thrdnum 3 spawn success
2018-03-09 16:39:26.896 :    CSSD:2760976128: clssscthrdmain: Starting thread GMPLstnrWorkerThread
2018-03-09 16:39:26.896 :    CSSD:2760976128: clssgmPeerWorkerThread: thrdname GMPLstnrWorkerThread, num 35, wrkthrdnum 1
2018-03-09 16:39:26.897 :    CSSD:2759399168: clssscthrdmain: Starting thread GMPLstnrWorkerThread
2018-03-09 16:39:26.897 :    CSSD:2759399168: clssgmPeerWorkerThread: thrdname GMPLstnrWorkerThread, num 35, wrkthrdnum 2
2018-03-09 16:39:26.897 :    CSSD:2757822208: clssscthrdmain: Starting thread GMPLstnrWorkerThread
2018-03-09 16:39:26.898 :    CSSD:2757822208: clssgmPeerWorkerThread: thrdname GMPLstnrWorkerThread, num 35, wrkthrdnum 3
2018-03-09 16:39:26.899 :    CSSD:2756245248: clssscthrdmain: Starting thread GMCReqWorkerThread
2018-03-09 16:39:26.899 :    CSSD:2756245248: clssgmpcGMCReqWorkerThread: thrdname GMCReqWorkerThread, num 36, wrkthrdnum 1 spawned
2018-03-09 16:39:26.899 :    CSSD:2754668288: clssscthrdmain: Starting thread GMCReqWorkerThread
2018-03-09 16:39:26.899 :    CSSD:2754668288: clssgmpcGMCReqWorkerThread: thrdname GMCReqWorkerThread, num 36, wrkthrdnum 2 spawned
2018-03-09 16:39:26.900 :    CSSD:2753091328: clssscthrdmain: Starting thread GMCReqWorkerThread
2018-03-09 16:39:26.900 :    CSSD:2753091328: clssgmpcGMCReqWorkerThread: thrdname GMCReqWorkerThread, num 36, wrkthrdnum 3 spawned
2018-03-09 16:39:26.901 :    CSSD:2950017088: clssscGetParameterOLR: OLR fetch for parameter auth rep (9) failed with rc 21
2018-03-09 16:39:26.901 :    CSSD:2950017088: clssgmceventsub_construct: eventsub(0x13e0610), gmc(0x139adf0), name(Event Subscription Cache)
2018-03-09 16:39:26.901 :    CSSD:2950017088: clssgmGMCInitCtx: GMC context init done
2018-03-09 16:39:26.902 :    CSSD:2011944704: clssscthrdmain: Starting thread GMClientListener
2018-03-09 16:39:26.902 :    CSSD:2011944704: clssgmclientlsnr: Spawned
2018-03-09 16:39:26.902 :    CSSD:2011944704: clssscqueue_init: queue(0x7f5658032cd0), max(0)
2018-03-09 16:39:26.902 :    CSSD:2011944704: clssscqueue_init: queue(0x7f5658032fd0), max(0)
2018-03-09 16:39:26.903 :    CSSD:2011944704: clsssclsnrsetup: endp 0x20a for clsc://(ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_cs2_)(GIPCID=00000000-00000000-29348))
2018-03-09 16:39:26.903 :    CSSD:2011944704: clssgmclientlsnr: listening on clsc://(ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_cs2_)(GIPCID=00000000-00000000-29348))
2018-03-09 16:39:26.903 :    CSSD:2011944704: clssgmceventsub_construct: eventsub(0x7f565805a340), gmc(0x139adf0), name(Event Subscription Cache)
2018-03-09 16:39:26.903 :    CSSD:2011944704: clssscWaitOnInitState: Waiting on requested state 0x00000001, current state 0x008c1e06, timeout 4294967295
2018-03-09 16:39:26.905 :    CSSD:2010367744: clssscthrdmain: Starting thread GMDeathCheck
2018-03-09 16:39:26.905 :    CSSD:2010367744: clssgmDeathChkThread: Spawned
2018-03-09 16:39:26.907 :    CSSD:2008790784: clssscthrdmain: Starting thread GMPResponse
2018-03-09 16:39:26.907 :    CSSD:2950017088: clssscUpdateInitState: Set state to 0x008c1e46, based on prior state of 0x008c1e06 and requested change of 0x00000040
2018-03-09 16:39:26.908 :    CSSD:2950017088: clssscGetParameterProfile: buffer passed for parameter ASM discovery (3) is too short, required 25, passed 20
2018-03-09 16:39:26.908 :    CSSD:2950017088: clssnmReadDiscoveryProfile: voting file discovery string(/dev/sd*,/dev/asm*,AFD:*)
2018-03-09 16:39:26.908 :    CSSD:2950017088: clssnkInit: NK generic layer initializing.
2018-03-09 16:39:26.909 :    CSSD:2007213824: clssscthrdmain: Starting thread clssnmvDDiscThread
2018-03-09 16:39:26.910 :    GPNP:2007213824: clsgpnp_Init: HMAC hash type in context is SHA-512
2018-03-09 16:39:26.910 :    GPNP:2007213824: clsgpnp_Init: [at clsgpnp0.c:684] '/u01/app/product/12.2.0/crs' in effect as GPnP home base.
2018-03-09 16:39:26.910 :    GPNP:2007213824: clsgpnp_Init: [at clsgpnp0.c:750] GPnP pid=29348, cli=clsuGpnpg GPNP comp tracelevel=1, depcomp tracelevel=0, tlsrc:init, apitl:0, tstenv:0, 

devenv:0, envopt:0, flags=2003
2018-03-09 16:39:26.915 :    GPNP:2007213824: clsgpnpkwf_initwfloc: [at clsgpnpkwf.c:403] Using FS Wallet Location : /u01/app/product/12.2.0/crs/gpnp/cs2/wallets/peer/

2018-03-09 16:39:26.915 :    GPNP:2007213824: clsgpnpkwf_initwfloc: [at clsgpnpkwf.c:415] Wallet readable. Path: /u01/app/product/12.2.0/crs/gpnp/cs2/wallets/peer/

2018-03-09 16:39:26.940 :    CLSF:2007213824: Allocated CLSF context
2018-03-09 16:39:26.940 :    CSSD:2007213824: clssnmvDDiscThread: using discovery string /dev/sd*,/dev/asm*,AFD:* for initial discovery 
2018-03-09 16:39:26.940 :   SKGFD:2007213824: Discovery with str:/dev/sd*,/dev/asm*,AFD:*:

2018-03-09 16:39:26.940 :   SKGFD:2007213824: UFS discovery with :/dev/sd*:

2018-03-09 16:39:26.940 :   SKGFD:2007213824: Execute glob on the string /dev/sd*

2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sda2
2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sda1
2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sdc
2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sdb
2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sdf
2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sde
2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sdd
2018-03-09 16:39:26.940 :   SKGFD:2007213824: running stat on disk:/dev/sda
2018-03-09 16:39:27.128 :    CSSD:2782349056: clssscagSelect: endpoint(0x85) authenticated with user(root)
2018-03-09 16:39:27.128 :    CSSD:2782349056: clssscagProcessInitialMsg: Handshake successful with agent 1
2018-03-09 16:39:27.128 :    CSSD:2782349056: clssscagProcAgReq: got a successful connection
2018-03-09 16:39:27.128 :    CSSD:2782349056: clssscagProcAgReq: Sending initdata
2018-03-09 16:39:27.128 :    CSSD:2782349056: clssscagProcessInitialMsg: notify agent 1 that it is active
2018-03-09 16:39:27.128 :    CSSD:2782349056: clssscagProcessInitialMsg: connection from agent 1, endp 0x85 - agents joined 0
2018-03-09 16:39:27.718 :    CSSD:2782349056: clssscagSelect: endpoint(0x74) authenticated with user(root)
2018-03-09 16:39:27.718 :    CSSD:2782349056: clssscagProcessInitialMsg: Handshake successful with agent 0
2018-03-09 16:39:27.718 :    CSSD:2782349056: clssscagProcAgReq: got a successful connection
2018-03-09 16:39:27.718 :    CSSD:2782349056: clssscagProcAgReq: Sending initdata
2018-03-09 16:39:27.718 :    CSSD:2782349056: clssscagProcessInitialMsg: connection from agent 0, endp 0x74 - agents joined 0
2018-03-09 16:39:27.868 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:28.868 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:29.868 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sda:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sda

2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sdd:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sdd

2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sde:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sde

2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sdf:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sdf

2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sdb:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sdb

2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sdc:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sdc

2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sda1:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sda1

2018-03-09 16:39:30.689 :   SKGFD:2007213824: Fetching UFS disk :/dev/sda2:

2018-03-09 16:39:30.689 :    CLSF:2007213824: Ignoring 0-byte file /dev/sda2

2018-03-09 16:39:30.689 :   SKGFD:2007213824: OSS discovery with :/dev/sd*:

2018-03-09 16:39:30.690 :   SKGFD:2007213824: Discovery with asmlib :ASM:AFD Library - Generic , version 3 (KABI_V3): str :/dev/sd*:

2018-03-09 16:39:30.690 :   SKGFD:2007213824: Discovery advancing to nxt string :/dev/asm*:

2018-03-09 16:39:30.690 :   SKGFD:2007213824: UFS discovery with :/dev/asm*:

2018-03-09 16:39:30.690 :   SKGFD:2007213824: Execute glob on the string /dev/asm*

2018-03-09 16:39:30.690 :   SKGFD:2007213824: running stat on disk:/dev/asm
2018-03-09 16:39:30.690 :   SKGFD:2007213824: running stat on disk:/dev/asmdisk05
2018-03-09 16:39:30.692 :   SKGFD:2007213824: running stat on disk:/dev/asmdisk04
2018-03-09 16:39:30.693 :   SKGFD:2007213824: running stat on disk:/dev/asmdisk03
2018-03-09 16:39:30.707 :   SKGFD:2007213824: running stat on disk:/dev/asmdisk02
2018-03-09 16:39:30.729 :   SKGFD:2007213824: running stat on disk:/dev/asmdisk01
2018-03-09 16:39:30.869 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:31.869 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:32.869 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:33.869 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:34.869 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:35.163 :   SKGFD:2007213824: Fetching UFS disk :/dev/asmdisk01:

2018-03-09 16:39:35.163 :   SKGFD:2007213824: Fetching UFS disk :/dev/asmdisk02:

2018-03-09 16:39:35.163 :   SKGFD:2007213824: Fetching UFS disk :/dev/asmdisk03:

2018-03-09 16:39:35.163 :   SKGFD:2007213824: Fetching UFS disk :/dev/asmdisk04:

2018-03-09 16:39:35.163 :   SKGFD:2007213824: Fetching UFS disk :/dev/asmdisk05:

2018-03-09 16:39:35.163 :   SKGFD:2007213824: Fetching UFS disk :/dev/asm:

2018-03-09 16:39:35.163 :    CLSF:2007213824: Ignoring 0-byte file /dev/asm

2018-03-09 16:39:35.163 :   SKGFD:2007213824: OSS discovery with :/dev/asm*:

2018-03-09 16:39:35.164 :   SKGFD:2007213824: Discovery with asmlib :ASM:AFD Library - Generic , version 3 (KABI_V3): str :/dev/asm*:

2018-03-09 16:39:35.164 :   SKGFD:2007213824: Discovery advancing to nxt string :AFD:*:

2018-03-09 16:39:35.164 :   SKGFD:2007213824: UFS discovery with :AFD:*:

2018-03-09 16:39:35.164 :   SKGFD:2007213824: Execute glob on the string /u01/app/product/12.2.0/crs/dbs/AFD:*

2018-03-09 16:39:35.869 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:36.870 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:37.870 :    CSSD:2778318592: clsssc_CLSFAInit_CB: System not ready for CLSFA initialization
2018-03-09 16:39:38.691 :   SKGFD:2007213824: OSS discovery with :AFD:*:

2018-03-09 16:39:38.692 :   SKGFD:2007213824: Discovery with asmlib :ASM:AFD Library - Generic , version 3 (KABI_V3): str :AFD:*:

2018-03-09 16:39:38.692 :   SKGFD:2007213824: Fetching asmlib disk :AFD:CRS2:

2018-03-09 16:39:38.692 :   SKGFD:2007213824: Handle 0x7f5644337dc0 from lib :UFS:: for disk :/dev/asmdisk01:

2018-03-09 16:39:38.692 :   SKGFD:2007213824: Handle 0x7f5644338d00 from lib :UFS:: for disk :/dev/asmdisk02:

2018-03-09 16:39:38.692 :   SKGFD:2007213824: Handle 0x7f5644339c40 from lib :UFS:: for disk :/dev/asmdisk03:

2018-03-09 16:39:38.693 :   SKGFD:2007213824: Handle 0x7f564433ab80 from lib :UFS:: for disk :/dev/asmdisk04:

2018-03-09 16:39:38.693 :   SKGFD:2007213824: Handle 0x7f564433bc50 from lib :UFS:: for disk :/dev/asmdisk05:

2018-03-09 16:39:38.693 :   SKGFD:2007213824: Handle 0x7f564433cd20 from lib :ASM:AFD Library - Generic , version 3 (KABI_V3): for disk :AFD:CRS2:

2018-03-09 16:39:38.693 :    CLSF:2007213824:  Warning: Voting disk: /dev/asmdisk01 is Hard mounted 

2018-03-09 16:39:38.693 :   SKGFD:2007213824: Lib :UFS:: closing handle 0x7f5644337dc0 for disk :/dev/asmdisk01:

2018-03-09 16:39:38.693 :    CLSF:2007213824:  Warning: Voting disk: /dev/asmdisk02 is Hard mounted 

2018-03-09 16:39:38.693 :   SKGFD:2007213824: Lib :UFS:: closing handle 0x7f5644338d00 for disk :/dev/asmdisk02:

2018-03-09 16:39:38.693 :    CLSF:2007213824: Read header of dev:/dev/asmdisk03:none:
2018-03-09 16:39:38.693 :   SKGFD:2007213824: Lib :UFS:: closing handle 0x7f5644339c40 for disk :/dev/asmdisk03:

2018-03-09 16:39:38.693 :    CLSF:2007213824: Read header of dev:/dev/asmdisk04:none:
2018-03-09 16:39:38.693 :   SKGFD:2007213824: Lib :UFS:: closing handle 0x7f564433ab80 for disk :/dev/asmdisk04:

2018-03-09 16:39:38.702 :    CLSF:2007213824: Read header of dev:/dev/asmdisk05:none:
2018-03-09 16:39:38.702 :   SKGFD:2007213824: Lib :UFS:: closing handle 0x7f564433bc50 for disk :/dev/asmdisk05:

2018-03-09 16:39:38.702 :   SKGFD:2007213824: Lib :ASM:AFD Library - Generic , version 3 (KABI_V3): closing handle 0x7f564433cd20 for disk :AFD:CRS2:

2018-03-09 16:39:38.702 :    CSSD:2007213824: clssnmvDiskVerify: discovered a potential voting file
2018-03-09 16:39:38.702 :   SKGFD:2007213824: Handle 0x7f564432fec0 from lib :UFS:: for disk :/dev/asmdisk01:

2018-03-09 16:39:38.702 :    CLSF:2007213824: Opened hdl:0x7f564432e790 for dev:/dev/asmdisk01:
2018-03-09 16:39:38.702 :    CSSD:2007213824: clssnmvDiskCreate: name /dev/asmdisk01 blocksz 512
2018-03-09 16:39:38.711 :    CSSD:2007213824: clssnmvDiskCreate: siteid during discovery = 00000000000000000000000000000000
2018-03-09 16:39:38.711 :    CSSD:2007213824: clssnmvDiskVerify: Successful discovery for disk /dev/asmdisk01, UID 750a78e1-ae984fcd-bfb4dbf4-4d337a77, SID 00112233-44556677-8899aabb-

ccddeeff, Pending CIN 0:1520582274:0, Committed CIN 0
:1520582274:0
2018-03-09 16:39:38.711 :    CLSF:2007213824: Closing handle:0x7f564432e790
2018-03-09 16:39:38.711 :   SKGFD:2007213824: Lib :UFS:: closing handle 0x7f564432fec0 for disk :/dev/asmdisk01:

2018-03-09 16:39:38.711 :    CSSD:2007213824: clssnmvDiskVerify: discovered a potential voting file
2018-03-09 16:39:38.711 :   SKGFD:2007213824: Handle 0x7f564432fec0 from lib :UFS:: for disk :/dev/asmdisk02:

2018-03-09 16:39:38.711 :    CLSF:2007213824: Opened hdl:0x7f564432e790 for dev:/dev/asmdisk02:
2018-03-09 16:39:38.711 :    CSSD:2007213824: clssnmvDiskCreate: name /dev/asmdisk02 blocksz 512
2018-03-09 16:39:38.712 :    CSSD:2007213824: clssnmvDiskCreate: siteid during discovery = 00000000000000000000000000000000
2018-03-09 16:39:38.712 :    CSSD:2007213824: clssnmFindVF: found VF by vdin in the discovered queue
2018-03-09 16:39:38.712 :    CSSD:2007213824: clssnmFindVF: Duplicate voting file found in the queue of previously discovered disks queued(/dev/asmdisk01|[750a78e1-ae984fcd-bfb4dbf4-

4d337a77]), found(/dev/asmdisk02|[750a78e1-ae984fcd-bfb4dbf4-4d337a77]), is not corrupted
2018-03-09 16:39:38.712 :    CLSF:2007213824: Resolved (/dev/asmdisk01,/dev/asmdisk02) to NONE
2018-03-09 16:39:38.712 :    CSSD:2007213824: clssnmvDiskCreate: Found a duplicate voting file /dev/asmdisk01 in the discovery queue which appears to be the same physical device as the 

newly discovered disk /dev/asmdisk02. Rejecting bot
h these files
2018-03-09 16:39:38.712 : default:2007213824: clssnmvDiskCreate:destroy_vdisk->vdisk:  dump of 0x0x7f56443d3760, len 10616

发现CRS磁盘组中磁盘/dev/asmdisk01中的voting file有一份重复的副本出现在/dev/asmdisk02磁盘中,因此拒绝了这些文件。

CSSD:2007213824: clssnmvDiskCreate: Found a duplicate voting file /dev/asmdisk01 in the discovery queue which appears to be the same physical device as the newly discovered disk 

/dev/asmdisk02. Rejecting both these files

如是在节点cs2上查看这两块磁盘,可以看到 /dev/asmdisk01与/dev/asmdisk02的minor number都显示为32,而cs1上的/dev/asmdisk01的minor number是16,/dev/asmdisk02的minor number为32

[root@cs2 /]# ls -lrt /dev/asm*
brw-rw---- 1 grid asmadmin 8, 32 Mar  9 12:21 /dev/asmdisk01
brw-rw---- 1 grid asmadmin 8, 32 Mar  9 12:23 /dev/asmdisk02
brw-rw---- 1 grid asmadmin 8, 48 Mar  9 12:23 /dev/asmdisk03
brw-rw---- 1 grid asmadmin 8, 64 Mar  9 12:23 /dev/asmdisk04
brw-rw---- 1 grid asmadmin 8, 80 Mar  9 12:23 /dev/asmdisk05

[root@cs1 /]# ls -lrt /dev/asm*
brw-rw---- 1 grid asmadmin 8, 48 Mar  9 12:23 /dev/asmdisk03
brw-rw---- 1 grid asmadmin 8, 64 Mar  9 12:23 /dev/asmdisk04
brw-rw---- 1 grid asmadmin 8, 80 Mar  9 12:23 /dev/asmdisk05
brw-rw---- 1 grid asmadmin 8, 32 Mar  9 15:57 /dev/asmdisk02
brw-rw---- 1 grid asmadmin 8, 16 Mar  9 15:57 /dev/asmdisk01

如果手动删除这些用来创建asm磁盘组的块设备

[root@cs2 /]# /bin/rm /dev/asmdisk01
[root@cs2 /]# /bin/rm /dev/asmdisk02
[root@cs2 /]# /bin/rm /dev/asmdisk023
[root@cs2 /]# /bin/rm /dev/asmdisk03
[root@cs2 /]# /bin/rm /dev/asmdisk04
[root@cs2 /]# /bin/rm /dev/asmdisk05
[root@cs2 /]# ls -lrt /dev/asm*
total 0

重新创建这些块设备

[root@cs2 /]# /sbin/udevadm trigger --type=devices --action=change
[root@cs2 /]# ls -lrt /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Mar  9 17:37 /dev/asmdisk01
brw-rw---- 1 grid asmadmin 8, 32 Mar  9 17:37 /dev/asmdisk02
brw-rw---- 1 grid asmadmin 8, 64 Mar  9 17:37 /dev/asmdisk04
brw-rw---- 1 grid asmadmin 8, 80 Mar  9 17:37 /dev/asmdisk05
brw-rw---- 1 grid asmadmin 8, 48 Mar  9 17:37 /dev/asmdisk03

/dev/asm:
total 0

再次重新执行root.sh脚本就可以执行成功

[root@cs2 /]# ./u01/app/product/12.2.0/crs/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/product/12.2.0/crs

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/product/12.2.0/crs/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/cs2/crsconfig/rootcrs_cs2_2018-03-09_05-37-57PM.log
2018/03/09 17:38:01 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2018/03/09 17:38:01 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.
2018/03/09 17:38:01 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2018/03/09 17:38:02 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2018/03/09 17:38:05 CLSRSC-363: User ignored prerequisites during installation
2018/03/09 17:38:05 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2018/03/09 17:38:06 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2018/03/09 17:38:06 CLSRSC-594: Executing installation step 5 of 19: 'SaveParamFile'.
2018/03/09 17:38:09 CLSRSC-594: Executing installation step 6 of 19: 'SetupOSD'.
2018/03/09 17:38:11 CLSRSC-594: Executing installation step 7 of 19: 'CheckCRSConfig'.
2018/03/09 17:38:12 CLSRSC-594: Executing installation step 8 of 19: 'SetupLocalGPNP'.
2018/03/09 17:38:15 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2018/03/09 17:38:16 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2018/03/09 17:39:03 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2018/03/09 17:39:04 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2018/03/09 17:39:06 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2018/03/09 17:39:08 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2018/03/09 17:39:11 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2018/03/09 17:39:12 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'cs2'
CRS-2673: Attempting to stop 'ora.driver.afd' on 'cs2'
CRS-2673: Attempting to stop 'ora.gpnpd' on 'cs2'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'cs2'
CRS-2673: Attempting to stop 'ora.gipcd' on 'cs2'
CRS-2673: Attempting to stop 'ora.evmd' on 'cs2'
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'cs2'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'cs2'
CRS-2677: Stop of 'ora.cssdmonitor' on 'cs2' succeeded
CRS-2677: Stop of 'ora.driver.afd' on 'cs2' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'cs2' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'cs2' succeeded
CRS-2677: Stop of 'ora.evmd' on 'cs2' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'cs2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'cs2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'cs2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2018/03/09 17:39:17 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
CRS-4123: Starting Oracle High Availability Services-managed resources
CRS-2672: Attempting to start 'ora.evmd' on 'cs2'
CRS-2672: Attempting to start 'ora.mdnsd' on 'cs2'
CRS-2676: Start of 'ora.mdnsd' on 'cs2' succeeded
CRS-2676: Start of 'ora.evmd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'cs2'
CRS-2676: Start of 'ora.gpnpd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'cs2'
CRS-2676: Start of 'ora.gipcd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'cs2'
CRS-2676: Start of 'ora.cssdmonitor' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'cs2'
CRS-2672: Attempting to start 'ora.diskmon' on 'cs2'
CRS-2676: Start of 'ora.diskmon' on 'cs2' succeeded
CRS-2676: Start of 'ora.cssd' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'cs2'
CRS-2672: Attempting to start 'ora.ctssd' on 'cs2'
CRS-2676: Start of 'ora.ctssd' on 'cs2' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'cs2'
CRS-2676: Start of 'ora.asm' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.storage' on 'cs2'
CRS-2676: Start of 'ora.storage' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.crf' on 'cs2'
CRS-2676: Start of 'ora.crf' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'cs2'
CRS-2676: Start of 'ora.crsd' on 'cs2' succeeded
CRS-6017: Processing resource auto-start for servers: cs2
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'cs1'
CRS-2672: Attempting to start 'ora.net1.network' on 'cs2'
CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on 'cs2'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'cs1' succeeded
CRS-2676: Start of 'ora.net1.network' on 'cs2' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'cs1'
CRS-2672: Attempting to start 'ora.ons' on 'cs2'
CRS-2677: Stop of 'ora.scan1.vip' on 'cs1' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'cs2'
CRS-2676: Start of 'ora.scan1.vip' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'cs2'
CRS-2676: Start of 'ora.ons' on 'cs2' succeeded
CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on 'cs2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'cs2'
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'cs2' succeeded
CRS-2676: Start of 'ora.asm' on 'cs2' succeeded
CRS-6016: Resource auto-start has completed for server cs2
CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources
CRS-4123: Oracle High Availability Services has been started.
2018/03/09 17:42:11 CLSRSC-343: Successfully started Oracle Clusterware stack
2018/03/09 17:42:11 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2018/03/09 17:42:24 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2018/03/09 17:43:16 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

到此这个问题就修复了

Oracle Cluster Time Management

Cluster Time Synchronization Service(CTSS)可以检测集群中节点之间的时间同步问题。CTSS被作为Oracle CLusterware的一部分进行安装。如果它检测到在系统中存在时间同步服务(比如NTP或Chrony)或者存在时间同步服务配置是valid或broken,那么它将以观察模式运行。例如,如果集群中的任何一个节点上 存在/etc/ntp.conf文件,那么就算没有运行时间同步服务CTSS也会以观察模式运行。如果CTSS在集群的任何一个节点上都没有检测到存在时间同步服务或时间同步服务配置信息,它就会变成主动模式运行并且对集群执行时间管理。如果CTSS在集群中的一个节点上以主动模式运行,在另一个节点上以观察模式运行,并且没有NTP,时间同步软件在运行,那么你可以通过创建一个名叫/etc/ntp.conf的文件来将CTSS修改为观察模式。对于CTSS改变为观察模式 会在alert.log中写入消息。当节点加入集群时,如果CTSS以主动模式运行时,那么它将会使用集群中存在引用时钟的节点与这些加入节点进行时间比较。如果两个时间之间存在差异并且这种差异在特定设置限制,那么CTSS将执行时间同步。集群中的时钟节点由于各种原因将不能使用引用时钟(CTSS用来作为基础的时间,它所在的节点是集群中第一个启动的节点)进行同步。当发生这种情况时,CTSS执行回转时间同步,它将加速或减慢节点上的系统时间直到它们与引 用系统时间处于同步状态。在这种时间同步方法中,CTSS不会向后调整时间,它将保证系统时间单向增加。

当Orale集群软件启动时,如果CTSS以主动模式运行并且时间差异超过了设置限制(限制为24小时),那么CTSS会在alert.log中生成一个告警,并退出,那么Oracle集群软件会启动失败。如果你必须手动对加入集群的节点进行时 间调整,在启动Oracle集群软件之后CTSS可以对这些节点管理时间。当执行回转时间同步时,CTSS从来不会使用引用时钟向后调整时间。CTSS定期写包含它如何使用引用时钟来调整节点时间的告警到alert.log中。

CTSS当出现以下情况下会向Oracle集群alert.log与syslog中写告警信息:
.检查到时间发生改变
.检查到与引用时钟相比存在着显著的时间差异
.从观察模式切换到主动模式或者从主动模式切换到观察模式

使用CTSS来同步集群中的时间可以促进对Oracle集群问题的诊断,因为不需要考虑不同节点上影响时间的一系列事件了。
激活与禁止集群时间同步
为了对集群设置定时间管理服务可以激活CTSS。如果想要使用不同的集群时间同步服务可以禁止CTSS。为了激活CTSS,必须要对集群中的所有节点停止与删除第三方的时间同步服务。当激活CTSS时会检查集群的时间管理服务方式。
下面的RAC因为所有节点存在第三方的时间同步服务配置信息使得CTSS以观察方式运行
检测集群节点是否存在第三方时间同步服务

[root@jytest1 ~]# find / -name ntp.conf
/etc/ntp.conf


[root@jytest2 ~]# find / -name ntp.conf
/etc/ntp.conf


[grid@jytest1 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...
CTSS is in Observer state. Switching over to clock synchronization checks using NTP

  Verifying Network Time Protocol (NTP) ...
    Verifying '/etc/ntp.conf' ...PASSED
    Verifying '/etc/chrony.conf' ...PASSED
    Verifying '/var/run/chronyd.pid' ...PASSED
    Verifying Daemon 'chronyd' ...PASSED
    Verifying NTP daemon or service using UDP port 123 ...PASSED
    Verifying chrony daemon is synchronized with at least one external time source ...FAILED (PRVG-13606)
  Verifying Network Time Protocol (NTP) ...FAILED (PRVG-1063)
Verifying Clock Synchronization ...FAILED (PRVG-1063, PRVG-13606)

Verification of Clock Synchronization across the cluster nodes was unsuccessful on all the specified nodes.


Failures were encountered during execution of CVU verification request "Clock Synchronization across the cluster nodes".

Verifying Clock Synchronization ...FAILED
  Verifying Network Time Protocol (NTP) ...FAILED
  PRVG-1063 : configuration files for more than one time synchronization
  service were found on nodes of the cluster
  configuration file "/etc/chrony.conf" was found on nodes "jytest2,jytest1"
  configuration file "/etc/ntp.conf" was found on nodes "jytest2,jytest1"

    Verifying chrony daemon is synchronized with at least one external time
    source ...FAILED
    jytest2: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest2".

    jytest1: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest1".


CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 12:58:07 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

[grid@jytest2 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...
CTSS is in Observer state. Switching over to clock synchronization checks using NTP

  Verifying Network Time Protocol (NTP) ...
    Verifying '/etc/ntp.conf' ...PASSED
    Verifying '/etc/chrony.conf' ...PASSED
    Verifying '/var/run/chronyd.pid' ...PASSED
    Verifying Daemon 'chronyd' ...PASSED
    Verifying NTP daemon or service using UDP port 123 ...PASSED
    Verifying chrony daemon is synchronized with at least one external time source ...FAILED (PRVG-13606)
  Verifying Network Time Protocol (NTP) ...FAILED (PRVG-1063)
Verifying Clock Synchronization ...FAILED (PRVG-1063, PRVG-13606)

Verification of Clock Synchronization across the cluster nodes was unsuccessful on all the specified nodes.


Failures were encountered during execution of CVU verification request "Clock Synchronization across the cluster nodes".

Verifying Clock Synchronization ...FAILED
  Verifying Network Time Protocol (NTP) ...FAILED
  PRVG-1063 : configuration files for more than one time synchronization
  service were found on nodes of the cluster
  configuration file "/etc/chrony.conf" was found on nodes "jytest2,jytest1"
  configuration file "/etc/ntp.conf" was found on nodes "jytest2,jytest1"

    Verifying chrony daemon is synchronized with at least one external time
    source ...FAILED
    jytest2: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest2".

    jytest1: PRVG-13606 : chrony daemon is not synchronized with any external
             time source on node "jytest1".


CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 1:11:12 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

使用grid用户执行crsctl check ctss命令来查看CTSS的运行模式,命令结果显示为观察模式

[grid@jytest1 ~]$ crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

[grid@jytest2 ~]$ crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

现在删除集群节点中的第三方时间同步服务

[root@jytest1 ~]# rm -rf /etc/ntp.conf
[root@jytest1 ~]# rm -rf /etc/chrony.conf
[root@jytest1 ~]# rm -rf /var/run/chronyd.pid


[root@jytest2 ~]# rm -rf /etc/ntp.conf
[root@jytest2 ~]# rm -rf /etc/chrony.conf
[root@jytest2 ~]# rm -rf /var/run/chronyd.pid

再次检查CTSS的运行模式,可以看到CTSS从观察模式变为了主动模式

[grid@jytest1 ~]$ crsctl check ctss
CRS-4701: The Cluster Time Synchronization Service is in Active mode.
CRS-4702: Offset (in msec): 100
[grid@jytest1 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...PASSED

Verification of Clock Synchronization across the cluster nodes was successful.

CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 1:14:39 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

[grid@jytest2 ~]$ crsctl check ctss
CRS-4701: The Cluster Time Synchronization Service is in Active mode.
CRS-4702: Offset (in msec): 0
[grid@jytest2 ~]$ cluvfy comp clocksync -n all

Verifying Clock Synchronization ...PASSED

Verification of Clock Synchronization across the cluster nodes was successful.

CVU operation performed:      Clock Synchronization across the cluster nodes
Date:                         Mar 3, 2018 1:15:14 AM
CVU home:                     /u01/app/product/12.2.0/crs/
User:                         grid

Oracle 12c RMAN Performing Cross-Platform Transport of a PDB Using Inconsistent

可以使用不一致与一致备份来传输PDB并将其插入到不同平台的CDB中。不一致备份能减少停机时间因为当PDB为open状态时可以创建跨平台不一致备份。第一次备份为增量0级备份。后续备份为增量1级备份它包含自上次增量备 份以来所有发生的改变。对于不一致1级备份的次数没有限制。最后关闭PDB,创建最终一致的增量1级备份与插入PDB到目标CDB中所需要的元数据XML文件。

源CDB与目标CDB的compatible参数必须设置为12.2。源CDB与目标CDB必须有相同的字节序。

下面的例子将Linux平台上的RAC CDB中的PDB数据库(jypdb与testpdb)传输到windows平台上的单实例CDB数据库中。 执行跨平台传输的操作如下:
1.检查源数据库与目标数据库的compatible参数是否设置为12.0.0或更高版本
源数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

目标数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

2.检查源平台与目标平台的字节序
源平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where tp.platform_name=d.platform_name;

PLATFORM_NAME                                                                                         ENDIAN_FORMAT
----------------------------------------------------------------------------------------------------- --------------
Linux x86 64-bit                                                                                      Little

目标平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where tp.platform_name=d.platform_name;

PLATFORM_NAME                                                                       ENDIAN_FORMAT
--------------------------------------------------------------------------------    --------------
Microsoft Windows x86 64-bit                                                        Little

3.确保被传输的PDB(testpdb)为读写状态

SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                             OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
TESTPDB                                                                                                                          READ WRITE

4.在创建0级增量备份之前记录数据库的SCN

SQL> SELECT CHECKPOINT_CHANGE# FROM V$DATABASE;

CHECKPOINT_CHANGE#
------------------
          21580167

5.对传输PDB(testpdb)创建不一致的跨平台的增量0级备份

RMAN> backup incremental level 0 for transport allow inconsistent pluggable database testpdb format '/ora_backup/tpdbs/testpdb_level0.bck';

Starting backup at 12-FEB-18
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1525 instance=jy1 device type=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00047 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409
input datafile file number=00048 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409
input datafile file number=00046 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409
input datafile file number=00049 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409
input datafile file number=00051 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409
input datafile file number=00050 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409
channel ORA_DISK_1: starting piece 1 at 12-FEB-18
channel ORA_DISK_1: finished piece 1 at 12-FEB-18
piece handle=/ora_backup/tpdbs/testpdb_level0.bck tag=TAG20180212T001250 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 12-FEB-18

[oracle@jytest1 tpdbs]$ ls -lrt
total 693420
-rw-r----- 1 oracle asmadmin 710049792 Feb 11 18:13 testpdb_level0.bck

6.关闭PDB

SQL> alter pluggable database testpdb close immediate;

Pluggable database altered.

SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                             OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                         READ ONLY
JYPDB                                                                                                                            READ WRITE
TESTPDB                                                                                                                          MOUNTED

7.创建一致的跨平台增量备份。增量备份的时间点就是步骤4记录的SCN号。使用unplug into子句来生成插入PDB到目标CDB中所需要的元数据XML文件。

RMAN> backup incremental from scn 21580167 for transport unplug into '/ora_backup/tpdbs/metadata_testpdb.xml' pluggable database testpdb format '/ora_backup/tpdbs/testpdb_level1_con.bck';

Starting backup at 12-FEB-18
starting full resync of recovery catalog
full resync complete
using channel ORA_DISK_1
running UNPLUG on the specified pluggable database: TESTPDB
UNPLUG file path : /ora_backup/tpdbs/metadata_testpdb.xml
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00047 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409
input datafile file number=00048 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409
input datafile file number=00046 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409
input datafile file number=00049 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409
input datafile file number=00051 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409
input datafile file number=00050 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409
channel ORA_DISK_1: starting piece 1 at 12-FEB-18
channel ORA_DISK_1: finished piece 1 at 12-FEB-18
piece handle=/ora_backup/tpdbs/testpdb_level1_con.bck tag=TAG20180212T002650 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 12-FEB-18
starting full resync of recovery catalog
full resync complete

8.将在源平台上使用rman backup命令生成的备份集与备份的控制文件传输到目标平台的D:\app\oracle\oradata\pdbs目录中

9.确保目标CDB为读写状态

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
JY        READ WRITE

10.还原不一致的跨平台增量0级备份

RMAN> restore foreign pluggable database testpdb format 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\%U' from backupset 'D:\app\oracle\oradata\pdbs\testpdb_level0.bck';

从位于 12-2月 -18 的 restore 开始
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=2654 设备类型=DISK

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原备份片段中的所有外部文件
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\pdbs\testpdb_level0.bck
通道 ORA_DISK_1: 将外部文件 47 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU
通道 ORA_DISK_1: 将外部文件 48 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU
通道 ORA_DISK_1: 将外部文件 46 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU
通道 ORA_DISK_1: 将外部文件 49 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU
通道 ORA_DISK_1: 将外部文件 51 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU
通道 ORA_DISK_1: 将外部文件 50 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU
通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\pdbs\testpdb_level0.bck
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:16
在 12-2月 -18 完成了 restore

11.给步骤10所还原的外部数据文件应用一致的跨平台增量1级备份

RMAN> recover using 'D:\app\oracle\oradata\pdbs\metadata_testpdb.xml' foreign datafilecopy 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU','D:\APP \ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA
_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I- 979425723_TS-TEST_FNO-51_9RSR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU'
2> from backupset 'D:\app\oracle\oradata\pdbs\testpdb_level1_con.bck';

从位于 12-2月 -18 的 restore 开始
使用通道 ORA_DISK_1

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\pdbs\testpdb_level1_con.bck
通道 ORA_DISK_1: 将外部文件 47 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU
通道 ORA_DISK_1: 将外部文件 48 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU
通道 ORA_DISK_1: 将外部文件 46 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU
通道 ORA_DISK_1: 将外部文件 49 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU
通道 ORA_DISK_1: 将外部文件 51 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU
通道 ORA_DISK_1: 将外部文件 50 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU
通道 ORA_DISK_1: 外部片段句柄 = D:\APP\ORACLE\ORADATA\PDBS\TESTPDB_LEVEL1_CON.BCK
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:02
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409 插入文件 46
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409 插入文件 47
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409 插入文件 48
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp.258.967852409 插入文件 4
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409 插入文件 49
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409 插入文件 50
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409 插入文件 51
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: 位于 02/12/2018 01:00:33 的 restore 命令失败
RMAN-00600: internal error, arguments [5304] [+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp.258.967852409] [] [] []

上面的错误是因为XMl文件所描述的数据文件名是源数据库中的文件名,手功修改XML文件中的数据文件名为目标数据库中的数据文件名,并执行下面的命令来创建PDB

SQL> create pluggable database testpdb using 'D:\app\oracle\oradata\pdbs\metadata_testpdb.xml';

插接式数据库已创建。

SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                     OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                 READ ONLY
JYPDB                                                                                                                    READ WRITE
TESTPDB                                                                                                                  MOUNTED

SQL> alter pluggable database testpdb open;

插接式数据库已变更。

SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                     OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                 READ ONLY
JYPDB                                                                                                                    READ WRITE
TESTPDB                                                                                                                  READ WRITE


12.查询tts.t1与cs.t2表中的数据来验证跨平台传输PDB是否操作成功

SQL> select count(*) from tts.t1;

  COUNT(*)
----------
        90

SQL> select count(*) from cs.t2;

  COUNT(*)
----------
        92

到此,跨平台传输PDB就完成了。

Oracle 12c RMAN Cross-Platform Transport of a Closed PDB

PDB可以被传输并插入到与源平台不同的目标CDB数据库中。除了需要对PDB创建备份外还需要将PDB插入到目标CDB中所需要的元数据。源CDB与目标CDB中的compatible参数必须设置为12.2,并且源平台与目标平台有相同的字节 序。

下面的例子将Linux平台上的RAC CDB中的PDB数据库(jypdb与testpdb)传输到windows平台上的单实例CDB数据库中。 执行跨平台传输的操作如下:
1.检查源数据库与目标数据库的compatible参数是否设置为12.0.0或更高版本
源数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

目标数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

2.检查源平台与目标平台的字节序
源平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where tp.platform_name=d.platform_name;

PLATFORM_NAME                                                                                         ENDIAN_FORMAT
----------------------------------------------------------------------------------------------------- --------------
Linux x86 64-bit                                                                                      Little

目标平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where tp.platform_name=d.platform_name;

PLATFORM_NAME                                                                       ENDIAN_FORMAT
--------------------------------------------------------------------------------    --------------
Microsoft Windows x86 64-bit                                                        Little

3.将要被传输的pdb(jypdb,testpdb)设置为关闭状态

SQL> alter pluggable database jypdb close immediate;

Pluggable database altered.

SQL> alter pluggable database testpdb close immediate;

Pluggable database altered.

SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                             OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                         READ ONLY
JYPDB                                                                                                                            MOUNTED
TESTPDB                                                                                                                          MOUNTED

4.使用backup pluggable database命令来为PDB(jypdb,testpdb)创建跨平台完全备份
下面的例子是为PDB(jypdb,testpdb)创建跨平台传输备份目标平台为Microsoft Windows x86 64-bit。使用unplug into子句将生成将PDB插入目标CDB中所需要的元数据XML文件。

RMAN> backup to platform='Microsoft Windows x86 64-bit' unplug into '/ora_backup/tpdbs/metadata_jypdb.xml' pluggable database jypdb format '/ora_backup/tpdbs/transport_jypdb.bck';

Starting backup at 11-FEB-18
using channel ORA_DISK_1
running UNPLUG on the specified pluggable database: JYPDB
UNPLUG file path : /ora_backup/tpdbs/metadata_jypdb.xml
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00028 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649
input datafile file number=00025 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649
input datafile file number=00026 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649
input datafile file number=00027 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649
input datafile file number=00024 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649
input datafile file number=00029 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609
input datafile file number=00030 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353
input datafile file number=00031 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783
channel ORA_DISK_1: starting piece 1 at 11-FEB-18
channel ORA_DISK_1: finished piece 1 at 11-FEB-18
piece handle=/ora_backup/tpdbs/transport_jypdb.bck tag=TAG20180211T223539 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 11-FEB-18
starting full resync of recovery catalog
full resync complete

RMAN> backup to platform='Microsoft Windows x86 64-bit' unplug into '/ora_backup/tpdbs/metadata_testpdb.xml' pluggable database testpdb format '/ora_backup/tpdbs/transport_testpdb.bck';

Starting backup at 11-FEB-18
using channel ORA_DISK_1
running UNPLUG on the specified pluggable database: TESTPDB
UNPLUG file path : /ora_backup/tpdbs/metadata_testpdb.xml
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00033 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409
input datafile file number=00034 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409
input datafile file number=00032 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409
input datafile file number=00035 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409
input datafile file number=00037 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409
input datafile file number=00036 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409
channel ORA_DISK_1: starting piece 1 at 11-FEB-18
channel ORA_DISK_1: finished piece 1 at 11-FEB-18
piece handle=/ora_backup/tpdbs/transport_testpdb.bck tag=TAG20180211T223830 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 11-FEB-18
starting full resync of recovery catalog
full resync complete


[oracle@jytest1 tpdbs]$ ls -lrt
total 1707044
-rw-r--r-- 1 oracle asmadmin      11417 Feb 11 16:36 metadata_jypdb.xml
-rw-r----- 1 oracle asmadmin 1038204928 Feb 11 16:37 transport_jypdb.bck
-rw-r--r-- 1 oracle asmadmin       9575 Feb 11 16:38 metadata_testpdb.xml
-rw-r----- 1 oracle asmadmin  709779456 Feb 11 16:39 transport_testpdb.bck


5.将步骤4生成的备份文件与XML文件传输到目标主机上的D:\app\oracle\oradata\pdbs目录中

6.确保目标CDB数据库的状态为读写状态

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

7.执行dbms_pdb.check_plug_compatibility过程来判断被传输的PDB与目标CDB是否兼容。

SQL> declare
  2    c boolean;
  3  begin
  4    c:=dbms_pdb.check_plug_compatibility('D:\app\oracle\oradata\pdbs\metadata_jypdb.xml','JYPDB');
  5    if (c) then dbms_output.put_line('True');
  6      else dbms_output.put_line('False');
  7    end if;
  8  end;
  9  /

PL/SQL 过程已成功完成。

SQL> declare
  2    c boolean;
  3  begin
  4    c:=dbms_pdb.check_plug_compatibility('D:\app\oracle\oradata\pdbs\metadata_testpdb.xml','TESTPDB');
  5    if (c) then dbms_output.put_line('True');
  6      else dbms_output.put_line('False');
  7    end if;
  8  end;
  9  /

PL/SQL 过程已成功完成。

8.还原PDB备份
使用using子句来存储将源PDB插入目标CDB所需要的元数据所在的XML文件名。为了将数据文件复制到与XML文件所描述的不同位置使用file_name_convert子句。

RMAN> restore using 'D:\app\oracle\oradata\pdbs\metadata_jypdb.xml'   foreign pluggable database JYPDB format 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\%U' from backupset 'D:\app\oracle\oradata \pdbs\transport_jypdb.bck';

从位于 11-2月 -18 的 restore 开始
使用通道 ORA_DISK_1

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原备份片段中的所有外部文件
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\pdbs\transport_jypdb.bck
通道 ORA_DISK_1: 将外部文件 28 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-28_IASR0EH6
通道 ORA_DISK_1: 将外部文件 25 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-25_EGSR0EH6
通道 ORA_DISK_1: 将外部文件 26 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-26_TESR0EH6
通道 ORA_DISK_1: 将外部文件 27 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-27_D2SR0EH6
通道 ORA_DISK_1: 将外部文件 24 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-24_FFSR0EH6
通道 ORA_DISK_1: 将外部文件 29 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-29_OMSR0EH6
通道 ORA_DISK_1: 将外部文件 30 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TTS_FNO-30_SUSR0EH6
通道 ORA_DISK_1: 将外部文件 31 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-CS_FNO-31_7LSR0EH6
通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\pdbs\transport_jypdb.bck
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:36
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649 插入文件 24
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649 插入文件 25
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649 插入文件 26
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/TEMPFILE/temp.258.967837571 插入文件 5
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649 插入文件 27
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649 插入文件 28
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609 插入文件 29
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353 插入文件 30
通道 ORA_DISK_1: 正在为 +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783 插入文件 31
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: 位于 02/11/2018 23:22:50 的 restore 命令失败
RMAN-00600: internal error, arguments [5302] [] [] [] []





RMAN> restore using 'D:\app\oracle\oradata\pdbs\metadata_testpdb.xml'   foreign pluggable database testpdb format 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\%U' from backupset 'D:\app\oracle \oradata\pdbs\transport_testpdb.bck';

从位于 11-2月 -18 的 restore 开始
使用通道 ORA_DISK_1

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原备份片段中的所有外部文件
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\pdbs\transport_testpdb.bck
通道 ORA_DISK_1: 将外部文件 33 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-33_N4SR0EOK
通道 ORA_DISK_1: 将外部文件 34 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-34_S1SR0EOK
通道 ORA_DISK_1: 将外部文件 32 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-32_KTSR0EOK
通道 ORA_DISK_1: 将外部文件 35 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-35_PGSR0EOK
通道 ORA_DISK_1: 将外部文件 37 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-37_1MSR0EOK
通道 ORA_DISK_1: 将外部文件 36 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-36_9ASR0EOK
通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\pdbs\transport_testpdb.bck
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:16
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409 插入文件 32
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409 插入文件 33
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409 插入文件 34
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp.276.967837623 插入文件 6
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409 插入文件 35
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409 插入文件 36
通道 ORA_DISK_1: 正在为 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409 插入文件 37
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: 位于 02/11/2018 23:26:28 的 restore 命令失败
RMAN-00600: internal error, arguments [5302] [] [] [] []

上面的错误是因为XMl文件所描述的数据文件名是源数据库中的文件名,手功修改XML文件中的数据文件名为目标数据库中的数据文件名,并执行下面的命令来创建PDB


SQL> create pluggable database jypdb using 'D:\app\oracle\oradata\pdbs\metadata_jypdb.xml';

插接式数据库已创建。

SQL> create pluggable database testpdb using 'D:\app\oracle\oradata\pdbs\metadata_testpdb.xml';

插接式数据库已创建。



SQL> alter pluggable database all open;

插接式数据库已变更。

SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                     OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                 READ ONLY
JYPDB                                                                                                                    READ WRITE
TESTPDB                                                                                                                  READ WRITE

9.查询tts.t1与cs.t2表中的数据来验证跨平台传输PDB是否操作成功

SQL> select count(*) from tts.t1;

  COUNT(*)
----------
        90

SQL> select count(*) from cs.t2;

  COUNT(*)
----------
        92

到此,跨平台传输PDB就完成了。

Oracle 12C RMAN Cross-Platform Transport of PDBs

为了将整个PDB传输到不同的平台,源平台与目标平台必须使用相同的字节序。compatible参数在源CDB数据库与目标CDB数据库中必须设置为12.1或更高版本。

下面的例子将Linux平台上的RAC CDB中的PDB数据库(jypdb与testpdb)传输到windows平台上的单实例CDB数据库中。 执行跨平台传输的操作如下:
1.检查源数据库与目标数据库的compatible参数是否设置为12.0.0或更高版本
源数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

目标数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

2.检查源平台与目标平台的字节序
源平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where tp.platform_name=d.platform_name;

PLATFORM_NAME                                                                                         ENDIAN_FORMAT
----------------------------------------------------------------------------------------------------- --------------
Linux x86 64-bit                                                                                      Little

目标平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where tp.platform_name=d.platform_name;

PLATFORM_NAME                                                                       ENDIAN_FORMAT
--------------------------------------------------------------------------------    --------------
Microsoft Windows x86 64-bit                                                        Little

3.将要被传输的pdb(jypdb,testpdb)设置为只读状态

SQL> alter pluggable database all close immediate;

Pluggable database altered.

SQL> set long 200
SQL> set linesize 200
SQL>  select name,open_mode from v$pdbs;

NAME                                                                                                                             OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                         READ ONLY
JYPDB                                                                                                                            MOUNTED
TESTPDB                                                                                                                          MOUNTED

4.备份要传输的PDB数据库,可以使用以下一种方法来跨平台传输PDB
4.1使用RMAN连接到CDB的root容器,并使用backup for transport … pluggable database或者backup to platform … pluggable database命令来为PDB创建跨平台备份。

4.2使用RMAN连接到PDB,并使用backup for transport或backup to platform命令来为PDB创建跨平台备份。

因为我这里要传输两个PDB所以选择第一种方法

RMAN> backup for transport unplug into '/ora_backup/tpdbs/metadata_jypdb.xml' pluggable database jypdb  format '/ora_backup/tpdbs/pdb_%U';

Starting backup at 11-FEB-18
using channel ORA_DISK_1
running UNPLUG on the specified pluggable database: JYPDB
UNPLUG file path : /ora_backup/tpdbs/metadata_jypdb.xml
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00014 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649
input datafile file number=00011 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649
input datafile file number=00012 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649
input datafile file number=00013 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649
input datafile file number=00010 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649
input datafile file number=00015 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609
input datafile file number=00022 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353
input datafile file number=00023 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783
channel ORA_DISK_1: starting piece 1 at 11-FEB-18
channel ORA_DISK_1: finished piece 1 at 11-FEB-18
piece handle=/ora_backup/tpdbs/pdb_8csqvqc5_1_1 tag=TAG20180211T173748 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56
Finished backup at 11-FEB-18
starting full resync of recovery catalog
full resync complete

RMAN> backup for transport unplug into '/ora_backup/tpdbs/metadata_testpdb.xml' pluggable database testpdb  format '/ora_backup/tpdbs/pdb_%U';

Starting backup at 11-FEB-18
starting full resync of recovery catalog
full resync complete
using channel ORA_DISK_1
running UNPLUG on the specified pluggable database: TESTPDB
UNPLUG file path : /ora_backup/tpdbs/metadata_testpdb.xml
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00017 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409
input datafile file number=00018 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409
input datafile file number=00016 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409
input datafile file number=00019 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409
input datafile file number=00021 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409
input datafile file number=00020 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409
channel ORA_DISK_1: starting piece 1 at 11-FEB-18
channel ORA_DISK_1: finished piece 1 at 11-FEB-18
piece handle=/ora_backup/tpdbs/pdb_8dsqvqpj_1_1 tag=TAG20180211T174458 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 11-FEB-18
starting full resync of recovery catalog
full resync complete


[oracle@jytest1 tpdbs]$ ls -lrt
total 1707488
-rw-r--r-- 1 oracle asmadmin      11413 Feb 11 11:38 metadata_jypdb.xml
-rw-r----- 1 oracle asmadmin 1038368768 Feb 11 11:39 pdb_8csqvqc5_1_1
-rw-r--r-- 1 oracle asmadmin       9569 Feb 11 11:45 metadata_testpdb.xml
-rw-r----- 1 oracle asmadmin  710066176 Feb 11 11:45 pdb_8dsqvqpj_1_1

5.将在源平台上使用rman backup命令生成的备份集与备份的控制文件传输到目标平台的D:\app\oracle\oradata\pdbs目录中

6.将PDB(jypdb,testpdb)还原到目标数据库

RMAN> restore from platform 'Linux x86 64-bit'   foreign pluggable database jypdb  to new from backupset 'D:\app\oracle\oradata\pdbs\pdb_8csqvqc5_1_1';

从位于 11-2月 -18 的 restore 开始
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=1522 设备类型=DISK

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原备份片段中的所有外部文件
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\pdbs\pdb_8csqvqc5_1_1
通道 ORA_DISK_1: 将外部文件 14 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_USERS_F805GPMS_.DBF
通道 ORA_DISK_1: 将外部文件 11 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_SYSAUX_F805GPMS_.DBF
通道 ORA_DISK_1: 将外部文件 12 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_UNDOTBS1_F805GPMS_.DBF
通道 ORA_DISK_1: 将外部文件 13 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_UNDO_2_F805GPMS_.DBF
通道 ORA_DISK_1: 将外部文件 10 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_SYSTEM_F805GPN8_.DBF
通道 ORA_DISK_1: 将外部文件 15 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_TEST_F805GPN8_.DBF
通道 ORA_DISK_1: 将外部文件 22 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_TTS_F805GPN8_.DBF
通道 ORA_DISK_1: 将外部文件 23 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_CS_F805GPN8_.DBF
通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\pdbs\pdb_8csqvqc5_1_1
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:36
在 11-2月 -18 完成了 restore


RMAN> restore from platform 'Linux x86 64-bit'   foreign pluggable database testpdb  to new from backupset 'D:\app\oracle\oradata\pdbs\pdb_8dsqvqpj_1_1';

从位于 11-2月 -18 的 restore 开始
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=1522 设备类型=DISK

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原备份片段中的所有外部文件
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\pdbs\pdb_8dsqvqpj_1_1
通道 ORA_DISK_1: 将外部文件 17 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_SYSAUX_F806C6WT_.DBF
通道 ORA_DISK_1: 将外部文件 18 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_UNDOTBS1_F806C6WT_.DBF
通道 ORA_DISK_1: 将外部文件 16 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_SYSTEM_F806C6WT_.DBF
通道 ORA_DISK_1: 将外部文件 19 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_UNDO_2_F806C6XB_.DBF
通道 ORA_DISK_1: 将外部文件 21 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_TEST_F806C6XB_.DBF
通道 ORA_DISK_1: 将外部文件 20 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\O1_MF_USERS_F806C6XB_.DBF
通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\pdbs\pdb_8dsqvqpj_1_1
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:26
在 11-2月 -18 完成了 restore

7.在目标主机上修改metadata_jypdb.xml与metadata_testpdb.xml文件将数据文件路径修改为还原后数据文件所在路径

8.将传输过来的PDB(jypdb,testpdb)插入CDB

SQL> create pluggable database jypdb using 'D:\app\oracle\oradata\pdbs\metadata_jypdb.xml' nocopy;

插接式数据库已创建。


SQL> create pluggable database testpdb using 'D:\app\oracle\oradata\pdbs\metadata_testpdb.xml' nocopy ;

插接式数据库已创建。

SQL> set long 200
SQL> set linesize 200
SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                     OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                 READ ONLY
JYPDB                                                                                                                    MOUNTED
TESTPDB                                                                                                                  MOUNTED

SQL> alter pluggable database all open;

插接式数据库已变更。

SQL> select name,open_mode from v$pdbs;

NAME                                                                                                                     OPEN_MODE
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED                                                                                                                 READ ONLY
JYPDB                                                                                                                    READ WRITE
TESTPDB                                                                                                                  READ WRITE

9.查询tts.t1与cs.t2表中的数据来验证跨平台传输PDB是否操作成功

SQL> select count(*) from tts.t1;

  COUNT(*)
----------
        90

SQL> select count(*) from cs.t2;

  COUNT(*)
----------
        92

到此,跨平台传输PDB就完成了。

Oraclc 12C使用不一致备份执行跨平台传输表空间

使用不一致备份执行跨平台传输表空间
RMAN可以跨平台传输不一致表空间备份。不一致表空间备份是当表空间处于读写状态时对一个或多个表空间创建的备份。不一致是指备份的数据文件包含了检查点之后发生的改变。跨平台不一致备份所生成的外部数据文件不能 直接附加到目标数据库。可以通过应用跨平台增量备份来使外部数据文件达到一致。这种备份必须包含附加传输表空间到目标数据库所需要元数据的dump文件。

不一致备份能让你减少停机时间。当表空间联机时,在源数据库上创建跨平台不一致备份。第一次备份必须是level 0增量备份,后续,创建level 1增量备份它包含从最近level 1备份后所有发生的改变。就算其它level 1增量 备份正在源数据库上创建时,这些level 0与level 1增量备份可以被还原与应用到目标数据库。在开始应用之前所创建的level 1备份到目标数据库之前不需要等待所有level 1增量备份在源数据库上创建完成就可以执行。因为 当创建增量备份时这些表空间仍然处于联机状态,在这时应用程序仍然可以正常运行。当最后一次创建增量备份时需要将表空间置于只读状态,这时应用程序处于停机状态。最后的备份必须包含附加表空间到目标数据库所需要 的元数据。

在目标数据库上,首先还原level 0增量备份来创建外部数据文件集。下一步就是应用当表空间处于读写状态时所生成的level 1增量备份至这些还原的外部数据文件。以创建这些备份的顺序来应用这些备份。在大多数情况下, 目标数据库的内容就赶上最后增量备份之前的最近一次level 1增量备份所包含的内容,创建最后增量备份时需要将源数据库中的表空间设置为只读状态。最后还原最终的level 1增量备份时会使用外部数据文件达到一致状态。 这次的备份包含附加表空间到目标数据库中所需要的元数据。

可以使用备份集或镜像副本来跨平台传输不一致备份,使用backup命令来以备份集方式来创建跨平台备份。使用convert命令来以镜像副本来创建跨平台备份。

在源数据为上创建不一致与增量备份
在backup或convert命令中使用allow inconsistent子句来为表空间创建跨平台不一致备份。当创建不一致备份时这些表空间处于读写状态。为了创建增量备份,在backup命令中使用incremental level 1子句。

第一次不一致备份是level 0增量备份。后续可以创建多个跨平台的level 1增量备份。最后一次跨平台增量备份必须是一个一致的备份因此在创建时表空间必须处于只读状态。在创建最后一次增量备份时,在backup命令中使用 dump file子句来创建包含表空间元数据的dump文件。

当使用convert命令时,必须显式的使用Data Pump导出工具来创建包含表空间元数据的导出dump文件。allo inconsistent子句不能用于跨平台数据库备份。

在目标数据库还原与恢复不一致备份
当源数据库中表空间处于读写状态时首先在目标数据库中还原跨平台level 0增量备份。这个操作会还原备份与创建外部数据文件副本。因为创建备份时这些表空间不是处于只读状态所以这些外部数据文件处于一不致状态。为了 使用这些外部数据文件达到一致并且达到一致检查点SCN,以创建增量备份的顺序来应用这些增量备份。最后应用的增量备份在创建时源数据库中的表空间必须处于只读状态。下一步就是将表空间附加到目标数据库中,在传输表 空间时可以还原与导入包含元数据的dump文件。

对还原的数据文件应用跨平台增量备份所要满足的条件
为了对还原的外部数据文件集成功应用跨平台增量表空间备份必须满足以下条件:
.每个被包含在跨平台增量备份中的数据文件,它的开始SCN号必须小于外部数据文件副本的当前检查点SCN号。

.对于通过还原操作所创建的外部数据文件副本必须不能被修改。例如,如果外部数据文件副本已经被附加到目标数据库中,并且处于读写状态,然后置于只读状态,那么RMAN会认为这些文件已经被修改。

跨平台传输不一致表空间
跨平台传输不一致表空间分主以下三个主要操作
1.在源数据库上创建传输表空间所需要的文件。
2.将文件从源主机传输到目标主机上。
3.在目标主机上还原表空间并附加到目标数据库

一在源数据库上创建传输表空间所需要的文件
1.1如果被传输的表空间是TDE加密表空间,那么在创建备份集之前指定加密密码
RMAN> SET PASSPHRASE ON IDENTIFIED BY encr_temp;

1.2对于要被传输的表空间在其处于读写状态下创建跨平台level 0不一致备份。在backup命令中使用allow inconsistent and incremental level 0子句来指示备份是不一致备份。

1.3在要被传输的表空间在其处于读写状态下创建跨平台level 1增量备份。在level 0不一致备份后,在表空间处于读写状态下时可以创建任何数量的level 1增量备份。在backup命令中使用allow inconsistent与 incremental level 1子句来创建增量备份。当被传输表空间处于读写状态时频繁的执行增量备份的好处就是可以减少当表空间处于只读状态时所创建的最后增量备份应用到目标数据库的时间。

1.4当被传输表空间处于只读状态时创建跨平台level 1增量备份。这是最后一次增量备份并且它必须包含附加表空间到目标数据库中所需要的表空间元数据。在backup命令中使用incremental level 1子句来创建level 1增量 备份。

当使用backup命令执地跨平台传输时,使用datapump子句在创建增量备份的同时也生成导出dump文件。dump文件被创建在一个单独的备份集中。当使用镜像副本来创建跨平台增量备份时,必须显式地使用Data Pump导出工具来 创建包含表空间元数据的dump文件。

二将文件从源主机传输到目标主机上
使用ftp,操作系统复制命令或一些其它机制来移动备份集,数据文件与dump文件到目标主机上。

三在目标主机上还原表空间并附加到目标数据库
3.1如果被传输表空间是TDE加密表空间,那么通过下面的方式来指定密码
RMAN> SET PASSPHRASE ON IDENTIFIED BY encr_temp;

3.2还原跨平台level 0不一致备份
还原操作将会在目标数据库上创建一组外部数据文件。这些外部数据文件是不一致状态,并且它们在附加到目标数据库之前需要执行恢复。使用restore命令来还原跨平台level 0不一致备份。当还原跨平台不一致备份,它是由 备份集组成,使用from backupset子句来指定包含level 0不一致备份的备份集名称。

3.3应用表空间处于读写状态时所创建的跨平台level 1增量备份到还原的外部数据文件。
如果创建了多次跨平台level 1增量备份,那么这些增量备份必须以相同的顺序来进行应用。使用recover命令来应用增量备份。recover命令中的foreign datafilecopy子句必须列出增量备份所要应用到的每个数据文件。使用 from backupset子句来指定包含被恢复数据的备份集名称。

3.4应用表空间处于只读状态时所创建的跨平台level 1增理备份到还原的外部数据文件。
使用recover命令来应用增量备份。recover命令中的foreign datafilecopy子句必须列出增量备份所要应用到的每个数据文件。使用from backupset子句来指定包含被恢复数据的备份集名称。

3.5还原包含表空间元数据的备份集
使用restore命令来还原在创建跨平台增量备份时一同创建的包含dump文件的备份集。这种备份是当表空间处于只读状态时所创建的。可以使用dump file子句来指定目标数据库上dump文件的名称,datapump destination子句 来指定存储dump文件的目录。如果这些子句被忽略,RMAN将使用配置的缺省值。当使用备份集传输数据时,使用from backupset子句来指定包含dump文件的备份集。

3.6向目标数据库导入包含表空间元数据的dump文件
通过使用Data Pump导入工具来导入在执行增量备份时所生成的dump文件来附加被恢复的表空间到目标数据库中。运行Data Pump导入工具的用户必须有sysdba权限。

Performing Cross-Platform Inconsistent Tablespace Transport Using Backup Sets
下面的例子将Linux平台上的RAC CDB中的jypdb的表空间tts与cs传输到windows平台上的单实例CDB的jypdb数据库中。使用不一致备份集对表空间执行跨平台传输的操作如下:
1.检查源数据库与目标数据库的compatible参数是否设置为12.0.0或更高版本
源数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

目标数据库

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      12.2.0
noncdb_compatible                    boolean     FALSE

2.对源数据库中的要被传输的表空间tts与cs执行自包含检查

SQL> alter session set container=jypdb;

Session altered.

SQL> exec sys.dbms_tts.transport_set_check('TTS,CS',true);

PL/SQL procedure successfully completed.

SQL> select * from sys.transport_set_violations;

no rows selected

3.检查源平台与目标平台的字节序
源平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where tp.platform_name=d.platform_name;

PLATFORM_NAME                                                                                         ENDIAN_FORMAT
----------------------------------------------------------------------------------------------------- --------------
Linux x86 64-bit                                                                                      Little

目标平台

SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d  where t

PLATFORM_NAME                                                                       ENDIAN_FORMAT
--------------------------------------------------------------------------------    --------------
Microsoft Windows x86 64-bit                                                        Little

4.当表空间jypdb:tts,与jypdb:cs处于读写状态时创建跨平台level 0不一致备份。备份集名为tts_cs_incon.bck并存储在/ora_backup/tts目录中

RMAN> backup for transport allow inconsistent incremental level 0 tablespace JYPDB:'TTS',JYPDB:'CS' format '/ora_backup/tts/tts_cs_incon.bck';

Starting backup at 09-FEB-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=16 instance=jy1 device type=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00022 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353
input datafile file number=00023 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783
channel ORA_DISK_1: starting piece 1 at 09-FEB-18
channel ORA_DISK_1: finished piece 1 at 09-FEB-18
piece handle=/ora_backup/tts/tts_cs_incon.bck tag=TAG20180209T184928 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-FEB-18

因为使用for transport代替to platform子句,因此这种跨平台备份可以被还原到任何平台。这种转换操作将在目标数据库上完成。

5.对tts.t1与cs.t2表进行更新

SQL> select count(*) from tts.t1;

  COUNT(*)
----------
        45


SQL> select count(*) from cs.t2;

  COUNT(*)
----------
        46

SQL> insert into tts.t1 select * from tts.t1;

45 rows created.

SQL> insert into cs.t2 select * from cs.t2;

46 rows created.

SQL> commit;

Commit complete.

SQL> select count(*) from tts.t1;

  COUNT(*)
----------
        90

SQL> select count(*) from cs.t2;

  COUNT(*)
----------
        92

6.当表空间jypdb:tts,jypdb:cs处于读写状态时创建跨平台的level 1增量备份。备份集名为tts_cs_incon1.bck并存储在/ora_backup/tts目录中

RMAN> backup for transport allow inconsistent incremental level 1 tablespace JYPDB:'TTS',JYPDB:'CS' format '/ora_backup/tts/tts_cs_incon1.bck';

Starting backup at 09-FEB-18
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00022 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353
input datafile file number=00023 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783
channel ORA_DISK_1: starting piece 1 at 09-FEB-18
channel ORA_DISK_1: finished piece 1 at 09-FEB-18
piece handle=/ora_backup/tts/tts_cs_incon1.bck tag=TAG20180209T185930 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-FEB-18

为了最小化应用程序停机的时间,在步骤4,6所创建的level 0与level 1增量备份当源数据库中表空间处于读写状态的情况下,可以被还原与应用到目标数据库。当目标数据库的内容赶上最近一次增量备份的内容时,可以将源 数据库中的表空间设置为只读状态来创建最终的增量备份。

7.将源数据库中的表空间jypdb:tts,jypdb:cs设置只读模式

SQL> alter tablespace tts read only;

Tablespace altered.

SQL> alter tablespace cs read only;

Tablespace altered.

SQL> select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME                STATUS
------------------------------ ---------
SYSTEM                         ONLINE
SYSAUX                         ONLINE
UNDOTBS1                       ONLINE
TEMP                           ONLINE
UNDO_2                         ONLINE
USERS                          ONLINE
TEST                           ONLINE
TTS                            READ ONLY
CS                             READ ONLY

9 rows selected.

8.创建最终的跨平台level 1增量备份。这次备份包含上一次备份以来所有的改变并且包含导出dump文件它包含表空间元数据。

RMAN> backup for transport  incremental level 1 tablespace JYPDB:'TTS',JYPDB:'CS' format '/ora_backup/tts/tts_cs_incr.bck' DATAPUMP FORMAT '/ora_backup/tts/tts_cs_incr_dp.bck';

Starting backup at 09-FEB-18
starting full resync of recovery catalog
full resync complete
using channel ORA_DISK_1
Running TRANSPORT_SET_CHECK on specified tablespaces
TRANSPORT_SET_CHECK completed successfully

Performing export of metadata for specified tablespaces...
   EXPDP> Starting "SYS"."TRANSPORT_EXP_JY_vqqz":
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
   EXPDP> Master table "SYS"."TRANSPORT_EXP_JY_vqqz" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TRANSPORT_EXP_JY_vqqz is:
   EXPDP>   /u01/app/oracle/product/12.2.0/db/dbs/backup_tts_JY_71118.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace CS:
   EXPDP>   +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783
   EXPDP> Datafiles required for transportable tablespace TTS:
   EXPDP>   +DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353
   EXPDP> Job "SYS"."TRANSPORT_EXP_JY_vqqz" successfully completed at Fri Feb 9 19:19:28 2018 elapsed 0 00:09:02
Export completed

channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00022 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353
input datafile file number=00023 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783
channel ORA_DISK_1: starting piece 1 at 09-FEB-18
channel ORA_DISK_1: finished piece 1 at 09-FEB-18
piece handle=/ora_backup/tts/tts_cs_incr.bck tag=TAG20180209T190934 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backup set
input Data Pump dump file=/u01/app/oracle/product/12.2.0/db/dbs/backup_tts_JY_71118.dmp
channel ORA_DISK_1: starting piece 1 at 09-FEB-18
channel ORA_DISK_1: finished piece 1 at 09-FEB-18
piece handle=/ora_backup/tts/tts_cs_incr_dp.bck tag=TAG20180209T190934 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-FEB-18
starting full resync of recovery catalog
full resync complete

9.将所有生成的备份集与Data Pump导出的dump文件传输到目标平台的D:\app\oracle\oradata\tts目录中

10.还原步骤4生成的跨平台level 0不一致备份
使用foreign datafile子句来指定被还原的数据文件。from platform子句指定创建备份的平台名称。在目标数据库中转换备份需要指定这个子句。在下面的例子中数据文件号为22,23的数据文件会被还原,并且通过指定 format子句来为数据文件指定名称。

RMAN> RESTORE FROM PLATFORM 'Linux x86 64-bit'
2> FOREIGN DATAFILE 22 FORMAT 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\tts_22.df',
3> 23
4> FORMAT 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\cs_23.df'
5> FROM BACKUPSET 'D:\app\oracle\oradata\tts\tts_cs_incon.bck';

从位于 09-2月 -18 的 restore 开始
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=2652 设备类型=DISK

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原外部文件 00022
通道 ORA_DISK_1: 正在还原外部文件 00023
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\tts\tts_cs_incon.bck
通道 ORA_DISK_1: 将外部文件 22 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\TTS_22.DF
通道 ORA_DISK_1: 将外部文件 23 还原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\CS_23.DF
通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\tts\tts_cs_incon.bck
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:04
在 09-2月 -18 完成了 restore

11.通过应用步骤6所创建的level 1增量备份来恢复步骤10中还原的外部数据文件

RMAN> RECOVER
2> FROM PLATFORM 'Linux x86 64-bit'
3> FOREIGN DATAFILECOPY 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\tts_22.df','D:\APP\ORACLE\ORADATA\JY\DATAFILE\cs_23.df'
4> FROM BACKUPSET 'D:\app\oracle\oradata\tts\tts_cs_incon1.bck';

从位于 09-2月 -18 的 restore 开始
使用通道 ORA_DISK_1

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\tts_22.df
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\cs_23.df
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\tts\tts_cs_incon1.bck
通道 ORA_DISK_1: 外部片段句柄 = D:\APP\ORACLE\ORADATA\TTS\TTS_CS_INCON1.BCK
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:01
在 09-2月 -18 完成了 restore

12.使用最终的level 1增量备份来恢复步骤10中还原的外部数据文件

RMAN> RECOVER
2> FROM PLATFORM 'Linux x86 64-bit'
3> FOREIGN DATAFILECOPY 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\tts_22.df','D:\APP\ORACLE\ORADATA\JY\DATAFILE\cs_23.df'
4> FROM BACKUPSET 'D:\app\oracle\oradata\tts\tts_cs_incr.bck';

从位于 09-2月 -18 的 restore 开始
使用通道 ORA_DISK_1

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\tts_22.df
通道 ORA_DISK_1: 正在还原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\cs_23.df
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\tts\tts_cs_incr.bck
通道 ORA_DISK_1: 外部片段句柄 = D:\APP\ORACLE\ORADATA\TTS\TTS_CS_INCR.BCK
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:01
在 09-2月 -18 完成了 restore

13.还原包含导出dump文件的备份集,dump文件是附加表空间到目标数据库中所需要的。

RMAN> RESTORE
2> FROM PLATFORM 'Linux x86 64-bit'
3> DUMP FILE 'tts_cs_restore_md.dmp'
4> DATAPUMP DESTINATION 'D:\app\oracle\oradata\tts\'
5> FROM BACKUPSET 'D:\app\oracle\oradata\tts\tts_cs_incr_dp.bck';

从位于 09-2月 -18 的 restore 开始
使用通道 ORA_DISK_1

通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 正在将数据泵转储文件还原到 D:\app\oracle\oradata\tts\/tts_cs_restore_md.dmp
通道 ORA_DISK_1: 正在读取备份片段 D:\app\oracle\oradata\tts\tts_cs_incr_dp.bck
通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\tts\tts_cs_incr_dp.bck
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:00:02
在 09-2月 -18 完成了 restore

14.附加表空间到目标数据库中

SQL> CREATE OR REPLACE DIRECTORY dp_dir  AS 'D:\app\oracle\oradata\tts\';

目录已创建。


SQL> GRANT read,write ON DIRECTORY dp_dir TO public;

授权成功。


C:\Users\Administrator>impdp system/abcd@jypdb directory=dp_dir dumpfile=tts_cs_restore_md.dmp transport_datafiles='D:\APP\ORACLE\ORADATA\JY\DATAFILE\tts_22.df','D:\APP\ORACLE \ORADATA\JY\DATAFILE\cs_23.df' nologfile=Y

Import: Release 12.2.0.1.0 - Production on 星期五 2月 9 19:56:16 2018

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

连接到: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
已成功加载/卸载了主表 "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01"
启动 "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/********@jypdb directory=dp_dir dumpfile=tts_cs_restore_md.dmp transport_datafiles='D:\APP\ORACLE\ORADATA\JY\DATAFILE\tts_22.df','D: \APP\ORACLE\ORADATA\JY\DATAFILE\cs_23.df' nologfile=Y
处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK
处理对象类型 TRANSPORTABLE_EXPORT/TABLE
处理对象类型 TRANSPORTABLE_EXPORT/INDEX/INDEX
处理对象类型 TRANSPORTABLE_EXPORT/INDEX_STATISTICS
处理对象类型 TRANSPORTABLE_EXPORT/TABLE_STATISTICS
处理对象类型 TRANSPORTABLE_EXPORT/STATISTICS/MARKER
处理对象类型 TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
作业 "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" 已于 星期五 2月 9 19:56:49 2018 elapsed 0 00:00:29 成功完成

15.检查tts.t1与cs.t2表的数据来验证传输是否成功

SQL> select tablespace_name,status from dba_tablespaces;

TABLESPACE_NAME                STATUS
------------------------------ ---------
SYSTEM                         ONLINE
SYSAUX                         ONLINE
UNDOTBS1                       ONLINE
TEMP                           ONLINE
UNDO_2                         ONLINE
USERS                          ONLINE
TEST                           ONLINE
TTS                            READ ONLY
CS                             READ ONLY

已选择 9 行。

SQL> select count(*) from tts.t1;

  COUNT(*)
----------
        90

SQL> select count(*) from cs.t2;

  COUNT(*)
----------
        92

SQL> alter tablespace tts read write;

表空间已更改。

SQL> alter tablespace cs read write;

表空间已更改。

到此使用不一致跨平台备份传输表空间操作完成