Oracle 11G RAC复制备库RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038故障

Oracle 11G RAC复制备库RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038故障

网络服务名配置如下(csdbs为主库,csdb为备库):

csdb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 11.11.10.101)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = csdb)
    )
  )


csdbs =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 11.11.10.108)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 11.11.10.109)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = csdb)(UR=A)
    )
  )

执行复制命令:

[oracle@dbst1 ~]$ rman target sys/abcd1234@csdbs auxiliary sys/abcd1234@csdb

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Sep 18 22:06:27 2022

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

connected to target database: csdb (DBID=4138492706)
connected to auxiliary database: csdb (not mounted)

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

Starting Duplicate Db at 18-SEP-22
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=1700 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0.4/db/dbs/orapwcsdb1' auxiliary format
 '/u01/app/oracle/product/11.2.0.4/db/dbs/orapwcsdb'   ;
}
executing Memory Script

Starting backup at 18-SEP-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4121 instance=csdb1 device type=DISK
Finished backup at 18-SEP-22

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/csdb/control01.ctl';
   restore clone controlfile to  '/u01/app/oracle/oradata/csdb/control02.ctl' from
 '/u01/app/oracle/oradata/csdb/control01.ctl';
}
executing Memory Script

Starting backup at 18-SEP-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0.4/db/dbs/snapcf_csdb1.f tag=TAG20220918T220701 RECID=182 STAMP=1115762822
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 18-SEP-22

Starting restore at 18-SEP-22
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 18-SEP-22

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

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/csdb/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/csdb/system01.dbf";
   set newname for datafile  2 to
 "/u01/app/oracle/oradata/csdb/sysaux01.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/csdb/undotbs01.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/csdb/users01.dbf";
   set newname for datafile  5 to
 "/u01/app/oracle/oradata/csdb/example01.dbf";
   set newname for datafile  8 to
 "/u01/app/oracle/oradata/csdb/swpt01";
   set newname for datafile  11 to
 "/u01/app/oracle/oradata/csdb/users02.dbf";
   set newname for datafile  12 to
 "/u01/app/oracle/oradata/csdb/users03.dbf";
   set newname for datafile  13 to
 "/u01/app/oracle/oradata/csdb/users04.dbf";
   set newname for datafile  14 to
 "/u01/app/oracle/oradata/csdb/users05.dbf";
   set newname for datafile  15 to
 "/u01/app/oracle/oradata/csdb/users06.dbf";
   set newname for datafile  16 to
 "/u01/app/oracle/oradata/csdb/users07.dbf";
   set newname for datafile  17 to
 "/u01/app/oracle/oradata/csdb/users08.dbf";
   set newname for datafile  18 to
 "/u01/app/oracle/oradata/csdb/users09.dbf";
   set newname for datafile  19 to
 "/u01/app/oracle/oradata/csdb/users10.dbf";
   set newname for datafile  20 to
 "/u01/app/oracle/oradata/csdb/users11.dbf";
   set newname for datafile  21 to
 "/u01/app/oracle/oradata/csdb/users12.dbf";
   set newname for datafile  22 to
 "/u01/app/oracle/oradata/csdb/users13.dbf";
   set newname for datafile  23 to
 "/u01/app/oracle/oradata/csdb/users14.dbf";
   set newname for datafile  25 to
 "/u01/app/oracle/oradata/csdb/users16.dbf";
   set newname for datafile  26 to
 "/u01/app/oracle/oradata/csdb/users17.dbf";
   set newname for datafile  27 to
 "/u01/app/oracle/oradata/csdb/users15.dbf";
   set newname for datafile  28 to
 "/u01/app/oracle/oradata/csdb/users18.dbf";
   set newname for datafile  29 to
 "/u01/app/oracle/oradata/csdb/users19.dbf";
   set newname for datafile  30 to
 "/u01/app/oracle/oradata/csdb/users20.dbf";
   set newname for datafile  31 to
 "/u01/app/oracle/oradata/csdb/users21.dbf";
   set newname for datafile  32 to
 "/u01/app/oracle/oradata/csdb/users22.dbf";
   set newname for datafile  33 to
 "/u01/app/oracle/oradata/csdb/users23.dbf";
   set newname for datafile  34 to
 "/u01/app/oracle/oradata/csdb/users24.dbf";
   set newname for datafile  35 to
 "/u01/app/oracle/oradata/csdb/users25.dbf";
   set newname for datafile  36 to
 "/u01/app/oracle/oradata/csdb/users26.dbf";
   set newname for datafile  37 to
 "/u01/app/oracle/oradata/csdb/users27.dbf";
   set newname for datafile  38 to
 "/u01/app/oracle/oradata/csdb/users28.dbf";
   set newname for datafile  39 to
 "/u01/app/oracle/oradata/csdb/users29.dbf";
   set newname for datafile  40 to
 "/u01/app/oracle/oradata/csdb/users30.dbf";
   set newname for datafile  41 to
 "/u01/app/oracle/oradata/csdb/undotbs02.dbf";
   set newname for datafile  42 to
 "/u01/app/oracle/oradata/csdb/undotbs03.dbf";
   set newname for datafile  49 to
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.262.1109177757";
   set newname for datafile  50 to
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.263.1109178111";
   set newname for datafile  51 to
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.264.1109178457";
   set newname for datafile  52 to
 "/u01/app/oracle/oradata/csdb/datafile/users.284.1109186395";
   set newname for datafile  53 to
 "/u01/app/oracle/oradata/csdb/datafile/users.285.1109186791";
   set newname for datafile  54 to
 "/u01/app/oracle/oradata/csdb/datafile/users.286.1109187157";
   set newname for datafile  55 to
 "/u01/app/oracle/oradata/csdb/datafile/users.287.1109187493";
   set newname for datafile  56 to
 "/u01/app/oracle/oradata/csdb/users31.dbf";
   set newname for datafile  57 to
 "/u01/app/oracle/oradata/csdb/users32.dbf";
   backup as copy reuse
   datafile  1 auxiliary format
 "/u01/app/oracle/oradata/csdb/system01.dbf"   datafile
 2 auxiliary format
 "/u01/app/oracle/oradata/csdb/sysaux01.dbf"   datafile
 3 auxiliary format
 "/u01/app/oracle/oradata/csdb/undotbs01.dbf"   datafile
 4 auxiliary format
 "/u01/app/oracle/oradata/csdb/users01.dbf"   datafile
 5 auxiliary format
 "/u01/app/oracle/oradata/csdb/example01.dbf"   datafile
 8 auxiliary format
 "/u01/app/oracle/oradata/csdb/swpt01"   datafile
 11 auxiliary format
 "/u01/app/oracle/oradata/csdb/users02.dbf"   datafile
 12 auxiliary format
 "/u01/app/oracle/oradata/csdb/users03.dbf"   datafile
 13 auxiliary format
 "/u01/app/oracle/oradata/csdb/users04.dbf"   datafile
 14 auxiliary format
 "/u01/app/oracle/oradata/csdb/users05.dbf"   datafile
 15 auxiliary format
 "/u01/app/oracle/oradata/csdb/users06.dbf"   datafile
 16 auxiliary format
 "/u01/app/oracle/oradata/csdb/users07.dbf"   datafile
 17 auxiliary format
 "/u01/app/oracle/oradata/csdb/users08.dbf"   datafile
 18 auxiliary format
 "/u01/app/oracle/oradata/csdb/users09.dbf"   datafile
 19 auxiliary format
 "/u01/app/oracle/oradata/csdb/users10.dbf"   datafile
 20 auxiliary format
 "/u01/app/oracle/oradata/csdb/users11.dbf"   datafile
 21 auxiliary format
 "/u01/app/oracle/oradata/csdb/users12.dbf"   datafile
 22 auxiliary format
 "/u01/app/oracle/oradata/csdb/users13.dbf"   datafile
 23 auxiliary format
 "/u01/app/oracle/oradata/csdb/users14.dbf"   datafile
 25 auxiliary format
 "/u01/app/oracle/oradata/csdb/users16.dbf"   datafile
 26 auxiliary format
 "/u01/app/oracle/oradata/csdb/users17.dbf"   datafile
 27 auxiliary format
 "/u01/app/oracle/oradata/csdb/users15.dbf"   datafile
 28 auxiliary format
 "/u01/app/oracle/oradata/csdb/users18.dbf"   datafile
 29 auxiliary format
 "/u01/app/oracle/oradata/csdb/users19.dbf"   datafile
 30 auxiliary format
 "/u01/app/oracle/oradata/csdb/users20.dbf"   datafile
 31 auxiliary format
 "/u01/app/oracle/oradata/csdb/users21.dbf"   datafile
 32 auxiliary format
 "/u01/app/oracle/oradata/csdb/users22.dbf"   datafile
 33 auxiliary format
 "/u01/app/oracle/oradata/csdb/users23.dbf"   datafile
 34 auxiliary format
 "/u01/app/oracle/oradata/csdb/users24.dbf"   datafile
 35 auxiliary format
 "/u01/app/oracle/oradata/csdb/users25.dbf"   datafile
 36 auxiliary format
 "/u01/app/oracle/oradata/csdb/users26.dbf"   datafile
 37 auxiliary format
 "/u01/app/oracle/oradata/csdb/users27.dbf"   datafile
 38 auxiliary format
 "/u01/app/oracle/oradata/csdb/users28.dbf"   datafile
 39 auxiliary format
 "/u01/app/oracle/oradata/csdb/users29.dbf"   datafile
 40 auxiliary format
 "/u01/app/oracle/oradata/csdb/users30.dbf"   datafile
 41 auxiliary format
 "/u01/app/oracle/oradata/csdb/undotbs02.dbf"   datafile
 42 auxiliary format
 "/u01/app/oracle/oradata/csdb/undotbs03.dbf"   datafile
 49 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.262.1109177757"   datafile
 50 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.263.1109178111"   datafile
 51 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.264.1109178457"   datafile
 52 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.284.1109186395"   datafile
 53 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.285.1109186791"   datafile
 54 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.286.1109187157"   datafile
 55 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.287.1109187493"   datafile
 56 auxiliary format
 "/u01/app/oracle/oradata/csdb/users31.dbf"   datafile
 57 auxiliary format
 "/u01/app/oracle/oradata/csdb/users32.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/csdb/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 18-SEP-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+JHK/csdbs/system01.dbf
output file name=/u01/app/oracle/oradata/csdb/system01.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+JHK/csdbs/sysaux01.dbf
output file name=/u01/app/oracle/oradata/csdb/sysaux01.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+JHK/csdbs/undotbs01.dbf
output file name=/u01/app/oracle/oradata/csdb/undotbs01.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00049 name=+JHK/csdbs/datafile/undotbs2.262.1109177757
output file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.262.1109177757 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:06:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00050 name=+JHK/csdbs/datafile/undotbs2.263.1109178111
output file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.263.1109178111 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00051 name=+JHK/csdbs/datafile/undotbs2.264.1109178457
output file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.264.1109178457 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00025 name=+JHK/csdbs/users16.dbf
output file name=/u01/app/oracle/oradata/csdb/users16.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00026 name=+JHK/csdbs/users17.dbf
output file name=/u01/app/oracle/oradata/csdb/users17.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00027 name=+JHK/csdbs/users15.dbf
output file name=/u01/app/oracle/oradata/csdb/users15.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00028 name=+JHK/csdbs/users18.dbf
output file name=/u01/app/oracle/oradata/csdb/users18.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00029 name=+JHK/csdbs/users19.dbf
output file name=/u01/app/oracle/oradata/csdb/users19.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00030 name=+JHK/csdbs/users20.dbf
output file name=/u01/app/oracle/oradata/csdb/users20.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00031 name=+JHK/csdbs/users21.dbf
output file name=/u01/app/oracle/oradata/csdb/users21.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00032 name=+JHK/csdbs/users22.dbf
output file name=/u01/app/oracle/oradata/csdb/users22.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00033 name=+JHK/csdbs/users23.dbf
output file name=/u01/app/oracle/oradata/csdb/users23.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00034 name=+JHK/csdbs/users24.dbf
output file name=/u01/app/oracle/oradata/csdb/users24.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00035 name=+JHK/csdbs/users25.dbf
output file name=/u01/app/oracle/oradata/csdb/users25.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00036 name=+JHK/csdbs/users26.dbf
output file name=/u01/app/oracle/oradata/csdb/users26.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00037 name=+JHK/csdbs/users27.dbf
output file name=/u01/app/oracle/oradata/csdb/users27.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00038 name=+JHK/csdbs/users28.dbf
output file name=/u01/app/oracle/oradata/csdb/users28.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00039 name=+JHK/csdbs/users29.dbf
output file name=/u01/app/oracle/oradata/csdb/users29.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00040 name=+JHK/csdbs/users30.dbf
output file name=/u01/app/oracle/oradata/csdb/users30.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00041 name=+JHK/csdbs/undotbs02.dbf
output file name=/u01/app/oracle/oradata/csdb/undotbs02.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00042 name=+JHK/csdbs/undotbs03.dbf
output file name=/u01/app/oracle/oradata/csdb/undotbs03.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00052 name=+JHK/csdbs/datafile/users.284.1109186395
output file name=/u01/app/oracle/oradata/csdb/datafile/users.284.1109186395 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00053 name=+JHK/csdbs/datafile/users.285.1109186791
output file name=/u01/app/oracle/oradata/csdb/datafile/users.285.1109186791 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00054 name=+JHK/csdbs/datafile/users.286.1109187157
output file name=/u01/app/oracle/oradata/csdb/datafile/users.286.1109187157 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00055 name=+JHK/csdbs/datafile/users.287.1109187493
output file name=/u01/app/oracle/oradata/csdb/datafile/users.287.1109187493 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00056 name=+JHK/csdbs/users31.dbf
output file name=/u01/app/oracle/oradata/csdb/users31.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00057 name=+JHK/csdbs/users32.dbf
output file name=/u01/app/oracle/oradata/csdb/users32.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+JHK/csdbs/users01.dbf
output file name=/u01/app/oracle/oradata/csdb/users01.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00011 name=+JHK/csdbs/users02.dbf
output file name=/u01/app/oracle/oradata/csdb/users02.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00012 name=+JHK/csdbs/users03.dbf
output file name=/u01/app/oracle/oradata/csdb/users03.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00013 name=+JHK/csdbs/users04.dbf
output file name=/u01/app/oracle/oradata/csdb/users04.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00014 name=+JHK/csdbs/users05.dbf
output file name=/u01/app/oracle/oradata/csdb/users05.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00023 name=+JHK/csdbs/users14.dbf
output file name=/u01/app/oracle/oradata/csdb/users14.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00019 name=+JHK/csdbs/users10.dbf
output file name=/u01/app/oracle/oradata/csdb/users10.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00020 name=+JHK/csdbs/users11.dbf
output file name=/u01/app/oracle/oradata/csdb/users11.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00021 name=+JHK/csdbs/users12.dbf
output file name=/u01/app/oracle/oradata/csdb/users12.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00022 name=+JHK/csdbs/users13.dbf
output file name=/u01/app/oracle/oradata/csdb/users13.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00015 name=+JHK/csdbs/users06.dbf
output file name=/u01/app/oracle/oradata/csdb/users06.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00016 name=+JHK/csdbs/users07.dbf
output file name=/u01/app/oracle/oradata/csdb/users07.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00018 name=+JHK/csdbs/users09.dbf
output file name=/u01/app/oracle/oradata/csdb/users09.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00017 name=+JHK/csdbs/users08.dbf
output file name=/u01/app/oracle/oradata/csdb/users08.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=+JHK/csdbs/swpt01
output file name=/u01/app/oracle/oradata/csdb/swpt01 tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+JHK/csdbs/example01.dbf
output file name=/u01/app/oracle/oradata/csdb/example01.dbf tag=TAG20220918T220713
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 19-SEP-22

sql statement: alter system archive log current
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/19/2022 01:26:50
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of sql command on ORA_AUX_DISK_1 channel at 09/19/2022 01:26:50
RMAN-10038: database session for channel ORA_AUX_DISK_1 terminated unexpectedly

出现了通道异常终止的错误,根本原因是在执行rman命令时连接主库配置的tns服务名不是指向单实例

修改网络服务名:

csdb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 11.11.10.101)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = csdb)
    )
  )


csdbs =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 11.11.10.108)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = csdb)(UR=A)
    )
  )

再次执行复制命令

[oracle@csdb admin]$ rman target sys/abcd1234@csdbs1 auxiliary sys/abcd1234@csdb

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Sep 19 12:45:00 2022

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

connected to target database: csdb (DBID=4138492706)
connected to auxiliary database: csdb (not mounted)

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 19-SEP-22
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=1982 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0.4/db/dbs/orapwcsdb1' auxiliary format
 '/u01/app/oracle/product/11.2.0.4/db/dbs/orapwcsdb'   ;
}
executing Memory Script

Starting backup at 19-SEP-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3126 instance=csdb1 device type=DISK
Finished backup at 19-SEP-22

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/csdb/control01.ctl';
   restore clone controlfile to  '/u01/app/oracle/oradata/csdb/control02.ctl' from
 '/u01/app/oracle/oradata/csdb/control01.ctl';
}
executing Memory Script

Starting backup at 19-SEP-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=+JHK/csdbs/snapcf_csdb1.f tag=TAG20220919T124512 RECID=185 STAMP=1115815514
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 19-SEP-22

Starting restore at 19-SEP-22
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 19-SEP-22

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

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/app/oracle/oradata/csdb/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/csdb/system01.dbf";
   set newname for datafile  2 to
 "/u01/app/oracle/oradata/csdb/sysaux01.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/csdb/undotbs01.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/csdb/users01.dbf";
   set newname for datafile  5 to
 "/u01/app/oracle/oradata/csdb/example01.dbf";
   set newname for datafile  8 to
 "/u01/app/oracle/oradata/csdb/swpt01";
   set newname for datafile  11 to
 "/u01/app/oracle/oradata/csdb/users02.dbf";
   set newname for datafile  12 to
 "/u01/app/oracle/oradata/csdb/users03.dbf";
   set newname for datafile  13 to
 "/u01/app/oracle/oradata/csdb/users04.dbf";
   set newname for datafile  14 to
 "/u01/app/oracle/oradata/csdb/users05.dbf";
   set newname for datafile  15 to
 "/u01/app/oracle/oradata/csdb/users06.dbf";
   set newname for datafile  16 to
 "/u01/app/oracle/oradata/csdb/users07.dbf";
   set newname for datafile  17 to
 "/u01/app/oracle/oradata/csdb/users08.dbf";
   set newname for datafile  18 to
 "/u01/app/oracle/oradata/csdb/users09.dbf";
   set newname for datafile  19 to
 "/u01/app/oracle/oradata/csdb/users10.dbf";
   set newname for datafile  20 to
 "/u01/app/oracle/oradata/csdb/users11.dbf";
   set newname for datafile  21 to
 "/u01/app/oracle/oradata/csdb/users12.dbf";
   set newname for datafile  22 to
 "/u01/app/oracle/oradata/csdb/users13.dbf";
   set newname for datafile  23 to
 "/u01/app/oracle/oradata/csdb/users14.dbf";
   set newname for datafile  25 to
 "/u01/app/oracle/oradata/csdb/users16.dbf";
   set newname for datafile  26 to
 "/u01/app/oracle/oradata/csdb/users17.dbf";
   set newname for datafile  27 to
 "/u01/app/oracle/oradata/csdb/users15.dbf";
   set newname for datafile  28 to
 "/u01/app/oracle/oradata/csdb/users18.dbf";
   set newname for datafile  29 to
 "/u01/app/oracle/oradata/csdb/users19.dbf";
   set newname for datafile  30 to
 "/u01/app/oracle/oradata/csdb/users20.dbf";
   set newname for datafile  31 to
 "/u01/app/oracle/oradata/csdb/users21.dbf";
   set newname for datafile  32 to
 "/u01/app/oracle/oradata/csdb/users22.dbf";
   set newname for datafile  33 to
 "/u01/app/oracle/oradata/csdb/users23.dbf";
   set newname for datafile  34 to
 "/u01/app/oracle/oradata/csdb/users24.dbf";
   set newname for datafile  35 to
 "/u01/app/oracle/oradata/csdb/users25.dbf";
   set newname for datafile  36 to
 "/u01/app/oracle/oradata/csdb/users26.dbf";
   set newname for datafile  37 to
 "/u01/app/oracle/oradata/csdb/users27.dbf";
   set newname for datafile  38 to
 "/u01/app/oracle/oradata/csdb/users28.dbf";
   set newname for datafile  39 to
 "/u01/app/oracle/oradata/csdb/users29.dbf";
   set newname for datafile  40 to
 "/u01/app/oracle/oradata/csdb/users30.dbf";
   set newname for datafile  41 to
 "/u01/app/oracle/oradata/csdb/undotbs02.dbf";
   set newname for datafile  42 to
 "/u01/app/oracle/oradata/csdb/undotbs03.dbf";
   set newname for datafile  49 to
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.262.1109177757";
   set newname for datafile  50 to
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.263.1109178111";
   set newname for datafile  51 to
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.264.1109178457";
   set newname for datafile  52 to
 "/u01/app/oracle/oradata/csdb/datafile/users.284.1109186395";
   set newname for datafile  53 to
 "/u01/app/oracle/oradata/csdb/datafile/users.285.1109186791";
   set newname for datafile  54 to
 "/u01/app/oracle/oradata/csdb/datafile/users.286.1109187157";
   set newname for datafile  55 to
 "/u01/app/oracle/oradata/csdb/datafile/users.287.1109187493";
   set newname for datafile  56 to
 "/u01/app/oracle/oradata/csdb/users31.dbf";
   set newname for datafile  57 to
 "/u01/app/oracle/oradata/csdb/users32.dbf";
   backup as copy reuse
   datafile  1 auxiliary format
 "/u01/app/oracle/oradata/csdb/system01.dbf"   datafile
 2 auxiliary format
 "/u01/app/oracle/oradata/csdb/sysaux01.dbf"   datafile
 3 auxiliary format
 "/u01/app/oracle/oradata/csdb/undotbs01.dbf"   datafile
 4 auxiliary format
 "/u01/app/oracle/oradata/csdb/users01.dbf"   datafile
 5 auxiliary format
 "/u01/app/oracle/oradata/csdb/example01.dbf"   datafile
 8 auxiliary format
 "/u01/app/oracle/oradata/csdb/swpt01"   datafile
 11 auxiliary format
 "/u01/app/oracle/oradata/csdb/users02.dbf"   datafile
 12 auxiliary format
 "/u01/app/oracle/oradata/csdb/users03.dbf"   datafile
 13 auxiliary format
 "/u01/app/oracle/oradata/csdb/users04.dbf"   datafile
 14 auxiliary format
 "/u01/app/oracle/oradata/csdb/users05.dbf"   datafile
 15 auxiliary format
 "/u01/app/oracle/oradata/csdb/users06.dbf"   datafile
 16 auxiliary format
 "/u01/app/oracle/oradata/csdb/users07.dbf"   datafile
 17 auxiliary format
 "/u01/app/oracle/oradata/csdb/users08.dbf"   datafile
 18 auxiliary format
 "/u01/app/oracle/oradata/csdb/users09.dbf"   datafile
 19 auxiliary format
 "/u01/app/oracle/oradata/csdb/users10.dbf"   datafile
 20 auxiliary format
 "/u01/app/oracle/oradata/csdb/users11.dbf"   datafile
 21 auxiliary format
 "/u01/app/oracle/oradata/csdb/users12.dbf"   datafile
 22 auxiliary format
 "/u01/app/oracle/oradata/csdb/users13.dbf"   datafile
 23 auxiliary format
 "/u01/app/oracle/oradata/csdb/users14.dbf"   datafile
 25 auxiliary format
 "/u01/app/oracle/oradata/csdb/users16.dbf"   datafile
 26 auxiliary format
 "/u01/app/oracle/oradata/csdb/users17.dbf"   datafile
 27 auxiliary format
 "/u01/app/oracle/oradata/csdb/users15.dbf"   datafile
 28 auxiliary format
 "/u01/app/oracle/oradata/csdb/users18.dbf"   datafile
 29 auxiliary format
 "/u01/app/oracle/oradata/csdb/users19.dbf"   datafile
 30 auxiliary format
 "/u01/app/oracle/oradata/csdb/users20.dbf"   datafile
 31 auxiliary format
 "/u01/app/oracle/oradata/csdb/users21.dbf"   datafile
 32 auxiliary format
 "/u01/app/oracle/oradata/csdb/users22.dbf"   datafile
 33 auxiliary format
 "/u01/app/oracle/oradata/csdb/users23.dbf"   datafile
 34 auxiliary format
 "/u01/app/oracle/oradata/csdb/users24.dbf"   datafile
 35 auxiliary format
 "/u01/app/oracle/oradata/csdb/users25.dbf"   datafile
 36 auxiliary format
 "/u01/app/oracle/oradata/csdb/users26.dbf"   datafile
 37 auxiliary format
 "/u01/app/oracle/oradata/csdb/users27.dbf"   datafile
 38 auxiliary format
 "/u01/app/oracle/oradata/csdb/users28.dbf"   datafile
 39 auxiliary format
 "/u01/app/oracle/oradata/csdb/users29.dbf"   datafile
 40 auxiliary format
 "/u01/app/oracle/oradata/csdb/users30.dbf"   datafile
 41 auxiliary format
 "/u01/app/oracle/oradata/csdb/undotbs02.dbf"   datafile
 42 auxiliary format
 "/u01/app/oracle/oradata/csdb/undotbs03.dbf"   datafile
 49 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.262.1109177757"   datafile
 50 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.263.1109178111"   datafile
 51 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/undotbs2.264.1109178457"   datafile
 52 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.284.1109186395"   datafile
 53 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.285.1109186791"   datafile
 54 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.286.1109187157"   datafile
 55 auxiliary format
 "/u01/app/oracle/oradata/csdb/datafile/users.287.1109187493"   datafile
 56 auxiliary format
 "/u01/app/oracle/oradata/csdb/users31.dbf"   datafile
 57 auxiliary format
 "/u01/app/oracle/oradata/csdb/users32.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/csdb/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 19-SEP-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+JHK/csdbs/system01.dbf
output file name=/u01/app/oracle/oradata/csdb/system01.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+JHK/csdbs/sysaux01.dbf
output file name=/u01/app/oracle/oradata/csdb/sysaux01.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+JHK/csdbs/undotbs01.dbf
output file name=/u01/app/oracle/oradata/csdb/undotbs01.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00049 name=+JHK/csdbs/datafile/undotbs2.262.1109177757
output file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.262.1109177757 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00050 name=+JHK/csdbs/datafile/undotbs2.263.1109178111
output file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.263.1109178111 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:06
channel ORA_DISK_1: starting datafile copy
input datafile file number=00051 name=+JHK/csdbs/datafile/undotbs2.264.1109178457
output file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.264.1109178457 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00025 name=+JHK/csdbs/users16.dbf
output file name=/u01/app/oracle/oradata/csdb/users16.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00026 name=+JHK/csdbs/users17.dbf
output file name=/u01/app/oracle/oradata/csdb/users17.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00027 name=+JHK/csdbs/users15.dbf
output file name=/u01/app/oracle/oradata/csdb/users15.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00028 name=+JHK/csdbs/users18.dbf
output file name=/u01/app/oracle/oradata/csdb/users18.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00029 name=+JHK/csdbs/users19.dbf
output file name=/u01/app/oracle/oradata/csdb/users19.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00030 name=+JHK/csdbs/users20.dbf
output file name=/u01/app/oracle/oradata/csdb/users20.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00031 name=+JHK/csdbs/users21.dbf
output file name=/u01/app/oracle/oradata/csdb/users21.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00032 name=+JHK/csdbs/users22.dbf
output file name=/u01/app/oracle/oradata/csdb/users22.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00033 name=+JHK/csdbs/users23.dbf
output file name=/u01/app/oracle/oradata/csdb/users23.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00034 name=+JHK/csdbs/users24.dbf
output file name=/u01/app/oracle/oradata/csdb/users24.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:36
channel ORA_DISK_1: starting datafile copy
input datafile file number=00035 name=+JHK/csdbs/users25.dbf
output file name=/u01/app/oracle/oradata/csdb/users25.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00036 name=+JHK/csdbs/users26.dbf
output file name=/u01/app/oracle/oradata/csdb/users26.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00037 name=+JHK/csdbs/users27.dbf
output file name=/u01/app/oracle/oradata/csdb/users27.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00038 name=+JHK/csdbs/users28.dbf
output file name=/u01/app/oracle/oradata/csdb/users28.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00039 name=+JHK/csdbs/users29.dbf
output file name=/u01/app/oracle/oradata/csdb/users29.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00040 name=+JHK/csdbs/users30.dbf
output file name=/u01/app/oracle/oradata/csdb/users30.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00041 name=+JHK/csdbs/undotbs02.dbf
output file name=/u01/app/oracle/oradata/csdb/undotbs02.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00042 name=+JHK/csdbs/undotbs03.dbf
output file name=/u01/app/oracle/oradata/csdb/undotbs03.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:36
channel ORA_DISK_1: starting datafile copy
input datafile file number=00052 name=+JHK/csdbs/datafile/users.284.1109186395
output file name=/u01/app/oracle/oradata/csdb/datafile/users.284.1109186395 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00053 name=+JHK/csdbs/datafile/users.285.1109186791
output file name=/u01/app/oracle/oradata/csdb/datafile/users.285.1109186791 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00054 name=+JHK/csdbs/datafile/users.286.1109187157
output file name=/u01/app/oracle/oradata/csdb/datafile/users.286.1109187157 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00055 name=+JHK/csdbs/datafile/users.287.1109187493
output file name=/u01/app/oracle/oradata/csdb/datafile/users.287.1109187493 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00056 name=+JHK/csdbs/users31.dbf
output file name=/u01/app/oracle/oradata/csdb/users31.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00057 name=+JHK/csdbs/users32.dbf
output file name=/u01/app/oracle/oradata/csdb/users32.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:06
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+JHK/csdbs/users01.dbf
output file name=/u01/app/oracle/oradata/csdb/users01.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00011 name=+JHK/csdbs/users02.dbf
output file name=/u01/app/oracle/oradata/csdb/users02.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:16
channel ORA_DISK_1: starting datafile copy
input datafile file number=00012 name=+JHK/csdbs/users03.dbf
output file name=/u01/app/oracle/oradata/csdb/users03.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00013 name=+JHK/csdbs/users04.dbf
output file name=/u01/app/oracle/oradata/csdb/users04.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:07:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00014 name=+JHK/csdbs/users05.dbf
output file name=/u01/app/oracle/oradata/csdb/users05.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:06:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00023 name=+JHK/csdbs/users14.dbf
output file name=/u01/app/oracle/oradata/csdb/users14.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00019 name=+JHK/csdbs/users10.dbf
output file name=/u01/app/oracle/oradata/csdb/users10.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:06
channel ORA_DISK_1: starting datafile copy
input datafile file number=00020 name=+JHK/csdbs/users11.dbf
output file name=/u01/app/oracle/oradata/csdb/users11.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00021 name=+JHK/csdbs/users12.dbf
output file name=/u01/app/oracle/oradata/csdb/users12.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00022 name=+JHK/csdbs/users13.dbf
output file name=/u01/app/oracle/oradata/csdb/users13.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:26
channel ORA_DISK_1: starting datafile copy
input datafile file number=00015 name=+JHK/csdbs/users06.dbf
output file name=/u01/app/oracle/oradata/csdb/users06.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00016 name=+JHK/csdbs/users07.dbf
output file name=/u01/app/oracle/oradata/csdb/users07.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00018 name=+JHK/csdbs/users09.dbf
output file name=/u01/app/oracle/oradata/csdb/users09.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00017 name=+JHK/csdbs/users08.dbf
output file name=/u01/app/oracle/oradata/csdb/users08.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=+JHK/csdbs/swpt01
output file name=/u01/app/oracle/oradata/csdb/swpt01 tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+JHK/csdbs/example01.dbf
output file name=/u01/app/oracle/oradata/csdb/example01.dbf tag=TAG20220919T124526
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 19-SEP-22

sql statement: alter system archive log current

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=185 STAMP=1115827367 file name=/u01/app/oracle/oradata/csdb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=186 STAMP=1115827367 file name=/u01/app/oracle/oradata/csdb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=187 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=188 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=189 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/example01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=190 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/swpt01
datafile 11 switched to datafile copy
input datafile copy RECID=191 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users02.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=192 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users03.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=193 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users04.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=194 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users05.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=195 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users06.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=196 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users07.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=197 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users08.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=198 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users09.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=199 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users10.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=200 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users11.dbf
datafile 21 switched to datafile copy
input datafile copy RECID=201 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users12.dbf
datafile 22 switched to datafile copy
input datafile copy RECID=202 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users13.dbf
datafile 23 switched to datafile copy
input datafile copy RECID=203 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users14.dbf
datafile 25 switched to datafile copy
input datafile copy RECID=204 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users16.dbf
datafile 26 switched to datafile copy
input datafile copy RECID=205 STAMP=1115827368 file name=/u01/app/oracle/oradata/csdb/users17.dbf
datafile 27 switched to datafile copy
input datafile copy RECID=206 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users15.dbf
datafile 28 switched to datafile copy
input datafile copy RECID=207 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users18.dbf
datafile 29 switched to datafile copy
input datafile copy RECID=208 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users19.dbf
datafile 30 switched to datafile copy
input datafile copy RECID=209 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users20.dbf
datafile 31 switched to datafile copy
input datafile copy RECID=210 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users21.dbf
datafile 32 switched to datafile copy
input datafile copy RECID=211 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users22.dbf
datafile 33 switched to datafile copy
input datafile copy RECID=212 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users23.dbf
datafile 34 switched to datafile copy
input datafile copy RECID=213 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users24.dbf
datafile 35 switched to datafile copy
input datafile copy RECID=214 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users25.dbf
datafile 36 switched to datafile copy
input datafile copy RECID=215 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users26.dbf
datafile 37 switched to datafile copy
input datafile copy RECID=216 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users27.dbf
datafile 38 switched to datafile copy
input datafile copy RECID=217 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users28.dbf
datafile 39 switched to datafile copy
input datafile copy RECID=218 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users29.dbf
datafile 40 switched to datafile copy
input datafile copy RECID=219 STAMP=1115827369 file name=/u01/app/oracle/oradata/csdb/users30.dbf
datafile 41 switched to datafile copy
input datafile copy RECID=220 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/undotbs02.dbf
datafile 42 switched to datafile copy
input datafile copy RECID=221 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/undotbs03.dbf
datafile 49 switched to datafile copy
input datafile copy RECID=222 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.262.1109177757
datafile 50 switched to datafile copy
input datafile copy RECID=223 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.263.1109178111
datafile 51 switched to datafile copy
input datafile copy RECID=224 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/datafile/undotbs2.264.1109178457
datafile 52 switched to datafile copy
input datafile copy RECID=225 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/datafile/users.284.1109186395
datafile 53 switched to datafile copy
input datafile copy RECID=226 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/datafile/users.285.1109186791
datafile 54 switched to datafile copy
input datafile copy RECID=227 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/datafile/users.286.1109187157
datafile 55 switched to datafile copy
input datafile copy RECID=228 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/datafile/users.287.1109187493
datafile 56 switched to datafile copy
input datafile copy RECID=229 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/users31.dbf
datafile 57 switched to datafile copy
input datafile copy RECID=230 STAMP=1115827370 file name=/u01/app/oracle/oradata/csdb/users32.dbf
Finished Duplicate Db at 19-SEP-22

Oracle Linux 6.7 静默认安装Oracle 11g

Oracle Linux 6.7 静默认安装Oracle 11g
一. 软件版本
操作系统:Oracle Linux 6.7
数据库软件:Oracle Database Enterprise 11.2.4.0

二·安装环境准备
2.1修改IP地址

[root@sjjh ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:50:56:A3:94:C1
TYPE=Ethernet
UUID=d2f38815-5bc0-4ce4-8bdb-bbd48992ebe6
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=10.10.10.101
NETMASK=255.255.255.0
GATEWAY=10.10.10.254

2.2关闭防火墙和SELinux

[root@sjjh ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: nat mangle filter [  OK  ]
iptables: Flushing firewall rules: [  OK  ]
iptables: Unloading modules: [  OK  ]
[root@sjjh ~]# chkconfig iptables off
[root@sjjh ~]# chkconfig libvirtd off
[root@sjjh ~]# chkconfig |grep libvirtd
libvirtd        0:off   1:off   2:off   3:off   4:off   5:off   6:off

2.3 配置本地YUM

[root@sjjh udev]# cd /etc/yum.repos.d/
[root@sjjh yum.repos.d]# ls -lrt
total 8
-rw-r--r--. 1 root root 4949 Sep 18 07:37 public-yum-ol6.repo
[root@sjjh yum.repos.d]# mv public-yum-ol6.repo public-yum-ol6.repo.bak
[root@sjjh yum.repos.d]# mkdir /mnt/vcdrom
[root@sjjh yum.repos.d]# mount -o loop -t iso9660  /soft/Oracle_Linux_Release_6_Update_7_for_x86_64.iso /mnt/vcdrom
[root@sjjh yum.repos.d]# echo "[base]
> name=jy
> baseurl=file:///mnt/vcdrom/
> gpgcheck=0
> enabled=1" > jy.repo

[root@sjjh yum.repos.d]# cat jy.repo
[base]
name=jy
baseurl=file:///mnt/cdrom/
gpgcheck=0
enabled=1

[root@sjjh yum.repos.d]# yum clean all
Loaded plugins: aliases, changelog, kabi, presto, refresh-packagekit, security, tmprepo, ulninfo, verify, versionlock
Loading support for kernel ABI
Cleaning repos: base
Cleaning up Everything
0 delta-package files removed, by presto

2.4创建用户和组
创建用户组

[root@sjjh yum.repos.d]# groupadd -g 54321 oinstall
[root@sjjh yum.repos.d]# groupadd -g 54322 dba
[root@sjjh yum.repos.d]# groupadd -g 54323 oper
[root@sjjh yum.repos.d]# groupadd -g 54324 backupdba
[root@sjjh yum.repos.d]# groupadd -g 54325 dgdba
[root@sjjh yum.repos.d]# groupadd -g 54326 kmdba
[root@sjjh yum.repos.d]# groupadd -g 54327 asmdba
[root@sjjh yum.repos.d]# groupadd -g 54328 asmoper
[root@sjjh yum.repos.d]# groupadd -g 54329 asmadmin
[root@sjjh yum.repos.d]# groupadd -g 54330 racdba
[root@sjjh yum.repos.d]# grep 543 /etc/group
oinstall:x:54321:
dba:x:54322:oracle
oper:x:54323:
backupdba:x:54324:
dgdba:x:54325:
kmdba:x:54326:
asmdba:x:54327:
asmoper:x:54328:
asmadmin:x:54329:
racdba:x:54330:

创建用户

[root@sjjh home]# useradd -u 54321 -g oinstall -G dba,asmadmin,asmdba,asmoper,backupdba,dgdba,kmdba,racdba,oper oracle
[root@sjjh home]# passwd oracle
Changing password for user oracle.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

2.5创建相关目录

[root@sjjh home]# mkdir -p /u01/tmp
[root@sjjh home]# mkdir -p /u01/app/oracle/product/11.2.0.4/db
[root@sjjh home]# mkdir -p /u01/app/oraInventory
[root@sjjh home]# mkdir -p /u01/app/oracle/oradata
[root@sjjh home]# chown -R oracle:oinstall /u01
[root@sjjh home]# chmod -R 775 /u01

2.6安装软件包

[root@sjjh /]# yum install -y binutils compat-libcap1 compat-libstdc++-33 e2fsprogs e2fsprogs-libs elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC ksh libX11 libXau libXi libXtst libxcb smartmontools unixODBC-devel net-tools compat-libstdc++-33* unzip vim* perl
Loaded plugins: aliases, changelog, kabi, presto, refresh-packagekit, security, tmprepo, ulninfo, verify, versionlock
Loading support for kernel ABI
Setting up Install Process
base                                                                                                                                                                                                                | 3.7 kB     00:00 ...
base/primary_db                                                                                                                                                                                                     | 3.0 MB     00:00 ...
Package binutils-2.20.51.0.2-5.43.el6.x86_64 already installed and latest version
Package compat-libcap1-1.10-1.x86_64 already installed and latest version
Package compat-libstdc++-33-3.2.3-69.el6.x86_64 already installed and latest version
Package e2fsprogs-1.42.8-1.0.2.el6.x86_64 already installed and latest version
Package e2fsprogs-libs-1.42.8-1.0.2.el6.x86_64 already installed and latest version
Package elfutils-libelf-0.161-3.el6.x86_64 already installed and latest version
Package elfutils-libelf-devel-0.161-3.el6.x86_64 already installed and latest version
Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
Package gcc-c++-4.4.7-16.el6.x86_64 already installed and latest version
Package glibc-2.12-1.166.el6.x86_64 already installed and latest version
Package glibc-devel-2.12-1.166.el6.x86_64 already installed and latest version
Package libaio-0.3.107-10.el6.x86_64 already installed and latest version
Package libaio-devel-0.3.107-10.el6.x86_64 already installed and latest version
Package libgcc-4.4.7-16.el6.x86_64 already installed and latest version
Package libstdc++-4.4.7-16.el6.x86_64 already installed and latest version
Package libstdc++-devel-4.4.7-16.el6.x86_64 already installed and latest version
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Package sysstat-9.0.4-27.el6.x86_64 already installed and latest version
Package unixODBC-2.2.14-14.el6.x86_64 already installed and latest version
Package ksh-20120801-28.el6.x86_64 already installed and latest version
Package libX11-1.6.0-6.el6.x86_64 already installed and latest version
Package libXau-1.0.6-4.el6.x86_64 already installed and latest version
Package libXi-1.7.2-2.2.el6.x86_64 already installed and latest version
Package libXtst-1.2.2-2.1.el6.x86_64 already installed and latest version
Package libxcb-1.9.1-3.el6.x86_64 already installed and latest version
Package 1:smartmontools-5.43-1.el6.x86_64 already installed and latest version
Package unixODBC-devel-2.2.14-14.el6.x86_64 already installed and latest version
Package net-tools-1.60-110.el6_2.x86_64 already installed and latest version
Package compat-libstdc++-33-3.2.3-69.el6.x86_64 already installed and latest version
Package unzip-6.0-2.el6_6.x86_64 already installed and latest version
Package 2:vim-minimal-7.4.629-5.el6.x86_64 already installed and latest version
Package 2:vim-filesystem-7.4.629-5.el6.x86_64 already installed and latest version
Package 2:vim-common-7.4.629-5.el6.x86_64 already installed and latest version
Package 2:vim-X11-7.4.629-5.el6.x86_64 already installed and latest version
Package 2:vim-enhanced-7.4.629-5.el6.x86_64 already installed and latest version
Package 4:perl-5.10.1-141.el6.x86_64 already installed and latest version
Nothing to do

检查已经安装的软件包

[root@sjjh /]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils compat-libcap1 compat-libstdc++-33 e2fsprogs e2fsprogs-libs elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC ksh libX11 libXau libXi libXtst libxcb smartmontools unixODBC-devel net-tools unzip vim* perl
binutils-2.20.51.0.2-5.43.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
e2fsprogs-1.42.8-1.0.2.el6 (x86_64)
e2fsprogs-libs-1.42.8-1.0.2.el6 (x86_64)
elfutils-libelf-0.161-3.el6 (x86_64)
elfutils-libelf-devel-0.161-3.el6 (x86_64)
gcc-4.4.7-16.el6 (x86_64)
gcc-c++-4.4.7-16.el6 (x86_64)
glibc-2.12-1.166.el6 (x86_64)
glibc-2.12-1.166.el6 (i686)
glibc-devel-2.12-1.166.el6 (x86_64)
libaio-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (x86_64)
libgcc-4.4.7-16.el6 (x86_64)
libgcc-4.4.7-16.el6 (i686)
libstdc++-4.4.7-16.el6 (x86_64)
libstdc++-devel-4.4.7-16.el6 (x86_64)
make-3.81-20.el6 (x86_64)
sysstat-9.0.4-27.el6 (x86_64)
unixODBC-2.2.14-14.el6 (x86_64)
ksh-20120801-28.el6 (x86_64)
libX11-1.6.0-6.el6 (x86_64)
libXau-1.0.6-4.el6 (x86_64)
libXi-1.7.2-2.2.el6 (x86_64)
libXtst-1.2.2-2.1.el6 (x86_64)
libxcb-1.9.1-3.el6 (x86_64)
smartmontools-5.43-1.el6 (x86_64)
unixODBC-devel-2.2.14-14.el6 (x86_64)
net-tools-1.60-110.el6_2 (x86_64)
unzip-6.0-2.el6_6 (x86_64)
package vim* is not installed
perl-5.10.1-141.el6 (x86_64)

2.7编辑hosts文件

[root@sjjh /]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.10.10.101 sjjh

2.8 修改系统内核参数

[root@sjjh /]# cat >> /etc/sysctl.conf < kernel.shmall = 4294967296
> kernel.sem = 250 32000 100 128
> kernel.shmmni = 4096
> kernel.shmmax = 429496729600
> net.ipv4.ip_local_port_range = 9000 65500
> net.core.rmem_default = 1048576
> net.core.rmem_max = 4194304
> net.core.wmem_default = 262144
> net.core.wmem_max = 1048576
> fs.file-max = 6815744
> fs.aio-max-nr = 1048576
> vm.swappiness = 0
> vm.dirty_background_ratio = 3
> vm.dirty_ratio = 20
> vm.dirty_expire_centisecs = 500
> vm.dirty_writeback_centisecs = 100
> vm.min_free_kbytes=524288
> net.ipv4.tcp_sack = 0
> net.ipv4.tcp_timestamps = 0
> net.ipv4.conf.default.rp_filter = 0
> net.ipv4.tcp_wmem = 262144
> net.ipv4.tcp_rmem = 4194304
> net.ipv4.ipfrag_high_thresh = 16777216
> net.ipv4.ipfrag_low_thresh = 15728640
> net.ipv4.ipfrag_time=60
> EOF

[root@sjjh /]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmall = 4294967296
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
kernel.shmall = 4294967296
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmmax = 429496729600
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 20
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
vm.min_free_kbytes = 524288
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.tcp_wmem = 262144
net.ipv4.tcp_rmem = 4194304
net.ipv4.ipfrag_high_thresh = 16777216
net.ipv4.ipfrag_low_thresh = 15728640
net.ipv4.ipfrag_time = 60

2.9 配置LIMITS限制参数

[root@sjjh /]# cat >> /etc/security/limits.conf < oracle          soft    nproc           16384
> oracle          hard    nproc           16384
> oracle          soft    nofile          65536
> oracle          hard    nofile          65536
> oracle          soft    memlock         26843545
> oracle          hard    memlock         26843545
> oracle          soft    stack           10240
> oracle          hard    stack           32768
> EOF

2.10配置PAM

[root@sjjh /]# echo "session    required     /lib64/security/pam_limits.so">>/etc/pam.d/login

2.11 配置系统环境变量

[root@sjjh /]# cat >> /etc/profile < if [ \$USER = "oracle" ]; then
>     if [ \$SHELL = "/bin/ksh" ]; then
>         ulimit -p 16384
>         ulimit -n 65536
>     else
>         ulimit -u 16384 -n 65536
>     fi
> fi
> EOF

2.11 配置oracle用户环境变量

[oracle@sjjh ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH


TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db
export ORACLE_SID=sjjh
export ORACLE_UNQNAME=sjjh
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib

[oracle@sjjh ~]$ source .bash_profile
[oracle@sjjh ~]$ echo $ORACLE_SID
sjjh

三·安装数据库软件
3.1解压安装包

[root@sjjh soft]# unzip p13390677_112040_Linux-x86-64_1of7.zip
[root@sjjh soft]# unzip p13390677_112040_Linux-x86-64_2of7.zip

3.2编写响应文件

[oracle@sjjh ~]$ vi dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=sjjh
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=sjjh
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=false
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet=
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

3.3执行安装

[oracle@sjjh database]$ ./runInstaller -silent  -force -noconfig  -ignorePrereq -responseFile /home/oracle/dbinstall.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 1731157 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 16383 MB    Passed
Preparing to launch Oracle Universal Installer from /u01/tmp/OraInstall2022-09-18_10-03-38AM. Please wait ...[oracle@sjjh database]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2022-09-18_10-03-38AM.log


[oracle@sjjh database]$ ./runInstaller -silent  -force -noconfig  -ignorePrereq -responseFile /home/oracle/dbinstall.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 1731157 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 16383 MB    Passed
Preparing to launch Oracle Universal Installer from /u01/tmp/OraInstall2022-09-18_10-03-38AM. Please wait ...[oracle@sjjh database]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2022-09-18_10-03-38AM.log
The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2022-09-18_10-03-38AM.log' for more details.

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/11.2.0.4/db/root.sh


Successfully Setup Software.

3.4执行root.sh脚本

[root@sjjh /]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@sjjh /]# /u01/app/oracle/product/11.2.0.4/db/root.sh
Check /u01/app/oracle/product/11.2.0.4/db/install/root_sjjh_2022-09-18_10-11-40.log for the output of root script

四·创建数据库

4.1 配置监听

[oracle@sjjh ~]$ vi netca.rsp
[GENERAL]
RESPONSEFILE_VERSION="11.2"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}

[oracle@sjjh ~]$ netca -silent -responsefile /home/oracle/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/oracle/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control:
      /u01/app/oracle/product/11.2.0.4/db/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
[oracle@sjjh ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 18-SEP-2022 10:14:34

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                18-SEP-2022 10:14:19
Uptime                    0 days 0 hr. 0 min. 15 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/sjjh/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sjjh)(PORT=1521)))
The listener supports no services
The command completed successfully

4.2创建配置数据库的响应文件

[oracle@sjjh ~]$ vi dbca.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "sjjh"
SID = "sjjh"
DB_UNIQUE_NAME = "sjjhp"
TEMPLATENAME = "General_Purpose.dbc"
characterSet = "ZHS16GBK"
nationalCharacterSet = "AL16UTF16"
sysPassword="xxzx7817600"
systemPassword="xxzx7817600"
storageType = "FS"
datafileDestination=/u01/app/oracle/oradata
recoveryAreaDestination=/u01/app/oracle/flash_recovery_area
totalMemory=2048
sampleSchema=TRUE

4.3 创建数据库

[oracle@sjjh ~]$ dbca -silent  -createDatabase -responseFile /home/oracle/dbca.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
57% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/sjjh/sjjh.log" for further details.

[oracle@sjjh ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 18-SEP-2022 10:52:25

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                18-SEP-2022 10:14:19
Uptime                    0 days 0 hr. 38 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/sjjh/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sjjh)(PORT=1521)))
Services Summary...
Service "sjjh" has 1 instance(s).
  Instance "sjjh", status READY, has 1 handler(s) for this service...
Service "sjjhXDB" has 1 instance(s).
  Instance "sjjh", status READY, has 1 handler(s) for this service...
The command completed successfully

[oracle@sjjh ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Sep 18 10:53:07 2022

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter unique

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      sjjh
SQL>

MySQL 5.7配置SSL连接

MySQL 5.7配置SSL连接

如果想服务能够部署自动支持安全连接,使用mysql_ssl_rsa_setup工具来创建缺省SSL与RSA文件

[root@cs2 bin]# ./mysql_ssl_rsa_setup --datadir=/mysqldata/mysql
Generating a 2048 bit RSA private key
......................................................................+++
..............................................................+++
writing new private key to 'ca-key.pem'
-----
Generating a 2048 bit RSA private key
.............+++
..............+++
writing new private key to 'server-key.pem'
-----
Generating a 2048 bit RSA private key
.....................................+++
................................................+++
writing new private key to 'client-key.pem'
-----





启动mysql

[root@cs2 ~]# service mysqld start
Starting MySQL.. SUCCESS!

测试远程登录

-bash-4.2$ mysql -h 10.11.13.19 -P 3306 -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT DISTINCT CONCAT('User: [', user, '''@''', host, '];') AS USER_HOST FROM user;
+------------------------------------+
| USER_HOST                          |
+------------------------------------+
| User: [root'@'%];                  |
| User: [mysql.session'@'localhost]; |
| User: [mysql.sys'@'localhost];     |
+------------------------------------+
3 rows in set (0.05 sec)

通过ssl登录mysql服务器

[mysql@localhost ~]$ mysql -h 10.11.13.19 -P 3306 -u root -pabcd123 --ssl-cert=client-cert.pem --ssl-key=client-key.pem
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.26-log Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \s
--------------
mysql  Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using  EditLine wrapper

Connection id:          7
Current database:
Current user:           root@10.11.13.19
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.7.26-log Source distribution
Protocol version:       10
Connection:             10.11.13.19 via TCP/IP
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    gb2312
Conn.  characterset:    gb2312
TCP port:               3306
Uptime:                 14 min 11 sec

Threads: 2  Questions: 13  Slow queries: 0  Opens: 108  Flush tables: 1  Open tables: 101  Queries per second avg: 0.015
--------------

mysql> show variables like 'have_ssl';
+---------------+----------+
| Variable_name | Value    |
+---------------+----------+
| have_ssl      | DISABLED |
+---------------+----------+
1 row in set (0.01 sec)

mysql> show variables like 'require_secure_transport';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| require_secure_transport | OFF   |
+--------------------------+-------+
1 row in set (0.00 sec)

mysql> show variables like '%ssl%';
+---------------+-----------------+
| Variable_name | Value           |
+---------------+-----------------+
| have_openssl  | DISABLED        |
| have_ssl      | DISABLED        |
| ssl_ca        | ca.pem          |
| ssl_capath    |                 |
| ssl_cert      | server-cert.pem |
| ssl_cipher    |                 |
| ssl_crl       |                 |
| ssl_crlpath   |                 |
| ssl_key       | server-key.pem  |
+---------------+-----------------+

从上面的查询结果可以看到SSL: Not in use,have_ssl和have_openssl为DISABLED,这说明实际上是没有启用ssl。

这是因为通过执行mysql_ssl_rsa_setup命令产生的pem文件的权限为root用户而不是mysql用户造成的,将这些pem文件的权限修改为mysql用户与组 权限不要太大,只用户权限为rw,组与其它用户需要r权限

[root@localhost mysql]# ls -lrt
30172
-rw-r-----. 1 mysql mysql 104857600 321 16:25 ib_logfile1
-rw-r-----. 1 mysql mysql 104857600 321 16:25 ib_logfile2
drwxr-x---. 2 mysql mysql        48 321 16:25 undo
-rw-r-----. 1 mysql mysql        56 321 16:25 auto.cnf
drwxr-x---. 2 mysql mysql      8192 321 16:25 performance_schema
drwxr-x---. 2 mysql mysql      4096 321 16:25 mysql
drwxr-x---. 2 mysql mysql      8192 321 16:25 sys
-rw-r-----. 1 mysql mysql       177 321 16:25 binlog.000001
-rw-r--r--. 1 mysql mysql      1679 321 16:26 ca-key.pem
-rw-r--r--. 1 mysql mysql      1107 321 16:26 ca.pem
-rw-r--r--. 1 root  root       1679 321 16:26 server-key.pem
-rw-r--r--. 1 root  root       1107 321 16:26 server-cert.pem
-rw-r--r--. 1 root  root      1675 321 16:26 client-key.pem
-rw-r--r--. 1 root  root      1107 321 16:26 client-cert.pem
-rw-r--r--. 1 root  root      1675 321 16:26 private_key.pem
-rw-r--r--. 1 root  root       451 321 16:26 public_key.pem
-rw-r-----. 1 mysql mysql    114688 524 17:00 ts2.ibd
-rw-r-----. 1 mysql mysql     98304 524 17:01 ts1.ibd
drwxr-x---. 2 mysql mysql        32 524 17:11 test
-rw-r-----. 1 mysql mysql      9352 621 10:46 binlog.000002
-rw-r-----. 1 mysql mysql       177 621 10:46 binlog.000003
-rw-r-----. 1 mysql mysql       154 9 9 19:55 binlog.000004
-rw-r-----. 1 mysql mysql       177 9 9 20:23 binlog.000005
-rw-r-----. 1 mysql mysql       177 9 9 20:38 binlog.000006
-rw-r-----. 1 mysql mysql       177 9 9 20:44 binlog.000007
-rw-r-----. 1 mysql mysql       122 9 9 20:44 ib_buffer_pool
-rw-r-----. 1 mysql mysql       248 9 9 20:44 binlog.index
-rw-r-----. 1 mysql mysql       154 9 9 20:44 binlog.000008
-rw-r-----. 1 mysql mysql         6 9 9 20:44 mysqld.pid
-rw-r-----. 1 mysql mysql  12582912 9 9 20:44 ibtmp1
-rw-r-----. 1 mysql mysql  10485760 9 9 20:44 ibdata1
-rw-r-----. 1 mysql mysql 104857600 9 9 20:44 ib_logfile0
-rw-r-----. 1 mysql mysql    107011 9 9 20:54 mysql.err

[root@localhost mysql]# chown -R mysql:mysql *.pem
[root@localhost mysql]# ls -lrt
30172
-rw-r-----. 1 mysql mysql 104857600 321 16:25 ib_logfile1
-rw-r-----. 1 mysql mysql 104857600 321 16:25 ib_logfile2
drwxr-x---. 2 mysql mysql        48 321 16:25 undo
-rw-r-----. 1 mysql mysql        56 321 16:25 auto.cnf
drwxr-x---. 2 mysql mysql      8192 321 16:25 performance_schema
drwxr-x---. 2 mysql mysql      4096 321 16:25 mysql
drwxr-x---. 2 mysql mysql      8192 321 16:25 sys
-rw-r-----. 1 mysql mysql       177 321 16:25 binlog.000001
-rw-r--r--. 1 mysql mysql      1679 321 16:26 ca-key.pem
-rw-r--r--. 1 mysql mysql      1107 321 16:26 ca.pem
-rw-r--r--. 1 mysql mysql      1679 321 16:26 server-key.pem
-rw-r--r--. 1 mysql mysql      1107 321 16:26 server-cert.pem
-rw-r--r--. 1 mysql mysql      1675 321 16:26 client-key.pem
-rw-r--r--. 1 mysql mysql      1107 321 16:26 client-cert.pem
-rw-r--r--. 1 mysql mysql      1675 321 16:26 private_key.pem
-rw-r--r--. 1 mysql mysql       451 321 16:26 public_key.pem
-rw-r-----. 1 mysql mysql    114688 524 17:00 ts2.ibd
-rw-r-----. 1 mysql mysql     98304 524 17:01 ts1.ibd
drwxr-x---. 2 mysql mysql        32 524 17:11 test
-rw-r-----. 1 mysql mysql      9352 621 10:46 binlog.000002
-rw-r-----. 1 mysql mysql       177 621 10:46 binlog.000003
-rw-r-----. 1 mysql mysql       154 9 9 19:55 binlog.000004
-rw-r-----. 1 mysql mysql       177 9 9 20:23 binlog.000005
-rw-r-----. 1 mysql mysql       177 9 9 20:38 binlog.000006
-rw-r-----. 1 mysql mysql       177 9 9 20:44 binlog.000007
-rw-r-----. 1 mysql mysql       122 9 9 20:44 ib_buffer_pool
-rw-r-----. 1 mysql mysql       248 9 9 20:44 binlog.index
-rw-r-----. 1 mysql mysql       154 9 9 20:44 binlog.000008
-rw-r-----. 1 mysql mysql         6 9 9 20:44 mysqld.pid
-rw-r-----. 1 mysql mysql  12582912 9 9 20:44 ibtmp1
-rw-r-----. 1 mysql mysql  10485760 9 9 20:44 ibdata1
-rw-r-----. 1 mysql mysql 104857600 9 9 20:44 ib_logfile0
-rw-r-----. 1 mysql mysql    107011 9 9 20:54 mysql.err

pem文件权限太多可能会出现如下错误

[mysql@localhost mysql]$ mysql -h 10.11.13.19 -P 3306 -u root -pabcd123 --ssl-cert=/mysqldata/mysql/client-cert.pem --ssl-key=/mysqldata/mysql/client-key.pem
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2026 (HY000): SSL connection error: SSL_CTX_set_default_verify_paths failed


[root@localhost mysql]# service mysqld restart
Shutting down MySQL.. SUCCESS!
Starting MySQL.. SUCCESS!

[mysql@localhost mysql]$ mysql -h 10.11.13.19 -P 3306 -u root -pabcd123 --ssl-cert=/mysqldata/mysql/client-cert.pem --ssl-key=/mysqldata/mysql/client-key.pem
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.26-log Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \s
--------------
mysql  Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using  EditLine wrapper

Connection id:          4
Current database:
Current user:           root@10.11.13.19
SSL:                    Cipher in use is DHE-RSA-AES256-SHA
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.7.26-log Source distribution
Protocol version:       10
Connection:             10.11.13.19 via TCP/IP
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    gb2312
Conn.  characterset:    gb2312
TCP port:               3306
Uptime:                 59 sec

Threads: 2  Questions: 11  Slow queries: 0  Opens: 108  Flush tables: 1  Open tables: 101  Queries per second avg: 0.186
--------------

创建用户限制用户必须用ssl登录

mysql> create user 'jy'@'%' identified by "123";
Query OK, 0 rows affected (0.02 sec)

mysql> grant all on *.* to 'jy'@'%' require ssl;
Query OK, 0 rows affected, 1 warning (0.02 sec)

虽然要求用ssl但是还是可以使用密码登录,是因为mysql.user表中的ssl_type=ANY

[mysql@localhost ~]$  mysql -h 10.11.13.19 -P 3306 -u jy -p123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.26-log Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \s
--------------
mysql  Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using  EditLine wrapper

Connection id:          7
Current database:
Current user:           jy@10.11.13.19
SSL:                    Cipher in use is DHE-RSA-AES256-SHA
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.7.26-log Source distribution
Protocol version:       10
Connection:             10.11.13.19 via TCP/IP
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    gb2312
Conn.  characterset:    gb2312
TCP port:               3306
Uptime:                 50 min 18 sec

Threads: 2  Questions: 69  Slow queries: 0  Opens: 139  Flush tables: 1  Open tables: 132  Queries per second avg: 0.022
--------------

mysql> select * from user where user='jy'\G
ERROR 1046 (3D000): No database selected
mysql> select * from mysql.user where user='root'\G
*************************** 1. row ***************************
                  Host: %
                  User: jy
           Select_priv: Y
           Insert_priv: Y
           Update_priv: Y
           Delete_priv: Y
           Create_priv: Y
             Drop_priv: Y
           Reload_priv: Y
         Shutdown_priv: Y
          Process_priv: Y
             File_priv: Y
            Grant_priv: Y
       References_priv: Y
            Index_priv: Y
            Alter_priv: Y
          Show_db_priv: Y
            Super_priv: Y
 Create_tmp_table_priv: Y
      Lock_tables_priv: Y
          Execute_priv: Y
       Repl_slave_priv: Y
      Repl_client_priv: Y
      Create_view_priv: Y
        Show_view_priv: Y
   Create_routine_priv: Y
    Alter_routine_priv: Y
      Create_user_priv: Y
            Event_priv: Y
          Trigger_priv: Y
Create_tablespace_priv: Y
              ssl_type: ANY
            ssl_cipher:
           x509_issuer:
          x509_subject:
         max_questions: 0
           max_updates: 0
       max_connections: 0
  max_user_connections: 0
                plugin: mysql_native_password
 authentication_string: *1AA476D99C1600C9D984E248FBF2FDE3A0BB256E
      password_expired: N
 password_last_changed: 2022-03-21 16:27:48
     password_lifetime: NULL
        account_locked: N
1 row in set (0.00 sec)

修改用户jy的ssl类型为x509

mysql> alter user 'jy'@'%' require x509
    -> ;
Query OK, 0 rows affected (0.01 sec)

在不指定ssl密钥时就不能登录了

[mysql@localhost ~]$ mysql -h 10.11.13.19 -P 3306 -u jy -p123
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'jy'@'10.11.13.19' (using password: YES)
[mysql@localhost ~]$  mysql -h 10.11.13.19 -P 3306 -u jy -p123 --ssl
mysql: [Warning] Using a password on the command line interface can be insecure.
WARNING: --ssl is deprecated and will be removed in a future version. Use --ssl-mode instead.
ERROR 1045 (28000): Access denied for user 'jy'@'10.11.13.19' (using password: YES)

指定ssl密钥进行登录

[mysql@localhost ~]$  mysql -h 10.11.13.19 -P 3306 -u jy -p123 --ssl-cert=/mysqldata/mysql/client-cert.pem --ssl-key=/mysqldata/mysql/client-key.pem
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.7.26-log Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit

如果指定ssl密钥进行登录时不指定密钥完整路径时会出现如下错误

[mysql@localhost ~]$  mysql -h 10.11.13.19 -P 3306 -u jy -p123 --ssl-cert=client-cert.pem --ssl-key=client-key.pem
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [ERROR] SSL error: Unable to get certificate from 'client-cert.pem'
ERROR 2026 (HY000): SSL connection error: Unable to get certificate

Oracle Linux 7.1 静默安装Oracle 18c RAC

Oracle Linux 7.1 静默安装Oracle 18c RAC
一·系统环境规则

1.1网络架构

                         节点1                        节点2
主机名                   18c1                         18c2               
Private IP            88.88.87.1                 88.88.87.2             
Public IP             10.10.13.171             10.10.13.172
VIP                   10.10.13.173             10.10.13.174
SCANIP                10.10.13.175/176/177   
SCAN_NAME             scan-18c

1.2 存储

共享磁盘                ASM磁盘                ASM磁盘组                 大小         冗余
/dev/sdb                /dev/asmdisk1          OCR                       50G          外部
/dev/sdc                /dev/asmdisk2          DATA                      50G          外部

1.3 软件版本
操作系统:Oracle Linux 7.1
集群软件: Oracle Clusterware 18.0.0
数据库软件:Oracle Database Enterprise 18.0.0

二·安装环境准备
2.1修改主机名和IP地址
修改主机名

[root@localhost ~]# hostnamectl set-hostname 18c1
[root@localhost ~]# hostnamectl set-hostname 18c2

2.2修改Private IP地址

[root@18c1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens33
UUID=934ab90a-5e97-496c-bd50-65cddd0a838f
DEVICE=ens33
ONBOOT=yes
IPADDR=88.88.87.1
NETMASK=255.255.255.0



[root@18c2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens33
UUID=934ab90a-5e97-496c-bd50-65cddd0a838f
DEVICE=ens33
ONBOOT=yes
IPADDR=88.88.87.2
NETMASK=255.255.255.0

2.3 修改Public IP地址

[root@18c1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens32
UUID=79732427-976c-4d80-b58d-dd81d62ebd17
DEVICE=ens32
ONBOOT=yes
IPADDR=10.10.13.171
NETMASK=255.255.255.0
GATEWAY=10.10.13.254

[root@18c2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens32
UUID=79732427-976c-4d80-b58d-dd81d62ebd17
DEVICE=ens32
ONBOOT=yes
IPADDR=10.10.13.172
NETMASK=255.255.255.0
GATEWAY=10.10.13.254

2.4 关闭时间同步服务

[root@18c1 ~]# systemctl stop chronyd
[root@18c1 ~]# systemctl disable chronyd
rm '/etc/systemd/system/multi-user.target.wants/chronyd.service'
[root@18c1 ~]# mv /etc/chrony.conf /etc/chrony.conf.bak


[root@18c2 ~]# systemctl stop chronyd
[root@18c2 ~]# systemctl disable chronyd
rm '/etc/systemd/system/multi-user.target.wants/chronyd.service'
[root@18c2 ~]# mv /etc/chrony.conf /etc/chrony.conf.bak

2.5关闭防火墙和SELinux

[root@18c1 ~]# setenforce 0
[root@18c1 ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@18c1 ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 


[root@18c2 ~]# setenforce 0
[root@18c2 ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@18c2 ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

2.6 配置本地YUM

[root@18c1 ~]# ls -lrt /etc/yum.repos.d/
total 4
-rw-r--r--. 1 root root 2323 Feb 16  2015 public-yum-ol7.repo
[root@18c1 ~]# mv /etc/yum.repos.d/public-yum-ol7.repo /etc/yum.repos.d/public-yum-ol7.repo.bak
[root@18c1 ~]# cat >> /etc/yum.repos.d/jy.repo < [base]
> name=jy
> baseurl=file:///run/media/root/OL-7.1\ Server.x86_64/  
> enabled=1
> gpgcheck=0
> multilib_policy=all
> EOF
[root@18c1 ~]# cat /etc/yum.repos.d/jy.repo
[base]
name=jy
baseurl=file:///run/media/root/OL-7.1\ Server.x86_64/  
enabled=1
gpgcheck=0
multilib_policy=all

[root@18c1 ~]# yum clean all
Loaded plugins: langpacks
Cleaning repos: base
Cleaning up everything
[root@18c1 ~]# yum makecache
Loaded plugins: langpacks
base                                                                                                                                                                                                                | 3.6 kB  00:00:00     
(1/4): base/group_gz                                                                                                                                                                                                | 134 kB  00:00:00     
(2/4): base/filelists_db                                                                                                                                                                                            | 3.4 MB  00:00:00     
(3/4): base/primary_db                                                                                                                                                                                              | 4.0 MB  00:00:00     
(4/4): base/other_db                                                                                                                                                                                                | 1.3 MB  00:00:00     
Metadata Cache Created



[root@18c2 ~]# ls -lrt /etc/yum.repos.d/
total 4
-rw-r--r--. 1 root root 2323 Feb 16  2015 public-yum-ol7.repo
[root@18c2 ~]# mv /etc/yum.repos.d/public-yum-ol7.repo /etc/yum.repos.d/public-yum-ol7.repo.bak
[root@18c2 ~]# cat >> /etc/yum.repos.d/jy.repo < [base]
> name=jy
> baseurl=file:///run/media/root/OL-7.1\ Server.x86_64/  
> enabled=1
> gpgcheck=0
> multilib_policy=all
> EOF
[root@18c2 ~]# cat /etc/yum.repos.d/jy.repo
[base]
name=jy
baseurl=file:///run/media/root/OL-7.1\ Server.x86_64/  
enabled=1
gpgcheck=0
multilib_policy=all



[root@18c2 ~]# yum makecache
Loaded plugins: langpacks
base                                                                                                                                                                                                                | 3.6 kB  00:00:00     
(1/4): base/group_gz                                                                                                                                                                                                | 134 kB  00:00:00     
(2/4): base/filelists_db                                                                                                                                                                                            | 3.4 MB  00:00:00     
(3/4): base/primary_db                                                                                                                                                                                              | 4.0 MB  00:00:00     
(4/4): base/other_db                                                                                                                                                                                                | 1.3 MB  00:00:00     
Metadata Cache Created

2.7 禁用NTP

[root@18c1 ~]# systemctl stop ntpd.service
[root@18c1 ~]# systemctl disable ntpd.service

[root@18c2 ~]# systemctl stop ntpd.service
[root@18c2 ~]# systemctl disable ntpd.service

2.8创建用户和组
创建用户组

[root@18c1 ~]# groupadd -g 54321 oinstall
[root@18c1 ~]# groupadd -g 54322 dba
[root@18c1 ~]# groupadd -g 54323 oper
[root@18c1 ~]# groupadd -g 54324 backupdba
[root@18c1 ~]# groupadd -g 54325 dgdba
[root@18c1 ~]# groupadd -g 54326 kmdba
[root@18c1 ~]# groupadd -g 54327 asmdba
[root@18c1 ~]# groupadd -g 54328 asmoper
[root@18c1 ~]# groupadd -g 54329 asmadmin
[root@18c1 ~]# groupadd -g 54330 racdba

[root@18c1 ~]# grep 543 /etc/group
oinstall:x:54321:
dba:x:54322:
oper:x:54323:
backupdba:x:54324:
dgdba:x:54325:
kmdba:x:54326:
asmdba:x:54327:
asmoper:x:54328:
asmadmin:x:54329:
racdba:x:54330:

[root@18c2 ~]# groupadd -g 54321 oinstall
[root@18c2 ~]# groupadd -g 54322 dba
[root@18c2 ~]# groupadd -g 54323 oper
[root@18c2 ~]# groupadd -g 54324 backupdba
[root@18c2 ~]# groupadd -g 54325 dgdba
[root@18c2 ~]# groupadd -g 54326 kmdba
[root@18c2 ~]# groupadd -g 54327 asmdba
[root@18c2 ~]# groupadd -g 54328 asmoper
[root@18c2 ~]# groupadd -g 54329 asmadmin
[root@18c2 ~]# groupadd -g 54330 racdba
[root@18c2 ~]# grep 543 /etc/group
oinstall:x:54321:
dba:x:54322:
oper:x:54323:
backupdba:x:54324:
dgdba:x:54325:
kmdba:x:54326:
asmdba:x:54327:
asmoper:x:54328:
asmadmin:x:54329:
racdba:x:54330:

创建用户

[root@18c1 ~]# useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,racdba grid
[root@18c1 ~]# useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
[root@18c1 ~]# passwd grid
Changing password for user grid.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@18c1 ~]# passwd oracle
Changing password for user oracle.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.


[root@18c2 ~]# useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,racdba grid
[root@18c2 ~]# useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
[root@18c2 ~]# passwd grid
Changing password for user grid.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@18c2 ~]# passwd oracle
Changing password for user oracle.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.

2.9创建相关目录

[root@18c1 ~]# mkdir -p /u01/tmp
[root@18c1 ~]# mkdir -p /u01/app/18.3/grid
[root@18c1 ~]# mkdir -p /u01/app/grid
[root@18c1 ~]# mkdir -p /u01/app/oracle/product/18.3/db
[root@18c1 ~]# mkdir -p /u01/app/oraInventory
[root@18c1 ~]# chown -R grid:oinstall /u01
[root@18c1 ~]# chown oracle:oinstall /u01/app/oracle
[root@18c1 ~]# chmod -R 775 /u01/

[root@18c2 ~]# mkdir -p /u01/tmp
[root@18c2 ~]# mkdir -p /u01/app/18.3/grid
[root@18c2 ~]# mkdir -p /u01/app/grid
[root@18c2 ~]# mkdir -p /u01/app/oracle/product/18.3/db
[root@18c2 ~]# mkdir -p /u01/app/oraInventory
[root@18c2 ~]# chown -R grid:oinstall /u01
[root@18c2 ~]# chown oracle:oinstall /u01/app/oracle
[root@18c2 ~]# chmod -R 775 /u01/

2.10 安装软件包

[root@18c1 ~]# yum install -y bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python  python-configshell  python-rtslib python-six targetcli smartmontools sysstat gcc c-c++ gcc-info gcc-locale gcc48 gcc48-info gcc48-locale gcc48-c++
Loaded plugins: langpacks
Package bc-1.06.95-13.el7.x86_64 already installed and latest version
Package binutils-2.23.52.0.1-30.el7.x86_64 already installed and latest version
Package compat-libcap1-1.10-7.el7.x86_64 already installed and latest version
No package compat-libstdc++ available.
Package elfutils-libelf-0.160-1.el7.x86_64 already installed and latest version
Package glibc-2.17-78.0.1.el7.x86_64 already installed and latest version
Package glibc-devel-2.17-78.0.1.el7.x86_64 already installed and latest version
Package libaio-0.3.109-12.el7.x86_64 already installed and latest version
Package libX11-1.6.0-2.1.el7.x86_64 already installed and latest version
Package libXau-1.0.8-2.1.el7.x86_64 already installed and latest version
Package libXi-1.7.2-2.1.el7.x86_64 already installed and latest version
Package libXtst-1.2.2-2.1.el7.x86_64 already installed and latest version
Package libXrender-0.9.8-2.1.el7.x86_64 already installed and latest version
Package libgcc-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-devel-4.8.3-9.el7.x86_64 already installed and latest version
Package libxcb-1.9-5.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package net-tools-2.0-0.17.20131004git.el7.x86_64 already installed and latest version
Package 1:nfs-utils-1.3.0-0.8.el7.x86_64 already installed and latest version
Package python-2.7.5-16.el7.x86_64 already installed and latest version
Package 1:python-configshell-1.1.fb14-1.el7.noarch already installed and latest version
Package python-rtslib-2.1.fb50-1.el7.noarch already installed and latest version
Package python-six-1.3.0-4.el7.noarch already installed and latest version
Package targetcli-2.1.fb37-3.el7.noarch already installed and latest version
Package 1:smartmontools-6.2-4.el7.x86_64 already installed and latest version
Package sysstat-10.1.5-7.el7.x86_64 already installed and latest version
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
No package c-c++ available.
No package gcc-info available.
No package gcc-locale available.
No package gcc48 available.
No package gcc48-info available.
No package gcc48-locale available.
No package gcc48-c++ available.
Resolving Dependencies
--> Running transaction check
---> Package elfutils-libelf-devel.x86_64 0:0.160-1.el7 will be installed
---> Package fontconfig-devel.x86_64 0:2.10.95-7.el7 will be installed
--> Processing Dependency: freetype-devel >= 2.1.4 for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(freetype2) for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.10.95-7.el7.x86_64
---> Package ksh.x86_64 0:20120801-22.el7 will be installed
---> Package libXrender-devel.x86_64 0:0.9.8-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(renderproto) >= 0.9 for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(x11) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
---> Package libaio-devel.x86_64 0:0.3.109-12.el7 will be installed
--> Running transaction check
---> Package expat-devel.x86_64 0:2.1.0-8.el7 will be installed
---> Package freetype-devel.x86_64 0:2.4.11-9.el7 will be installed
--> Processing Dependency: zlib-devel for package: freetype-devel-2.4.11-9.el7.x86_64
---> Package libX11-devel.x86_64 0:1.6.0-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(xcb) >= 1.1.92 for package: libX11-devel-1.6.0-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.0-2.1.el7.x86_64
---> Package xorg-x11-proto-devel.noarch 0:7.7-8.el7.1 will be installed
--> Running transaction check
---> Package libxcb-devel.x86_64 0:1.9-5.el7 will be installed
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.9-5.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-13.el7 will be installed
--> Running transaction check
---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================================================
 Package                                                           Arch                                               Version                                                       Repository                                        Size
===========================================================================================================================================================================================================================================
Installing:
 elfutils-libelf-devel                                             x86_64                                             0.160-1.el7                                                   base                                              34 k
 fontconfig-devel                                                  x86_64                                             2.10.95-7.el7                                                 base                                             127 k
 ksh                                                               x86_64                                             20120801-22.el7                                               base                                             879 k
 libXrender-devel                                                  x86_64                                             0.9.8-2.1.el7                                                 base                                              16 k
 libaio-devel                                                      x86_64                                             0.3.109-12.el7                                                base                                              12 k
Installing for dependencies:
 expat-devel                                                       x86_64                                             2.1.0-8.el7                                                   base                                              56 k
 freetype-devel                                                    x86_64                                             2.4.11-9.el7                                                  base                                             354 k
 libX11-devel                                                      x86_64                                             1.6.0-2.1.el7                                                 base                                             978 k
 libXau-devel                                                      x86_64                                             1.0.8-2.1.el7                                                 base                                              14 k
 libxcb-devel                                                      x86_64                                             1.9-5.el7                                                     base                                             1.0 M
 xorg-x11-proto-devel                                              noarch                                             7.7-8.el7.1                                                   base                                             280 k
 zlib-devel                                                        x86_64                                             1.2.7-13.el7                                                  base                                              49 k

Transaction Summary
===========================================================================================================================================================================================================================================
Install  5 Packages (+7 Dependent packages)

Total download size: 3.7 M
Installed size: 12 M
Downloading packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                       15 MB/s | 3.7 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : xorg-x11-proto-devel-7.7-8.el7.1.noarch                                                                                                                                                                                1/12 
  Installing : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                                                                                                      2/12 
  Installing : libxcb-devel-1.9-5.el7.x86_64                                                                                                                                                                                          3/12 
  Installing : libX11-devel-1.6.0-2.1.el7.x86_64                                                                                                                                                                                      4/12 
  Installing : expat-devel-2.1.0-8.el7.x86_64                                                                                                                                                                                         5/12 
  Installing : zlib-devel-1.2.7-13.el7.x86_64                                                                                                                                                                                         6/12 
  Installing : freetype-devel-2.4.11-9.el7.x86_64                                                                                                                                                                                     7/12 
  Installing : fontconfig-devel-2.10.95-7.el7.x86_64                                                                                                                                                                                  8/12 
  Installing : libXrender-devel-0.9.8-2.1.el7.x86_64                                                                                                                                                                                  9/12 
  Installing : libaio-devel-0.3.109-12.el7.x86_64                                                                                                                                                                                    10/12 
  Installing : elfutils-libelf-devel-0.160-1.el7.x86_64                                                                                                                                                                              11/12 
  Installing : ksh-20120801-22.el7.x86_64                                                                                                                                                                                            12/12 
  Verifying  : ksh-20120801-22.el7.x86_64                                                                                                                                                                                             1/12 
  Verifying  : libXrender-devel-0.9.8-2.1.el7.x86_64                                                                                                                                                                                  2/12 
  Verifying  : zlib-devel-1.2.7-13.el7.x86_64                                                                                                                                                                                         3/12 
  Verifying  : libxcb-devel-1.9-5.el7.x86_64                                                                                                                                                                                          4/12 
  Verifying  : libX11-devel-1.6.0-2.1.el7.x86_64                                                                                                                                                                                      5/12 
  Verifying  : expat-devel-2.1.0-8.el7.x86_64                                                                                                                                                                                         6/12 
  Verifying  : xorg-x11-proto-devel-7.7-8.el7.1.noarch                                                                                                                                                                                7/12 
  Verifying  : elfutils-libelf-devel-0.160-1.el7.x86_64                                                                                                                                                                               8/12 
  Verifying  : libaio-devel-0.3.109-12.el7.x86_64                                                                                                                                                                                     9/12 
  Verifying  : fontconfig-devel-2.10.95-7.el7.x86_64                                                                                                                                                                                 10/12 
  Verifying  : freetype-devel-2.4.11-9.el7.x86_64                                                                                                                                                                                    11/12 
  Verifying  : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                                                                                                     12/12 

Installed:
  elfutils-libelf-devel.x86_64 0:0.160-1.el7          fontconfig-devel.x86_64 0:2.10.95-7.el7          ksh.x86_64 0:20120801-22.el7          libXrender-devel.x86_64 0:0.9.8-2.1.el7          libaio-devel.x86_64 0:0.3.109-12.el7         

Dependency Installed:
  expat-devel.x86_64 0:2.1.0-8.el7    freetype-devel.x86_64 0:2.4.11-9.el7    libX11-devel.x86_64 0:1.6.0-2.1.el7    libXau-devel.x86_64 0:1.0.8-2.1.el7    libxcb-devel.x86_64 0:1.9-5.el7    xorg-x11-proto-devel.noarch 0:7.7-8.el7.1   
  zlib-devel.x86_64 0:1.2.7-13.el7   

Complete!

安装compat-libstdc++-33-3.2.3-72.el7.i686.rpm,因为名字带有版本信息

[root@18c1 ~]# yum install  compat-libstdc++-33-3.2.3-72.el7.i686
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-33.i686 0:3.2.3-72.el7 will be installed
--> Processing Dependency: libm.so.6 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libc.so.6(GLIBC_2.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Running transaction check
---> Package glibc.i686 0:2.17-78.0.1.el7 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-78.0.1.el7.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-78.0.1.el7.i686
---> Package libgcc.i686 0:4.8.3-9.el7 will be installed
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.16.2.3-9.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================================================
 Package                                                          Arch                                              Version                                                        Repository                                         Size
===========================================================================================================================================================================================================================================
Installing:
 compat-libstdc++-33                                              i686                                              3.2.3-72.el7                                                   base                                              196 k
Installing for dependencies:
 glibc                                                            i686                                              2.17-78.0.1.el7                                                base                                              4.2 M
 libgcc                                                           i686                                              4.8.3-9.el7                                                    base                                               99 k
 nss-softokn-freebl                                               i686                                              3.16.2.3-9.el7                                                 base                                              186 k

Transaction Summary
===========================================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 4.6 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                       35 MB/s | 4.6 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libgcc-4.8.3-9.el7.i686                                                                                                                                                                                                 1/4 
  Installing : nss-softokn-freebl-3.16.2.3-9.el7.i686                                                                                                                                                                                  2/4 
  Installing : glibc-2.17-78.0.1.el7.i686                                                                                                                                                                                              3/4 
  Installing : compat-libstdc++-33-3.2.3-72.el7.i686                                                                                                                                                                                   4/4 
  Verifying  : compat-libstdc++-33-3.2.3-72.el7.i686                                                                                                                                                                                   1/4 
  Verifying  : glibc-2.17-78.0.1.el7.i686                                                                                                                                                                                              2/4 
  Verifying  : libgcc-4.8.3-9.el7.i686                                                                                                                                                                                                 3/4 
  Verifying  : nss-softokn-freebl-3.16.2.3-9.el7.i686                                                                                                                                                                                  4/4 

Installed:
  compat-libstdc++-33.i686 0:3.2.3-72.el7                                                                                                                                                                                                  

Dependency Installed:
  glibc.i686 0:2.17-78.0.1.el7                                               libgcc.i686 0:4.8.3-9.el7                                               nss-softokn-freebl.i686 0:3.16.2.3-9.el7                                              

Complete!


[root@18c2 ~]# yum install -y bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python  python-configshell  python-rtslib python-six targetcli smartmontools sysstat gcc c-c++ gcc-info gcc-locale gcc48 gcc48-info gcc48-locale gcc48-c++
Loaded plugins: langpacks
Package bc-1.06.95-13.el7.x86_64 already installed and latest version
Package binutils-2.23.52.0.1-30.el7.x86_64 already installed and latest version
Package compat-libcap1-1.10-7.el7.x86_64 already installed and latest version
No package compat-libstdc++ available.
Package elfutils-libelf-0.160-1.el7.x86_64 already installed and latest version
Package glibc-2.17-78.0.1.el7.x86_64 already installed and latest version
Package glibc-devel-2.17-78.0.1.el7.x86_64 already installed and latest version
Package libaio-0.3.109-12.el7.x86_64 already installed and latest version
Package libX11-1.6.0-2.1.el7.x86_64 already installed and latest version
Package libXau-1.0.8-2.1.el7.x86_64 already installed and latest version
Package libXi-1.7.2-2.1.el7.x86_64 already installed and latest version
Package libXtst-1.2.2-2.1.el7.x86_64 already installed and latest version
Package libXrender-0.9.8-2.1.el7.x86_64 already installed and latest version
Package libgcc-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-devel-4.8.3-9.el7.x86_64 already installed and latest version
Package libxcb-1.9-5.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package net-tools-2.0-0.17.20131004git.el7.x86_64 already installed and latest version
Package 1:nfs-utils-1.3.0-0.8.el7.x86_64 already installed and latest version
Package python-2.7.5-16.el7.x86_64 already installed and latest version
Package 1:python-configshell-1.1.fb14-1.el7.noarch already installed and latest version
Package python-rtslib-2.1.fb50-1.el7.noarch already installed and latest version
Package python-six-1.3.0-4.el7.noarch already installed and latest version
Package targetcli-2.1.fb37-3.el7.noarch already installed and latest version
Package 1:smartmontools-6.2-4.el7.x86_64 already installed and latest version
Package sysstat-10.1.5-7.el7.x86_64 already installed and latest version
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
No package c-c++ available.
No package gcc-info available.
No package gcc-locale available.
No package gcc48 available.
No package gcc48-info available.
No package gcc48-locale available.
No package gcc48-c++ available.
Resolving Dependencies
--> Running transaction check
---> Package elfutils-libelf-devel.x86_64 0:0.160-1.el7 will be installed
---> Package fontconfig-devel.x86_64 0:2.10.95-7.el7 will be installed
--> Processing Dependency: freetype-devel >= 2.1.4 for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(freetype2) for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.10.95-7.el7.x86_64
---> Package ksh.x86_64 0:20120801-22.el7 will be installed
---> Package libXrender-devel.x86_64 0:0.9.8-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(renderproto) >= 0.9 for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(x11) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
---> Package libaio-devel.x86_64 0:0.3.109-12.el7 will be installed
--> Running transaction check
---> Package expat-devel.x86_64 0:2.1.0-8.el7 will be installed
---> Package freetype-devel.x86_64 0:2.4.11-9.el7 will be installed
--> Processing Dependency: zlib-devel for package: freetype-devel-2.4.11-9.el7.x86_64
---> Package libX11-devel.x86_64 0:1.6.0-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(xcb) >= 1.1.92 for package: libX11-devel-1.6.0-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.0-2.1.el7.x86_64
---> Package xorg-x11-proto-devel.noarch 0:7.7-8.el7.1 will be installed
--> Running transaction check
---> Package libxcb-devel.x86_64 0:1.9-5.el7 will be installed
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.9-5.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-13.el7 will be installed
--> Running transaction check
---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================================================
 Package                                                           Arch                                               Version                                                       Repository                                        Size
===========================================================================================================================================================================================================================================
Installing:
 elfutils-libelf-devel                                             x86_64                                             0.160-1.el7                                                   base                                              34 k
 fontconfig-devel                                                  x86_64                                             2.10.95-7.el7                                                 base                                             127 k
 ksh                                                               x86_64                                             20120801-22.el7                                               base                                             879 k
 libXrender-devel                                                  x86_64                                             0.9.8-2.1.el7                                                 base                                              16 k
 libaio-devel                                                      x86_64                                             0.3.109-12.el7                                                base                                              12 k
Installing for dependencies:
 expat-devel                                                       x86_64                                             2.1.0-8.el7                                                   base                                              56 k
 freetype-devel                                                    x86_64                                             2.4.11-9.el7                                                  base                                             354 k
 libX11-devel                                                      x86_64                                             1.6.0-2.1.el7                                                 base                                             978 k
 libXau-devel                                                      x86_64                                             1.0.8-2.1.el7                                                 base                                              14 k
 libxcb-devel                                                      x86_64                                             1.9-5.el7                                                     base                                             1.0 M
 xorg-x11-proto-devel                                              noarch                                             7.7-8.el7.1                                                   base                                             280 k
 zlib-devel                                                        x86_64                                             1.2.7-13.el7                                                  base                                              49 k

Transaction Summary
===========================================================================================================================================================================================================================================
Install  5 Packages (+7 Dependent packages)

Total download size: 3.7 M
Installed size: 12 M
Downloading packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                      7.4 MB/s | 3.7 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : xorg-x11-proto-devel-7.7-8.el7.1.noarch                                                                                                                                                                                1/12 
  Installing : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                                                                                                      2/12 
  Installing : libxcb-devel-1.9-5.el7.x86_64                                                                                                                                                                                          3/12 
  Installing : libX11-devel-1.6.0-2.1.el7.x86_64                                                                                                                                                                                      4/12 
  Installing : expat-devel-2.1.0-8.el7.x86_64                                                                                                                                                                                         5/12 
  Installing : zlib-devel-1.2.7-13.el7.x86_64                                                                                                                                                                                         6/12 
  Installing : freetype-devel-2.4.11-9.el7.x86_64                                                                                                                                                                                     7/12 
  Installing : fontconfig-devel-2.10.95-7.el7.x86_64                                                                                                                                                                                  8/12 
  Installing : libXrender-devel-0.9.8-2.1.el7.x86_64                                                                                                                                                                                  9/12 
  Installing : libaio-devel-0.3.109-12.el7.x86_64                                                                                                                                                                                    10/12 
  Installing : elfutils-libelf-devel-0.160-1.el7.x86_64                                                                                                                                                                              11/12 
  Installing : ksh-20120801-22.el7.x86_64                                                                                                                                                                                            12/12 
  Verifying  : ksh-20120801-22.el7.x86_64                                                                                                                                                                                             1/12 
  Verifying  : libXrender-devel-0.9.8-2.1.el7.x86_64                                                                                                                                                                                  2/12 
  Verifying  : zlib-devel-1.2.7-13.el7.x86_64                                                                                                                                                                                         3/12 
  Verifying  : libxcb-devel-1.9-5.el7.x86_64                                                                                                                                                                                          4/12 
  Verifying  : libX11-devel-1.6.0-2.1.el7.x86_64                                                                                                                                                                                      5/12 
  Verifying  : expat-devel-2.1.0-8.el7.x86_64                                                                                                                                                                                         6/12 
  Verifying  : xorg-x11-proto-devel-7.7-8.el7.1.noarch                                                                                                                                                                                7/12 
  Verifying  : elfutils-libelf-devel-0.160-1.el7.x86_64                                                                                                                                                                               8/12 
  Verifying  : libaio-devel-0.3.109-12.el7.x86_64                                                                                                                                                                                     9/12 
  Verifying  : fontconfig-devel-2.10.95-7.el7.x86_64                                                                                                                                                                                 10/12 
  Verifying  : freetype-devel-2.4.11-9.el7.x86_64                                                                                                                                                                                    11/12 
  Verifying  : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                                                                                                     12/12 

Installed:
  elfutils-libelf-devel.x86_64 0:0.160-1.el7          fontconfig-devel.x86_64 0:2.10.95-7.el7          ksh.x86_64 0:20120801-22.el7          libXrender-devel.x86_64 0:0.9.8-2.1.el7          libaio-devel.x86_64 0:0.3.109-12.el7         

Dependency Installed:
  expat-devel.x86_64 0:2.1.0-8.el7    freetype-devel.x86_64 0:2.4.11-9.el7    libX11-devel.x86_64 0:1.6.0-2.1.el7    libXau-devel.x86_64 0:1.0.8-2.1.el7    libxcb-devel.x86_64 0:1.9-5.el7    xorg-x11-proto-devel.noarch 0:7.7-8.el7.1   
  zlib-devel.x86_64 0:1.2.7-13.el7   

Complete!

安装compat-libstdc++-33-3.2.3-72.el7.i686.rpm,因为名字带有版本信息

[root@18c2 ~]# yum install  compat-libstdc++-33-3.2.3-72.el7.i686
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-33.i686 0:3.2.3-72.el7 will be installed
--> Processing Dependency: libm.so.6 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libc.so.6(GLIBC_2.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Running transaction check
---> Package glibc.i686 0:2.17-78.0.1.el7 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-78.0.1.el7.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-78.0.1.el7.i686
---> Package libgcc.i686 0:4.8.3-9.el7 will be installed
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.16.2.3-9.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================================================
 Package                                                          Arch                                              Version                                                        Repository                                         Size
===========================================================================================================================================================================================================================================
Installing:
 compat-libstdc++-33                                              i686                                              3.2.3-72.el7                                                   base                                              196 k
Installing for dependencies:
 glibc                                                            i686                                              2.17-78.0.1.el7                                                base                                              4.2 M
 libgcc                                                           i686                                              4.8.3-9.el7                                                    base                                               99 k
 nss-softokn-freebl                                               i686                                              3.16.2.3-9.el7                                                 base                                              186 k

Transaction Summary
===========================================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 4.6 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                       73 MB/s | 4.6 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libgcc-4.8.3-9.el7.i686                                                                                                                                                                                                 1/4 
  Installing : nss-softokn-freebl-3.16.2.3-9.el7.i686                                                                                                                                                                                  2/4 
  Installing : glibc-2.17-78.0.1.el7.i686                                                                                                                                                                                              3/4 
  Installing : compat-libstdc++-33-3.2.3-72.el7.i686                                                                                                                                                                                   4/4 
  Verifying  : compat-libstdc++-33-3.2.3-72.el7.i686                                                                                                                                                                                   1/4 
  Verifying  : glibc-2.17-78.0.1.el7.i686                                                                                                                                                                                              2/4 
  Verifying  : libgcc-4.8.3-9.el7.i686                                                                                                                                                                                                 3/4 
  Verifying  : nss-softokn-freebl-3.16.2.3-9.el7.i686                                                                                                                                                                                  4/4 

Installed:
  compat-libstdc++-33.i686 0:3.2.3-72.el7                                                                                                                                                                                                  

Dependency Installed:
  glibc.i686 0:2.17-78.0.1.el7                                               libgcc.i686 0:4.8.3-9.el7                                               nss-softokn-freebl.i686 0:3.16.2.3-9.el7                                              

Complete!

检查已经安装的软件包

[root@18c1 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python  python-configshell  python-rtslib python-six targetcli smartmontools sysstat
bc-1.06.95-13.el7 (x86_64)
binutils-2.23.52.0.1-30.el7 (x86_64)
compat-libcap1-1.10-7.el7 (x86_64)
package compat-libstdc++ is not installed
elfutils-libelf-0.160-1.el7 (x86_64)
elfutils-libelf-devel-0.160-1.el7 (x86_64)
fontconfig-devel-2.10.95-7.el7 (x86_64)
glibc-2.17-78.0.1.el7 (x86_64)
glibc-2.17-78.0.1.el7 (i686)
glibc-devel-2.17-78.0.1.el7 (x86_64)
ksh-20120801-22.el7 (x86_64)
libaio-0.3.109-12.el7 (x86_64)
libaio-devel-0.3.109-12.el7 (x86_64)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (x86_64)
libXi-1.7.2-2.1.el7 (x86_64)
libXtst-1.2.2-2.1.el7 (x86_64)
libXrender-0.9.8-2.1.el7 (x86_64)
libXrender-devel-0.9.8-2.1.el7 (x86_64)
libgcc-4.8.3-9.el7 (x86_64)
libgcc-4.8.3-9.el7 (i686)
libstdc++-4.8.3-9.el7 (x86_64)
libstdc++-devel-4.8.3-9.el7 (x86_64)
libxcb-1.9-5.el7 (x86_64)
make-3.82-21.el7 (x86_64)
net-tools-2.0-0.17.20131004git.el7 (x86_64)
nfs-utils-1.3.0-0.8.el7 (x86_64)
python-2.7.5-16.el7 (x86_64)
python-configshell-1.1.fb14-1.el7 (noarch)
python-rtslib-2.1.fb50-1.el7 (noarch)
python-six-1.3.0-4.el7 (noarch)
targetcli-2.1.fb37-3.el7 (noarch)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-7.el7 (x86_64)


[root@18c2 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python  python-configshell  python-rtslib python-six targetcli smartmontools sysstat
bc-1.06.95-13.el7 (x86_64)
binutils-2.23.52.0.1-30.el7 (x86_64)
compat-libcap1-1.10-7.el7 (x86_64)
package compat-libstdc++ is not installed
elfutils-libelf-0.160-1.el7 (x86_64)
elfutils-libelf-devel-0.160-1.el7 (x86_64)
fontconfig-devel-2.10.95-7.el7 (x86_64)
glibc-2.17-78.0.1.el7 (x86_64)
glibc-2.17-78.0.1.el7 (i686)
glibc-devel-2.17-78.0.1.el7 (x86_64)
ksh-20120801-22.el7 (x86_64)
libaio-0.3.109-12.el7 (x86_64)
libaio-devel-0.3.109-12.el7 (x86_64)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (x86_64)
libXi-1.7.2-2.1.el7 (x86_64)
libXtst-1.2.2-2.1.el7 (x86_64)
libXrender-0.9.8-2.1.el7 (x86_64)
libXrender-devel-0.9.8-2.1.el7 (x86_64)
libgcc-4.8.3-9.el7 (x86_64)
libgcc-4.8.3-9.el7 (i686)
libstdc++-4.8.3-9.el7 (x86_64)
libstdc++-devel-4.8.3-9.el7 (x86_64)
libxcb-1.9-5.el7 (x86_64)
make-3.82-21.el7 (x86_64)
net-tools-2.0-0.17.20131004git.el7 (x86_64)
nfs-utils-1.3.0-0.8.el7 (x86_64)
python-2.7.5-16.el7 (x86_64)
python-configshell-1.1.fb14-1.el7 (noarch)
python-rtslib-2.1.fb50-1.el7 (noarch)
python-six-1.3.0-4.el7 (noarch)
targetcli-2.1.fb37-3.el7 (noarch)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-7.el7 (x86_64)

2.11编辑hosts文件

[root@18c1 ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#public-ip
10.10.13.171      18c1
10.10.13.172      18c2

#public-vip
10.10.13.173      18c1-vip
10.10.13.174      18c2-vip

#prive-ip
88.88.87.1        18c1-priv
88.88.87.2        18c2-priv

#scan-ip
10.10.13.175      scan-18c
10.10.13.176      scan-18c
10.10.13.177      scan-18c

[root@18c2 ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#public-ip
10.10.13.171      18c1
10.10.13.172      18c2

#public-vip
10.10.13.173      18c1-vip
10.10.13.174      18c2-vip

#prive-ip
88.88.87.1        18c1-priv
88.88.87.2        18c2-priv

#scan-ip
10.10.13.175      scan-18c
10.10.13.176      scan-18c
10.10.13.177      scan-18c

2.12 修改系统内核参数

[root@18c1 ~]# cat >> /etc/sysctl.conf < kernel.shmall = 4294967296
> kernel.sem = 510 65280 510 128
> kernel.shmmni = 4096
> kernel.shmmax = 429496729500
> net.ipv4.ip_local_port_range = 9000 65500
> net.core.rmem_default = 1048576
> net.core.rmem_max = 4194304
> net.core.wmem_default = 262144
> net.core.wmem_max = 1048576
> fs.file-max = 6815744
> fs.aio-max-nr = 1048576
> vm.swappiness = 0
> vm.dirty_background_ratio = 3
> vm.dirty_ratio = 80
> vm.dirty_expire_centisecs = 500
> vm.dirty_writeback_centisecs = 100
> net.ipv4.tcp_sack = 0
> net.ipv4.tcp_timestamps = 0
> net.ipv4.conf.default.rp_filter = 0
> net.ipv4.tcp_wmem = 262144
> net.ipv4.tcp_rmem = 4194304
> EOF


[root@18c2 ~]# cat >> /etc/sysctl.conf < kernel.shmall = 4294967296
> kernel.sem = 510 65280 510 128
> kernel.shmmni = 4096
> kernel.shmmax = 429496729500
> net.ipv4.ip_local_port_range = 9000 65500
> net.core.rmem_default = 1048576
> net.core.rmem_max = 4194304
> net.core.wmem_default = 262144
> net.core.wmem_max = 1048576
> fs.file-max = 6815744
> fs.aio-max-nr = 1048576
> vm.swappiness = 0
> vm.dirty_background_ratio = 3
> vm.dirty_ratio = 80
> vm.dirty_expire_centisecs = 500
> vm.dirty_writeback_centisecs = 100
> net.ipv4.tcp_sack = 0
> net.ipv4.tcp_timestamps = 0
> net.ipv4.conf.default.rp_filter = 0
> net.ipv4.tcp_wmem = 262144
> net.ipv4.tcp_rmem = 4194304
> EOF

[root@18c1 ~]# sysctl -p
kernel.shmall = 4294967296
kernel.sem = 510 65280 510 128
kernel.shmmni = 4096
kernel.shmmax = 429496729500
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.tcp_wmem = 262144
net.ipv4.tcp_rmem = 4194304


[root@18c2 ~]# sysctl -p
kernel.shmall = 4294967296
kernel.sem = 510 65280 510 128
kernel.shmmni = 4096
kernel.shmmax = 429496729500
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.tcp_wmem = 262144
net.ipv4.tcp_rmem = 4194304

2.13 配置LIMITS限制参数

[root@18c1 ~]# cat >> /etc/security/limits.conf < oracle          soft    nproc           2047
> oracle          hard    nproc           16384
> oracle          soft    nofile          65536
> oracle          hard    nofile          65536
> oracle          soft    memlock         3145728
> oracle          hard    memlock         3145728
> oracle          soft    stack           10240
> oracle          hard    stack           32768
> 
> grid          soft    nproc           2047
> grid          hard    nproc           16384
> grid          soft    nofile          65536
> grid          hard    nofile          65536
> grid          soft    memlock         3145728
> grid          hard    memlock         3145728
> grid          soft    stack           10240
> grid          hard    stack           32768
> EOF

[root@18c2 ~]# cat >> /etc/security/limits.conf < oracle          soft    nproc           2047
> oracle          hard    nproc           16384
> oracle          soft    nofile          65536
> oracle          hard    nofile          65536
> oracle          soft    memlock         3145728
> oracle          hard    memlock         3145728
> oracle          soft    stack           10240
> oracle          hard    stack           32768
> 
> grid          soft    nproc           2047
> grid          hard    nproc           16384
> grid          soft    nofile          65536
> grid          hard    nofile          65536
> grid          soft    memlock         3145728
> grid          hard    memlock         3145728
> grid          soft    stack           10240
> grid          hard    stack           32768
> EOF

2.14配置PAM

[root@18c1 ~]# cat  >> /etc/pam.d/login < session    required     /lib64/security/pam_limits.so 
> EOF

[root@18c2 ~]# cat  >> /etc/pam.d/login < session    required     /lib64/security/pam_limits.so 
> EOF

2.15 配置系统环境变量

[root@18c1 ~]# cat  >> /etc/pam.d/login < if [ \$USER = "oracle" ]; then  
>     if [ \$SHELL = "/bin/ksh" ]; then
>         ulimit -p 16384
>         ulimit -n 65536
>     else
>         ulimit -u 16384 -n 65536
>     fi
> fi
> 
> if [ \$USER = "grid" ]; then  
>     if [ \$SHELL = "/bin/ksh" ]; then
>         ulimit -p 16384
>         ulimit -n 65536
>     else
>         ulimit -u 16384 -n 65536
>     fi
> fi
> EOF

[root@18c2 ~]# cat  >> /etc/pam.d/login < if [ \$USER = "oracle" ]; then  
>     if [ \$SHELL = "/bin/ksh" ]; then
>         ulimit -p 16384
>         ulimit -n 65536
>     else
>         ulimit -u 16384 -n 65536
>     fi
> fi
> 
> if [ \$USER = "grid" ]; then  
>     if [ \$SHELL = "/bin/ksh" ]; then
>         ulimit -p 16384
>         ulimit -n 65536
>     else
>         ulimit -u 16384 -n 65536
>     fi
> fi
> EOF

2.16 配置grid用户环境变量

[grid@18c1 ~]$ vi .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/18.3/grid
export ORACLE_SID=+ASM1
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib


[grid@18c2 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/18.3/grid
export ORACLE_SID=+ASM2
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib

2.17 配置oracle用户环境变量

[oracle@18c1 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/18.3/db
export ORACLE_SID=ora18c1
export ORACLE_UNQNAME=ora18c
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib




[oracle@18c2 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/18.3/db
export ORACLE_SID=ora18c2
export ORACLE_UNQNAME=ora18c
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib

2.18 配置ASM所需磁盘,编辑/etc/udev/rules.d/99-my-asmdevices.rules配置文件

[root@18c1 ~]# fdisk -l

Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000e39cc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   209715199   104344576   8e  Linux LVM

Disk /dev/mapper/ol-root: 98.4 GB, 98385788928 bytes, 192159744 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ol-swap: 8455 MB, 8455716864 bytes, 16515072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


[root@18c2 ~]# fdisk -l

Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000e39cc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   209715199   104344576   8e  Linux LVM

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ol-root: 98.4 GB, 98385788928 bytes, 192159744 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ol-swap: 8455 MB, 8455716864 bytes, 16515072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


[root@18c1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
36000c2900cdc8c5166aa71fdb62b37b1
[root@18c1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
36000c2976add1db1089450eb6795b7f1

[root@18c2 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
36000c2900cdc8c5166aa71fdb62b37b1
[root@18c2 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
36000c2976add1db1089450eb6795b7f1

[root@18c1 ~]# vi /etc/udev/rules.d/99-my-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2900cdc8c5166aa71fdb62b37b1", RUN+="/bin/sh -c 'mknod /dev/asmdisk01 b $major $minor; chown grid:asmadmin /dev/asmdisk01; chmod 0660 /dev/asmdisk01'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2976add1db1089450eb6795b7f1", RUN+="/bin/sh -c 'mknod /dev/asmdisk02 b $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02'"


[root@18c2 ~]# vi /etc/udev/rules.d/99-my-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2900cdc8c5166aa71fdb62b37b1", RUN+="/bin/sh -c 'mknod /dev/asmdisk01 b $major $minor; chown grid:asmadmin /dev/asmdisk01; chmod 0660 /dev/asmdisk01'"
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2976add1db1089450eb6795b7f1", RUN+="/bin/sh -c 'mknod /dev/asmdisk02 b $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02'"


[root@18c1 ~]# /sbin/udevadm trigger --type=devices --action=change
[root@18c1 ~]# ls -lrt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 32 Sep 14 10:39 /dev/asmdisk02
brw-rw----. 1 grid asmadmin 8, 16 Sep 14 10:39 /dev/asmdisk01

[root@18c2 ~]# /sbin/udevadm trigger --type=devices --action=change
[root@18c2 ~]# ls -lrt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 16 Sep 14 10:39 /dev/asmdisk01
brw-rw----. 1 grid asmadmin 8, 32 Sep 14 10:39 /dev/asmdisk02

三·安装集群软件
3.1解压grid软件

[grid@18c1 ~]$ cd /soft
[grid@18c1 soft]$ ls -lrt
total 9713788
-rw-r--r--. 1 oracle oinstall 4564649047 Mar 31  2019 LINUX.X64_180000_db_home.zip
-rw-r--r--. 1 grid   oinstall 5382265496 Mar 31  2019 LINUX.X64_180000_grid_home.zip

[grid@18c1 soft]$ unzip -q LINUX.X64_180000_grid_home.zip -d $ORACLE_HOME

3.2 安装CVU

[root@18c1 ~]# export CVUQDISK_GRP=oinstall; 
[root@18c1 ~]# rpm -ivh /u01/app/18.3/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:cvuqdisk-1.0.10-1                ################################# [100%]

把安装包复件到节点2

[root@18c1 ~]# scp /u01/app/18.3/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm 18c2:~ 
The authenticity of host '18c2 (10.10.13.172)' can't be established.
ECDSA key fingerprint is 33:bd:b1:91:b4:06:6d:e9:5a:e5:1c:e4:8a:98:e3:d8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '18c2,10.10.13.172' (ECDSA) to the list of known hosts.
root@18c2's password: 
cvuqdisk-1.0.10-1.rpm                                                                                                                                                                                    100% 8860     8.7KB/s   00:00    
[root@18c1 ~]# 

[root@18c2 ~]# export CVUQDISK_GRP=oinstall;
[root@18c2 ~]# rpm -ivh cvuqdisk-1.0.10-1.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:cvuqdisk-1.0.10-1                ################################# [100%]

3.3 配置SSH信任
给grid,oracle用户进行配置

[root@18c1 ~]# /u01/app/18.3/grid/oui/prov/resources/scripts/sshUserSetup.sh -user grid  -hosts "18c1 18c2" -advanced exverify -confirm
The output of this script is also logged into /tmp/sshUserSetup_2022-09-14-11-01-04.log
Hosts are 18c1 18c2
user is grid
Platform:- Linux 
Checking if the remote hosts are reachable
PING 18c1 (10.10.13.171) 56(84) bytes of data.
64 bytes from 18c1 (10.10.13.171): icmp_seq=1 ttl=64 time=0.034 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=2 ttl=64 time=0.020 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=3 ttl=64 time=0.020 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=4 ttl=64 time=0.018 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=5 ttl=64 time=0.037 ms

--- 18c1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.018/0.025/0.037/0.010 ms
PING 18c2 (10.10.13.172) 56(84) bytes of data.
64 bytes from 18c2 (10.10.13.172): icmp_seq=1 ttl=64 time=0.368 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=2 ttl=64 time=0.170 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=3 ttl=64 time=0.178 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=4 ttl=64 time=0.168 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=5 ttl=64 time=0.157 ms

--- 18c2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 0.157/0.208/0.368/0.080 ms
Remote host reachability check succeeded.
The following hosts are reachable: 18c1 18c2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost 18c1
numhosts 2
The script will setup SSH connectivity from the host 18c1 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host 18c1
and the remote hosts without being prompted for passwords or confirmations.

NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.

NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE
directories.

Do you want to continue and let the script make the above mentioned changes (yes/no)?
Confirmation provided on the command line

The user chose yes
Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp. no 
The estimated number of times the user would be prompted for a passphrase is 4. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion. 
Enter 'yes' or 'no'.
yes

The user chose yes
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /root/.ssh/config, it would be backed up to /root/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
passphrase too short: have 4 bytes, need > 4
Generating public/private rsa key pair.
Saving the key failed: /root/.ssh/id_rsa.
Creating .ssh directory and setting permissions on remote host 18c1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR grid. THIS IS AN SSH REQUIREMENT.
The script would create ~grid/.ssh/config file on remote host 18c1. If a config file exists already at ~grid/.ssh/config, it would be backed up to ~grid/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host 18c1.
Warning: Permanently added '18c1,10.10.13.171' (ECDSA) to the list of known hosts.
grid@18c1's password: 
Done with creating .ssh directory and setting permissions on remote host 18c1.
Creating .ssh directory and setting permissions on remote host 18c2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR grid. THIS IS AN SSH REQUIREMENT.
The script would create ~grid/.ssh/config file on remote host 18c2. If a config file exists already at ~grid/.ssh/config, it would be backed up to ~grid/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host 18c2.
Warning: Permanently added '18c2,10.10.13.172' (ECDSA) to the list of known hosts.
grid@18c2's password: 
Done with creating .ssh directory and setting permissions on remote host 18c2.
Copying local host public key to the remote host 18c1
The user may be prompted for a password or passphrase here since the script would be using SCP for host 18c1.
grid@18c1's password: 
/root/.ssh/id_rsa.pub: No such file or directory
Done copying local host public key to the remote host 18c1
Copying local host public key to the remote host 18c2
The user may be prompted for a password or passphrase here since the script would be using SCP for host 18c2.
grid@18c2's password: 
/root/.ssh/id_rsa.pub: No such file or directory
Done copying local host public key to the remote host 18c2
cat: /root/.ssh/id_rsa.pub: No such file or directory
Creating keys on remote host 18c1 if they do not exist already. This is required to setup SSH on host 18c1.
grid@18c1's password: 
Generating public/private rsa key pair.
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
bf:e3:a6:88:97:da:e0:7f:46:6e:9f:1a:c7:9b:a1:35 grid@18c1
The key's randomart image is:
+--[ RSA 1024]----+
|                 |
|                 |
|                 |
|                 |
|        S        |
|        .o       |
|    .  +. E      |
|   . +o.==oB     |
|    +++++*B.     |
+-----------------+
Creating keys on remote host 18c2 if they do not exist already. This is required to setup SSH on host 18c2.
grid@18c2's password: 
Generating public/private rsa key pair.
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
ea:df:a7:75:09:21:8e:b2:c3:6d:03:28:c0:03:8c:c6 grid@18c2
The key's randomart image is:
+--[ RSA 1024]----+
|=                |
|+E               |
|oo        . .    |
| ..  .   o . .   |
|  . . o S . .    |
|   . . *     . . |
|      = +   . o  |
|     . o o ...   |
|      ... oo     |
+-----------------+
grid@18c1's password: 
grid@18c2's password: 
Updating authorized_keys file on remote host 18c1
grid@18c1's password: 
Updating known_hosts file on remote host 18c1
grid@18c1's password: 
The script will run SSH on the remote machine 18c1. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
grid@18c1's password: 
Updating authorized_keys file on remote host 18c2
grid@18c2's password: 
Updating known_hosts file on remote host 18c2
grid@18c2's password: 
The script will run SSH on the remote machine 18c2. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
grid@18c2's password: 
SSH setup is complete.

------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user grid.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~grid or ~grid/.ssh on the remote host may not be owned by grid.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--18c1:--
Running /usr/bin/ssh -x -l grid 18c1 date to verify SSH connectivity has been setup from local host to 18c1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine 18c1. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
grid@18c1's password: 
Wed Sep 14 11:03:09 CST 2022
------------------------------------------------------------------------
--18c2:--
Running /usr/bin/ssh -x -l grid 18c2 date to verify SSH connectivity has been setup from local host to 18c2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine 18c2. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
grid@18c2's password: 
Wed Sep 14 11:03:12 CST 2022
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from 18c1 to 18c1
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
grid@18c1's password: 
Wed Sep 14 11:03:16 CST 2022
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from 18c1 to 18c2
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
grid@18c1's password: 
Wed Sep 14 11:03:20 CST 2022
------------------------------------------------------------------------
-Verification from complete-
SSH verification complete.




[root@18c1 ~]# /u01/app/18.3/grid/oui/prov/resources/scripts/sshUserSetup.sh -user oracle  -hosts "18c1 18c2" -advanced exverify -confirm
The output of this script is also logged into /tmp/sshUserSetup_2022-09-14-11-04-24.log
Hosts are 18c1 18c2
user is oracle
Platform:- Linux 
Checking if the remote hosts are reachable
PING 18c1 (10.10.13.171) 56(84) bytes of data.
64 bytes from 18c1 (10.10.13.171): icmp_seq=1 ttl=64 time=0.027 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=2 ttl=64 time=0.025 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=3 ttl=64 time=0.018 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=4 ttl=64 time=0.023 ms
64 bytes from 18c1 (10.10.13.171): icmp_seq=5 ttl=64 time=0.016 ms

--- 18c1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.016/0.021/0.027/0.007 ms
PING 18c2 (10.10.13.172) 56(84) bytes of data.
64 bytes from 18c2 (10.10.13.172): icmp_seq=1 ttl=64 time=0.222 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=2 ttl=64 time=0.145 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=3 ttl=64 time=0.141 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=4 ttl=64 time=0.153 ms
64 bytes from 18c2 (10.10.13.172): icmp_seq=5 ttl=64 time=0.142 ms

--- 18c2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.141/0.160/0.222/0.033 ms
Remote host reachability check succeeded.
The following hosts are reachable: 18c1 18c2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost 18c1
numhosts 2
The script will setup SSH connectivity from the host 18c1 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host 18c1
and the remote hosts without being prompted for passwords or confirmations.

NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.

NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE
directories.

Do you want to continue and let the script make the above mentioned changes (yes/no)?
Confirmation provided on the command line

The user chose yes
Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp. no 
The estimated number of times the user would be prompted for a passphrase is 4. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion. 
Enter 'yes' or 'no'.
yes

The user chose yes
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /root/.ssh/config, it would be backed up to /root/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Generating public/private rsa key pair.
Passphrases do not match.  Try again.
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
3b:8c:65:92:69:ee:94:70:cf:7d:9b:66:73:12:9b:be root@18c1
The key's randomart image is:
+--[ RSA 1024]----+
|                 |
|                 |
|                 |
|       o         |
|    . * S        |
|     = X o  .    |
|      = * . .+   |
|     o   . .Bo.  |
|      .    +E=   |
+-----------------+
Creating .ssh directory and setting permissions on remote host 18c1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host 18c1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host 18c1.
Warning: Permanently added '18c1,10.10.13.171' (ECDSA) to the list of known hosts.
oracle@18c1's password: 
Done with creating .ssh directory and setting permissions on remote host 18c1.
Creating .ssh directory and setting permissions on remote host 18c2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host 18c2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host 18c2.
Warning: Permanently added '18c2,10.10.13.172' (ECDSA) to the list of known hosts.
oracle@18c2's password: 
Done with creating .ssh directory and setting permissions on remote host 18c2.
Copying local host public key to the remote host 18c1
The user may be prompted for a password or passphrase here since the script would be using SCP for host 18c1.
oracle@18c1's password: 
Done copying local host public key to the remote host 18c1
Copying local host public key to the remote host 18c2
The user may be prompted for a password or passphrase here since the script would be using SCP for host 18c2.
oracle@18c2's password: 
Done copying local host public key to the remote host 18c2
Creating keys on remote host 18c1 if they do not exist already. This is required to setup SSH on host 18c1.
Enter passphrase for key '/root/.ssh/id_rsa': 
Generating public/private rsa key pair.
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
d6:14:54:7b:fc:11:f3:99:4f:69:b0:66:a8:31:70:0f oracle@18c1
The key's randomart image is:
+--[ RSA 1024]----+
|       . Eo... o |
|        o o..oo B|
|         o.o.+o*o|
|         o+ o..oo|
|        S..     o|
|       .         |
|                 |
|                 |
|                 |
+-----------------+
Creating keys on remote host 18c2 if they do not exist already. This is required to setup SSH on host 18c2.
Enter passphrase for key '/root/.ssh/id_rsa': 
Generating public/private rsa key pair.
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
2f:de:18:db:83:fe:6f:e9:1a:59:9f:73:82:9f:62:31 oracle@18c2
The key's randomart image is:
+--[ RSA 1024]----+
|                 |
|                 |
|                 |
|                 |
|        S   .    |
|         . oEo . |
|        o.+ .+= .|
|       ..B..=. = |
|       .=.=Bo.o  |
+-----------------+
Enter passphrase for key '/root/.ssh/id_rsa': 
Enter passphrase for key '/root/.ssh/id_rsa': 
Updating authorized_keys file on remote host 18c1
Enter passphrase for key '/root/.ssh/id_rsa': 
Updating known_hosts file on remote host 18c1
Enter passphrase for key '/root/.ssh/id_rsa': 
The script will run SSH on the remote machine 18c1. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Enter passphrase for key '/root/.ssh/id_rsa': 
Updating authorized_keys file on remote host 18c2
Enter passphrase for key '/root/.ssh/id_rsa': 
Updating known_hosts file on remote host 18c2
Enter passphrase for key '/root/.ssh/id_rsa': 
The script will run SSH on the remote machine 18c2. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Enter passphrase for key '/root/.ssh/id_rsa': 
SSH setup is complete.

------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the /sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--18c1:--
Running /usr/bin/ssh -x -l oracle 18c1 date to verify SSH connectivity has been setup from local host to 18c1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine 18c1. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Enter passphrase for key '/root/.ssh/id_rsa': 
Wed Sep 14 11:06:55 CST 2022
------------------------------------------------------------------------
--18c2:--
Running /usr/bin/ssh -x -l oracle 18c2 date to verify SSH connectivity has been setup from local host to 18c2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine 18c2. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Enter passphrase for key '/root/.ssh/id_rsa': 
Wed Sep 14 11:07:00 CST 2022
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from 18c1 to 18c1
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Enter passphrase for key '/root/.ssh/id_rsa': 
Wed Sep 14 11:07:06 CST 2022
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from 18c1 to 18c2
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Enter passphrase for key '/root/.ssh/id_rsa': 
Wed Sep 14 11:07:12 CST 2022
------------------------------------------------------------------------
-Verification from complete-
SSH verification complete.


[root@18c1 ~]# su - grid
Last login: Wed Sep 14 10:52:12 CST 2022 on pts/0
[grid@18c1 ~]$ ssh 18c2 date
Wed Sep 14 11:08:23 CST 2022
[grid@18c1 ~]$ ssh 18c1 date
Wed Sep 14 11:08:30 CST 2022
[grid@18c1 ~]$ exit
logout
[root@18c1 ~]# su - oracle
Last login: Wed Sep 14 10:34:49 CST 2022 on pts/0
[oracle@18c1 ~]$ ssh 18c2 date
Wed Sep 14 11:08:43 CST 2022
[oracle@18c1 ~]$ ssh 18c1 date
Wed Sep 14 11:08:48 CST 2022

[grid@18c2 ~]$ ssh 18c1 date
Wed Sep 14 11:09:13 CST 2022
[grid@18c2 ~]$ ssh 18c2 date
Wed Sep 14 11:09:17 CST 2022
[grid@18c2 ~]$ exit
logout
[root@18c2 ~]# su - oracle
Last login: Wed Sep 14 10:36:22 CST 2022 on pts/0
[oracle@18c2 ~]$ ssh 18c1 date
Wed Sep 14 11:09:33 CST 2022
[oracle@18c2 ~]$ ssh 18c2 date
Wed Sep 14 11:09:41 CST 2022

3.4 安装前环境检查GI

[grid@18c1 ~]$ $ORACLE_HOME/runcluvfy.sh  stage -pre crsinst -n  "18c1,18c2"  -fixup -verbose

根据提示修复检查的问题

[root@18c1 ~]# /u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

[root@18c2 ~]# /u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

3.5开始安装Grid软件

[grid@18c1 ~]$ vi grid.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v18.0.0
INVENTORY_LOCATION=/u01/app/oraInventory
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.scanType=LOCAL_SCAN
oracle.install.crs.config.gpnp.scanName=scan-18c
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.clusterName=ora18c-cluster
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.clusterNodes=18c1:18c1-vip:HUB,18c2:18c2-vip:HUB
oracle.install.crs.config.networkInterfaceList=ens33:88.88.87.0:5,ens32:10.10.13.0:1
oracle.install.asm.configureGIMRDataDG=false
oracle.install.crs.config.useIPMI=false
oracle.install.asm.storageOption=ASM
oracle.install.asmOnNAS.configureGIMRDataDG=false
oracle.install.asm.SYSASMPassword=xxzx7817600
oracle.install.asm.diskGroup.name=OCR
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.AUSize=4
oracle.install.asm.diskGroup.disks=/dev/asmdisk01
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*
oracle.install.asm.configureAFD=false
oracle.install.asm.monitorPassword=xxzx7817600
oracle.install.crs.configureRHPS=false
oracle.install.crs.config.ignoreDownNodes=false
oracle.install.config.managementOption=NONE
oracle.install.config.omsPort=0
oracle.install.crs.rootconfig.executeRootScript=false

[grid@18c1 ~]$ $ORACLE_HOME/gridSetup.sh -silent -force -noconfig -waitforcompletion -ignorePrereq -responseFile /home/grid/grid.rsp
Launching Oracle Grid Infrastructure Setup Wizard...

[WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.
   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
   ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
   ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-40109] The specified Oracle Base location is not empty on this server.
   ACTION: Specify an empty location for Oracle Base.
[WARNING] [INS-13013] Target environment does not meet some mandatory requirements.
   CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/tmp/GridSetupActions2022-09-14_11-40-40AM/gridSetupActions2022-09-14_11-40-40AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/tmp/GridSetupActions2022-09-14_11-40-40AM/gridSetupActions2022-09-14_11-40-40AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/18.3/grid/install/response/grid_2022-09-14_11-40-40AM.rsp

You can find the log of this install session at:
 /u01/tmp/GridSetupActions2022-09-14_11-40-40AM/gridSetupActions2022-09-14_11-40-40AM.log

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/18.3/grid/root.sh

Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: 
[18c1, 18c2]
Execute /u01/app/18.3/grid/root.sh on the following nodes: 
[18c1, 18c2]

Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes.

Successfully Setup Software with warning(s).
As install user, execute the following command to complete the configuration.
        /u01/app/18.3/grid/gridSetup.sh -executeConfigTools -responseFile /home/grid/grid.rsp [-silent]


Moved the install session logs to:
 /u01/app/oraInventory/logs/GridSetupActions2022-09-14_11-40-40AM

节点一 执行root脚本

[root@18c1 /]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@18c1 /]# /u01/app/18.3/grid/root.sh
Check /u01/app/18.3/grid/install/root_18c1_2022-09-14_12-06-17-524505190.log for the output of root script

节点二 执行root脚本

[root@18c2 /]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@18c2 /]# /u01/app/18.3/grid/root.sh
Check /u01/app/18.3/grid/install/root_18c2_2022-09-14_12-26-02-499327120.log for the output of root script

[grid@18c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.OCR.GHCHKPT.advm
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.OCR.dg
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.helper
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     IDLE,STABLE
ora.net1.network
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.ocr.ghchkpt.acfs
               OFFLINE OFFLINE      18c1                     volume /opt/oracle/r
                                                             hp_images/chkbase is
                                                             unmounted,STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.ons
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.proxy_advm
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.18c1.vip
      1        ONLINE  ONLINE       18c1                     STABLE
ora.18c2.vip
      1        ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       18c1                     STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       18c1                     STABLE
ora.MGMTLSNR
      1        OFFLINE OFFLINE                               STABLE
ora.asm
      1        ONLINE  ONLINE       18c1                     Started,STABLE
      2        ONLINE  ONLINE       18c2                     Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       18c1                     STABLE
ora.qosmserver
      1        ONLINE  ONLINE       18c1                     STABLE
ora.rhpserver
      1        OFFLINE OFFLINE                               STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       18c2                     STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       18c1                     STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       18c1                     STABLE
--------------------------------------------------------------------------------

3.6创建ASM磁盘组

[grid@18c1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 18.0.0.0.0 - Production on Wed Sep 14 14:53:11 2022
Version 18.3.0.0.0

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


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> create diskgroup DATA external REDUNDANCY disk '/dev/asmdisk02' ATTRIBUTE 'au_size'='4M', 'compatible.rdbms' = '18.0', 'compatible.asm' = '18.0';

Diskgroup created.

节点二执行挂载

[grid@18c2 ~]$ sqlplus / as sysasm

SQL*Plus: Release 18.0.0.0.0 - Production on Wed Sep 14 14:52:53 2022
Version 18.3.0.0.0

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


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> alter diskgroup data mount;

Diskgroup altered.


[grid@18c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.DATA.dg
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.OCR.GHCHKPT.advm
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.OCR.dg
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.helper
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     IDLE,STABLE
ora.net1.network
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.ocr.ghchkpt.acfs
               OFFLINE OFFLINE      18c1                     volume /opt/oracle/r
                                                             hp_images/chkbase is
                                                             unmounted,STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.ons
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.proxy_advm
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.18c1.vip
      1        ONLINE  ONLINE       18c1                     STABLE
ora.18c2.vip
      1        ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       18c1                     STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       18c1                     STABLE
ora.MGMTLSNR
      1        OFFLINE OFFLINE                               STABLE
ora.asm
      1        ONLINE  ONLINE       18c1                     Started,STABLE
      2        ONLINE  ONLINE       18c2                     Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       18c1                     STABLE
ora.qosmserver
      1        ONLINE  ONLINE       18c1                     STABLE
ora.rhpserver
      1        OFFLINE OFFLINE                               STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       18c2                     STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       18c1                     STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       18c1                     STABLE
--------------------------------------------------------------------------------

四·安装数据库软件
4.1 解压安装包

[oracle@18c1 ~]$ cd /soft
[oracle@18c1 soft]$ ls -lrt
total 9713788
-rw-r--r--. 1 oracle oinstall 4564649047 Mar 31  2019 LINUX.X64_180000_db_home.zip
-rw-r--r--. 1 grid   oinstall 5382265496 Mar 31  2019 LINUX.X64_180000_grid_home.zip

[oracle@18c1 soft]$ unzip -q LINUX.X64_180000_db_home.zip -d $ORACLE_HOME

4.2安装前检查

[grid@18c1 ~]$ORACLE_HOME/runcluvfy.sh stage -pre dbinst -n  "18c1,18c2"  -fixup -verbose
......
Execute "/u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh" as root user on nodes "18c2,18c1" to perform the fix up operations manually

Press ENTER key to continue after execution of "/u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh" has completed on nodes "18c2,18c1"

Fix: Group Membership: dba 

  Node Name                             Status                  
  ------------------------------------  ------------------------
  18c2                                  failed                  
  18c1                                  failed                  

ERROR: 
18c2: PRVG-9023 : Manual fix up command "/u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh" was not issued by root user on node "18c2"

18c1: PRVG-9023 : Manual fix up command "/u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh" was not issued by root user on node "18c1"

Result: 
"Group Membership: dba" could not be fixed on nodes "18c2,18c1"

Fix up operations for selected fixable prerequisites were unsuccessful on nodes "18c2,18c1"


[root@18c1 ~]# /u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh
All Fix-up operations were completed successfully.


[root@18c2 ~]# /u01/tmp/CVU_18.0.0.0.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

4.3编写响应文件

[oracle@18c1 ~]$ vi dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v18.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/18.3/db
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.CLUSTER_NODES=18c1,18c2
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

[oracle@18c1 ~]$ $ORACLE_HOME/runInstaller -silent  -force -noconfig  -ignorePrereq -responseFile /home/oracle/dbinstall.rsp
Launching Oracle Database Setup Wizard...

[WARNING] [INS-13013] Target environment does not meet some mandatory requirements.
   CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2022-09-14_01-09-17PM/installActions2022-09-14_01-09-17PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2022-09-14_01-09-17PM/installActions2022-09-14_01-09-17PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/18.3/db/install/response/db_2022-09-14_01-09-17PM.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/InstallActions2022-09-14_01-09-17PM/installActions2022-09-14_01-09-17PM.log

As a root user, execute the following script(s):
        1. /u01/app/oracle/product/18.3/db/root.sh

Execute /u01/app/oracle/product/18.3/db/root.sh on the following nodes: 
[18c1, 18c2]


Successfully Setup Software with warning(s).

4.4执行root.sh脚本

[root@18c1 oracle]# /u01/app/oracle/product/18.3/db/root.sh
Check /u01/app/oracle/product/18.3/db/install/root_18c1_2022-09-14_14-17-43-907653393.log for the output of root script
[root@18c1 oracle]# cat /u01/app/oracle/product/18.3/db/install/root_18c1_2022-09-14_14-17-43-907653393.log
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/18.3/db
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

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.

[root@18c2 18.3]# /u01/app/oracle/product/18.3/db/root.sh
Check /u01/app/oracle/product/18.3/db/install/root_18c2_2022-09-14_14-17-49-252045874.log for the output of root script
[root@18c2 18.3]# cat /u01/app/oracle/product/18.3/db/install/root_18c2_2022-09-14_14-17-49-252045874.log
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/18.3/db
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

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.

五·创建数据库

[oracle@18c1 ~]$ vi dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
templateName=General_Purpose.dbc
gdbName=ora18c
sid=ora18c
databaseConfigType=RAC
responseFile=NO_VALUE
characterSet=ZHS16GBK
nationalCharacterSet=AL16UTF16
sysPassword=xxzx7817600
systemPassword=xxzx7817600
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=ora18cpdb
useLocalUndoForPDBs=TRUE
pdbAdminPassword=xxzx7817600
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=3072
redoLogFileSize=50
emConfiguration=NONE
nodelist=18c1,18c2
storageType=ASM
diskGroupName=+DATA
datafileDestination=+DATA
asmsnmpPassword=xxzx7817600
sampleSchema=TRUE

[oracle@18c1 ~]$ dbca -ignorePreReqs -silent  -createDatabase   -responseFile /home/oracle/dbca.rsp
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
7% complete
Copying database files
27% complete
Creating and starting Oracle instance
28% complete
31% complete
35% complete
37% complete
40% complete
Creating cluster database views
41% complete
53% complete
Completing Database Creation
57% complete
59% complete
60% complete
Creating Pluggable Databases
64% complete
80% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ora18c.
Database Information:
Global Database Name:ora18c
System Identifier(SID) Prefix:ora18c
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora18c/ora18c.log" for further details.

[grid@18c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.DATA.dg
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.OCR.GHCHKPT.advm
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.OCR.dg
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.helper
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     IDLE,STABLE
ora.net1.network
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.ocr.ghchkpt.acfs
               OFFLINE OFFLINE      18c1                     volume /opt/oracle/r
                                                             hp_images/chkbase is
                                                             unmounted,STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.ons
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.proxy_advm
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.18c1.vip
      1        ONLINE  ONLINE       18c1                     STABLE
ora.18c2.vip
      1        ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       18c1                     STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       18c1                     STABLE
ora.MGMTLSNR
      1        OFFLINE OFFLINE                               STABLE
ora.asm
      1        ONLINE  ONLINE       18c1                     Started,STABLE
      2        ONLINE  ONLINE       18c2                     Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       18c1                     STABLE
ora.ora18c.db
      1        ONLINE  ONLINE       18c1                     Open,HOME=/u01/app/o
                                                             racle/product/18.3/d
                                                             b,STABLE
      2        ONLINE  ONLINE       18c2                     Open,HOME=/u01/app/o
                                                             racle/product/18.3/d
                                                             b,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       18c1                     STABLE
ora.rhpserver
      1        OFFLINE OFFLINE                               STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       18c2                     STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       18c1                     STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       18c1                     STABLE
--------------------------------------------------------------------------------

也可以不指定响应文件直接使用命令行参数来执行

[oracle@18c1 ~]$ dbca -ignorePreReqs -silent -createDatabase -templateName General_Purpose.dbc -gdbName ora18c -sid ora18c -createAsContainerDatabase true -numberOfPDBs 1 -pdbName  ora18cpdb -pdbAdminPassword xxzx7817600 -sysPassword xxzx7817600 -systemPassword xxzx7817600 -datafileDestination 'data/' -redoLogFileSize 50   -storageType ASM  -responseFile NO_VALUE  -characterset ZHS16GBK -nationalCharacterSet AL16UTF16    -sampleSchema  true -automaticMemoryManagement false -totalMemory 3072 -databaseType MULTIPURPOSE -nodelist 18c1,18c2 -listeners ASMNET1LSNR_ASM,LISTENER,LISTENER_SCAN2
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
7% complete
Copying database files
27% complete
Creating and starting Oracle instance
28% complete
31% complete
35% complete
37% complete
40% complete
Creating cluster database views
41% complete
53% complete
Completing Database Creation
57% complete
59% complete
60% complete
Creating Pluggable Databases
64% complete
80% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ora18c.
Database Information:
Global Database Name:ora18c
System Identifier(SID) Prefix:ora18c
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora18c/ora18c.log" for further details.

测试连接

[oracle@18c1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Wed Sep 14 15:32:38 2022
Version 18.3.0.0.0

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


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> desc v$version;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 BANNER                                             VARCHAR2(80)
 BANNER_FULL                                        VARCHAR2(160)
 BANNER_LEGACY                                      VARCHAR2(80)
 CON_ID                                             NUMBER



SQL> select * from v$version;

BANNER                                                                           BANNER_FULL                                                                                                                                                BANNER_LEGACY                                                                 CON_ID
-------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production           Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production                                                                                     Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production             0
                                                                                 Version 18.3.0.0.0


SQL> show pdbs;

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