oracle – 但行好事 莫问前程 http://www.jydba.net Tue, 08 Oct 2024 07:22:55 +0000 zh-CN hourly 1 https://wordpress.org/?v=4.9.10 oracle使用rman对启用归档的rac 11g数据库执行备份与恢复操作(异机恢复) http://www.jydba.net/index.php/archives/3553 http://www.jydba.net/index.php/archives/3553#respond Tue, 19 Mar 2024 00:41:33 +0000 http://www.jydba.net/?p=3553 因为要被审计的数据库有10T大小,用逻辑导出导入方式复制一份数据用于审计满足不了时间要求,而且生产环境没有空间用于执行逻辑备份或物理备份,所以执行rman物理备份时只能通过nfs将备份文件直接存储在目标主机上。但我这里的测试还是在生产环境中执行rman备份,这个只是测试可行性。下面是将生产库通过rman备份在异机上执行恢复的具体步骤:
1.对源库执行全库备份脚本

vi backup.sh
backtime=`date +"20%y%m%d%H%M%S"`
rman target /  log=/rmanbak/dadb_backupall_$backtime.log < 

2.执行备份脚本对源库执行备份

[oracle@dbs1 rmanbak]$ ./jy.sh

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14>
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=3694 instance=dadb1 device type=DISK

allocated channel: c2
channel c2: SID=1849 instance=dadb1 device type=DISK

Starting backup at 06-MAR-24
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00002 name=+DA/dadbp/datafile/sysaux.260.1109022421
input datafile file number=00007 name=+DA/dadbp/datafile/system001.dbf
input datafile file number=00010 name=+DA/dadbp/datafile/test.288.1109026503
input datafile file number=00004 name=+DA/dadbp/datafile/users.267.1109022873
input datafile file number=00006 name=+DA/dadbp/datafile/hygeia.261.1109022717
channel c1: starting piece 1 at 06-MAR-24
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00008 name=+DA/dadbp/datafile/sysaux.259.1109022127
input datafile file number=00001 name=+DA/dadbp/datafile/system.263.1109022847
input datafile file number=00005 name=+DA/dadbp/datafile/undotbs2.264.1109022863
input datafile file number=00003 name=+DA/dadbp/datafile/undotbs1.265.1109022869
input datafile file number=00009 name=+DA/dadbp/datafile/cs01.bdf
channel c2: starting piece 1 at 06-MAR-24
channel c2: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_DADB_20240306_vv2l0hog_1_1 tag=DA_FULL_BAK comment=NONE
channel c2: backup set complete, elapsed time: 00:14:35
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
including current control file in backup set
channel c2: starting piece 1 at 06-MAR-24
channel c2: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_DADB_20240306_002l0ijr_1_1 tag=DA_FULL_BAK comment=NONE
channel c2: backup set complete, elapsed time: 00:00:03
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c2: starting piece 1 at 06-MAR-24
channel c2: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_DADB_20240306_012l0ijv_1_1 tag=DA_FULL_BAK comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c1: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_DADB_20240306_vu2l0hog_1_1 tag=DA_FULL_BAK comment=NONE
channel c1: backup set complete, elapsed time: 00:18:24
Finished backup at 06-MAR-24

sql statement: alter system archive log current

Starting backup at 06-MAR-24
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=36171 RECID=12088 STAMP=1162596765
input archived log thread=2 sequence=27786 RECID=12094 STAMP=1162628068
input archived log thread=1 sequence=36172 RECID=12090 STAMP=1162625683
input archived log thread=1 sequence=36173 RECID=12092 STAMP=1162628067
input archived log thread=1 sequence=36174 RECID=12096 STAMP=1162645216
input archived log thread=2 sequence=27787 RECID=12098 STAMP=1162663210
input archived log thread=1 sequence=36175 RECID=12101 STAMP=1162679311
input archived log thread=2 sequence=27788 RECID=12102 STAMP=1162679311
input archived log thread=1 sequence=36176 RECID=12104 STAMP=1162679313
input archived log thread=2 sequence=27789 RECID=12106 STAMP=1162679314
input archived log thread=1 sequence=36177 RECID=12108 STAMP=1162683167
input archived log thread=2 sequence=27790 RECID=12114 STAMP=1162714548
input archived log thread=1 sequence=36178 RECID=12110 STAMP=1162713627
input archived log thread=1 sequence=36179 RECID=12112 STAMP=1162714545
input archived log thread=1 sequence=36180 RECID=12116 STAMP=1162750588
input archived log thread=2 sequence=27791 RECID=12120 STAMP=1162765758
channel c1: starting piece 1 at 06-MAR-24
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=36181 RECID=12118 STAMP=1162765756
input archived log thread=1 sequence=36182 RECID=12124 STAMP=1162765763
input archived log thread=2 sequence=27792 RECID=12122 STAMP=1162765761
input archived log thread=2 sequence=27793 RECID=12130 STAMP=1162800019
input archived log thread=1 sequence=36183 RECID=12126 STAMP=1162769575
input archived log thread=1 sequence=36184 RECID=12128 STAMP=1162800017
input archived log thread=1 sequence=36185 RECID=12132 STAMP=1162801020
input archived log thread=2 sequence=27794 RECID=12136 STAMP=1162850453
input archived log thread=1 sequence=36186 RECID=12134 STAMP=1162846806
input archived log thread=1 sequence=36187 RECID=12138 STAMP=1162852076
input archived log thread=2 sequence=27795 RECID=12140 STAMP=1162852078
input archived log thread=1 sequence=36188 RECID=12144 STAMP=1162852082
input archived log thread=2 sequence=27796 RECID=12142 STAMP=1162852080
input archived log thread=2 sequence=27797 RECID=12150 STAMP=1162887460
input archived log thread=1 sequence=36189 RECID=12146 STAMP=1162855991
input archived log thread=1 sequence=36190 RECID=12148 STAMP=1162887457
input archived log thread=1 sequence=36191 RECID=12154 STAMP=1162890083
input archived log thread=2 sequence=27798 RECID=12152 STAMP=1162890082
channel c2: starting piece 1 at 06-MAR-24
channel c1: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_arc_1162890092_21506 tag=DA_ARC_BAK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=2 sequence=27799 RECID=12158 STAMP=1162890088
input archived log thread=1 sequence=36192 RECID=12156 STAMP=1162890086
channel c1: starting piece 1 at 06-MAR-24
channel c2: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_arc_1162890092_21507 tag=DA_ARC_BAK comment=NONE
channel c2: backup set complete, elapsed time: 00:00:15
channel c1: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_arc_1162890107_21508 tag=DA_ARC_BAK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-MAR-24

Starting backup at 06-MAR-24
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 06-MAR-24
channel c1: finished piece 1 at 06-MAR-24
piece handle=/rmanbak/dadb_cntrl_21509_1_21509 tag=DA_CONTROL_BAK comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-MAR-24

validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_02/thread_1_seq_36171.938.1162596765 RECID=12088 STAMP=1162596765
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_1_seq_36172.317.1162625683 RECID=12090 STAMP=1162625683
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_1_seq_36173.2388.1162628067 RECID=12092 STAMP=1162628067
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_1_seq_36174.1976.1162645215 RECID=12096 STAMP=1162645216
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_1_seq_36175.370.1162679311 RECID=12101 STAMP=1162679311
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_1_seq_36176.962.1162679313 RECID=12104 STAMP=1162679313
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_1_seq_36177.2719.1162683167 RECID=12108 STAMP=1162683167
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_1_seq_36178.2575.1162713627 RECID=12110 STAMP=1162713627
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_1_seq_36179.2282.1162714545 RECID=12112 STAMP=1162714545
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_1_seq_36180.1884.1162750589 RECID=12116 STAMP=1162750588
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_1_seq_36181.973.1162765757 RECID=12118 STAMP=1162765756
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_1_seq_36182.2148.1162765763 RECID=12124 STAMP=1162765763
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_1_seq_36183.1132.1162769575 RECID=12126 STAMP=1162769575
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_1_seq_36184.2397.1162800017 RECID=12128 STAMP=1162800017
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_1_seq_36185.1359.1162801021 RECID=12132 STAMP=1162801020
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_1_seq_36186.2488.1162846805 RECID=12134 STAMP=1162846806
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_1_seq_36187.2068.1162852077 RECID=12138 STAMP=1162852076
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_1_seq_36188.2513.1162852083 RECID=12144 STAMP=1162852082
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_1_seq_36189.2592.1162855991 RECID=12146 STAMP=1162855991
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_06/thread_1_seq_36190.287.1162887457 RECID=12148 STAMP=1162887457
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_06/thread_1_seq_36191.2276.1162890083 RECID=12154 STAMP=1162890083
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_06/thread_1_seq_36192.1168.1162890087 RECID=12156 STAMP=1162890086
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_2_seq_27786.2448.1162628069 RECID=12094 STAMP=1162628068
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_2_seq_27787.1182.1162663211 RECID=12098 STAMP=1162663210
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_2_seq_27788.567.1162679311 RECID=12102 STAMP=1162679311
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_03/thread_2_seq_27789.2305.1162679315 RECID=12106 STAMP=1162679314
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_2_seq_27790.2769.1162714549 RECID=12114 STAMP=1162714548
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_2_seq_27791.2742.1162765757 RECID=12120 STAMP=1162765758
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_04/thread_2_seq_27792.1811.1162765761 RECID=12122 STAMP=1162765761
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_2_seq_27793.1189.1162800019 RECID=12130 STAMP=1162800019
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_2_seq_27794.1140.1162850449 RECID=12136 STAMP=1162850453
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_2_seq_27795.2058.1162852077 RECID=12140 STAMP=1162852078
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_05/thread_2_seq_27796.2345.1162852081 RECID=12142 STAMP=1162852080
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_06/thread_2_seq_27797.1391.1162887461 RECID=12150 STAMP=1162887460
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_06/thread_2_seq_27798.2100.1162890083 RECID=12152 STAMP=1162890082
validation succeeded for archived log
archived log file name=+ARCH/dadbp/archivelog/2024_03_06/thread_2_seq_27799.2212.1162890089 RECID=12158 STAMP=1162890088
Crosschecked 36 objects


crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240303_v62kq4gm_1_1 RECID=21314 STAMP=1162678806
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240303_v72kq4uk_1_1 RECID=21315 STAMP=1162679259
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240303_v52kq4gm_1_1 RECID=21317 STAMP=1162678806
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162679319_21482 RECID=21318 STAMP=1162679319
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162679319_21481 RECID=21319 STAMP=1162679319
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162679326_21483 RECID=21320 STAMP=1162679326
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/cntrl_21484_1_21484 RECID=21321 STAMP=1162679331
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240304_ve2ksoso_1_1 RECID=21322 STAMP=1162765208
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240304_vf2kspbt_1_1 RECID=21323 STAMP=1162765719
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240304_vg2kspco_1_1 RECID=21324 STAMP=1162765720
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240304_vd2ksoso_1_1 RECID=21325 STAMP=1162765208
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162765766_21490 RECID=21326 STAMP=1162765767
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162765766_21489 RECID=21327 STAMP=1162765766
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/cntrl_21491_1_21491 RECID=21328 STAMP=1162765777
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240305_vl2kvd8m_1_1 RECID=21329 STAMP=1162851606
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240305_vm2kvdll_1_1 RECID=21330 STAMP=1162852028
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240305_vn2kvdlt_1_1 RECID=21331 STAMP=1162852029
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/db_DADB_20240305_vk2kvd8m_1_1 RECID=21332 STAMP=1162851606
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162852086_21496 RECID=21333 STAMP=1162852086
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162852086_21497 RECID=21334 STAMP=1162852086
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/arc_1162852093_21498 RECID=21335 STAMP=1162852093
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dangan/cntrl_21499_1_21499 RECID=21336 STAMP=1162852098
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_DADB_20240306_vv2l0hog_1_1 RECID=21337 STAMP=1162888976
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_DADB_20240306_002l0ijr_1_1 RECID=21338 STAMP=1162889852
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_DADB_20240306_012l0ijv_1_1 RECID=21339 STAMP=1162889855
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_DADB_20240306_vu2l0hog_1_1 RECID=21340 STAMP=1162888976
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_arc_1162890092_21506 RECID=21341 STAMP=1162890092
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_arc_1162890092_21507 RECID=21342 STAMP=1162890092
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_arc_1162890107_21508 RECID=21343 STAMP=1162890107
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rmanbak/dadb_cntrl_21509_1_21509 RECID=21344 STAMP=1162890110
Crosschecked 30 objects


specification does not match any backup in the repository

RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 7 days
no obsolete backups found

released channel: c1

released channel: c2

RMAN>

Recovery Manager complete.

3.将备份文件拷贝到目标主机上

[root@dbs1 rmanbak]# scp dadb*  10.18.10.101:/databak/dadb/
root@10.18.10.101's password:
dadb_arc_1162890092_21506                                                                                                                                                                                100%  970MB  88.2MB/s   00:11
dadb_arc_1162890092_21507                                                                                                                                                                                100%  854MB  85.4MB/s   00:10
dadb_arc_1162890107_21508                                                                                                                                                                                100%   20KB  20.0KB/s   00:00
dadb_backupall_20240306084252.log                                                                                                                                                                        100%   17KB  16.7KB/s   00:00
dadb_cntrl_21509_1_21509                                                                                                                                                                                 100%   85MB  85.4MB/s   00:00
dadb_DADB_20240306_002l0ijr_1_1                                                                                                                                                                          100% 5344KB   5.2MB/s   00:01
dadb_DADB_20240306_012l0ijv_1_1                                                                                                                                                                          100%   96KB  96.0KB/s   00:00
dadb_DADB_20240306_vu2l0hog_1_1                                                                                                                                                                          100% 5794MB  90.5MB/s   01:04
dadb_DADB_20240306_vv2l0hog_1_1                                                                                                                                                                          100% 4626MB  94.4MB/s   00:49
[root@dbs1 rmanbak]#

4.将源库的密码文件复制到目标主机上

[root@dbs1 rmanbak]# scp  /u01/app/oracle/product/11.2.0.4/db/dbs/orapwdadb1  10.18.10.101:/u01/app/oracle/product/11.2.0.4/db/dbs/
root@10.18.10.101's password:
orapwdadb1                                                                                                                                                                                               100% 1536     1.5KB/s   00:00
[root@dbs1 rmanbak]#

5.恢复初始化参数文件(这里需要找到包含初始化参数文件的备份集,在源端数据库可以通过list backup可以找到包含参数文件的备份集)

[oracle@sjjh dbs]$ rman target/

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Mar 6 09:39:47 2024

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

connected to target database (not started)

RMAN> startup nomount

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0.4/db/dbs/initdadb.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                327156616 bytes
Database Buffers             734003200 bytes
Redo Buffers                   5517312 bytes

RMAN> restore spfile to pfile '/u01/app/oracle/product/11.2.0.4/db/dbs/initdadb.ora' from '/databak/dadb/dadb_DADB_20240306_012l0ijv_1_1';

Starting restore at 06-MAR-24
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /databak/dadb/dadb_DADB_20240306_012l0ijv_1_1
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 06-MAR-24

6.修改控制文件

[oracle@sjjh dbs]$ cat  initdadb.ora
dadb1.__db_cache_size=5133828096
dadb2.__db_cache_size=6442450944
dadb1.__java_pool_size=234881024
dadb2.__java_pool_size=234881024
dadb1.__large_pool_size=268435456
dadb2.__large_pool_size=268435456
dadb1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
dadb1.__pga_aggregate_target=5368709120
dadb2.__pga_aggregate_target=5368709120
dadb1.__sga_target=10737418240
dadb2.__sga_target=10737418240
dadb1.__shared_io_pool_size=536870912
dadb2.__shared_io_pool_size=0
dadb1.__shared_pool_size=4429185024
dadb2.__shared_pool_size=3724541952
dadb1.__streams_pool_size=67108864
dadb2.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/dadb/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/oradata/dadb/controlfile/control01.ctl','/oradata/dadb/controlfile/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='/oradata/dadb'
*.db_domain=''
*.db_file_name_convert='+da/dadbs/','/oradata/dadb/'
*.db_name='dadb'
*.db_unique_name='dadbp'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=dadbXDB)'
dadb2.instance_number=2
dadb1.instance_number=1
*.log_archive_dest_1='location=/oradata/arch  valid_for=(all_logfiles,all_roles) db_unique_name=dadb'
*.log_archive_dest_2=''
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arch'
*.log_file_name_convert='+da/dadbs/','/oradata/dadb/'
*.open_cursors=300
*.pga_aggregate_target=5368709120
*.processes=3000
*.remote_login_passwordfile='exclusive'
*.service_names='dadb'
*.sessions=3305
*.sga_max_size=10737418240
*.sga_target=10737418240
dadb2.thread=2
dadb1.thread=1
dadb1.undo_tablespace='UNDOTBS1'
dadb2.undo_tablespace='UNDOTBS2'

[oracle@sjjh dbs]$ mkdir -p /u01/app/oracle/admin/dadb/adump

7.使用恢复的初始化参数文件nomount数据库

RMAN> shutdown immediate

Oracle instance shut down


RMAN> startup nomount pfile='/u01/app/oracle/product/11.2.0.4/db/dbs/initdadb.ora'

Oracle instance started

Total System Global Area   10689474560 bytes

Fixed Size                     2262656 bytes
Variable Size               2785020288 bytes
Database Buffers            7885291520 bytes
Redo Buffers                  16900096 bytes

8.恢复控制文件

RMAN> restore controlfile from '/databak/dadb/dadb_DADB_20240306_002l0ijr_1_1';

Starting restore at 06-MAR-24
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1982 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/oradata/dadb/controlfile/control01.ctl
output file name=/oradata/dadb/controlfile/control02.ctl
Finished restore at 06-MAR-24

9.启动数据库到mount状态

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

10.将备份集的信息加入到catalog,使目前的控制文件记录有目前的备份信息,以便用户恢复.从远端数据库拷贝过来的备份集存放于目录/databak/dadb/

RMAN> catalog start with '/databak/dadb/';

searching for all files that match the pattern /databak/dadb/

List of Files Unknown to the Database
=====================================
File Name: /databak/dadb/dadb_cntrl_21509_1_21509
File Name: /databak/dadb/dadb_DADB_20240306_vu2l0hog_1_1
File Name: /databak/dadb/dadb_DADB_20240306_002l0ijr_1_1
File Name: /databak/dadb/dadb_arc_1162890092_21506
File Name: /databak/dadb/dadb_DADB_20240306_012l0ijv_1_1
File Name: /databak/dadb/dadb_arc_1162890092_21507
File Name: /databak/dadb/dadb_arc_1162890107_21508
File Name: /databak/dadb/dadb_DADB_20240306_vv2l0hog_1_1

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /databak/dadb/dadb_cntrl_21509_1_21509
File Name: /databak/dadb/dadb_DADB_20240306_vu2l0hog_1_1
File Name: /databak/dadb/dadb_DADB_20240306_002l0ijr_1_1
File Name: /databak/dadb/dadb_arc_1162890092_21506
File Name: /databak/dadb/dadb_DADB_20240306_012l0ijv_1_1
File Name: /databak/dadb/dadb_arc_1162890092_21507
File Name: /databak/dadb/dadb_arc_1162890107_21508
File Name: /databak/dadb/dadb_DADB_20240306_vv2l0hog_1_1

11.还原数据文件

RMAN> run{
2> allocate channel c1 device type disk;
3> allocate channel c2 device type disk;
4> set newname for datafile '+DA/dadbp/datafile/cs01.bdf' to '/oradata/dadb/cs01.dbf';
5> set newname for datafile '+DA/dadbp/datafile/hygeia.261.1109022717' to '/oradata/dadb/hygeia.dbf';
6> set newname for datafile '+DA/dadbp/datafile/sysaux.260.1109022421' to '/oradata/dadb/sysaux01.dbf';
7> set newname for datafile '+DA/dadbp/datafile/sysaux.259.1109022127' to '/oradata/dadb/sysaux.dbf';
8> set newname for datafile '+DA/dadbp/datafile/system.263.1109022847' to '/oradata/dadb/system.dbf';
9> set newname for datafile '+DA/dadbp/datafile/system001.dbf' to '/oradata/dadb/system001.dbf';
10> set newname for datafile '+DA/dadbp/datafile/test.288.1109026503' to '/oradata/dadb/test.dbf';
11> set newname for datafile '+DA/dadbp/datafile/undotbs1.265.1109022869' to '/oradata/dadb/undotbs1.dbf';
12> set newname for datafile '+DA/dadbp/datafile/undotbs2.264.1109022863' to '/oradata/dadb/undotbs2.dbf';
13> set newname for datafile '+DA/dadbp/datafile/users.267.1109022873' to '/oradata/dadb/users.dbf';
14> restore database;
15> switch datafile all;
16> release channel c1;
17> release channel c2;
18> }

released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=1982 device type=DISK

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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 06-MAR-24

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00002 to /oradata/dadb/sysaux01.dbf
channel c1: restoring datafile 00004 to /oradata/dadb/users.dbf
channel c1: restoring datafile 00006 to /oradata/dadb/hygeia.dbf
channel c1: restoring datafile 00007 to /oradata/dadb/system001.dbf
channel c1: restoring datafile 00010 to /oradata/dadb/test.dbf
channel c1: reading from backup piece /databak/dadb/dadb_DADB_20240306_vu2l0hog_1_1
channel c2: starting datafile backup set restore
channel c2: specifying datafile(s) to restore from backup set
channel c2: restoring datafile 00001 to /oradata/dadb/system.dbf
channel c2: restoring datafile 00003 to /oradata/dadb/undotbs1.dbf
channel c2: restoring datafile 00005 to /oradata/dadb/undotbs2.dbf
channel c2: restoring datafile 00008 to /oradata/dadb/sysaux.dbf
channel c2: restoring datafile 00009 to /oradata/dadb/cs01.dbf
channel c2: reading from backup piece /databak/dadb/dadb_DADB_20240306_vv2l0hog_1_1
channel c2: piece handle=/databak/dadb/dadb_DADB_20240306_vv2l0hog_1_1 tag=DA_FULL_BAK
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:20:26
channel c1: piece handle=/databak/dadb/dadb_DADB_20240306_vu2l0hog_1_1 tag=DA_FULL_BAK
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:25:36
Finished restore at 06-MAR-24


released channel: c1

released channel: c2

12.还原归档日志文件

RMAN> run{
2> allocate channel c1 device type disk;
3> allocate channel c2 device type disk;
4> set archivelog destination to '/oradata/arch/';
5> restore archivelog from logseq 36171 until logseq 36192 thread 1;
6> restore archivelog from logseq 27786 until logseq 27799 thread 2;
7> release channel c1;
8> release channel c2;
9> }

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

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

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 06-MAR-24

channel c1: starting archived log restore to user-specified destination
archived log destination=/oradata/arch/
channel c1: restoring archived log
archived log thread=1 sequence=36171
channel c1: restoring archived log
archived log thread=1 sequence=36172
channel c1: restoring archived log
archived log thread=1 sequence=36173
channel c1: restoring archived log
archived log thread=1 sequence=36174
channel c1: restoring archived log
archived log thread=1 sequence=36175
channel c1: restoring archived log
archived log thread=1 sequence=36176
channel c1: restoring archived log
archived log thread=1 sequence=36177
channel c1: restoring archived log
archived log thread=1 sequence=36178
channel c1: restoring archived log
archived log thread=1 sequence=36179
channel c1: restoring archived log
archived log thread=1 sequence=36180
channel c1: reading from backup piece /databak/dadb/dadb_arc_1162890092_21506
channel c2: starting archived log restore to user-specified destination
archived log destination=/oradata/arch/
channel c2: restoring archived log
archived log thread=1 sequence=36181
channel c2: restoring archived log
archived log thread=1 sequence=36182
channel c2: restoring archived log
archived log thread=1 sequence=36183
channel c2: restoring archived log
archived log thread=1 sequence=36184
channel c2: restoring archived log
archived log thread=1 sequence=36185
channel c2: restoring archived log
archived log thread=1 sequence=36186
channel c2: restoring archived log
archived log thread=1 sequence=36187
channel c2: restoring archived log
archived log thread=1 sequence=36188
channel c2: restoring archived log
archived log thread=1 sequence=36189
channel c2: restoring archived log
archived log thread=1 sequence=36190
channel c2: restoring archived log
archived log thread=1 sequence=36191
channel c2: reading from backup piece /databak/dadb/dadb_arc_1162890092_21507
channel c2: piece handle=/databak/dadb/dadb_arc_1162890092_21507 tag=DA_ARC_BAK
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:15
channel c2: starting archived log restore to user-specified destination
archived log destination=/oradata/arch/
channel c2: restoring archived log
archived log thread=1 sequence=36192
channel c2: reading from backup piece /databak/dadb/dadb_arc_1162890107_21508
channel c1: piece handle=/databak/dadb/dadb_arc_1162890092_21506 tag=DA_ARC_BAK
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:16
channel c2: piece handle=/databak/dadb/dadb_arc_1162890107_21508 tag=DA_ARC_BAK
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:01
Finished restore at 06-MAR-24

Starting restore at 06-MAR-24

channel c1: starting archived log restore to user-specified destination
archived log destination=/oradata/arch/
channel c1: restoring archived log
archived log thread=2 sequence=27786
channel c1: restoring archived log
archived log thread=2 sequence=27787
channel c1: restoring archived log
archived log thread=2 sequence=27788
channel c1: restoring archived log
archived log thread=2 sequence=27789
channel c1: restoring archived log
archived log thread=2 sequence=27790
channel c1: restoring archived log
archived log thread=2 sequence=27791
channel c1: reading from backup piece /databak/dadb/dadb_arc_1162890092_21506
channel c2: starting archived log restore to user-specified destination
archived log destination=/oradata/arch/
channel c2: restoring archived log
archived log thread=2 sequence=27792
channel c2: restoring archived log
archived log thread=2 sequence=27793
channel c2: restoring archived log
archived log thread=2 sequence=27794
channel c2: restoring archived log
archived log thread=2 sequence=27795
channel c2: restoring archived log
archived log thread=2 sequence=27796
channel c2: restoring archived log
archived log thread=2 sequence=27797
channel c2: restoring archived log
archived log thread=2 sequence=27798
channel c2: reading from backup piece /databak/dadb/dadb_arc_1162890092_21507
channel c2: piece handle=/databak/dadb/dadb_arc_1162890092_21507 tag=DA_ARC_BAK
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:07
channel c2: starting archived log restore to user-specified destination
archived log destination=/oradata/arch/
channel c2: restoring archived log
archived log thread=2 sequence=27799
channel c2: reading from backup piece /databak/dadb/dadb_arc_1162890107_21508
channel c1: piece handle=/databak/dadb/dadb_arc_1162890092_21506 tag=DA_ARC_BAK
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:09
channel c2: piece handle=/databak/dadb/dadb_arc_1162890107_21508 tag=DA_ARC_BAK
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:01
Finished restore at 06-MAR-24

released channel: c1

released channel: c2

13.执行恢复操作

RMAN> recover database;

Starting recover at 06-MAR-24
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1700 device type=DISK

starting media recovery

archived log for thread 1 with sequence 36191 is already on disk as file /oradata/arch/1_36191_939387772.arch
archived log for thread 1 with sequence 36192 is already on disk as file /oradata/arch/1_36192_939387772.arch
archived log for thread 2 with sequence 27798 is already on disk as file /oradata/arch/2_27798_939387772.arch
archived log for thread 2 with sequence 27799 is already on disk as file /oradata/arch/2_27799_939387772.arch
archived log file name=/oradata/arch/1_36191_939387772.arch thread=1 sequence=36191
archived log file name=/oradata/arch/2_27798_939387772.arch thread=2 sequence=27798
archived log file name=/oradata/arch/2_27799_939387772.arch thread=2 sequence=27799
archived log file name=/oradata/arch/1_36192_939387772.arch thread=1 sequence=36192
unable to find archived log
archived log thread=1 sequence=36193
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/06/2024 12:21:52
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 36193 and starting SCN of 18518339722150

上面提示需要日志序号为36193的归档日志文件,因为我的备份只备到日志序号为36192的归档日志。

RMAN> list backup;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21345   Full    85.42M     DISK        00:00:00     06-MAR-24
        BP Key: 21346   Status: AVAILABLE  Compressed: NO  Tag: DA_CONTROL_BAK
        Piece Name: /databak/dadb/dadb_cntrl_21509_1_21509
  Control File Included: Ckp SCN: 18518339722264   Ckp time: 06-MAR-24

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21346   Full    5.66G      DISK        00:00:00     06-MAR-24
        BP Key: 21347   Status: AVAILABLE  Compressed: YES  Tag: DA_FULL_BAK
        Piece Name: /databak/dadb/dadb_DADB_20240306_vu2l0hog_1_1
  List of Datafiles in backup set 21346
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 18518339718516 06-MAR-24 /oradata/dadb/sysaux01.dbf
  4       Full 18518339718516 06-MAR-24 /oradata/dadb/users.dbf
  6       Full 18518339718516 06-MAR-24 /oradata/dadb/hygeia.dbf
  7       Full 18518339718516 06-MAR-24 /oradata/dadb/system001.dbf
  10      Full 18518339718516 06-MAR-24 /oradata/dadb/test.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21347   Full    5.20M      DISK        00:00:00     06-MAR-24
        BP Key: 21348   Status: AVAILABLE  Compressed: YES  Tag: DA_FULL_BAK
        Piece Name: /databak/dadb/dadb_DADB_20240306_002l0ijr_1_1
  Control File Included: Ckp SCN: 18518339720451   Ckp time: 06-MAR-24

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
21348   970.06M    DISK        00:00:00     06-MAR-24
        BP Key: 21349   Status: AVAILABLE  Compressed: NO  Tag: DA_ARC_BAK
        Piece Name: /databak/dadb/dadb_arc_1162890092_21506

  List of Archived Logs in backup set 21348
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    36171   18518338674292 02-MAR-24 18518338689793 02-MAR-24
  1    36172   18518338689793 02-MAR-24 18518338799839 03-MAR-24
  1    36173   18518338799839 03-MAR-24 18518338813263 03-MAR-24
  1    36174   18518338813263 03-MAR-24 18518338884449 03-MAR-24
  1    36175   18518338884449 03-MAR-24 18518338974024 03-MAR-24
  1    36176   18518338974024 03-MAR-24 18518338974039 03-MAR-24
  1    36177   18518338974039 03-MAR-24 18518338993139 03-MAR-24
  1    36178   18518338993139 03-MAR-24 18518339079673 04-MAR-24
  1    36179   18518339079673 04-MAR-24 18518339088612 04-MAR-24
  1    36180   18518339088612 04-MAR-24 18518339193641 04-MAR-24
  2    27786   18518338674296 02-MAR-24 18518338813706 03-MAR-24
  2    27787   18518338813706 03-MAR-24 18518338929221 03-MAR-24
  2    27788   18518338929221 03-MAR-24 18518338974028 03-MAR-24
  2    27789   18518338974028 03-MAR-24 18518338974042 03-MAR-24
  2    27790   18518338974042 03-MAR-24 18518339090540 04-MAR-24
  2    27791   18518339090540 04-MAR-24 18518339290871 04-MAR-24

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21349   Full    80.00K     DISK        00:00:00     06-MAR-24
        BP Key: 21350   Status: AVAILABLE  Compressed: YES  Tag: DA_FULL_BAK
        Piece Name: /databak/dadb/dadb_DADB_20240306_012l0ijv_1_1
  SPFILE Included: Modification time: 05-MAR-24
  SPFILE db_unique_name: DADBP

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
21350   854.23M    DISK        00:00:00     06-MAR-24
        BP Key: 21351   Status: AVAILABLE  Compressed: NO  Tag: DA_ARC_BAK
        Piece Name: /databak/dadb/dadb_arc_1162890092_21507

  List of Archived Logs in backup set 21350
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    36181   18518339193641 04-MAR-24 18518339290866 04-MAR-24
  1    36182   18518339290866 04-MAR-24 18518339290887 04-MAR-24
  1    36183   18518339290887 04-MAR-24 18518339307311 04-MAR-24
  1    36184   18518339307311 04-MAR-24 18518339398770 05-MAR-24
  1    36185   18518339398770 05-MAR-24 18518339409567 05-MAR-24
  1    36186   18518339409567 05-MAR-24 18518339534019 05-MAR-24
  1    36187   18518339534019 05-MAR-24 18518339592978 05-MAR-24
  1    36188   18518339592978 05-MAR-24 18518339593000 05-MAR-24
  1    36189   18518339593000 05-MAR-24 18518339609217 05-MAR-24
  1    36190   18518339609217 05-MAR-24 18518339708119 06-MAR-24
  1    36191   18518339708119 06-MAR-24 18518339722138 06-MAR-24
  2    27792   18518339290871 04-MAR-24 18518339290882 04-MAR-24
  2    27793   18518339290882 04-MAR-24 18518339398968 05-MAR-24
  2    27794   18518339398968 05-MAR-24 18518339548475 05-MAR-24
  2    27795   18518339548475 05-MAR-24 18518339592982 05-MAR-24
  2    27796   18518339592982 05-MAR-24 18518339592995 05-MAR-24
  2    27797   18518339592995 05-MAR-24 18518339709370 06-MAR-24
  2    27798   18518339709370 06-MAR-24 18518339722134 06-MAR-24

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
21351   19.50K     DISK        00:00:00     06-MAR-24
        BP Key: 21352   Status: AVAILABLE  Compressed: NO  Tag: DA_ARC_BAK
        Piece Name: /databak/dadb/dadb_arc_1162890107_21508

  List of Archived Logs in backup set 21351
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    36192   18518339722138 06-MAR-24 18518339722150 06-MAR-24
  2    27799   18518339722134 06-MAR-24 18518339722196 06-MAR-24

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21352   Full    4.52G      DISK        00:00:00     06-MAR-24
        BP Key: 21353   Status: AVAILABLE  Compressed: YES  Tag: DA_FULL_BAK
        Piece Name: /databak/dadb/dadb_DADB_20240306_vv2l0hog_1_1
  List of Datafiles in backup set 21352
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 18518339718518 06-MAR-24 /oradata/dadb/system.dbf
  3       Full 18518339718518 06-MAR-24 /oradata/dadb/undotbs1.dbf
  5       Full 18518339718518 06-MAR-24 /oradata/dadb/undotbs2.dbf
  8       Full 18518339718518 06-MAR-24 /oradata/dadb/sysaux.dbf
  9       Full 18518339718518 06-MAR-24 /oradata/dadb/cs01.dbf

执行按时间点或scn号的恢复操作。因为日志序号为36193的归档日志文件的scn号是从18518339722150开始,所以我们可以执行恢复到scn号=18518339722150为止。

RMAN> recover database until scn 18518339722150;

Starting recover at 06-MAR-24
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:01

Finished recover at 06-MAR-24

14.打开数据库。

RMAN> alter database open resetlogs;

database opened

[oracle@sjjh oradata]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 6 12:25:01 2024

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> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
dadb             OPEN
]]> http://www.jydba.net/index.php/archives/3553/feed 0 Oracle 18c 使用影子表空间来管理丢失写保护 http://www.jydba.net/index.php/archives/3517 http://www.jydba.net/index.php/archives/3517#respond Fri, 24 Nov 2023 00:28:36 +0000 http://www.jydba.net/?p=3517 使用影子表空间来管理丢失写保护

当I/O子系统确认块写入已完成,但在持久存储中没有发生写入时,就会发生数据块丢失写入。影子丢失写保护可以防止丢失写。
.关于影子丢失写保护
当I/O子系统确认块写入的完成,即使没有发生写入,或者当块的前一个镜像覆盖了当前的镜像时,就会发生数据块丢失写. 影子丢失写保护可以防止表空间或单个数据文件的丢失写。

.为影子丢失写保护创建影子表空间
为了给影子丢失写保护创建一个影子表空间,在执行create big file tablespace语句时使用lost write protection子句。

.对数据库启用影子丢失写保护
为了对一个多租户容器数据库(CDB)或一个非CDB启用影子丢人写保护,可以执行带有enable lost write protection子句的alter database语句。为了对一个PDB启用影子丢失写失保护,可以执行带有enable lost write protection子句的alter pluggable database语句。

.对表空间和数据文件启用影子丢失写保护
可以对表空间和数据文件启用影子丢失写保护

.对数据库禁用影子丢失写保护
为了对CDB或非CDB数据库禁用影子丢失写保护,执行带有disable lost write protection子句的alter database语句。为了对一个pdb禁用丢失写保护,执行带有disable lost write protection子句的alter pluggable database语句。

.删除或暂停影子丢失写保护
可以对表空间或数据文件删除或暂停影子丢失写保护

.删除影子表空间
可以执行drop tablespace语句来删除影子表空间。如果使用带有including contents子句的drop tablespace语句,那么影子表空间连同它的内容会一起被删除。如果使用不带including contents子句的drop tablespace语句,那么在删除影子表空间之前,影子表空间的内容在存在其它影子表空间且有足够的可用空间时会被移动到其它的影子表空间中。

关于影子丢失写保护
当I/O子系统确认块写入的完成,即使没有发生写入,或者当块的前一个镜像覆盖了当前的镜像时,就会发生数据块丢失写操作。影子丢失写保护可以防止表空间或数据文件发生丢失写。

影子丢失写保护对于丢失写提供了一种快速检测和立即响应的方法。使用影子丢失写保护可以最小化数据丢失和请求修复数据库所需要的时间。

为了使用影子丢失写保护,你必须对数据库启用并创建一个或多个影子表空间。一个影子表空间是一种特殊目的的大文件表空间它只包含跟踪数据文件的系统改变号(SCNs)。可以通过使用带有lost write protection子句的create tablespace语句来创建一个影子表空间。

当一个被跟踪的数据块从磁盘被读取时,影子丢失写保护通过比较在影子表空间中数据块的SCN与将被读取的数据块最近写入的SCN来检测是否发生了丢失写。如果影子条目的SCN大于被读数据块的SCN,那么发生了丢失写。当检测到丢失写时会返回一个错误。

未检测到的丢失写可能会造成数据损坏因为不正确的数据可能被用于其它的DML事务。影子丢失写保护在使用之前检测到丢失写,以防止数据损坏。可以对特定的表空间和数据文件启用影子丢失写保护。因此,可以对你最重要的数据启用它。你不必使用它来跟踪你的所有数据。

此外,影子表空间也是灵活的。您可以将一个影子表空间替换为另一个影子表空间,以更改其配置或位置。

当影子丢失写保护被启用后,可以对正常的DML操作和SQL*Loader常规路径加载和直接路径加载启用。也可以对RMAN备份启用。RMAN备份检查正在读取的块是否丢失写,如果找到这样的块,会引发错误。

在对表空间或数据文件启用影子丢失写保护之后,如果你想停止收集新的丢失写保护信息并检测丢失写可以暂停它。当影子丢失写保护被暂停之后,跟踪数据会被保存在影子表空间中,并且可以重新启用影子丢失写保护。如果对数据文件或表空间删除影子丢失写保护,那么它的跟踪数据会被删除并且不能重新使用。

可以通过执行带有lost write protection子句的alter tablespace语句来对表空间启用影子丢失写保护,执行带有lost write protection子句的alter database data_file_name语句来对数据文件启用影子丢失写保护。当对表空间启用影子丢失写保护后,表空间的所有当前和以后的数据文件都会启用影子丢失写保护。

Oracle数据库会自动对一个特定的影子表空间指派一个跟踪数据文件。你不能指定那个影子表空间使用某个特定的数据文件。影子表空间中的空间量应该至少为启用影子丢失写保护的数据文件所使用的空间的2%。

注意:
如果增加跟踪数据文件的大小,那么影子丢失写保护将试图重置影子表空间中的跟踪数据。如果没有足够的空间来跟踪所有数据,那么影子丢失写保护会向日志文件插入一条告警信息并使用它所能使用的影子空间来跟踪数据。

数据库闪回会造成任何影子丢失写保护数据被删除。在闪回之后,影子丢失写保护在重新填充时跟踪数据,并在块更新时对影子跟踪数据进行更新。

影子丢失写保护与使用DB_LOST_WRITE_PROTECT初始化参数和备用数据库配置的丢失写保护无关。

为影子丢失写保护创建影子表空间
可以使用带有lost write protection子句的create bigfile tablespace语句来为影子丢失写保护创建一个影子表空间。

一个影子表空间可以被任何启用影子丢失写保护的表空间或数据文件所使用。影子表空间的空间量至少是那些启用影子丢失写保护的数据文件大小的2%.

为了创建影子表空间,数据库的兼容级别必须至少为18.0.0或更高版本。

例如创建一个名为shadow_lwp1的影子表空间供影子丢失写保护使用

SQL> CREATE BIGFILE TABLESPACE shadow_lwp1 DATAFILE 'shadow_lwp1.df' SIZE 10M LOST WRITE PROTECTION;

Tablespace created.

对数据库启用影子丢失写保护
为了对一个CDB或非CDB启用影子丢失写保护,执行带有enable lost write protection子句的alter database语句。为了对pdb启用影子丢失写保护执行带有enable lost write protection子句的alter pluggable database语句。

在对单个表空间和数据文件启用影子丢失写保护之前,你必须至少创建一个影子表空间,并且必须对包含它的数据库启用影子丢失写保护。在执行这些配置后,可以通过执行alter tablespace语句来对表空间启用影子丢失写保护,并且可以通过执行alter database语句来为数据文件启用影子丢失写保护。

注意:
对数据库启用影子丢失写保护,那么数据库的兼容级别至少为18.0.0或更高版本,并且至少存在一个影子表空间。

对CDB root启用或禁用影子丢失写保护不影响PDBs的影子丢失写保护。因此即使对CDB root禁用了影子丢失写保护也还是能对PDB启用影子丢失写保护。

当对数据库启用影子丢失写保护时,会自动指派一个影子表空间供其使用。

对数据库启用影子丢失写保护操作如下:
1.通过SQL*Plus,使用有要求的权限的用户进行登录:
.对于非CDB或CDB root使用有alter database系统权限的用户进行登录。

.对于应用程序root,PDB或应用程序PDB,使用有alter pluggable database系统权限的用户进行登录。

2.执行以下操作:
.对于非CDB或CDB root,执行带有enable lost write protection子句的alter database语句。

.对于应用程序root,PDB或应用程序PDB,执行带有enable lost write protection子句的alter pluggable database语句。

对非CDB或CDB root启用影子丢失写保护

SQL> alter database enable lost write protection;

Database altered.

对PDB启用影子丢失写保护

SQL> create bigfile tablespace shadow_pdb datafile 'shadow_pdb.dbf' size 10M lost write protection;

Tablespace created.

SQL> alter pluggable database enable lost write protection;

Pluggable database altered.

对表空间和数据文件启用影子丢失写保护
为了对表空间启用影子丢失写保护,执行带有enable lost write protection子句的alter tablespace语句。为了对数据文件启用影子丢失写保护执行带有enable lost write protection子句的alter database data_file_name语句。当对一个表空间启用了影子丢失写保护,那么就是对表空间的所有数据文件启用了影子丢失写保护,并且对于向表空间增加的任何数据文件也会启用影子丢失写保护。

注意:
.为了对一个表空间或数据文件启用影子丢失写保护那么数据库中必须至少存在一个影子表空间。
.当对一个表空间或数据文件启用影子丢失写保护,那么这个影子表空间会自动被分配给它。

为了对一个表空间或数据文件启用影子丢失写保护必须满足以下条件:
1.在SQL*Plus中,使用有以下权限的用户来连接数据库:
.如果计划对一个表空间启用影子丢失写保护,那么连接用户必须有alter tablespace权限。

.如果计划对非CDB或CDB root中的数据文件启用影子丢失写保护,那么连接用户必须有alter database权限。

.如果计划对一个应用程序root,PDB或应用程序PDB中的数据文件启用影子丢失写保护,那么连接用户必须有alter pluggable database权限。

2.执行以下操作来启用影子丢失写保护:
.为了对一个表空间启用影子丢失写保护,执行带有enable lost write protection子句的alter tablespace语句。

.为了对非CDB或CDB root中的数据文件启用影子丢失写保护,执行带有enable lost write protection子句的alter database data_file_name语句。

.为了对一个应用程序root,PDB或应用程序PDB中的数据文件启用影子丢失写保护,执行带有enable lost write protection子句的alter pluggable database datafile data_file_name语句。

创建一个test表空间并启用影子丢失写保护:

SQL> create tablespace test datafile 'test01.dbf' size 10M;

Tablespace created.


SQL> alter tablespace test enable lost write protection;

Tablespace altered.

对非CDB或CDB root中的数据文件启用影子丢失写保护

SQL> create tablespace test1 datafile 'test1_01.dbf' size 10M;

Tablespace created.

SQL> alter tablespace test1 add datafile 'test1_02.dbf' size 10M;

Tablespace altered.

SQL> alter database datafile 'test1_01.dbf' enable lost write protection;

Database altered.

对一个应用程序root,PDB或应用程序PDB中的数据文件启用影子丢失写保护

SQL> alter session set container=hypdb;

Session altered.

SQL> create tablespace cs datafile 'cs01.dbf' size 10M;

Tablespace created.

SQL> alter pluggable database datafile 'cs01.dbf' enable lost write protection;

Pluggable database altered.

对数据库禁用影子丢失写保护
为了对CDB或非CDB禁用影子丢失写保护,执行带有disable lost write protection子句的alter database语句。为了对PDB禁用影子丢失写保护,执行带有disable lost write protection子句的alter pluggable database语句。

当你对一个数据库禁用影子丢失写保护后,不是这个数据库中的表空间或数据文件可以被影子丢失写保护。

注意:
.禁用影子丢失写保护不会删除现有影子表空间中的数据,但表空间中的数据不再被更新或被检查。如果想删除影子表空间中的数据,那么可以使用带有including contents子句的drop tablespace语句。

.对CDB root启用或禁用影子丢失写保护不会影响PDBs的影子丢失写保护。

为了对一个数据库禁用影子丢失写保护必须满足以下条件:
1.在SQL*Plus中,使用有以下权限的用户来连接数据库:
.在非CDB或CDB root中,那么连接用户必须有alter tablespace权限。

.在应用程序root,PDB或应用程序PDB中,那么连接用户必须有alter pluggable database权限。

2.执行以下操作来启用影子丢失写保护:
.对非CDB或CDB root,执行带有disable lost write protection子句的alter database语句。

.对应用程序root,PDB或应用程序PDB,执行带有disable lost write protection子句的alter pluggable database语句。

对非CDB或CDB root禁用影子丢失写保护

SQL> alter session set container=cdb$root;

Session altered.


SQL> alter database disable lost write protection;

Database altered.

对PDB禁用影子丢失写保护

SQL> alter session set container=hypdb;

Session altered.

SQL> alter pluggable database disable lost write protection;

Pluggable database altered.

删除或暂停影子丢失写保护
可以对表空间或数据文件删了或暂停影子丢失写保护。

当表空间或数据文件不再需要影子丢失写保护,可以选对以下操作:
.可以删除影子丢失写保护。这个操作会从影子表空间中删除表空间或数据文件的跟踪信息。这个选项也会停止对表空间或数据文件收集新的写丢失信息并且对他们的新丢失写停止检查。

.也可以暂停影子丢失写保护。停止对表空间或数据文件收集新的写丢失信息并且对他们的新丢失写停止检查。然而旧的丢失写信息仍然保留在影子表空间中。如果对表空间或数据文件重新启用影子丢失写保护,那么它们可以使用旧的丢失写信息。

当对表空间删除或暂停影子丢失写保护后,会删除影子丢失写保护或对表空间中的所有数据文件暂停影子丢失写保护。

为了对一个表空间或数据文件删除或暂停影子丢失写保护必须满足以下条件:
1.在SQL*Plus中,使用有以下权限的用户来连接数据库:
.如果计划对一个表空间删了或禁用影子丢失写保护,那么连接用户必须有alter tablespace权限。

.如果计划对非CDB或CDB root中的数据文件删除或禁用影子丢失写保护,那么连接用户必须有alter database权限。

.如果计划对一个应用程序root,PDB或应用程序PDB中的数据文件删除或禁用影子丢失写保护,那么连接用户必须有alter pluggable database权限。

2.执行以下操作来启用影子丢失写保护:
.为了对一个表空间删除或禁用影子丢失写保护,执行带有enable lost write protection或suspend lost write protection子句的alter tablespace语句。

.为了对非CDB或CDB root中的数据文件删除或禁用影子丢失写保护,执行带有enable lost write protection或suspend lost write protection 子句的alter database data_file_name语句。

.为了对一个应用程序root,PDB或应用程序PDB中的数据文件删除或禁用影子丢失写保护,执行带有enable lost write protection或suspend lost write protection子句的alter pluggable database datafile data_file_name语句。

删了表空间test的影子丢失写保护

SQL> alter session set container=cdb$root;

Session altered.

SQL> alter tablespace test remove lost write protection;

Tablespace altered.

暂停对数据文件test1_01.dbf的影子丢失写保护

SQL> alter database datafile 'test1_01.dbf' suspend lost write protection;

Database altered.

对PDB中的数据文件cs01.dbf暂停影子丢失写保护

SQL> alter session set container=hypdb;

Session altered.

SQL> alter pluggable database datafile 'cs01.dbf' suspend lost write protection;

Pluggable database altered.

删除影子表空间
可以执行drop tablespace语句来删除影子表空间。如果执行带有including contents子句的drop tablespace语句,那么在删除影子表空间的同时也会删除它的内容和数据文件。如果执行没带inclding contents子句的drop tablespace语句,那么在删除影子表空间之前,如果存在其它的影子表空间且有足够空间,它的内容会被移到另一个影子表空间中。

SQL> drop tablespace shadow_pdb including contents;

Tablespace dropped.
]]>
http://www.jydba.net/index.php/archives/3517/feed 0
MySQL InnoDB文件格式管理 http://www.jydba.net/index.php/archives/3504 http://www.jydba.net/index.php/archives/3504#respond Fri, 01 Sep 2023 03:21:17 +0000 http://www.jydba.net/?p=3504 InnoDB文件格式管理
随着InnoDB的发展,数据文件格式有时需要与以前版本的InnoDB不兼容,以支持新特性。为了在升级和降级的情况下管理兼容性,以及运行不同版本MySQL的系统,InnoDB使用命名文件格式。InnoDB目前支持两种命名文件格式,Antelope和Barracuda。

.Antelope是原始的InnoDB文件格式,以前没有一个名字。它支持紧凑和冗余的InnoDB表行格式。

.Barracuda是最新的文件格式。它支持所有InnoDB行格式,包括较新的compressed和dynamic行格式。与compressed和dynamic行格式相关的特性包括压缩表、页外列的高效存储以及高达3072字节的索引键前缀(innodb_large_prefix)。

这将讨论为新的InnoDB表启用InnoDB文件格式,验证MySQL版本之间不同文件格式的兼容性,以及识别正在使用的文件格式。

InnoDB文件格式设置不适用于存储在一般表空间中的表。通用表空间提供对所有行格式和相关特性的支持。

以下文件格式配置参数有新的默认值:
.innodb_file_format默认值修改为Barracuda。之前的默认值是Antelope。

.innodb_large_prefix默认值修改为ON。之前的默认值是OFF。

以下文件格式配置参数已弃用,并可能在将来的版本中删除:
.innodb_file_format

.innodb_file_format_check

.innodb_file_format_max

.innodb_large_prefix

文件格式配置参数用于创建与MySQL 5.1中早期版本的InnoDB兼容的表。现在MySQL 5.1已经结束了它的产品生命周期,不再需要这些参数。

启用文件格式
innodb_file_format配置选项为file-per-table表空间启用一个InnoDB文件格式。

Barracuda是默认的innodb_file_format设置。在早期版本中,默认的文件格式是Antelope。

innodb_file_format配置选项已弃用,可能在将来的版本中被删除。

当你启动mysqld时,你可以在命令行中设置innodb_file_format的值,或者在选项文件中(Unix上是my.cnf, Windows上是my.ini)。你也可以使用SET GLOBAL语句动态地修改它。

SET GLOBAL innodb_file_format=Barracuda;

使用说明
.InnoDB文件格式设置不适用于存储在一般表空间中的表。通用表空间提供对所有行格式和相关特性的支持。

.当使用CREATE table或ALTER table的TABLESPACE [=] innodb_system 表选项在system表空间中存储动态表时,innodb_file_format设置不适用。

.在创建使用动态行格式的表时,innodb_file_format设置会被忽略。

验证文件格式兼容性
InnoDB包含了一些检查来防止可能发生的崩溃和数据损坏,如果你对运行在旧版本的MySQL服务器上的InnoDB数据文件使用新文件格式可能会发生。这些检查发生在服务器启动时,以及用户第一次访问表时。本节描述这些检查,如何控制它们,以及可能出现的错误和警告条件。

向后兼容性
你只需要在使用最新版本的InnoDB (InnoDB的MySQL 5.5或更高版本)和旧版本(MySQL 5.1或更早版本,内置InnoDB而不是InnoDB插件)时考虑向后的文件格式兼容性。为了尽量减少兼容性问题,你可以在所有MySQL 5.1和更早版本的数据库服务器上使用InnoDB插件进行标准化。

一般来说,新版本的InnoDB创建的表或索引在旧版本的InnoDB中无法安全地读取或写入,而不会有崩溃、挂起、错误结果或损坏的风险。InnoDB提供了一种机制来防范这些情况,并有助于保持数据库文件和InnoDB版本之间的兼容性。这种机制可以让你利用InnoDB版本的一些新特性(如性能改进和bug修复),同时通过防止意外使用创建向下不兼容的磁盘文件的新特性,仍然保留使用旧版本InnoDB数据库的选择。

如果某个版本的InnoDB支持一种特定的文件格式(不管这种格式是否是默认的),你就可以查询和更新任何需要这种格式或更早的格式的表。根据所启用的特定文件格式,只有使用新特性创建新表的操作受到限制。相反,如果表空间包含一个使用不支持的文件格式的表或索引,则根本无法访问它,即使是读访问。

将InnoDB表空间“降级”为早期的Antelope文件格式的唯一方法是将数据复制到使用早期格式的新表中。

确定一个已经存在的InnoDB表空间的文件格式最简单的方法是检查它所包含的表的属性,使用SHOW table STATUS命令或者查询表INFORMATION_SCHEMA.TABLES。如果表的Row_format被报告为’Compressed’或’Dynamic’,则包含该表的表空间支持Barracuda格式。

内部细节
每个InnoDB file-per-table表空间(由一个*.ibd文件)文件标记了文件格式标识符。system表空间(由ibdata文件表示)被标记为在一组InnoDB数据库文件中使用的“最高”文件格式,并且当文件被打开时检查这个标记。

创建一个压缩表,或者一个带有ROW_FORMAT=DYNAMIC的表,更新对应file-per-table .ibd文件的文件头和InnoDB数据字典中的表类型,其中包含Barracuda文件格式的标识符。从那以后,这个表就不能在不支持Barracuda文件格式的InnoDB版本中使用了。为了防止异常行为,InnoDB会在打开表时进行兼容性检查。(在很多情况下,ALTER TABLE语句会重新创建一个表,从而改变它的属性。)

一般的表空间,也用*.ibd文件表示,支持Antelope和Barracuda文件格式。

ib文件集的定义
为了避免混淆,为了讨论的目的,我们将术语“ib文件集”定义为InnoDB作为一个单元管理的操作系统文件集。ib文件集合包括以下文件:

.系统表空间(一个或多个ibdata文件),包含内部系统信息(包括内部目录和undo信息),可能包括用户数据和索引。

.零个或多个单表表空间(也称为“file per table”文件,命名为*.ibd文件)。

.InnoDB日志文件;通常有两个,ib_logfile0和ib_logfile1。用于崩溃恢复和备份。

“ib文件集”不包含包含InnoDB表元数据的对应的.frm文件。.frm文件由MySQL创建和管理,有时会与InnoDB中的内部元数据不同步。

多个表(甚至来自多个数据库)可以存储在一个“ib文件集”中。(在MySQL中,“数据库”是表的逻辑集合,其他系统称之为“模式”或“目录”。)

InnoDB启动时的兼容性检查
当InnoDB打开ib文件集时,为了防止可能的崩溃或数据损坏,它会检查是否完全支持ib文件集中正在使用的文件格式。如果系统在崩溃后重新启动,或者“快速关机”(即innodb_fast_shutdown大于零),磁盘上的数据结构(如redo或undo条目,或doublewrite页面)可能对当前软件来说是“太新的”格式。在恢复过程中,如果访问了这些数据结构,可能会对数据文件造成严重的破坏。文件格式的启动检查在任何恢复过程开始之前进行,从而防止新表的一致性问题或MySQL服务器的启动问题。

从版本InnoDB 1.0.1开始,system表空间记录了ib文件集中任何表空间中任何表使用的“最高”文件格式的标识符或标记。这个文件格式标签的检查由配置参数innodb_file_format_check控制,默认是开启的。

如果system表空间中的文件格式标签比当前执行的软件支持的最高版本更新或更高,并且innodb_file_format_check开启,则在服务器启动时会发出以下错误:

InnoDB: Error: the system tablespace is in a
file format that this version doesn't support

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

mysql> show variables like 'innodb_file_format';
+--------------------+-----------+
| Variable_name      | Value     |
+--------------------+-----------+
| innodb_file_format | Barracuda |
+--------------------+-----------+
1 row in set (0.02 sec)

也可以设置“innodb_file_format”为文件格式名称。如果当前软件不支持指定的文件格式,这样做可以防止InnoDB启动。它还将“高水位标记”设置为指定的值。如果你手动“降级”ib文件集中的所有表,那么设置innodb_file_format_check的能力(在未来的版本中)是很有用的。如果你随后使用旧版本的InnoDB来访问ib文件集,那么你可以依赖启动时的文件格式检查。

在某些有限的情况下,您可能希望启动服务器并使用ib文件集,该文件集是您正在使用的软件不支持的新文件格式。如果你把配置参数innodb_file_format_check设置为OFF, InnoDB会打开数据库,但会在错误日志中显示如下警告信息:

InnoDB: Warning: the system tablespace is in a
file format that this version doesn't support

这是一个危险的设置,因为它允许恢复过程运行,如果之前的关闭是崩溃或“快速关闭”,可能会破坏数据库。

只有当你确定上一次关闭innodb_fast_shutdown=0时,才应该将innodb_file_format_check设置为OFF,这样基本上没有恢复过程发生。

参数innodb_file_format_check只影响打开数据库时发生的操作,不会影响后续操作。相反,参数innodb_file_format(启用特定的格式)只确定是否可以以启用的格式创建新表,对数据库是否可以打开没有影响。

文件格式标记是一个“高水位标记”,如果创建了一个“更高”格式的表,或者访问一个现有的表进行读或写(假设支持它的格式),那么在服务器启动后,它就会增加。如果你以高于运行软件支持的格式访问一个已经存在的表,系统表空间标签不会更新,但是表级别的兼容性检查会应用(并且会发出错误),如14.10.2.2节“打开表时兼容性检查”所述。每当高水位线更新时,innodb_file_format_check的值也会更新,因此执行SELECT @@innodb_file_format_check;显示当前打开的ib文件集中的表使用的、当前执行软件支持的最新文件格式的名称。

mysql> SELECT @@innodb_file_format_check;
+----------------------------+
| @@innodb_file_format_check |
+----------------------------+
|                          1 |
+----------------------------+
1 row in set (0.00 sec)

打开表时检查兼容性
当第一次访问表时,InnoDB(包括一些InnoDB 1.0之前的版本)会检查存储表的表空间的文件格式是否完全支持。这种检查可以防止使用“太新”数据结构的表出现崩溃或损坏。

使用某个版本支持的任何文件格式的所有表都可以读或写(假设用户有足够的权限)。设置系统配置参数innodb_file_format可以防止创建使用特定文件格式的新表,即使给定的版本支持这种文件格式。这样的设置可以用来保持向后兼容性,但它不会阻止访问任何使用支持的格式的表。

如果在创建表时使用了新的文件格式,那么5.0.21之前的MySQL版本不能可靠地使用新版本创建的数据库文件。为了防止各种错误或损坏,InnoDB在打开文件时(例如,第一次访问一张表时)会检查文件格式的兼容性。如果当前运行的InnoDB版本不支持InnoDB数据字典中表类型标识的文件格式,MySQL报告如下错误:

ERROR 1146 (42S02): Table 'test.t1' doesn't exist

InnoDB也会在错误日志中写入一条消息:

InnoDB: table test/t1: unknown table type 33

MySQL 4.1之前的InnoDB版本在数据库文件中不包含表格式标识符,MySQL 5.0.21之前的版本不包含表格式兼容性检查。因此,如果在5.0.21之前的InnoDB版本中使用了较新的文件格式的表,则无法确保操作是正确的。

InnoDB 1.0及更高版本的文件格式管理能力(表空间标记和运行时检查)允许InnoDB尽快验证运行版本的软件能够正确处理数据库中存在的表。

如果你允许InnoDB打开一个包含它不支持的文件格式的数据库(通过设置参数innodb_file_format_check为OFF),本节描述的表级检查仍然适用。

在使用InnoDB插件的MySQL 5.1之前的版本中强烈建议用户不要使用包含Barracuda文件格式表的数据库文件。可以使用Antelope格式重建这样的表。

识别正在使用的文件格式
如果您使用innodb_file_format配置选项启用不同的文件格式,则更改仅适用于新创建的表。此外,当您创建一个新表时,包含该表的表空间被标记为支持表特性所需的“最早”或“最简单”文件格式。例如,如果您启用了Barracuda文件格式,并创建了一个不使用Dynamic或Compressed行格式的新表,那么包含该表的新表空间将被标记为使用Antelope文件格式。

很容易识别给定表使用的文件格式。如果SHOW TABLE STATUS报告的行格式是Compact或Redundant,则表使用Antelope文件格式。如果SHOW TABLE STATUS报告的行格式是Compressed或Dynamic,则表使用Barracuda文件格式。


mysql> SHOW TABLE STATUS\G
*************************** 1. row ***************************
           Name: big_table
         Engine: InnoDB
        Version: 10
     Row_format: Dynamic
           Rows: 3370592
 Avg_row_length: 205
    Data_length: 694140928
Max_data_length: 0
   Index_length: 0
      Data_free: 3145728
 Auto_increment: 3326977
    Create_time: 2023-07-06 18:05:18
    Update_time: NULL
     Check_time: NULL
      Collation: utf8mb4_general_ci
       Checksum: NULL
 Create_options:
        Comment:

您还可以使用InnoDB INFORMATION_SCHEMA表识别给定表或表空间使用的文件格式。例如:

mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='undo/big_table'\G
*************************** 1. row ***************************
     TABLE_ID: 488
         NAME: undo/big_table
         FLAG: 33
       N_COLS: 25
        SPACE: 487
  FILE_FORMAT: Barracuda
   ROW_FORMAT: Dynamic
ZIP_PAGE_SIZE: 0
   SPACE_TYPE: Single
1 row in set (0.00 sec)


mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE NAME='undo/big_table'\G
*************************** 1. row ***************************
         SPACE: 487
          NAME: undo/big_table
          FLAG: 33
   FILE_FORMAT: Barracuda
    ROW_FORMAT: Dynamic
     PAGE_SIZE: 16384
 ZIP_PAGE_SIZE: 0
    SPACE_TYPE: Single
 FS_BLOCK_SIZE: 4096
     FILE_SIZE: 708837376
ALLOCATED_SIZE: 708841472
1 row in set (0.00 sec)

修改文件格式
每个InnoDB表空间文件(名称匹配*.ibd)都被标记为用于创建其表和索引的文件格式。修改文件格式的方法是重新创建表及其索引。重建表及其索引的最简单方法是在每个想要修改的表上使用以下命令:

ALTER TABLE t ROW_FORMAT=format_name;

如果您正在修改文件格式以降级到较旧的MySQL版本,则可能存在表存储格式的不兼容性,需要额外的步骤。

]]>
http://www.jydba.net/index.php/archives/3504/feed 0
Oracle 19c IMP-00058 ORA-03113 http://www.jydba.net/index.php/archives/3482 http://www.jydba.net/index.php/archives/3482#respond Fri, 05 May 2023 00:26:06 +0000 http://www.jydba.net/?p=3482 用imp命令向Oracle 19c数据库导入数据时出现IMP-00058 ORA-03113错误

经过排查最后发现是因为执行imp命令的客户端机器内存不足引起的,在关闭无关的程序后再次执行可以正常导入。

]]>
http://www.jydba.net/index.php/archives/3482/feed 0
benchmark 压测Oracle 11g http://www.jydba.net/index.php/archives/3458 http://www.jydba.net/index.php/archives/3458#respond Wed, 22 Feb 2023 00:58:11 +0000 http://www.jydba.net/?p=3458 benchmarksql 5.0 支持对MySQL的TPC-C测试
根据官方文档介绍的测试环境,本文中涉及的TPC-C测试将使用 BenchmarkSQL5.0 软件实现。BenchmarkSQL是一款基于JDBC实现的类似于OLTP的TPC-C标准测试工具,目前支持的数据库如:PostgreSQL、Oracle等。

一.下载&编译安装

1.先要确定服务器是否安装了 JDK1.8

[root@sjjh /]# java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (rhel-2.5.4.2.0.1.el7_0-x86_64 u75-b13)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

因为自带jdk存储在/usr/lib/jvm下,需要将其删除。

[root@sjjh lib]# mv jvm jvmold
[root@sjjh lib]# java -version
-bash: /usr/bin/java: ???

2.安装JDK1.8

[root@sjjh /]# tar -zxvf jdk-linux-x64.tar.gz

[root@sjjh /]# mkdir /usr/java
[root@sjjh /]# mv jdk1.8.0_131 /usr/java/
[root@sjjh /]# vi /etc/profile
....
export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}

[root@sjjh /]# source /etc/profile
[root@sjjh /]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

[root@shard1 /]# unzip benchmarksql-5.0.zip
[root@shard1 /]# cd benchmarksql-5.0/

加载oracle 驱动

[oracle@sjjh lib]$ ls -lrt
total 26084
-rw-r--r--. 1 oracle oinstall 2091135 Jul 11  2013 ojdbc5.jar
-rw-r--r--. 1 oracle oinstall 2739616 Jul 11  2013 ojdbc6.jar
-rw-r--r--. 1 oracle oinstall 2609739 Jul 11  2013 ojdbc5dms.jar
-rw-r--r--. 1 oracle oinstall 3350717 Jul 11  2013 ojdbc6dms.jar
-rw-r--r--. 1 oracle oinstall 3424145 Jul 11  2013 ojdbc5_g.jar
-rw-r--r--. 1 oracle oinstall 3445412 Jul 11  2013 ojdbc5dms_g.jar
-rw-r--r--. 1 oracle oinstall 4494540 Jul 11  2013 ojdbc6_g.jar
-rw-r--r--. 1 oracle oinstall 4517780 Jul 11  2013 ojdbc6dms_g.jar
-rw-r--r--. 1 oracle oinstall   20365 Jul 11  2013 simplefan.jar
[oracle@sjjh lib]$ pwd
/u01/app/oracle/product/11.2.0.4/db/jdbc/lib

[oracle@sjjh lib]$ cp ojdbc6.jar /benchmarksql-5.0/lib/oracle/

[oracle@sjjh lib]$ cd /benchmarksql-5.0/lib/oracle/
[oracle@sjjh oracle]$ pwd
/benchmarksql-5.0/lib/oracle
[oracle@sjjh oracle]$ ls -lrt
total 2680
-rwxrwxr-x. 1 oracle oinstall     174 May 26  2016 README.txt
-rw-r--r--. 1 oracle oinstall 2739616 Nov 14 10:21 ojdbc6.jar


修改props.ora

[oracle@sjjh run]$ vi props.ora
db=oracle
driver=oracle.jdbc.driver.OracleDriver
conn=jdbc:oracle:thin:@localhost:1521:sjjh
user=tpcs
password=tpcs

warehouses=40
loadWorkers=10

terminals=10
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=10
//Number of total transactions per minute
limitTxnsPerMin=0

//Set to true to run in 4.x compatible mode. Set to false to use the
//entire configured database evenly.
terminalWarehouseFixed=true

//The following five values must add up to 100
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4

// Directory name to create for collecting detailed result data.
// Comment this out to suppress.
resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
osCollectorScript=./misc/os_collector_linux.py
osCollectorInterval=1
//osCollectorSSHAddr=user@dbhost
//osCollectorDevices=net_eth0 blk_sda

使用ant进行编译

[oracle@sjjh benchmarksql-5.0]$ ant
Buildfile: /benchmarksql-5.0/build.xml

init:

compile:
    [javac] Compiling 11 source files to /benchmarksql-5.0/build

dist:
    [mkdir] Created dir: /benchmarksql-5.0/dist
      [jar] Building jar: /benchmarksql-5.0/dist/BenchmarkSQL-5.0.jar

BUILD SUCCESSFUL
Total time: 2 seconds


初始化数据

[oracle@sjjh run]$  ./runDatabaseBuild.sh props.ora
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableCreates.sql
# ------------------------------------------------------------
create table bmsql_config (
cfg_name    varchar(30) primary key,
cfg_value   varchar(50)
);
create table bmsql_warehouse (
w_id        integer   not null,
w_ytd       decimal(12,2),
w_tax       decimal(4,4),
w_name      varchar(10),
w_street_1  varchar(20),
w_street_2  varchar(20),
w_city      varchar(20),
w_state     char(2),
w_zip       char(9)
);
create table bmsql_district (
d_w_id       integer       not null,
d_id         integer       not null,
d_ytd        decimal(12,2),
d_tax        decimal(4,4),
d_next_o_id  integer,
d_name       varchar(10),
d_street_1   varchar(20),
d_street_2   varchar(20),
d_city       varchar(20),
d_state      char(2),
d_zip        char(9)
);
create table bmsql_customer (
c_w_id         integer        not null,
c_d_id         integer        not null,
c_id           integer        not null,
c_discount     decimal(4,4),
c_credit       char(2),
c_last         varchar(16),
c_first        varchar(16),
c_credit_lim   decimal(12,2),
c_balance      decimal(12,2),
c_ytd_payment  decimal(12,2),
c_payment_cnt  integer,
c_delivery_cnt integer,
c_street_1     varchar(20),
c_street_2     varchar(20),
c_city         varchar(20),
c_state        char(2),
c_zip          char(9),
c_phone        char(16),
c_since        timestamp,
c_middle       char(2),
c_data         varchar(500)
);
create sequence bmsql_hist_id_seq;
create table bmsql_history (
hist_id  integer,
h_c_id   integer,
h_c_d_id integer,
h_c_w_id integer,
h_d_id   integer,
h_w_id   integer,
h_date   timestamp,
h_amount decimal(6,2),
h_data   varchar(24)
);
create table bmsql_new_order (
no_w_id  integer   not null,
no_d_id  integer   not null,
no_o_id  integer   not null
);
create table bmsql_oorder (
o_w_id       integer      not null,
o_d_id       integer      not null,
o_id         integer      not null,
o_c_id       integer,
o_carrier_id integer,
o_ol_cnt     integer,
o_all_local  integer,
o_entry_d    timestamp
);
create table bmsql_order_line (
ol_w_id         integer   not null,
ol_d_id         integer   not null,
ol_o_id         integer   not null,
ol_number       integer   not null,
ol_i_id         integer   not null,
ol_delivery_d   timestamp,
ol_amount       decimal(6,2),
ol_supply_w_id  integer,
ol_quantity     integer,
ol_dist_info    char(24)
);
create table bmsql_item (
i_id     integer      not null,
i_name   varchar(24),
i_price  decimal(5,2),
i_data   varchar(50),
i_im_id  integer
);
create table bmsql_stock (
s_w_id       integer       not null,
s_i_id       integer       not null,
s_quantity   integer,
s_ytd        integer,
s_order_cnt  integer,
s_remote_cnt integer,
s_data       varchar(50),
s_dist_01    char(24),
s_dist_02    char(24),
s_dist_03    char(24),
s_dist_04    char(24),
s_dist_05    char(24),
s_dist_06    char(24),
s_dist_07    char(24),
s_dist_08    char(24),
s_dist_09    char(24),
s_dist_10    char(24)
);
Starting BenchmarkSQL LoadData

driver=oracle.jdbc.driver.OracleDriver
conn=jdbc:oracle:thin:@10.138.130.101:1521:sjjh
user=tpcs
password=***********
warehouses=40
loadWorkers=10
fileLocation (not defined)
csvNullValue (not defined - using default 'NULL')

Worker 000: Loading ITEM
Worker 001: Loading Warehouse      1
Worker 002: Loading Warehouse      2
Worker 003: Loading Warehouse      3
Worker 004: Loading Warehouse      4
Worker 005: Loading Warehouse      5
Worker 006: Loading Warehouse      6
Worker 007: Loading Warehouse      7
Worker 008: Loading Warehouse      8
Worker 009: Loading Warehouse      9
Worker 000: Loading ITEM done
Worker 000: Loading Warehouse     10
Worker 004: Loading Warehouse      4 done
Worker 004: Loading Warehouse     11
Worker 007: Loading Warehouse      7 done
Worker 007: Loading Warehouse     12
Worker 005: Loading Warehouse      5 done
Worker 005: Loading Warehouse     13
Worker 008: Loading Warehouse      8 done
Worker 008: Loading Warehouse     14
Worker 006: Loading Warehouse      6 done
Worker 001: Loading Warehouse      1 done
Worker 006: Loading Warehouse     15
Worker 001: Loading Warehouse     16
Worker 009: Loading Warehouse      9 done
Worker 009: Loading Warehouse     17
Worker 002: Loading Warehouse      2 done
Worker 002: Loading Warehouse     18
Worker 003: Loading Warehouse      3 done
Worker 003: Loading Warehouse     19
Worker 000: Loading Warehouse     10 done
Worker 000: Loading Warehouse     20
Worker 004: Loading Warehouse     11 done
Worker 004: Loading Warehouse     21
Worker 008: Loading Warehouse     14 done
Worker 008: Loading Warehouse     22
Worker 005: Loading Warehouse     13 done
Worker 005: Loading Warehouse     23
Worker 007: Loading Warehouse     12 done
Worker 006: Loading Warehouse     15 done
Worker 007: Loading Warehouse     24
Worker 006: Loading Warehouse     25
Worker 003: Loading Warehouse     19 done
Worker 003: Loading Warehouse     26
Worker 002: Loading Warehouse     18 done
Worker 002: Loading Warehouse     27
Worker 000: Loading Warehouse     20 done
Worker 000: Loading Warehouse     28
Worker 001: Loading Warehouse     16 done
Worker 001: Loading Warehouse     29
Worker 009: Loading Warehouse     17 done
Worker 009: Loading Warehouse     30
Worker 004: Loading Warehouse     21 done
Worker 004: Loading Warehouse     31
Worker 008: Loading Warehouse     22 done
Worker 008: Loading Warehouse     32
Worker 006: Loading Warehouse     25 done
Worker 006: Loading Warehouse     33
Worker 007: Loading Warehouse     24 done
Worker 007: Loading Warehouse     34
Worker 003: Loading Warehouse     26 done
Worker 001: Loading Warehouse     29 done
Worker 003: Loading Warehouse     35
Worker 001: Loading Warehouse     36
Worker 005: Loading Warehouse     23 done
Worker 005: Loading Warehouse     37
Worker 002: Loading Warehouse     27 done
Worker 002: Loading Warehouse     38
Worker 000: Loading Warehouse     28 done
Worker 000: Loading Warehouse     39
Worker 009: Loading Warehouse     30 done
Worker 009: Loading Warehouse     40
Worker 007: Loading Warehouse     34 done
Worker 004: Loading Warehouse     31 done
Worker 008: Loading Warehouse     32 done
Worker 006: Loading Warehouse     33 done
Worker 003: Loading Warehouse     35 done
Worker 001: Loading Warehouse     36 done
Worker 005: Loading Warehouse     37 done
Worker 000: Loading Warehouse     39 done
Worker 009: Loading Warehouse     40 done
Worker 002: Loading Warehouse     38 done
# ------------------------------------------------------------
# Loading SQL file ./sql.common/indexCreates.sql
# ------------------------------------------------------------
alter table bmsql_warehouse add constraint bmsql_warehouse_pkey
primary key (w_id);
alter table bmsql_district add constraint bmsql_district_pkey
primary key (d_w_id, d_id);
alter table bmsql_customer add constraint bmsql_customer_pkey
primary key (c_w_id, c_d_id, c_id);
create index bmsql_customer_idx1
on  bmsql_customer (c_w_id, c_d_id, c_last, c_first);
alter table bmsql_oorder add constraint bmsql_oorder_pkey
primary key (o_w_id, o_d_id, o_id);
create unique index bmsql_oorder_idx1
on  bmsql_oorder (o_w_id, o_d_id, o_carrier_id, o_id);
alter table bmsql_new_order add constraint bmsql_new_order_pkey
primary key (no_w_id, no_d_id, no_o_id);
alter table bmsql_order_line add constraint bmsql_order_line_pkey
primary key (ol_w_id, ol_d_id, ol_o_id, ol_number);
alter table bmsql_stock add constraint bmsql_stock_pkey
primary key (s_w_id, s_i_id);
alter table bmsql_item add constraint bmsql_item_pkey
primary key (i_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.common/foreignKeys.sql
# ------------------------------------------------------------
alter table bmsql_district add constraint d_warehouse_fkey
foreign key (d_w_id)
references bmsql_warehouse (w_id);
alter table bmsql_customer add constraint c_district_fkey
foreign key (c_w_id, c_d_id)
references bmsql_district (d_w_id, d_id);
alter table bmsql_history add constraint h_customer_fkey
foreign key (h_c_w_id, h_c_d_id, h_c_id)
references bmsql_customer (c_w_id, c_d_id, c_id);
alter table bmsql_history add constraint h_district_fkey
foreign key (h_w_id, h_d_id)
references bmsql_district (d_w_id, d_id);
alter table bmsql_new_order add constraint no_order_fkey
foreign key (no_w_id, no_d_id, no_o_id)
references bmsql_oorder (o_w_id, o_d_id, o_id);
alter table bmsql_oorder add constraint o_customer_fkey
foreign key (o_w_id, o_d_id, o_c_id)
references bmsql_customer (c_w_id, c_d_id, c_id);
alter table bmsql_order_line add constraint ol_order_fkey
foreign key (ol_w_id, ol_d_id, ol_o_id)
references bmsql_oorder (o_w_id, o_d_id, o_id);
alter table bmsql_order_line add constraint ol_stock_fkey
foreign key (ol_supply_w_id, ol_i_id)
references bmsql_stock (s_w_id, s_i_id);
alter table bmsql_stock add constraint s_warehouse_fkey
foreign key (s_w_id)
references bmsql_warehouse (w_id);
alter table bmsql_stock add constraint s_item_fkey
foreign key (s_i_id)
references bmsql_item (i_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.oracle/extraHistID.sql
# ------------------------------------------------------------
-- ----
-- Extra Schema objects/definitions for history.hist_id in Oracle
-- ----
-- ----
--      This is an extra column not present in the TPC-C
--      specs. It is useful for replication systems like
--      Bucardo and Slony-I, which like to have a primary
--      key on a table. It is an auto-increment or serial
--      column type. The definition below is compatible
--      with Oracle 11g, using the sequence in a trigger.
-- ----
-- Adjust the sequence above the current max(hist_id)
alter sequence bmsql_hist_id_seq increment by 30000;
declare
n integer;
i integer;
dummy integer;
begin
select max(hist_id) into n from bmsql_history;
i := 0;
while i < = n loop
select bmsql_hist_id_seq.nextval into dummy from dual;
i := i + 30000;
end loop;
end;
;
alter sequence bmsql_hist_id_seq increment by 1;
-- Create a trigger that forces hist_id to be hist_id_seq.nextval
create trigger bmsql_history_before_insert
before insert on bmsql_history
for each row
begin
if :new.hist_id is null then
select bmsql_hist_id_seq.nextval into :new.hist_id from dual;
end if;
end;
;
-- Add a primary key history(hist_id)
alter table bmsql_history add primary key (hist_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.common/buildFinish.sql
# ------------------------------------------------------------
-- ----
-- Extra commands to run after the tables are created, loaded,
-- indexes built and extra's created.
-- ----‘

执行压测

[oracle@sjjh run]$ ./runBenchmark.sh props.ora
10:51:30,810 [main] INFO   jTPCC : Term-00,
10:51:30,815 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:51:30,816 [main] INFO   jTPCC : Term-00,      BenchmarkSQL v5.0
10:51:30,816 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:51:30,816 [main] INFO   jTPCC : Term-00,  (c) 2003, Raul Barbosa
10:51:30,817 [main] INFO   jTPCC : Term-00,  (c) 2004-2016, Denis Lussier
10:51:30,821 [main] INFO   jTPCC : Term-00,  (c) 2016, Jan Wieck
10:51:30,821 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:51:30,822 [main] INFO   jTPCC : Term-00,
10:51:30,822 [main] INFO   jTPCC : Term-00, db=oracle
10:51:30,822 [main] INFO   jTPCC : Term-00, driver=oracle.jdbc.driver.OracleDriver
10:51:30,823 [main] INFO   jTPCC : Term-00, conn=jdbc:oracle:thin:@10.138.130.101:1521:sjjh
10:51:30,823 [main] INFO   jTPCC : Term-00, user=tpcs
10:51:30,823 [main] INFO   jTPCC : Term-00,
10:51:30,823 [main] INFO   jTPCC : Term-00, warehouses=40
10:51:30,824 [main] INFO   jTPCC : Term-00, terminals=10
10:51:30,827 [main] INFO   jTPCC : Term-00, runMins=10
10:51:30,827 [main] INFO   jTPCC : Term-00, limitTxnsPerMin=0
10:51:30,827 [main] INFO   jTPCC : Term-00, terminalWarehouseFixed=true
10:51:30,828 [main] INFO   jTPCC : Term-00,
10:51:30,828 [main] INFO   jTPCC : Term-00, newOrderWeight=45
10:51:30,828 [main] INFO   jTPCC : Term-00, paymentWeight=43
10:51:30,828 [main] INFO   jTPCC : Term-00, orderStatusWeight=4
10:51:30,829 [main] INFO   jTPCC : Term-00, deliveryWeight=4
10:51:30,829 [main] INFO   jTPCC : Term-00, stockLevelWeight=4
10:51:30,829 [main] INFO   jTPCC : Term-00,
10:51:30,829 [main] INFO   jTPCC : Term-00, resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
10:51:30,830 [main] INFO   jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
10:51:30,830 [main] INFO   jTPCC : Term-00,
10:51:31,026 [main] INFO   jTPCC : Term-00, copied props.ora to my_result_2022-11-14_105131/run.properties
10:51:31,027 [main] INFO   jTPCC : Term-00, created my_result_2022-11-14_105131/data/runInfo.csv for runID 1
10:51:31,027 [main] INFO   jTPCC : Term-00, writing per transaction results to my_result_2022-11-14_105131/data/result.csv
10:51:31,028 [main] INFO   jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
10:51:31,029 [main] INFO   jTPCC : Term-00, osCollectorInterval=1
10:51:31,029 [main] INFO   jTPCC : Term-00, osCollectorSSHAddr=null
10:51:31,029 [main] INFO   jTPCC : Term-00, osCollectorDevices=null
10:51:31,161 [main] INFO   jTPCC : Term-00,
10:51:31,676 [main] INFO   jTPCC : Term-00, C value for C_LAST during load: 243
10:51:31,677 [main] INFO   jTPCC : Term-00, C value for C_LAST this run:    125
10:51:31,677 [main] INFO   jTPCC : Term-00,
Term-00, Running Average tpmTOTAL: 10382.94    Current tpmTOTAL: 684828    Memory Usage: 107MB / 649MB
11:01:32,117 [Thread-2] INFO   jTPCC : Term-00,
11:01:32,118 [Thread-2] INFO   jTPCC : Term-00,
11:01:32,118 [Thread-2] INFO   jTPCC : Term-00, Measured tpmC (NewOrders) = 4686.82
11:01:32,118 [Thread-2] INFO   jTPCC : Term-00, Measured tpmTOTAL = 10382.59
11:01:32,118 [Thread-2] INFO   jTPCC : Term-00, Session Start     = 2022-11-14 10:51:32
11:01:32,118 [Thread-2] INFO   jTPCC : Term-00, Session End       = 2022-11-14 11:01:32
11:01:32,119 [Thread-2] INFO   jTPCC : Term-00, Transaction Count = 103831'

清理数据

[oracle@sjjh run]$ ./runDatabaseDestroy.sh props.ora
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableDrops.sql
# ------------------------------------------------------------
drop table bmsql_config;
drop table bmsql_new_order;
drop table bmsql_order_line;
drop table bmsql_oorder;
drop table bmsql_history;
drop table bmsql_customer;
drop table bmsql_stock;
drop table bmsql_item;
drop table bmsql_district;
drop table bmsql_warehouse;
drop sequence bmsql_hist_id_seq;
]]>
http://www.jydba.net/index.php/archives/3458/feed 0
benchmark 压测Oracle 12c http://www.jydba.net/index.php/archives/3455 http://www.jydba.net/index.php/archives/3455#respond Mon, 20 Feb 2023 00:39:37 +0000 http://www.jydba.net/?p=3455 benchmarksql 5.0 支持对MySQL的TPC-C测试
根据官方文档介绍的测试环境,本文中涉及的TPC-C测试将使用 BenchmarkSQL5.0 软件实现。BenchmarkSQL是一款基于JDBC实现的类似于OLTP的TPC-C标准测试工具,目前支持的数据库如:PostgreSQL、Oracle等。

一.下载&编译安装

1.先要确定服务器是否安装了 JDK1.8

[root@shard1 /]# java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (rhel-2.5.4.2.0.1.el7_0-x86_64 u75-b13)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

因为自带jdk存储在/usr/lib/jvm下,需要将其删除。

[root@shard1 lib]# mv jvm jvmold
[root@shard1 lib]# java -version
-bash: /usr/bin/java: ???

2.安装JDK1.8

[root@shard1 /]# tar -zxvf jdk-linux-x64.tar.gz

[root@shard1 /]# mkdir /usr/java
[root@shard1 /]# mv jdk1.8.0_131 /usr/java/
[root@shard1 /]# vi /etc/profile
....
export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}

[root@shard1 /]# source /etc/profile
[root@shard1 /]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

[root@shard1 /]# unzip benchmarksql-5.0.zip
[root@shard1 /]# cd benchmarksql-5.0/


加载oracle 驱动(这里要使用11g版本的驱动ojdbc6.jar不能使用oracle 12c的ojdbc8.jar)

[oracle@shard1 lib]$ pwd
/u01/app/oracle/product/12.2.0/db/jdbc/lib
[oracle@shard1 lib]$ ls -lrt
2604
-rw-r--r--. 1 oracle oinstall   29051 123 2016 simplefan.jar
-rw-r--r--. 1 oracle oinstall 4036257 123 2016 ojdbc8.jar
-rw-r--r--. 1 oracle oinstall 5623186 123 2016 ojdbc8dms.jar
-rw-r--r--. 1 oracle oinstall 6708730 123 2016 ojdbc8_g.jar
-rw-r--r--. 1 oracle oinstall 6738172 123 2016 ojdbc8dms_g.jar
[oracle@shard1 lib]$ cp ojdbc8.jar /benchmarksql-5.0/lib/oracle/

使用oracle 12c的ojdbc8.jar在执行测试时就会报以下错误信息

[oracle@shard1 run]$ ./runBenchmark.sh props.ora
10:04:25,158 [main] INFO   jTPCC : Term-00,
10:04:25,192 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:04:25,192 [main] INFO   jTPCC : Term-00,      BenchmarkSQL v5.0
10:04:25,192 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:04:25,192 [main] INFO   jTPCC : Term-00,  (c) 2003, Raul Barbosa
10:04:25,192 [main] INFO   jTPCC : Term-00,  (c) 2004-2016, Denis Lussier
10:04:25,196 [main] INFO   jTPCC : Term-00,  (c) 2016, Jan Wieck
10:04:25,196 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:04:25,197 [main] INFO   jTPCC : Term-00,
10:04:25,197 [main] INFO   jTPCC : Term-00, db=oracle
10:04:25,197 [main] INFO   jTPCC : Term-00, driver=oracle.jdbc.driver.OracleDriver
10:04:25,197 [main] INFO   jTPCC : Term-00, conn=jdbc:oracle:thin:@localhost:1521:shardcat
10:04:25,197 [main] INFO   jTPCC : Term-00, user=tpcs
10:04:25,198 [main] INFO   jTPCC : Term-00,
10:04:25,198 [main] INFO   jTPCC : Term-00, warehouses=40
10:04:25,198 [main] INFO   jTPCC : Term-00, terminals=10
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:592)
        at java.lang.Integer.parseInt(Integer.java:615)
        at jTPCC.(jTPCC.java:95)
        at jTPCC.main(jTPCC.java:53)


[oracle@shard1 lib]$ ls -lrt
total 26084
-rw-r--r--. 1 oracle oinstall 2091135 Jul 11  2013 ojdbc5.jar
-rw-r--r--. 1 oracle oinstall 2739616 Jul 11  2013 ojdbc6.jar
-rw-r--r--. 1 oracle oinstall 2609739 Jul 11  2013 ojdbc5dms.jar
-rw-r--r--. 1 oracle oinstall 3350717 Jul 11  2013 ojdbc6dms.jar
-rw-r--r--. 1 oracle oinstall 3424145 Jul 11  2013 ojdbc5_g.jar
-rw-r--r--. 1 oracle oinstall 3445412 Jul 11  2013 ojdbc5dms_g.jar
-rw-r--r--. 1 oracle oinstall 4494540 Jul 11  2013 ojdbc6_g.jar
-rw-r--r--. 1 oracle oinstall 4517780 Jul 11  2013 ojdbc6dms_g.jar
-rw-r--r--. 1 oracle oinstall   20365 Jul 11  2013 simplefan.jar
[oracle@shard1 lib]$ pwd
/u01/app/oracle/product/11.2.0.4/db/jdbc/lib

[oracle@shard1 lib]$ cp ojdbc6.jar /benchmarksql-5.0/lib/oracle/

[oracle@shard1 lib]$ cd /benchmarksql-5.0/lib/oracle/
[oracle@shard1 oracle]$ pwd
/benchmarksql-5.0/lib/oracle
[oracle@shard1 oracle]$ ls -lrt
total 2680
-rwxrwxr-x. 1 oracle oinstall     174 May 26  2016 README.txt
-rw-r--r--. 1 oracle oinstall 2739616 Nov 14 10:21 ojdbc6.jar

修改props.ora

[oracle@shard1 run]$ vi props.ora
db=oracle
driver=oracle.jdbc.driver.OracleDriver
conn=jdbc:oracle:thin:@localhost:1521:shardcat
user=tpcs
password=tpcs

warehouses=40
loadWorkers=10

terminals=10
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=10
//Number of total transactions per minute
limitTxnsPerMin=0

//Set to true to run in 4.x compatible mode. Set to false to use the
//entire configured database evenly.
terminalWarehouseFixed=true

//The following five values must add up to 100
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4

// Directory name to create for collecting detailed result data.
// Comment this out to suppress.
resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
osCollectorScript=./misc/os_collector_linux.py
osCollectorInterval=1
//osCollectorSSHAddr=user@dbhost
//osCollectorDevices=net_eth0 blk_sda

使用ant进行编译

[oracle@shard1 benchmarksql-5.0]$ ant
Buildfile: /benchmarksql-5.0/build.xml

init:

compile:
    [javac] Compiling 11 source files to /benchmarksql-5.0/build

dist:
    [mkdir] Created dir: /benchmarksql-5.0/dist
      [jar] Building jar: /benchmarksql-5.0/dist/BenchmarkSQL-5.0.jar

BUILD SUCCESSFUL
Total time: 2 seconds


初始化数据

[oracle@shard1 run]$ ./runDatabaseBuild.sh props.ora
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableCreates.sql
# ------------------------------------------------------------
create table bmsql_config (
cfg_name    varchar(30) primary key,
cfg_value   varchar(50)
);
create table bmsql_warehouse (
w_id        integer   not null,
w_ytd       decimal(12,2),
w_tax       decimal(4,4),
w_name      varchar(10),
w_street_1  varchar(20),
w_street_2  varchar(20),
w_city      varchar(20),
w_state     char(2),
w_zip       char(9)
);
create table bmsql_district (
d_w_id       integer       not null,
d_id         integer       not null,
d_ytd        decimal(12,2),
d_tax        decimal(4,4),
d_next_o_id  integer,
d_name       varchar(10),
d_street_1   varchar(20),
d_street_2   varchar(20),
d_city       varchar(20),
d_state      char(2),
d_zip        char(9)
);
create table bmsql_customer (
c_w_id         integer        not null,
c_d_id         integer        not null,
c_id           integer        not null,
c_discount     decimal(4,4),
c_credit       char(2),
c_last         varchar(16),
c_first        varchar(16),
c_credit_lim   decimal(12,2),
c_balance      decimal(12,2),
c_ytd_payment  decimal(12,2),
c_payment_cnt  integer,
c_delivery_cnt integer,
c_street_1     varchar(20),
c_street_2     varchar(20),
c_city         varchar(20),
c_state        char(2),
c_zip          char(9),
c_phone        char(16),
c_since        timestamp,
c_middle       char(2),
c_data         varchar(500)
);
create sequence bmsql_hist_id_seq;
ORA-00955: name is already used by an existing object

create table bmsql_history (
hist_id  integer,
h_c_id   integer,
h_c_d_id integer,
h_c_w_id integer,
h_d_id   integer,
h_w_id   integer,
h_date   timestamp,
h_amount decimal(6,2),
h_data   varchar(24)
);
create table bmsql_new_order (
no_w_id  integer   not null,
no_d_id  integer   not null,
no_o_id  integer   not null
);
create table bmsql_oorder (
o_w_id       integer      not null,
o_d_id       integer      not null,
o_id         integer      not null,
o_c_id       integer,
o_carrier_id integer,
o_ol_cnt     integer,
o_all_local  integer,
o_entry_d    timestamp
);
create table bmsql_order_line (
ol_w_id         integer   not null,
ol_d_id         integer   not null,
ol_o_id         integer   not null,
ol_number       integer   not null,
ol_i_id         integer   not null,
ol_delivery_d   timestamp,
ol_amount       decimal(6,2),
ol_supply_w_id  integer,
ol_quantity     integer,
ol_dist_info    char(24)
);
create table bmsql_item (
i_id     integer      not null,
i_name   varchar(24),
i_price  decimal(5,2),
i_data   varchar(50),
i_im_id  integer
);
create table bmsql_stock (
s_w_id       integer       not null,
s_i_id       integer       not null,
s_quantity   integer,
s_ytd        integer,
s_order_cnt  integer,
s_remote_cnt integer,
s_data       varchar(50),
s_dist_01    char(24),
s_dist_02    char(24),
s_dist_03    char(24),
s_dist_04    char(24),
s_dist_05    char(24),
s_dist_06    char(24),
s_dist_07    char(24),
s_dist_08    char(24),
s_dist_09    char(24),
s_dist_10    char(24)
);
Starting BenchmarkSQL LoadData

driver=oracle.jdbc.driver.OracleDriver
conn=jdbc:oracle:thin:@localhost:1521:shardcat
user=tpcc
password=***********
warehouses=40
loadWorkers=10
fileLocation (not defined)
csvNullValue (not defined - using default 'NULL')

Worker 000: Loading ITEM
Worker 001: Loading Warehouse      1
Worker 002: Loading Warehouse      2
Worker 003: Loading Warehouse      3
Worker 004: Loading Warehouse      4
Worker 005: Loading Warehouse      5
Worker 006: Loading Warehouse      6
Worker 007: Loading Warehouse      7
Worker 008: Loading Warehouse      8
Worker 009: Loading Warehouse      9
Worker 000: Loading ITEM done
Worker 000: Loading Warehouse     10
Worker 003: Loading Warehouse      3 done
Worker 003: Loading Warehouse     11
Worker 004: Loading Warehouse      4 done
Worker 004: Loading Warehouse     12
Worker 006: Loading Warehouse      6 done
Worker 006: Loading Warehouse     13
Worker 002: Loading Warehouse      2 done
Worker 002: Loading Warehouse     14
Worker 005: Loading Warehouse      5 done
Worker 005: Loading Warehouse     15
Worker 007: Loading Warehouse      7 done
Worker 007: Loading Warehouse     16
Worker 001: Loading Warehouse      1 done
Worker 001: Loading Warehouse     17
Worker 009: Loading Warehouse      9 done
Worker 009: Loading Warehouse     18
Worker 008: Loading Warehouse      8 done
Worker 008: Loading Warehouse     19
Worker 000: Loading Warehouse     10 done
Worker 000: Loading Warehouse     20
Worker 006: Loading Warehouse     13 done
Worker 006: Loading Warehouse     21
Worker 002: Loading Warehouse     14 done
Worker 002: Loading Warehouse     22
Worker 003: Loading Warehouse     11 done
Worker 003: Loading Warehouse     23
Worker 005: Loading Warehouse     15 done
Worker 005: Loading Warehouse     24
Worker 004: Loading Warehouse     12 done
Worker 004: Loading Warehouse     25
Worker 007: Loading Warehouse     16 done
Worker 007: Loading Warehouse     26
Worker 008: Loading Warehouse     19 done
Worker 008: Loading Warehouse     27
Worker 000: Loading Warehouse     20 done
Worker 000: Loading Warehouse     28
Worker 009: Loading Warehouse     18 done
Worker 009: Loading Warehouse     29
Worker 001: Loading Warehouse     17 done
Worker 001: Loading Warehouse     30
Worker 000: Loading Warehouse     28 done
Worker 000: Loading Warehouse     31
Worker 006: Loading Warehouse     21 done
Worker 006: Loading Warehouse     32
Worker 009: Loading Warehouse     29 done
Worker 009: Loading Warehouse     33
Worker 008: Loading Warehouse     27 done
Worker 008: Loading Warehouse     34
Worker 003: Loading Warehouse     23 done
Worker 003: Loading Warehouse     35
Worker 007: Loading Warehouse     26 done
Worker 007: Loading Warehouse     36
Worker 005: Loading Warehouse     24 done
Worker 005: Loading Warehouse     37
Worker 001: Loading Warehouse     30 done
Worker 001: Loading Warehouse     38
Worker 002: Loading Warehouse     22 done
Worker 002: Loading Warehouse     39
Worker 004: Loading Warehouse     25 done
Worker 004: Loading Warehouse     40
Worker 000: Loading Warehouse     31 done
Worker 009: Loading Warehouse     33 done
Worker 005: Loading Warehouse     37 done
Worker 004: Loading Warehouse     40 done
Worker 008: Loading Warehouse     34 done
Worker 007: Loading Warehouse     36 done
Worker 003: Loading Warehouse     35 done
Worker 006: Loading Warehouse     32 done
Worker 001: Loading Warehouse     38 done
Worker 002: Loading Warehouse     39 done
# ------------------------------------------------------------
# Loading SQL file ./sql.common/indexCreates.sql
# ------------------------------------------------------------
alter table bmsql_warehouse add constraint bmsql_warehouse_pkey
primary key (w_id);
alter table bmsql_district add constraint bmsql_district_pkey
primary key (d_w_id, d_id);
alter table bmsql_customer add constraint bmsql_customer_pkey
primary key (c_w_id, c_d_id, c_id);
create index bmsql_customer_idx1
on  bmsql_customer (c_w_id, c_d_id, c_last, c_first);
alter table bmsql_oorder add constraint bmsql_oorder_pkey
primary key (o_w_id, o_d_id, o_id);
create unique index bmsql_oorder_idx1
on  bmsql_oorder (o_w_id, o_d_id, o_carrier_id, o_id);
alter table bmsql_new_order add constraint bmsql_new_order_pkey
primary key (no_w_id, no_d_id, no_o_id);
alter table bmsql_order_line add constraint bmsql_order_line_pkey
primary key (ol_w_id, ol_d_id, ol_o_id, ol_number);
alter table bmsql_stock add constraint bmsql_stock_pkey
primary key (s_w_id, s_i_id);
alter table bmsql_item add constraint bmsql_item_pkey
primary key (i_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.common/foreignKeys.sql
# ------------------------------------------------------------
alter table bmsql_district add constraint d_warehouse_fkey
foreign key (d_w_id)
references bmsql_warehouse (w_id);
alter table bmsql_customer add constraint c_district_fkey
foreign key (c_w_id, c_d_id)
references bmsql_district (d_w_id, d_id);
alter table bmsql_history add constraint h_customer_fkey
foreign key (h_c_w_id, h_c_d_id, h_c_id)
references bmsql_customer (c_w_id, c_d_id, c_id);
alter table bmsql_history add constraint h_district_fkey
foreign key (h_w_id, h_d_id)
references bmsql_district (d_w_id, d_id);
alter table bmsql_new_order add constraint no_order_fkey
foreign key (no_w_id, no_d_id, no_o_id)
references bmsql_oorder (o_w_id, o_d_id, o_id);
alter table bmsql_oorder add constraint o_customer_fkey
foreign key (o_w_id, o_d_id, o_c_id)
references bmsql_customer (c_w_id, c_d_id, c_id);
alter table bmsql_order_line add constraint ol_order_fkey
foreign key (ol_w_id, ol_d_id, ol_o_id)
references bmsql_oorder (o_w_id, o_d_id, o_id);
alter table bmsql_order_line add constraint ol_stock_fkey
foreign key (ol_supply_w_id, ol_i_id)
references bmsql_stock (s_w_id, s_i_id);
alter table bmsql_stock add constraint s_warehouse_fkey
foreign key (s_w_id)
references bmsql_warehouse (w_id);
alter table bmsql_stock add constraint s_item_fkey
foreign key (s_i_id)
references bmsql_item (i_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.oracle/extraHistID.sql
# ------------------------------------------------------------
-- ----
-- Extra Schema objects/definitions for history.hist_id in Oracle
-- ----
-- ----
--      This is an extra column not present in the TPC-C
--      specs. It is useful for replication systems like
--      Bucardo and Slony-I, which like to have a primary
--      key on a table. It is an auto-increment or serial
--      column type. The definition below is compatible
--      with Oracle 11g, using the sequence in a trigger.
-- ----
-- Adjust the sequence above the current max(hist_id)
alter sequence bmsql_hist_id_seq increment by 30000;
declare
n integer;
i integer;
dummy integer;
begin
select max(hist_id) into n from bmsql_history;
i := 0;
while i < = n loop
select bmsql_hist_id_seq.nextval into dummy from dual;
i := i + 30000;
end loop;
end;
;
alter sequence bmsql_hist_id_seq increment by 1;
-- Create a trigger that forces hist_id to be hist_id_seq.nextval
create trigger bmsql_history_before_insert
before insert on bmsql_history
for each row
begin
if :new.hist_id is null then
select bmsql_hist_id_seq.nextval into :new.hist_id from dual;
end if;
end;
;
-- Add a primary key history(hist_id)
alter table bmsql_history add primary key (hist_id);
# ------------------------------------------------------------
# Loading SQL file ./sql.common/buildFinish.sql
# ------------------------------------------------------------
-- ----
-- Extra commands to run after the tables are created, loaded,
-- indexes built and extra's created.
-- ----

执行压测

[oracle@shard1 run]$ ./runBenchmark.sh props.ora
10:55:01,136 [main] INFO   jTPCC : Term-00,
10:55:01,142 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:55:01,142 [main] INFO   jTPCC : Term-00,      BenchmarkSQL v5.0
10:55:01,142 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:55:01,143 [main] INFO   jTPCC : Term-00,  (c) 2003, Raul Barbosa
10:55:01,143 [main] INFO   jTPCC : Term-00,  (c) 2004-2016, Denis Lussier
10:55:01,147 [main] INFO   jTPCC : Term-00,  (c) 2016, Jan Wieck
10:55:01,147 [main] INFO   jTPCC : Term-00, +-------------------------------------------------------------+
10:55:01,147 [main] INFO   jTPCC : Term-00,
10:55:01,147 [main] INFO   jTPCC : Term-00, db=oracle
10:55:01,148 [main] INFO   jTPCC : Term-00, driver=oracle.jdbc.driver.OracleDriver
10:55:01,148 [main] INFO   jTPCC : Term-00, conn=jdbc:oracle:thin:@localhost:1521:shardcat
10:55:01,148 [main] INFO   jTPCC : Term-00, user=tpcc
10:55:01,148 [main] INFO   jTPCC : Term-00,
10:55:01,148 [main] INFO   jTPCC : Term-00, warehouses=40
10:55:01,149 [main] INFO   jTPCC : Term-00, terminals=10
10:55:01,151 [main] INFO   jTPCC : Term-00, runMins=10
10:55:01,152 [main] INFO   jTPCC : Term-00, limitTxnsPerMin=0
10:55:01,152 [main] INFO   jTPCC : Term-00, terminalWarehouseFixed=true
10:55:01,152 [main] INFO   jTPCC : Term-00,
10:55:01,152 [main] INFO   jTPCC : Term-00, newOrderWeight=45
10:55:01,152 [main] INFO   jTPCC : Term-00, paymentWeight=43
10:55:01,152 [main] INFO   jTPCC : Term-00, orderStatusWeight=4
10:55:01,153 [main] INFO   jTPCC : Term-00, deliveryWeight=4
10:55:01,153 [main] INFO   jTPCC : Term-00, stockLevelWeight=4
10:55:01,153 [main] INFO   jTPCC : Term-00,
10:55:01,153 [main] INFO   jTPCC : Term-00, resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
10:55:01,154 [main] INFO   jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
10:55:01,154 [main] INFO   jTPCC : Term-00,
10:55:01,455 [main] INFO   jTPCC : Term-00, copied props.ora to my_result_2022-11-14_105501/run.properties
10:55:01,456 [main] INFO   jTPCC : Term-00, created my_result_2022-11-14_105501/data/runInfo.csv for runID 5
10:55:01,456 [main] INFO   jTPCC : Term-00, writing per transaction results to my_result_2022-11-14_105501/data/result.csv
10:55:01,457 [main] INFO   jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
10:55:01,457 [main] INFO   jTPCC : Term-00, osCollectorInterval=1
10:55:01,458 [main] INFO   jTPCC : Term-00, osCollectorSSHAddr=null
10:55:01,458 [main] INFO   jTPCC : Term-00, osCollectorDevices=null
10:55:01,543 [main] INFO   jTPCC : Term-00,
10:55:02,053 [main] INFO   jTPCC : Term-00, C value for C_LAST during load: 74
10:55:02,054 [main] INFO   jTPCC : Term-00, C value for C_LAST this run:    175
10:55:02,054 [main] INFO   jTPCC : Term-00,
Term-00, Running Average tpmTOTAL: 33105.98    Current tpmTOTAL: 2183436    Memory Usage: 39MB / 196MB
11:05:02,526 [Thread-6] INFO   jTPCC : Term-00,
11:05:02,526 [Thread-6] INFO   jTPCC : Term-00,
11:05:02,527 [Thread-6] INFO   jTPCC : Term-00, Measured tpmC (NewOrders) = 14913.98
11:05:02,527 [Thread-6] INFO   jTPCC : Term-00, Measured tpmTOTAL = 33102.08
11:05:02,527 [Thread-6] INFO   jTPCC : Term-00, Session Start     = 2022-11-14 10:55:02
11:05:02,528 [Thread-6] INFO   jTPCC : Term-00, Session End       = 2022-11-14 11:05:02
11:05:02,528 [Thread-6] INFO   jTPCC : Term-00, Transaction Count = 331069

清理数据

[oracle@shard1 run]$ ./runDatabaseDestroy.sh props.ora
# ------------------------------------------------------------
# Loading SQL file ./sql.common/tableDrops.sql
# ------------------------------------------------------------
drop table bmsql_config;
drop table bmsql_new_order;
drop table bmsql_order_line;
drop table bmsql_oorder;
drop table bmsql_history;
drop table bmsql_customer;
drop table bmsql_stock;
drop table bmsql_item;
drop table bmsql_district;
drop table bmsql_warehouse;
drop sequence bmsql_hist_id_seq;
]]>
http://www.jydba.net/index.php/archives/3455/feed 0
sysbench压测Oracle 11g http://www.jydba.net/index.php/archives/3453 http://www.jydba.net/index.php/archives/3453#respond Thu, 16 Feb 2023 03:34:14 +0000 http://www.jydba.net/?p=3453 sysbench是一款测试工具主要包括以下几种方式的测试:
1、cpu性能
2、磁盘io性能
3、调度程式性能
4、内存分配及传输速度
5、POSIX线程性能
6、数据库性能(OLTP基准测试)现在sysbench主要支持 MySQL,pgsql,oracle 这3种数据库,默认支持MySQL,想要支持pgsql和oracle需要在编译时指定参数

环境介绍

名称	             版本
sysbench软件版本	sysbench 0.5
操作系统	        oracle linux 7.1
Oracle	          11.2.0.4

安装
1.安装依赖包

[root@shard1 /]# yum -y install make m4  autoconf automake libtool pkgconfig libaio-devel

2.解压sysbench软件

[root@sjjh /]# unzip sysbench-0.5.zip
Archive:  sysbench-0.5.zip
b23a7db377916e424cb555108dc5f784f615993b
   creating: sysbench-0.5/
  inflating: sysbench-0.5/.gitignore
  inflating: sysbench-0.5/.travis.yml
  inflating: sysbench-0.5/COPYING
  inflating: sysbench-0.5/ChangeLog
  inflating: sysbench-0.5/Makefile.am
  inflating: sysbench-0.5/README-WIN.txt
  inflating: sysbench-0.5/README.md
 extracting: sysbench-0.5/TODO
  inflating: sysbench-0.5/autogen.sh
   creating: sysbench-0.5/config/
  inflating: sysbench-0.5/config/config.rpath
  inflating: sysbench-0.5/configure.ac
   creating: sysbench-0.5/doc/
  inflating: sysbench-0.5/doc/Makefile.am
  inflating: sysbench-0.5/doc/manual.xml
   creating: sysbench-0.5/doc/xsl/
  inflating: sysbench-0.5/doc/xsl/Makefile.am
  inflating: sysbench-0.5/doc/xsl/catalog.xml.in
  inflating: sysbench-0.5/doc/xsl/xhtml-chunk.xsl
  inflating: sysbench-0.5/doc/xsl/xhtml-common.xsl
  inflating: sysbench-0.5/doc/xsl/xhtml.xsl
  inflating: sysbench-0.5/install-sh
   creating: sysbench-0.5/m4/
  inflating: sysbench-0.5/m4/ac_check_aio.m4
  inflating: sysbench-0.5/m4/ac_check_mysqlr.m4
  inflating: sysbench-0.5/m4/ac_check_pgsql.m4
  inflating: sysbench-0.5/m4/ac_lua_devel.m4
  inflating: sysbench-0.5/m4/acx_pthread.m4
  inflating: sysbench-0.5/m4/ax_check_docbook.m4
  inflating: sysbench-0.5/m4/extensions.m4
  inflating: sysbench-0.5/m4/lib-ld.m4
  inflating: sysbench-0.5/m4/lib-link.m4
  inflating: sysbench-0.5/m4/lib-prefix.m4
  inflating: sysbench-0.5/missing
  inflating: sysbench-0.5/mkinstalldirs
   creating: sysbench-0.5/sysbench/
  inflating: sysbench-0.5/sysbench/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/Makefile.am
  inflating: sysbench-0.5/sysbench/db_driver.c
  inflating: sysbench-0.5/sysbench/db_driver.h
   creating: sysbench-0.5/sysbench/drivers/
  inflating: sysbench-0.5/sysbench/drivers/Makefile.am
   creating: sysbench-0.5/sysbench/drivers/attachsql/
  inflating: sysbench-0.5/sysbench/drivers/attachsql/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/attachsql/drv_attachsql.c
   creating: sysbench-0.5/sysbench/drivers/drizzle/
  inflating: sysbench-0.5/sysbench/drivers/drizzle/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/drizzle/drv_drizzle.c
   creating: sysbench-0.5/sysbench/drivers/mysql/
  inflating: sysbench-0.5/sysbench/drivers/mysql/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/drivers/mysql/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/mysql/drv_mysql.c
   creating: sysbench-0.5/sysbench/drivers/oracle/
  inflating: sysbench-0.5/sysbench/drivers/oracle/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/oracle/drv_oracle.c
   creating: sysbench-0.5/sysbench/drivers/pgsql/
  inflating: sysbench-0.5/sysbench/drivers/pgsql/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/pgsql/drv_pgsql.c
  inflating: sysbench-0.5/sysbench/sb_barrier.c
  inflating: sysbench-0.5/sysbench/sb_barrier.h
  inflating: sysbench-0.5/sysbench/sb_list.h
  inflating: sysbench-0.5/sysbench/sb_logger.c
  inflating: sysbench-0.5/sysbench/sb_logger.h
  inflating: sysbench-0.5/sysbench/sb_options.c
  inflating: sysbench-0.5/sysbench/sb_options.h
  inflating: sysbench-0.5/sysbench/sb_percentile.c
  inflating: sysbench-0.5/sysbench/sb_percentile.h
  inflating: sysbench-0.5/sysbench/sb_timer.c
  inflating: sysbench-0.5/sysbench/sb_timer.h
  inflating: sysbench-0.5/sysbench/sb_win.c
  inflating: sysbench-0.5/sysbench/sb_win.h
   creating: sysbench-0.5/sysbench/scripting/
  inflating: sysbench-0.5/sysbench/scripting/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/scripting/Makefile.am
   creating: sysbench-0.5/sysbench/scripting/lua/
  inflating: sysbench-0.5/sysbench/scripting/lua/COPYRIGHT
  inflating: sysbench-0.5/sysbench/scripting/lua/Makefile.am
  inflating: sysbench-0.5/sysbench/scripting/lua/README
   creating: sysbench-0.5/sysbench/scripting/lua/src/
  inflating: sysbench-0.5/sysbench/scripting/lua/src/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/scripting/lua/src/Makefile.am
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lapi.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lapi.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lauxlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lauxlib.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lbaselib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lcode.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lcode.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldblib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldebug.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldebug.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldo.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldo.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldump.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lfunc.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lfunc.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lgc.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lgc.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/linit.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/liolib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/llex.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/llex.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/llimits.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lmathlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lmem.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lmem.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/loadlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lobject.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lobject.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lopcodes.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lopcodes.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/loslib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lparser.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lparser.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstate.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstate.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstring.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstring.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstrlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltable.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltable.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltablib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltm.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltm.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lua.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/luaconf.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lualib.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lundump.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lundump.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lvm.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lvm.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lzio.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lzio.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/print.c
  inflating: sysbench-0.5/sysbench/scripting/sb_script.c
  inflating: sysbench-0.5/sysbench/scripting/sb_script.h
  inflating: sysbench-0.5/sysbench/scripting/script_lua.c
  inflating: sysbench-0.5/sysbench/scripting/script_lua.h
  inflating: sysbench-0.5/sysbench/sysbench.c
  inflating: sysbench-0.5/sysbench/sysbench.h
   creating: sysbench-0.5/sysbench/tests/
  inflating: sysbench-0.5/sysbench/tests/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/Makefile.am
   creating: sysbench-0.5/sysbench/tests/cpu/
  inflating: sysbench-0.5/sysbench/tests/cpu/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/cpu/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/cpu/sb_cpu.c
   creating: sysbench-0.5/sysbench/tests/db/
  inflating: sysbench-0.5/sysbench/tests/db/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/db/bulk_insert.lua
  inflating: sysbench-0.5/sysbench/tests/db/common.lua
  inflating: sysbench-0.5/sysbench/tests/db/delete.lua
  inflating: sysbench-0.5/sysbench/tests/db/insert.lua
  inflating: sysbench-0.5/sysbench/tests/db/oltp.lua
  inflating: sysbench-0.5/sysbench/tests/db/oltp_simple.lua
  inflating: sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
  inflating: sysbench-0.5/sysbench/tests/db/select.lua
  inflating: sysbench-0.5/sysbench/tests/db/select_random_points.lua
  inflating: sysbench-0.5/sysbench/tests/db/select_random_ranges.lua
  inflating: sysbench-0.5/sysbench/tests/db/update_index.lua
  inflating: sysbench-0.5/sysbench/tests/db/update_non_index.lua
   creating: sysbench-0.5/sysbench/tests/fileio/
  inflating: sysbench-0.5/sysbench/tests/fileio/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/fileio/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/fileio/crc32.c
  inflating: sysbench-0.5/sysbench/tests/fileio/crc32.h
  inflating: sysbench-0.5/sysbench/tests/fileio/crc32tbl.h
  inflating: sysbench-0.5/sysbench/tests/fileio/sb_fileio.c
   creating: sysbench-0.5/sysbench/tests/memory/
  inflating: sysbench-0.5/sysbench/tests/memory/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/memory/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/memory/sb_memory.c
   creating: sysbench-0.5/sysbench/tests/mutex/
  inflating: sysbench-0.5/sysbench/tests/mutex/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/mutex/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/mutex/sb_mutex.c
  inflating: sysbench-0.5/sysbench/tests/sb_cpu.h
  inflating: sysbench-0.5/sysbench/tests/sb_fileio.h
  inflating: sysbench-0.5/sysbench/tests/sb_memory.h
  inflating: sysbench-0.5/sysbench/tests/sb_mutex.h
  inflating: sysbench-0.5/sysbench/tests/sb_threads.h
   creating: sysbench-0.5/sysbench/tests/threads/
  inflating: sysbench-0.5/sysbench/tests/threads/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/threads/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/threads/sb_threads.c
   creating: sysbench-0.5/tests/
  inflating: sysbench-0.5/tests/Makefile.am
  inflating: sysbench-0.5/tests/README.md
   creating: sysbench-0.5/tests/include/
  inflating: sysbench-0.5/tests/include/config.sh.in
  inflating: sysbench-0.5/tests/include/drv_common.sh
  inflating: sysbench-0.5/tests/include/script_oltp_common.sh
   creating: sysbench-0.5/tests/t/
 extracting: sysbench-0.5/tests/t/1st.t
  inflating: sysbench-0.5/tests/t/api_basic.t
  inflating: sysbench-0.5/tests/t/api_rand.t
  inflating: sysbench-0.5/tests/t/api_sql.t
  inflating: sysbench-0.5/tests/t/cleanup.t
  inflating: sysbench-0.5/tests/t/commands.t
  inflating: sysbench-0.5/tests/t/drivers.t
  inflating: sysbench-0.5/tests/t/drv_mysql.t
  inflating: sysbench-0.5/tests/t/drv_pgsql.t
  inflating: sysbench-0.5/tests/t/help.t
  inflating: sysbench-0.5/tests/t/help_drv_mysql.t
  inflating: sysbench-0.5/tests/t/help_drv_pgsql.t
  inflating: sysbench-0.5/tests/t/prepare.t
  inflating: sysbench-0.5/tests/t/run.t
  inflating: sysbench-0.5/tests/t/script_oltp_mysql.t
  inflating: sysbench-0.5/tests/t/script_oltp_pgsql.t
  inflating: sysbench-0.5/tests/t/test_cpu.t
  inflating: sysbench-0.5/tests/t/test_fileio.t
  inflating: sysbench-0.5/tests/t/test_memory.t
  inflating: sysbench-0.5/tests/t/test_mutex.t
  inflating: sysbench-0.5/tests/t/test_threads.t
  inflating: sysbench-0.5/tests/t/tests.t
  inflating: sysbench-0.5/tests/t/version.t
  inflating: sysbench-0.5/tests/test_run.sh

3.配置环境变量,使用实际的ORACLE_HOME目录

export CC=cc
export CXX=c++
export CFLAGS="-m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public"
export CXXFLAGS="$CFLAGS"
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db
export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0.4/db/lib

[root@sjjh /]# export CC=cc
[root@sjjh /]# export CXX=c++
[root@sjjh /]# export CFLAGS="-m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public"
[root@sjjh /]# export CXXFLAGS="$CFLAGS"
[root@sjjh /]# export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db
[root@sjjh /]# export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0.4/db/lib

4.运行autogen.sh,生成configure目录

[root@sjjh sysbench-0.5]# ./autogen.sh
./autogen.sh: running `aclocal -I m4'
./autogen.sh: running `libtoolize --copy --force'
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
./autogen.sh: running `autoheader'
./autogen.sh: running `automake -c --foreign --add-missing'
configure.ac:25: installing `config/compile'
configure.ac:11: installing `config/config.guess'
configure.ac:11: installing `config/config.sub'
configure.ac:16: installing `config/install-sh'
configure.ac:16: installing `config/missing'
sysbench/Makefile.am: installing `config/depcomp'
./autogen.sh: running `autoconf'
Libtoolized with: libtoolize (GNU libtool) 2.2.6b
Automade with: automake (GNU automake) 1.11.1
Configured with: autoconf (GNU Autoconf) 2.63

5.编译参数配置,加上–with-oracle

[root@sjjh sysbench-0.5]# ./configure --with-oracle --libdir=/u01/app/oracle/product/11.2.0.4/db/lib --without-mysql
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking dependency style of cc... gcc3
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) cc
checking whether we are using the GNU C compiler... (cached) yes
checking whether cc accepts -g... (cached) yes
checking for cc option to accept ISO C89... (cached) none needed
checking dependency style of cc... (cached) gcc3
checking how to run the C preprocessor... cc -E
checking whether cc understands -c and -o together... yes
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether __SUNPRO_C is declared... no
checking "C Compiler version"... "cc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)"
checking whether to compile with MySQL support... (cached) no
checking whether to compile with Drizzle support... (cached) yes
checking whether to compile with libattachsql support... (cached) yes
checking whether to compile with Oracle support... (cached) yes
checking whether to compile with PostgreSQL support... (cached) no
checking whether to compile with Lua support... (cached) yes
checking whether SHM_HUGETLB is declared... yes
checking whether O_SYNC is declared... yes
checking for xsltproc... xsltproc
checking whether xsltproc works... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for sqrt in -lm... yes
checking for ld used by GCC... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for libdrizzle... no
checking for libattachsql... no
checking libaio.h usability... yes
checking libaio.h presence... yes
checking for libaio.h... yes
checking for io_queue_init in -laio... yes
checking if io_getevents() has an old interface... no
checking for malloc in -lumem... no
checking for malloc in -lmtmalloc... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/aio.h usability... no
checking sys/aio.h presence... no
checking for sys/aio.h... no
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking thread.h usability... no
checking thread.h presence... no
checking for thread.h... no
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of size_t... 8
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking whether clock_gettime is declared... yes
checking for library containing clock_gettime... -lrt
checking for alarm... yes
checking for directio... no
checking for fdatasync... yes
checking for gettimeofday... yes
checking for lrand48... yes
checking for drand48... yes
checking for memalign... yes
checking for memset... yes
checking for mkstemp... yes
checking for popen... yes
checking for posix_memalign... yes
checking for pthread_yield... yes
checking for _setjmp... yes
checking for setvbuf... yes
checking for sqrt... yes
checking for strdup... yes
checking for thr_setconcurrency... no
checking for valloc... yes
checking for pthread_once... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/xsl/Makefile
config.status: creating doc/xsl/catalog.xml
config.status: creating doc/Makefile
config.status: creating sysbench/Makefile
config.status: creating sysbench/drivers/Makefile
config.status: creating sysbench/drivers/mysql/Makefile
config.status: creating sysbench/drivers/drizzle/Makefile
config.status: creating sysbench/drivers/oracle/Makefile
config.status: creating sysbench/drivers/pgsql/Makefile
config.status: creating sysbench/drivers/attachsql/Makefile
config.status: creating sysbench/tests/Makefile
config.status: creating sysbench/tests/cpu/Makefile
config.status: creating sysbench/tests/fileio/Makefile
config.status: creating sysbench/tests/memory/Makefile
config.status: creating sysbench/tests/threads/Makefile
config.status: creating sysbench/tests/mutex/Makefile
config.status: creating sysbench/tests/db/Makefile
config.status: creating sysbench/scripting/Makefile
config.status: creating sysbench/scripting/lua/Makefile
config.status: creating sysbench/scripting/lua/src/Makefile
config.status: creating tests/Makefile
config.status: creating tests/include/config.sh
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

6.编译及安装,注意这里要带上oracle的一个so

[oracle@sjjh db]$ pwd
/u01/app/oracle/product/11.2.0.4/db
[oracle@sjjh db]$ cd /u01/app/oracle/product/11.2.0.4/db/lib
[oracle@sjjh lib]$ ls -lrt libclntsh.so
lrwxrwxrwx. 1 oracle oinstall 57 Sep 18 10:06 libclntsh.so -> /u01/app/oracle/product/11.2.0.4/db/lib/libclntsh.so.11.1

[root@sjjh sysbench-0.5]# make ORA_LIBS=/u01/app/oracle/product/11.2.0.4/db/lib/libclntsh.so -j 4
Making all in doc
make[1]: Entering directory `/sysbench-0.5/doc'
Making all in xsl
make[2]: Entering directory `/sysbench-0.5/doc/xsl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/sysbench-0.5/doc/xsl'
make[2]: Entering directory `/sysbench-0.5/doc'
XML_CATALOG_FILES=./xsl/catalog.xml xsltproc --nonet -o manual.html ./xsl/xhtml.xsl ../doc/manual.xml
make[2]: Leaving directory `/sysbench-0.5/doc'
make[1]: Leaving directory `/sysbench-0.5/doc'
Making all in sysbench
make[1]: Entering directory `/sysbench-0.5/sysbench'
Making all in drivers
make[2]: Entering directory `/sysbench-0.5/sysbench/drivers'
Making all in oracle
make[3]: Entering directory `/sysbench-0.5/sysbench/drivers/oracle'
cc -DHAVE_CONFIG_H -I. -I../../../config  -Iyes/rdbms/demo -Iyes/rdbms/public -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsboracle_a-drv_oracle.o -MD -MP -MF .deps/libsboracle_a-drv_oracle.Tpo -c -o libsboracle_a-drv_oracle.o `test -f 'drv_oracle.c' || echo './'`drv_oracle.c
In file included from /u01/app/oracle/product/11.2.0.4/db/rdbms/public/oci.h:3045,
                 from drv_oracle.c:30:
/u01/app/oracle/product/11.2.0.4/db/rdbms/public/ociap.h:10795: warning: function declaration isn’t a prototype
/u01/app/oracle/product/11.2.0.4/db/rdbms/public/ociap.h:10801: warning: function declaration isn’t a prototype
drv_oracle.c: In function ‘ora_drv_init’:
drv_oracle.c:243: warning: pointer targets in assignment differ in signedness
drv_oracle.c: In function ‘ora_drv_connect’:
drv_oracle.c:310: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
/usr/include/string.h:399: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
drv_oracle.c: In function ‘ora_drv_prepare’:
drv_oracle.c:472: warning: pointer targets in passing argument 3 of ‘OCIStmtPrepare’ differ in signedness
/u01/app/oracle/product/11.2.0.4/db/rdbms/public/ociap.h:7163: note: expected ‘const OraText *’ but argument is of type ‘char *’
drv_oracle.c: In function ‘ora_drv_store_results’:
drv_oracle.c:852: warning: pointer targets in assignment differ in signedness
drv_oracle.c:855: warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness
drv_oracle.c:855: note: expected ‘char *’ but argument is of type ‘text *’
drv_oracle.c:855: warning: pointer targets in passing argument 2 of ‘__builtin_strncpy’ differ in signedness
drv_oracle.c:855: note: expected ‘const char *’ but argument is of type ‘text *’
drv_oracle.c: At top level:
drv_oracle.c:1077: warning: no previous prototype for ‘get_db_bind_type’
mv -f .deps/libsboracle_a-drv_oracle.Tpo .deps/libsboracle_a-drv_oracle.Po
rm -f libsboracle.a
ar cru libsboracle.a libsboracle_a-drv_oracle.o
ranlib libsboracle.a
make[3]: Leaving directory `/sysbench-0.5/sysbench/drivers/oracle'
make[3]: Entering directory `/sysbench-0.5/sysbench/drivers'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/sysbench-0.5/sysbench/drivers'
make[2]: Leaving directory `/sysbench-0.5/sysbench/drivers'
Making all in tests
make[2]: Entering directory `/sysbench-0.5/sysbench/tests'
Making all in cpu
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/cpu'
cc -DHAVE_CONFIG_H -I. -I../../../config  -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbcpu_a-sb_cpu.o -MD -MP -MF .deps/libsbcpu_a-sb_cpu.Tpo -c -o libsbcpu_a-sb_cpu.o `test -f 'sb_cpu.c' || echo './'`sb_cpu.c
mv -f .deps/libsbcpu_a-sb_cpu.Tpo .deps/libsbcpu_a-sb_cpu.Po
rm -f libsbcpu.a
ar cru libsbcpu.a libsbcpu_a-sb_cpu.o
ranlib libsbcpu.a
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/cpu'
Making all in fileio
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/fileio'
cc -DHAVE_CONFIG_H -I. -I../../../config  -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbfileio_a-sb_fileio.o -MD -MP -MF .deps/libsbfileio_a-sb_fileio.Tpo -c -o libsbfileio_a-sb_fileio.o `test -f 'sb_fileio.c' || echo './'`sb_fileio.c
cc -DHAVE_CONFIG_H -I. -I../../../config  -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbfileio_a-crc32.o -MD -MP -MF .deps/libsbfileio_a-crc32.Tpo -c -o libsbfileio_a-crc32.o `test -f 'crc32.c' || echo './'`crc32.c
mv -f .deps/libsbfileio_a-crc32.Tpo .deps/libsbfileio_a-crc32.Po
mv -f .deps/libsbfileio_a-sb_fileio.Tpo .deps/libsbfileio_a-sb_fileio.Po
rm -f libsbfileio.a
ar cru libsbfileio.a libsbfileio_a-sb_fileio.o libsbfileio_a-crc32.o
ranlib libsbfileio.a
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/fileio'
Making all in memory
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/memory'
cc -DHAVE_CONFIG_H -I. -I../../../config  -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbmemory_a-sb_memory.o -MD -MP -MF .deps/libsbmemory_a-sb_memory.Tpo -c -o libsbmemory_a-sb_memory.o `test -f 'sb_memory.c' || echo './'`sb_memory.c
mv -f .deps/libsbmemory_a-sb_memory.Tpo .deps/libsbmemory_a-sb_memory.Po
rm -f libsbmemory.a
ar cru libsbmemory.a libsbmemory_a-sb_memory.o
ranlib libsbmemory.a
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/memory'
Making all in threads
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/threads'
cc -DHAVE_CONFIG_H -I. -I../../../config  -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbthreads_a-sb_threads.o -MD -MP -MF .deps/libsbthreads_a-sb_threads.Tpo -c -o libsbthreads_a-sb_threads.o `test -f 'sb_threads.c' || echo './'`sb_threads.c
mv -f .deps/libsbthreads_a-sb_threads.Tpo .deps/libsbthreads_a-sb_threads.Po
rm -f libsbthreads.a
ar cru libsbthreads.a libsbthreads_a-sb_threads.o
ranlib libsbthreads.a
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/threads'
Making all in mutex
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/mutex'
cc -DHAVE_CONFIG_H -I. -I../../../config  -I../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbmutex_a-sb_mutex.o -MD -MP -MF .deps/libsbmutex_a-sb_mutex.Tpo -c -o libsbmutex_a-sb_mutex.o `test -f 'sb_mutex.c' || echo './'`sb_mutex.c
mv -f .deps/libsbmutex_a-sb_mutex.Tpo .deps/libsbmutex_a-sb_mutex.Po
rm -f libsbmutex.a
ar cru libsbmutex.a libsbmutex_a-sb_mutex.o
ranlib libsbmutex.a
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/mutex'
Making all in db
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/db'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/db'
make[3]: Entering directory `/sysbench-0.5/sysbench/tests'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests'
make[2]: Leaving directory `/sysbench-0.5/sysbench/tests'
Making all in scripting
make[2]: Entering directory `/sysbench-0.5/sysbench/scripting'
Making all in lua
make[3]: Entering directory `/sysbench-0.5/sysbench/scripting/lua'
Making all in src
make[4]: Entering directory `/sysbench-0.5/sysbench/scripting/lua/src'
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lapi.o -MD -MP -MF .deps/lapi.Tpo -c -o lapi.o lapi.c
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lcode.o -MD -MP -MF .deps/lcode.Tpo -c -o lcode.o lcode.c
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT ldebug.o -MD -MP -MF .deps/ldebug.Tpo -c -o ldebug.o ldebug.c
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT ldo.o -MD -MP -MF .deps/ldo.Tpo -c -o ldo.o ldo.c
mv -f .deps/ldebug.Tpo .deps/ldebug.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT ldump.o -MD -MP -MF .deps/ldump.Tpo -c -o ldump.o ldump.c
mv -f .deps/ldo.Tpo .deps/ldo.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lfunc.o -MD -MP -MF .deps/lfunc.Tpo -c -o lfunc.o lfunc.c
mv -f .deps/lcode.Tpo .deps/lcode.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lgc.o -MD -MP -MF .deps/lgc.Tpo -c -o lgc.o lgc.c
mv -f .deps/ldump.Tpo .deps/ldump.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT llex.o -MD -MP -MF .deps/llex.Tpo -c -o llex.o llex.c
mv -f .deps/lapi.Tpo .deps/lapi.Po
mv -f .deps/lfunc.Tpo .deps/lfunc.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lmem.o -MD -MP -MF .deps/lmem.Tpo -c -o lmem.o lmem.c
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lobject.o -MD -MP -MF .deps/lobject.Tpo -c -o lobject.o lobject.c
mv -f .deps/lmem.Tpo .deps/lmem.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lopcodes.o -MD -MP -MF .deps/lopcodes.Tpo -c -o lopcodes.o lopcodes.c
mv -f .deps/lopcodes.Tpo .deps/lopcodes.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lparser.o -MD -MP -MF .deps/lparser.Tpo -c -o lparser.o lparser.c
mv -f .deps/lobject.Tpo .deps/lobject.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lstate.o -MD -MP -MF .deps/lstate.Tpo -c -o lstate.o lstate.c
mv -f .deps/llex.Tpo .deps/llex.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lstring.o -MD -MP -MF .deps/lstring.Tpo -c -o lstring.o lstring.c
mv -f .deps/lstate.Tpo .deps/lstate.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT ltable.o -MD -MP -MF .deps/ltable.Tpo -c -o ltable.o ltable.c
mv -f .deps/lgc.Tpo .deps/lgc.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT ltm.o -MD -MP -MF .deps/ltm.Tpo -c -o ltm.o ltm.c
mv -f .deps/lstring.Tpo .deps/lstring.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lundump.o -MD -MP -MF .deps/lundump.Tpo -c -o lundump.o lundump.c
mv -f .deps/ltm.Tpo .deps/ltm.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lvm.o -MD -MP -MF .deps/lvm.Tpo -c -o lvm.o lvm.c
mv -f .deps/lundump.Tpo .deps/lundump.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lzio.o -MD -MP -MF .deps/lzio.Tpo -c -o lzio.o lzio.c
mv -f .deps/lparser.Tpo .deps/lparser.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lauxlib.o -MD -MP -MF .deps/lauxlib.Tpo -c -o lauxlib.o lauxlib.c
mv -f .deps/ltable.Tpo .deps/ltable.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lbaselib.o -MD -MP -MF .deps/lbaselib.Tpo -c -o lbaselib.o lbaselib.c
mv -f .deps/lzio.Tpo .deps/lzio.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT ldblib.o -MD -MP -MF .deps/ldblib.Tpo -c -o ldblib.o ldblib.c
mv -f .deps/ldblib.Tpo .deps/ldblib.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT liolib.o -MD -MP -MF .deps/liolib.Tpo -c -o liolib.o liolib.c
mv -f .deps/lauxlib.Tpo .deps/lauxlib.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lmathlib.o -MD -MP -MF .deps/lmathlib.Tpo -c -o lmathlib.o lmathlib.c
mv -f .deps/lbaselib.Tpo .deps/lbaselib.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT loslib.o -MD -MP -MF .deps/loslib.Tpo -c -o loslib.o loslib.c
mv -f .deps/lvm.Tpo .deps/lvm.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT ltablib.o -MD -MP -MF .deps/ltablib.Tpo -c -o ltablib.o ltablib.c
mv -f .deps/loslib.Tpo .deps/loslib.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT lstrlib.o -MD -MP -MF .deps/lstrlib.Tpo -c -o lstrlib.o lstrlib.c
mv -f .deps/lmathlib.Tpo .deps/lmathlib.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT loadlib.o -MD -MP -MF .deps/loadlib.Tpo -c -o loadlib.o loadlib.c
mv -f .deps/ltablib.Tpo .deps/ltablib.Po
cc -DHAVE_CONFIG_H -I. -I../../../../config  -I../../../../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -Wno-bad-function-cast -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT linit.o -MD -MP -MF .deps/linit.Tpo -c -o linit.o linit.c
mv -f .deps/liolib.Tpo .deps/liolib.Po
mv -f .deps/linit.Tpo .deps/linit.Po
mv -f .deps/loadlib.Tpo .deps/loadlib.Po
mv -f .deps/lstrlib.Tpo .deps/lstrlib.Po
rm -f liblua.a
ar cru liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
ranlib liblua.a
make[4]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua/src'
make[4]: Entering directory `/sysbench-0.5/sysbench/scripting/lua'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua'
make[3]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua'
Making all in .
make[3]: Entering directory `/sysbench-0.5/sysbench/scripting'
cc -DHAVE_CONFIG_H -I. -I../../config  -I../../sysbench -I./lua/src -DDATA_PATH=\"/usr/local/share/sysbench\" -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbscript_a-sb_script.o -MD -MP -MF .deps/libsbscript_a-sb_script.Tpo -c -o libsbscript_a-sb_script.o `test -f 'sb_script.c' || echo './'`sb_script.c
cc -DHAVE_CONFIG_H -I. -I../../config  -I../../sysbench -I./lua/src -DDATA_PATH=\"/usr/local/share/sysbench\" -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT libsbscript_a-script_lua.o -MD -MP -MF .deps/libsbscript_a-script_lua.Tpo -c -o libsbscript_a-script_lua.o `test -f 'script_lua.c' || echo './'`script_lua.c
mv -f .deps/libsbscript_a-sb_script.Tpo .deps/libsbscript_a-sb_script.Po
mv -f .deps/libsbscript_a-script_lua.Tpo .deps/libsbscript_a-script_lua.Po
rm -f libsbscript.a
ar cru libsbscript.a libsbscript_a-sb_script.o libsbscript_a-script_lua.o
ranlib libsbscript.a
make[3]: Leaving directory `/sysbench-0.5/sysbench/scripting'
make[2]: Leaving directory `/sysbench-0.5/sysbench/scripting'
Making all in .
make[2]: Entering directory `/sysbench-0.5/sysbench'
cc -DHAVE_CONFIG_H -I. -I../config  -I../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT sysbench.o -MD -MP -MF .deps/sysbench.Tpo -c -o sysbench.o sysbench.c
cc -DHAVE_CONFIG_H -I. -I../config  -I../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT sb_timer.o -MD -MP -MF .deps/sb_timer.Tpo -c -o sb_timer.o sb_timer.c
cc -DHAVE_CONFIG_H -I. -I../config  -I../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT sb_options.o -MD -MP -MF .deps/sb_options.Tpo -c -o sb_options.o sb_options.c
cc -DHAVE_CONFIG_H -I. -I../config  -I../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT sb_logger.o -MD -MP -MF .deps/sb_logger.Tpo -c -o sb_logger.o sb_logger.c
mv -f .deps/sb_timer.Tpo .deps/sb_timer.Po
cc -DHAVE_CONFIG_H -I. -I../config  -I../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT db_driver.o -MD -MP -MF .deps/db_driver.Tpo -c -o db_driver.o db_driver.c
mv -f .deps/sb_logger.Tpo .deps/sb_logger.Po
cc -DHAVE_CONFIG_H -I. -I../config  -I../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT sb_percentile.o -MD -MP -MF .deps/sb_percentile.Tpo -c -o sb_percentile.o sb_percentile.c
mv -f .deps/sb_options.Tpo .deps/sb_options.Po
cc -DHAVE_CONFIG_H -I. -I../config  -I../sysbench -D_XOPEN_SOURCE=500 -D_GNU_SOURCE  -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -MT sb_barrier.o -MD -MP -MF .deps/sb_barrier.Tpo -c -o sb_barrier.o sb_barrier.c
mv -f .deps/sb_barrier.Tpo .deps/sb_barrier.Po
mv -f .deps/sb_percentile.Tpo .deps/sb_percentile.Po
mv -f .deps/sysbench.Tpo .deps/sysbench.Po
mv -f .deps/db_driver.Tpo .deps/db_driver.Po
/bin/sh ../libtool --tag=CC   --mode=link cc -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast   -Wstrict-prototypes -Wnested-externs -Winline   -funroll-loops  -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align        -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public       -L/u01/app/oracle/product/11.2.0.4/db/lib -o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o sb_percentile.o sb_barrier.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/mutex/libsbmutex.a scripting/libsbscript.a     drivers/oracle/libsboracle.a /u01/app/oracle/product/11.2.0.4/db/lib/libclntsh.so scripting/lua/src/liblua.a -lm -ldl -lrt -laio -lm
libtool: link: cc -W -Wall -Wextra -Wpointer-arith -Wbad-function-cast -Wstrict-prototypes -Wnested-externs -Winline -funroll-loops -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wcast-align -pthread -O2 -ggdb3 -m64 -I /u01/app/oracle/product/11.2.0.4/db/rdbms/public -o sysbench sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o sb_percentile.o sb_barrier.o /u01/app/oracle/product/11.2.0.4/db/lib/libclntsh.so  -L/u01/app/oracle/product/11.2.0.4/db/lib tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/mutex/libsbmutex.a scripting/libsbscript.a drivers/oracle/libsboracle.a scripting/lua/src/liblua.a -ldl -lrt -laio -lm -pthread
make[2]: Leaving directory `/sysbench-0.5/sysbench'
make[1]: Leaving directory `/sysbench-0.5/sysbench'
Making all in tests
make[1]: Entering directory `/sysbench-0.5/tests'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/sysbench-0.5/tests'
make[1]: Entering directory `/sysbench-0.5'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/sysbench-0.5'


[root@sjjh sysbench-0.5]# make install
Making install in doc
make[1]: Entering directory `/sysbench-0.5/doc'
Making install in xsl
make[2]: Entering directory `/sysbench-0.5/doc/xsl'
make[3]: Entering directory `/sysbench-0.5/doc/xsl'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/sysbench-0.5/doc/xsl'
make[2]: Leaving directory `/sysbench-0.5/doc/xsl'
make[2]: Entering directory `/sysbench-0.5/doc'
make[3]: Entering directory `/sysbench-0.5/doc'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/share/doc/sysbench" || /bin/mkdir -p "/usr/local/share/doc/sysbench"
 /usr/bin/install -c -m 644 manual.html '/usr/local/share/doc/sysbench'
make[3]: Leaving directory `/sysbench-0.5/doc'
make[2]: Leaving directory `/sysbench-0.5/doc'
make[1]: Leaving directory `/sysbench-0.5/doc'
Making install in sysbench
make[1]: Entering directory `/sysbench-0.5/sysbench'
Making install in drivers
make[2]: Entering directory `/sysbench-0.5/sysbench/drivers'
Making install in oracle
make[3]: Entering directory `/sysbench-0.5/sysbench/drivers/oracle'
make[4]: Entering directory `/sysbench-0.5/sysbench/drivers/oracle'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/drivers/oracle'
make[3]: Leaving directory `/sysbench-0.5/sysbench/drivers/oracle'
make[3]: Entering directory `/sysbench-0.5/sysbench/drivers'
make[4]: Entering directory `/sysbench-0.5/sysbench/drivers'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/drivers'
make[3]: Leaving directory `/sysbench-0.5/sysbench/drivers'
make[2]: Leaving directory `/sysbench-0.5/sysbench/drivers'
Making install in tests
make[2]: Entering directory `/sysbench-0.5/sysbench/tests'
Making install in cpu
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/cpu'
make[4]: Entering directory `/sysbench-0.5/sysbench/tests/cpu'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/tests/cpu'
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/cpu'
Making install in fileio
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/fileio'
make[4]: Entering directory `/sysbench-0.5/sysbench/tests/fileio'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/tests/fileio'
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/fileio'
Making install in memory
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/memory'
make[4]: Entering directory `/sysbench-0.5/sysbench/tests/memory'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/tests/memory'
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/memory'
Making install in threads
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/threads'
make[4]: Entering directory `/sysbench-0.5/sysbench/tests/threads'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/tests/threads'
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/threads'
Making install in mutex
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/mutex'
make[4]: Entering directory `/sysbench-0.5/sysbench/tests/mutex'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/tests/mutex'
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/mutex'
Making install in db
make[3]: Entering directory `/sysbench-0.5/sysbench/tests/db'
make[4]: Entering directory `/sysbench-0.5/sysbench/tests/db'
make[4]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/share/sysbench" || /bin/mkdir -p "/usr/local/share/sysbench"
 /usr/bin/install -c -m 644 common.lua delete.lua insert.lua bulk_insert.lua oltp.lua oltp_simple.lua parallel_prepare.lua select_random_points.lua select_random_ranges.lua select.lua update_index.lua update_non_index.lua '/usr/local/share/sysbench'
make[4]: Leaving directory `/sysbench-0.5/sysbench/tests/db'
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests/db'
make[3]: Entering directory `/sysbench-0.5/sysbench/tests'
make[4]: Entering directory `/sysbench-0.5/sysbench/tests'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/tests'
make[3]: Leaving directory `/sysbench-0.5/sysbench/tests'
make[2]: Leaving directory `/sysbench-0.5/sysbench/tests'
Making install in scripting
make[2]: Entering directory `/sysbench-0.5/sysbench/scripting'
Making install in lua
make[3]: Entering directory `/sysbench-0.5/sysbench/scripting/lua'
Making install in src
make[4]: Entering directory `/sysbench-0.5/sysbench/scripting/lua/src'
make[5]: Entering directory `/sysbench-0.5/sysbench/scripting/lua/src'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua/src'
make[4]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua/src'
make[4]: Entering directory `/sysbench-0.5/sysbench/scripting/lua'
make[5]: Entering directory `/sysbench-0.5/sysbench/scripting/lua'
make[5]: Nothing to be done for `install-exec-am'.
make[5]: Nothing to be done for `install-data-am'.
make[5]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua'
make[4]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua'
make[3]: Leaving directory `/sysbench-0.5/sysbench/scripting/lua'
Making install in .
make[3]: Entering directory `/sysbench-0.5/sysbench/scripting'
make[4]: Entering directory `/sysbench-0.5/sysbench/scripting'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/sysbench-0.5/sysbench/scripting'
make[3]: Leaving directory `/sysbench-0.5/sysbench/scripting'
make[2]: Leaving directory `/sysbench-0.5/sysbench/scripting'
Making install in .
make[2]: Entering directory `/sysbench-0.5/sysbench'
make[3]: Entering directory `/sysbench-0.5/sysbench'
test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin"
  /bin/sh ../libtool   --mode=install /usr/bin/install -c sysbench '/usr/local/bin'
libtool: install: /usr/bin/install -c sysbench /usr/local/bin/sysbench
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/sysbench-0.5/sysbench'
make[2]: Leaving directory `/sysbench-0.5/sysbench'
make[1]: Leaving directory `/sysbench-0.5/sysbench'
Making install in tests
make[1]: Entering directory `/sysbench-0.5/tests'
make[2]: Entering directory `/sysbench-0.5/tests'
make[2]: Nothing to be done for `install-exec-am'.
make    INSTALL_TO_DIR="/usr/local/share/sysbench/tests" install_test_files
make[3]: Entering directory `/sysbench-0.5/tests'
make[3]: Leaving directory `/sysbench-0.5/tests'
test -z "/usr/local/share/sysbench/tests" || /bin/mkdir -p "/usr/local/share/sysbench/tests"
 /usr/bin/install -c test_run.sh '/usr/local/share/sysbench/tests'
make[2]: Leaving directory `/sysbench-0.5/tests'
make[1]: Leaving directory `/sysbench-0.5/tests'
make[1]: Entering directory `/sysbench-0.5'
make[2]: Entering directory `/sysbench-0.5'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/sysbench-0.5'
make[1]: Leaving directory `/sysbench-0.5'


[root@shard1 sysbench-0.5]# which sysbench
/usr/local/bin/sysbench

7.设置sysbench到path环境变量

[root@sjjh sysbench-0.5]# echo "export PATH=$PATH:/usr/local/sysbench/bin">>/etc/profile
[root@sjjh sysbench-0.5]# source /etc/profile

8.验证安装是否成功

[root@sjjh ~]# su - oracle
[oracle@sjjh ~]$ sysbench
Missing required command argument.
Usage:
  sysbench --test= [options]... 

Commands: prepare run cleanup help version

General options:
  --num-threads=N             number of threads to use [1]
  --max-requests=N            limit for total number of requests [10000]
  --max-time=N                limit for total execution time in seconds [0]
  --forced-shutdown=STRING    amount of time to wait after --max-time before forcing shutdown [off]
  --thread-stack-size=SIZE    size of stack per thread [64K]
  --tx-rate=N                 target transaction rate (tps) [0]
  --report-interval=N         periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
  --report-checkpoints=[LIST,...]dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []
  --test=STRING               test to run
  --debug=[on|off]            print more debugging info [off]
  --validate=[on|off]         perform validation checks where possible [off]
  --help=[on|off]             print help and exit
  --version=[on|off]          print version and exit [off]
  --rand-init=[on|off]        initialize random number generator [off]
  --rand-type=STRING          random numbers distribution {uniform,gaussian,special,pareto} [special]
  --rand-spec-iter=N          number of iterations used for numbers generation [12]
  --rand-spec-pct=N           percentage of values to be treated as 'special' (for special distribution) [1]
  --rand-spec-res=N           percentage of 'special' values to use (for special distribution) [75]
  --rand-seed=N               seed for random number generator, ignored when 0 [0]
  --rand-pareto-h=N           parameter h for pareto distibution [0.2]
  --config-file=FILENAME      File containing command line options

Log options:
  --verbosity=N      verbosity level {5 - debug, 0 - only critical messages} [3]

  --percentile=N      percentile rank of query response times to count [95]

General database options:

  --db-driver=STRING  specifies database driver to use ('help' to get list of available drivers)
  --db-ps-mode=STRING prepared statements usage mode {auto, disable} [auto]
  --db-debug=[on|off] print database-specific debug information [off]


Compiled-in database drivers:
  oracle - Oracle driver

oracle options:
  --oracle-user=STRING     Oracle user [sbtest]
  --oracle-password=STRING Oracle password []
  --oracle-db=STRING       Oracle database name [sbtest]

Compiled-in tests:
  fileio - File I/O test
  cpu - CPU performance test
  memory - Memory functions speed test
  threads - Threads subsystem performance test
  mutex - Mutex performance test

See 'sysbench --test= help' for a list of options for each test.

9.将.lua文件存储在sysbench-0.5/tests/db

[root@sjjh /]# unzip sysbench_lua-master.zip
Archive:  sysbench_lua-master.zip
f2ceb6cdf7315dbb8dd5f43d9c6757320a80a270
   creating: sysbench_lua-master/
  inflating: sysbench_lua-master/README.md
   creating: sysbench_lua-master/lua/
  inflating: sysbench_lua-master/lua/common.lua
  inflating: sysbench_lua-master/lua/delete.lua
  inflating: sysbench_lua-master/lua/insert.lua
  inflating: sysbench_lua-master/lua/oltp.lua
  inflating: sysbench_lua-master/lua/oltp_simple.lua
  inflating: sysbench_lua-master/lua/parallel_prepare.lua
  inflating: sysbench_lua-master/lua/select.lua
  inflating: sysbench_lua-master/lua/select_ora.lua
  inflating: sysbench_lua-master/lua/select_random_points.lua
  inflating: sysbench_lua-master/lua/select_random_ranges.lua
  inflating: sysbench_lua-master/lua/update_index.lua
  inflating: sysbench_lua-master/lua/update_index_ora.lua
  inflating: sysbench_lua-master/lua/update_index_pg_with_prepare.lua
  inflating: sysbench_lua-master/lua/update_index_with_commit.lua
  inflating: sysbench_lua-master/lua/update_non_index.lua
  inflating: sysbench_lua-master/lua/update_non_index_pg_with_prepare.lua
  inflating: sysbench_lua-master/lua/update_non_index_with_commit.lua

[root@sjjh db]# cd /sysbench_lua-master
[root@sjjh sysbench_lua-master]# ls
lua  README.md
[root@sjjh sysbench_lua-master]# cd lua
[root@sjjh lua]# ls -lrt
total 72
-rw-r--r--. 1 root root  595 Dec 18  2015 update_non_index_with_commit.lua
-rw-r--r--. 1 root root  640 Dec 18  2015 update_non_index_pg_with_prepare.lua
-rw-r--r--. 1 root root  552 Dec 18  2015 update_non_index.lua
-rw-r--r--. 1 root root  386 Dec 18  2015 update_index_with_commit.lua
-rw-r--r--. 1 root root  496 Dec 18  2015 update_index_pg_with_prepare.lua
-rw-r--r--. 1 root root  551 Dec 18  2015 update_index_ora.lua
-rw-r--r--. 1 root root  343 Dec 18  2015 update_index.lua
-rw-r--r--. 1 root root 4066 Dec 18  2015 select_random_ranges.lua
-rw-r--r--. 1 root root 3964 Dec 18  2015 select_random_points.lua
-rw-r--r--. 1 root root  526 Dec 18  2015 select_ora.lua
-rw-r--r--. 1 root root  343 Dec 18  2015 select.lua
-rw-r--r--. 1 root root  425 Dec 18  2015 parallel_prepare.lua
-rw-r--r--. 1 root root  342 Dec 18  2015 oltp_simple.lua
-rw-r--r--. 1 root root 3139 Dec 18  2015 oltp.lua
-rw-r--r--. 1 root root  830 Dec 18  2015 insert.lua
-rw-r--r--. 1 root root  340 Dec 18  2015 delete.lua
-rw-r--r--. 1 root root 4576 Dec 18  2015 common.lua

[root@sjjh lua]# cp *.lua  /sysbench-0.5/tests/db/
[root@sjjh lua]# cd /sysbench-0.5/tests/db/
[root@sjjh db]# ls -lrt
total 72
-rw-r--r--. 1 root root  830 Nov 10 12:18 insert.lua
-rw-r--r--. 1 root root  340 Nov 10 12:18 delete.lua
-rw-r--r--. 1 root root 4576 Nov 10 12:18 common.lua
-rw-r--r--. 1 root root  526 Nov 10 12:18 select_ora.lua
-rw-r--r--. 1 root root  343 Nov 10 12:18 select.lua
-rw-r--r--. 1 root root  425 Nov 10 12:18 parallel_prepare.lua
-rw-r--r--. 1 root root  342 Nov 10 12:18 oltp_simple.lua
-rw-r--r--. 1 root root 3139 Nov 10 12:18 oltp.lua
-rw-r--r--. 1 root root  640 Nov 10 12:18 update_non_index_pg_with_prepare.lua
-rw-r--r--. 1 root root  552 Nov 10 12:18 update_non_index.lua
-rw-r--r--. 1 root root  386 Nov 10 12:18 update_index_with_commit.lua
-rw-r--r--. 1 root root  496 Nov 10 12:18 update_index_pg_with_prepare.lua
-rw-r--r--. 1 root root  551 Nov 10 12:18 update_index_ora.lua
-rw-r--r--. 1 root root  343 Nov 10 12:18 update_index.lua
-rw-r--r--. 1 root root 4066 Nov 10 12:18 select_random_ranges.lua
-rw-r--r--. 1 root root 3964 Nov 10 12:18 select_random_points.lua
-rw-r--r--. 1 root root  595 Nov 10 12:18 update_non_index_with_commit.lua

测试
1.创建测试用户

SQL> create user sysbench identified by sysbench default tablespace users;

User created.

SQL> grant connect,resource,dba to sysbench;

Grant succeeded.

2.准备数据,lua文件需要指定绝对路径 需要进去oracle用户,并且数据库TNS配置在tnsnames.ora中

[oracle@sjjh admin]$ cat tnsnames.ora
sjjh =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.138.130.101)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = sjjh)(UR=A)
    )
  )


[oracle@sjjh admin]$ sysbench --test=/sysbench-0.5/tests/db/oltp.lua --db-driver=oracle --oltp-table-name=sysbench --oltp-table-size=250000 --oltp-tables-count=25 --oracle-db=sjjh --oracle-user=sysbench --oracle-password=sysbench --max-time=600 --max-requests=10000000 --num-threads=32 --report-interval=1 prepare
sysbench 0.5:  multi-threaded system evaluation benchmark

Creating table 'sbtest1'...
Inserting 250000 records into 'sbtest1'
Creating table 'sbtest2'...
Inserting 250000 records into 'sbtest2'
Creating table 'sbtest3'...
Inserting 250000 records into 'sbtest3'
Creating table 'sbtest4'...
Inserting 250000 records into 'sbtest4'
Creating table 'sbtest5'...
Inserting 250000 records into 'sbtest5'
Creating table 'sbtest6'...
Inserting 250000 records into 'sbtest6'
Creating table 'sbtest7'...
Inserting 250000 records into 'sbtest7'
Creating table 'sbtest8'...
Inserting 250000 records into 'sbtest8'
Creating table 'sbtest9'...
Inserting 250000 records into 'sbtest9'
Creating table 'sbtest10'...
Inserting 250000 records into 'sbtest10'
Creating table 'sbtest11'...
Inserting 250000 records into 'sbtest11'
Creating table 'sbtest12'...
Inserting 250000 records into 'sbtest12'
Creating table 'sbtest13'...
Inserting 250000 records into 'sbtest13'
Creating table 'sbtest14'...
Inserting 250000 records into 'sbtest14'
Creating table 'sbtest15'...
Inserting 250000 records into 'sbtest15'
Creating table 'sbtest16'...
Inserting 250000 records into 'sbtest16'
Creating table 'sbtest17'...
Inserting 250000 records into 'sbtest17'
Creating table 'sbtest18'...
Inserting 250000 records into 'sbtest18'
Creating table 'sbtest19'...
Inserting 250000 records into 'sbtest19'
Creating table 'sbtest20'...
Inserting 250000 records into 'sbtest20'
Creating table 'sbtest21'...
Inserting 250000 records into 'sbtest21'
Creating table 'sbtest22'...
Inserting 250000 records into 'sbtest22'
Creating table 'sbtest23'...
Inserting 250000 records into 'sbtest23'
Creating table 'sbtest24'...
Inserting 250000 records into 'sbtest24'
Creating table 'sbtest25'...
Inserting 250000 records into 'sbtest25'
[oracle@sjjh admin]$ sysbench --test=/sysbench-0.5/tests/db/oltp.lua --db-driver=oracle --oltp-table-name=sysbench --oltp-table-size=250000 --oltp-tables-count=25 --oracle-db=sjjh --oracle-user=sysbench --oracle-password=sysbench --max-time=600 --max-requests=10000000 --num-threads=32 --report-interval=1 run
sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 32
Report intermediate results every 1 second(s)
Random number generator seed is 0 and will be ignored


Initializing worker threads...

Threads started!

[   1s] threads: 32, tps: 193.63, reads: 2939.43, writes: 792.50, response time: 381.18ms (95%), errors: 0.00, reconnects:  0.00
[   2s] threads: 32, tps: 254.03, reads: 3611.49, writes: 1015.14, response time: 181.98ms (95%), errors: 0.00, reconnects:  0.00
[   3s] threads: 32, tps: 267.99, reads: 3887.91, writes: 1105.97, response time: 156.17ms (95%), errors: 0.00, reconnects:  0.00
[   4s] threads: 32, tps: 295.00, reads: 3854.02, writes: 1129.00, response time: 150.21ms (95%), errors: 0.00, reconnects:  0.00
[   5s] threads: 32, tps: 270.00, reads: 3867.02, writes: 1105.00, response time: 153.39ms (95%), errors: 0.00, reconnects:  0.00
[   6s] threads: 32, tps: 271.00, reads: 3825.97, writes: 1099.99, response time: 153.76ms (95%), errors: 0.00, reconnects:  0.00
[   7s] threads: 32, tps: 267.01, reads: 3880.10, writes: 1091.03, response time: 174.88ms (95%), errors: 0.00, reconnects:  0.00
[   8s] threads: 32, tps: 289.99, reads: 4054.90, writes: 1143.97, response time: 141.61ms (95%), errors: 0.00, reconnects:  0.00
[   9s] threads: 32, tps: 279.00, reads: 3897.03, writes: 1127.01, response time: 190.62ms (95%), errors: 0.00, reconnects:  0.00
[  10s] threads: 32, tps: 268.00, reads: 3746.98, writes: 1074.99, response time: 201.17ms (95%), errors: 0.00, reconnects:  0.00
[  11s] threads: 32, tps: 297.99, reads: 3987.83, writes: 1136.95, response time: 147.84ms (95%), errors: 0.00, reconnects:  0.00
[  12s] threads: 32, tps: 297.01, reads: 4255.20, writes: 1208.06, response time: 142.07ms (95%), errors: 0.00, reconnects:  0.00
[  13s] threads: 32, tps: 304.96, reads: 4248.48, writes: 1225.85, response time: 145.12ms (95%), errors: 0.00, reconnects:  0.00
[  14s] threads: 32, tps: 296.04, reads: 4177.59, writes: 1185.17, response time: 144.60ms (95%), errors: 0.00, reconnects:  0.00
[  15s] threads: 32, tps: 302.99, reads: 4357.84, writes: 1256.95, response time: 148.51ms (95%), errors: 0.00, reconnects:  0.00
[  16s] threads: 32, tps: 298.01, reads: 4097.07, writes: 1166.02, response time: 194.31ms (95%), errors: 0.00, reconnects:  0.00
[  17s] threads: 32, tps: 311.00, reads: 4312.98, writes: 1202.99, response time: 132.82ms (95%), errors: 0.00, reconnects:  0.00
[  18s] threads: 32, tps: 274.00, reads: 3973.01, writes: 1202.00, response time: 151.43ms (95%), errors: 0.00, reconnects:  0.00
[  19s] threads: 32, tps: 300.00, reads: 4070.02, writes: 1101.01, response time: 179.71ms (95%), errors: 0.00, reconnects:  0.00
[  20s] threads: 32, tps: 306.00, reads: 4347.07, writes: 1270.02, response time: 144.78ms (95%), errors: 0.00, reconnects:  0.00
[  21s] threads: 32, tps: 285.00, reads: 3910.99, writes: 1075.00, response time: 177.94ms (95%), errors: 0.00, reconnects:  0.00
[  22s] threads: 32, tps: 302.99, reads: 4350.84, writes: 1249.96, response time: 151.79ms (95%), errors: 0.00, reconnects:  0.00
[  23s] threads: 32, tps: 313.01, reads: 4256.07, writes: 1261.02, response time: 141.78ms (95%), errors: 0.00, reconnects:  0.00
[  24s] threads: 32, tps: 300.01, reads: 4042.08, writes: 1155.02, response time: 160.58ms (95%), errors: 0.00, reconnects:  0.00
[  25s] threads: 32, tps: 318.00, reads: 4708.94, writes: 1304.98, response time: 123.46ms (95%), errors: 0.00, reconnects:  0.00
[  26s] threads: 32, tps: 318.99, reads: 4360.92, writes: 1260.98, response time: 142.24ms (95%), errors: 0.00, reconnects:  0.00
[  27s] threads: 32, tps: 316.01, reads: 4531.16, writes: 1281.05, response time: 128.56ms (95%), errors: 0.00, reconnects:  0.00
[  28s] threads: 32, tps: 307.00, reads: 4296.94, writes: 1279.98, response time: 163.10ms (95%), errors: 0.00, reconnects:  0.00
[  29s] threads: 32, tps: 293.00, reads: 4101.96, writes: 1156.99, response time: 196.06ms (95%), errors: 0.00, reconnects:  0.00
[  30s] threads: 32, tps: 309.00, reads: 4371.06, writes: 1274.02, response time: 132.46ms (95%), errors: 0.00, reconnects:  0.00
[  31s] threads: 32, tps: 289.00, reads: 3932.93, writes: 1111.98, response time: 206.17ms (95%), errors: 0.00, reconnects:  0.00
[  32s] threads: 32, tps: 334.00, reads: 4695.96, writes: 1307.99, response time: 130.22ms (95%), errors: 0.00, reconnects:  0.00
[  33s] threads: 32, tps: 280.01, reads: 3995.12, writes: 1176.03, response time: 206.73ms (95%), errors: 0.00, reconnects:  0.00
[  34s] threads: 32, tps: 334.00, reads: 4484.98, writes: 1291.99, response time: 142.07ms (95%), errors: 0.00, reconnects:  0.00
[  35s] threads: 32, tps: 319.00, reads: 4671.97, writes: 1322.99, response time: 122.95ms (95%), errors: 0.00, reconnects:  0.00
[  36s] threads: 32, tps: 308.00, reads: 4333.04, writes: 1261.01, response time: 126.72ms (95%), errors: 0.00, reconnects:  0.00
[  37s] threads: 32, tps: 332.97, reads: 4528.63, writes: 1255.90, response time: 156.03ms (95%), errors: 0.00, reconnects:  0.00
[  38s] threads: 32, tps: 336.02, reads: 4702.32, writes: 1304.09, response time: 128.59ms (95%), errors: 0.00, reconnects:  0.00
[  39s] threads: 32, tps: 323.00, reads: 4603.01, writes: 1349.00, response time: 129.99ms (95%), errors: 0.00, reconnects:  0.00
[  40s] threads: 32, tps: 341.91, reads: 4618.82, writes: 1338.66, response time: 130.96ms (95%), errors: 0.00, reconnects:  0.00
[  41s] threads: 32, tps: 305.07, reads: 4395.94, writes: 1218.26, response time: 171.76ms (95%), errors: 0.00, reconnects:  0.00
[  42s] threads: 32, tps: 321.01, reads: 4574.20, writes: 1343.06, response time: 123.02ms (95%), errors: 0.00, reconnects:  0.00
[  43s] threads: 32, tps: 319.01, reads: 4298.11, writes: 1215.03, response time: 141.82ms (95%), errors: 0.00, reconnects:  0.00
[  44s] threads: 32, tps: 314.99, reads: 4544.90, writes: 1282.97, response time: 144.39ms (95%), errors: 0.00, reconnects:  0.00
[  45s] threads: 32, tps: 287.00, reads: 4068.02, writes: 1217.01, response time: 191.77ms (95%), errors: 0.00, reconnects:  0.00
[  46s] threads: 32, tps: 340.98, reads: 4629.77, writes: 1246.94, response time: 135.96ms (95%), errors: 0.00, reconnects:  0.00
[  47s] threads: 32, tps: 325.01, reads: 4626.17, writes: 1306.05, response time: 123.76ms (95%), errors: 0.00, reconnects:  0.00
[  48s] threads: 32, tps: 341.00, reads: 4773.01, writes: 1428.00, response time: 123.24ms (95%), errors: 0.00, reconnects:  0.00
[  49s] threads: 32, tps: 343.00, reads: 4723.06, writes: 1314.02, response time: 120.61ms (95%), errors: 0.00, reconnects:  0.00
[  50s] threads: 32, tps: 328.00, reads: 4604.96, writes: 1352.99, response time: 137.88ms (95%), errors: 0.00, reconnects:  0.00
[  51s] threads: 32, tps: 330.99, reads: 4719.90, writes: 1344.97, response time: 135.92ms (95%), errors: 0.00, reconnects:  0.00
[  52s] threads: 32, tps: 360.00, reads: 4867.04, writes: 1399.01, response time: 123.61ms (95%), errors: 0.00, reconnects:  0.00
[  53s] threads: 32, tps: 298.01, reads: 4214.08, writes: 1208.02, response time: 168.76ms (95%), errors: 0.00, reconnects:  0.00
[  54s] threads: 32, tps: 343.89, reads: 4698.55, writes: 1331.59, response time: 130.07ms (95%), errors: 0.00, reconnects:  0.00
[  55s] threads: 32, tps: 275.08, reads: 4147.25, writes: 1211.37, response time: 185.11ms (95%), errors: 0.00, reconnects:  0.00
[  56s] threads: 32, tps: 309.01, reads: 4289.08, writes: 1182.02, response time: 153.57ms (95%), errors: 0.00, reconnects:  0.00
[  57s] threads: 32, tps: 322.99, reads: 4494.91, writes: 1264.98, response time: 179.28ms (95%), errors: 0.00, reconnects:  0.00
[  58s] threads: 32, tps: 300.00, reads: 4186.94, writes: 1222.98, response time: 154.91ms (95%), errors: 0.00, reconnects:  0.00
[  59s] threads: 32, tps: 335.00, reads: 4638.05, writes: 1286.01, response time: 151.15ms (95%), errors: 0.00, reconnects:  0.00
[  60s] threads: 32, tps: 310.01, reads: 4353.11, writes: 1263.03, response time: 184.89ms (95%), errors: 0.00, reconnects:  0.00
[  61s] threads: 32, tps: 318.99, reads: 4528.81, writes: 1278.95, response time: 168.71ms (95%), errors: 0.00, reconnects:  0.00
[  62s] threads: 32, tps: 337.00, reads: 4681.06, writes: 1338.02, response time: 147.62ms (95%), errors: 0.00, reconnects:  0.00
[  63s] threads: 32, tps: 345.00, reads: 4830.05, writes: 1361.02, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[  64s] threads: 32, tps: 332.00, reads: 4660.98, writes: 1386.99, response time: 123.87ms (95%), errors: 0.00, reconnects:  0.00
[  65s] threads: 32, tps: 317.00, reads: 4494.98, writes: 1300.99, response time: 173.26ms (95%), errors: 0.00, reconnects:  0.00
[  66s] threads: 32, tps: 341.00, reads: 4772.93, writes: 1339.98, response time: 128.52ms (95%), errors: 0.00, reconnects:  0.00
[  67s] threads: 32, tps: 300.01, reads: 4011.18, writes: 1163.05, response time: 140.13ms (95%), errors: 0.00, reconnects:  0.00
[  68s] threads: 32, tps: 309.00, reads: 4331.98, writes: 1222.99, response time: 238.46ms (95%), errors: 0.00, reconnects:  0.00
[  69s] threads: 32, tps: 322.99, reads: 4679.90, writes: 1329.97, response time: 169.26ms (95%), errors: 0.00, reconnects:  0.00
[  70s] threads: 32, tps: 353.93, reads: 4895.04, writes: 1354.73, response time: 118.89ms (95%), errors: 0.00, reconnects:  0.00
[  71s] threads: 32, tps: 339.07, reads: 4717.98, writes: 1373.28, response time: 131.87ms (95%), errors: 0.00, reconnects:  0.00
[  72s] threads: 32, tps: 322.00, reads: 4472.01, writes: 1309.00, response time: 149.71ms (95%), errors: 0.00, reconnects:  0.00
[  73s] threads: 32, tps: 308.00, reads: 4313.95, writes: 1234.99, response time: 146.92ms (95%), errors: 0.00, reconnects:  0.00
[  74s] threads: 32, tps: 335.00, reads: 4647.02, writes: 1307.01, response time: 133.78ms (95%), errors: 0.00, reconnects:  0.00
[  75s] threads: 32, tps: 356.00, reads: 4998.99, writes: 1427.00, response time: 121.78ms (95%), errors: 0.00, reconnects:  0.00
[  76s] threads: 32, tps: 347.00, reads: 4898.01, writes: 1390.00, response time: 124.47ms (95%), errors: 0.00, reconnects:  0.00
[  77s] threads: 32, tps: 353.00, reads: 4987.02, writes: 1425.01, response time: 121.78ms (95%), errors: 0.00, reconnects:  0.00
[  78s] threads: 32, tps: 320.00, reads: 4449.97, writes: 1303.99, response time: 208.91ms (95%), errors: 0.00, reconnects:  0.00
[  79s] threads: 32, tps: 348.00, reads: 4819.00, writes: 1363.00, response time: 122.21ms (95%), errors: 0.00, reconnects:  0.00
[  80s] threads: 32, tps: 297.00, reads: 4221.07, writes: 1220.02, response time: 166.90ms (95%), errors: 0.00, reconnects:  0.00
[  81s] threads: 32, tps: 328.99, reads: 4644.85, writes: 1303.96, response time: 137.80ms (95%), errors: 0.00, reconnects:  0.00
[  82s] threads: 32, tps: 327.97, reads: 4574.64, writes: 1316.90, response time: 148.86ms (95%), errors: 0.00, reconnects:  0.00
[  83s] threads: 32, tps: 344.04, reads: 4840.55, writes: 1351.15, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[  84s] threads: 32, tps: 351.98, reads: 4789.74, writes: 1399.92, response time: 124.80ms (95%), errors: 0.00, reconnects:  0.00
[  85s] threads: 32, tps: 296.01, reads: 4302.14, writes: 1249.04, response time: 166.55ms (95%), errors: 0.00, reconnects:  0.00
[  86s] threads: 32, tps: 332.99, reads: 4558.89, writes: 1279.97, response time: 146.13ms (95%), errors: 0.00, reconnects:  0.00
[  87s] threads: 32, tps: 323.01, reads: 4473.21, writes: 1291.06, response time: 154.86ms (95%), errors: 0.00, reconnects:  0.00
[  88s] threads: 32, tps: 345.00, reads: 4957.94, writes: 1396.98, response time: 129.79ms (95%), errors: 0.00, reconnects:  0.00
[  89s] threads: 32, tps: 327.00, reads: 4489.93, writes: 1285.98, response time: 136.00ms (95%), errors: 0.00, reconnects:  0.00
[  90s] threads: 32, tps: 362.01, reads: 5145.08, writes: 1453.02, response time: 115.08ms (95%), errors: 0.00, reconnects:  0.00
[  91s] threads: 32, tps: 350.00, reads: 4819.95, writes: 1391.99, response time: 142.80ms (95%), errors: 0.00, reconnects:  0.00
[  92s] threads: 32, tps: 310.00, reads: 4515.03, writes: 1325.01, response time: 157.81ms (95%), errors: 0.00, reconnects:  0.00
[  93s] threads: 32, tps: 312.00, reads: 4374.02, writes: 1267.01, response time: 133.26ms (95%), errors: 0.00, reconnects:  0.00
[  94s] threads: 32, tps: 340.00, reads: 4684.99, writes: 1254.00, response time: 222.26ms (95%), errors: 0.00, reconnects:  0.00
[  95s] threads: 32, tps: 349.00, reads: 4889.06, writes: 1410.02, response time: 121.85ms (95%), errors: 0.00, reconnects:  0.00
[  96s] threads: 32, tps: 343.99, reads: 4776.86, writes: 1383.96, response time: 135.47ms (95%), errors: 0.00, reconnects:  0.00
[  97s] threads: 32, tps: 341.01, reads: 4677.12, writes: 1340.04, response time: 136.28ms (95%), errors: 0.00, reconnects:  0.00
[  98s] threads: 32, tps: 313.00, reads: 4432.93, writes: 1280.98, response time: 172.80ms (95%), errors: 0.00, reconnects:  0.00
[  99s] threads: 32, tps: 358.00, reads: 4953.01, writes: 1383.00, response time: 121.81ms (95%), errors: 0.00, reconnects:  0.00
[ 100s] threads: 32, tps: 337.99, reads: 4868.87, writes: 1410.96, response time: 118.18ms (95%), errors: 0.00, reconnects:  0.00
[ 101s] threads: 32, tps: 339.01, reads: 4697.16, writes: 1301.04, response time: 132.66ms (95%), errors: 0.00, reconnects:  0.00
[ 102s] threads: 32, tps: 337.00, reads: 4741.97, writes: 1385.99, response time: 136.73ms (95%), errors: 0.00, reconnects:  0.00
[ 103s] threads: 32, tps: 316.00, reads: 4489.00, writes: 1296.00, response time: 178.95ms (95%), errors: 0.00, reconnects:  0.00
[ 104s] threads: 32, tps: 368.00, reads: 5075.99, writes: 1405.00, response time: 115.46ms (95%), errors: 0.00, reconnects:  0.00
[ 105s] threads: 32, tps: 356.00, reads: 4953.01, writes: 1445.00, response time: 121.81ms (95%), errors: 0.00, reconnects:  0.00
[ 106s] threads: 32, tps: 318.99, reads: 4472.89, writes: 1276.97, response time: 169.36ms (95%), errors: 0.00, reconnects:  0.00
[ 107s] threads: 32, tps: 351.84, reads: 4843.87, writes: 1412.38, response time: 140.00ms (95%), errors: 0.00, reconnects:  0.00
[ 108s] threads: 32, tps: 351.16, reads: 4884.20, writes: 1406.63, response time: 129.83ms (95%), errors: 0.00, reconnects:  0.00
[ 109s] threads: 32, tps: 355.00, reads: 5105.00, writes: 1428.00, response time: 119.86ms (95%), errors: 0.00, reconnects:  0.00
[ 110s] threads: 32, tps: 359.01, reads: 4830.14, writes: 1392.04, response time: 121.09ms (95%), errors: 0.00, reconnects:  0.00
[ 111s] threads: 32, tps: 353.00, reads: 5070.01, writes: 1424.00, response time: 118.72ms (95%), errors: 0.00, reconnects:  0.00
[ 112s] threads: 32, tps: 349.99, reads: 4980.91, writes: 1447.97, response time: 127.10ms (95%), errors: 0.00, reconnects:  0.00
[ 113s] threads: 32, tps: 318.01, reads: 4486.08, writes: 1242.02, response time: 175.66ms (95%), errors: 0.00, reconnects:  0.00
[ 114s] threads: 32, tps: 344.99, reads: 4861.91, writes: 1445.97, response time: 127.10ms (95%), errors: 0.00, reconnects:  0.00
[ 115s] threads: 32, tps: 320.00, reads: 4415.97, writes: 1188.99, response time: 160.05ms (95%), errors: 0.00, reconnects:  0.00
[ 116s] threads: 32, tps: 314.00, reads: 4468.96, writes: 1344.99, response time: 132.82ms (95%), errors: 0.00, reconnects:  0.00
[ 117s] threads: 32, tps: 369.01, reads: 5009.17, writes: 1426.05, response time: 143.18ms (95%), errors: 0.00, reconnects:  0.00
[ 118s] threads: 32, tps: 343.99, reads: 5002.89, writes: 1459.97, response time: 115.73ms (95%), errors: 0.00, reconnects:  0.00
[ 119s] threads: 32, tps: 343.00, reads: 4781.00, writes: 1327.00, response time: 173.21ms (95%), errors: 0.00, reconnects:  0.00
[ 120s] threads: 32, tps: 370.01, reads: 5124.11, writes: 1466.03, response time: 114.87ms (95%), errors: 0.00, reconnects:  0.00
[ 121s] threads: 32, tps: 319.99, reads: 4556.89, writes: 1333.97, response time: 141.48ms (95%), errors: 0.00, reconnects:  0.00
[ 122s] threads: 32, tps: 377.00, reads: 5042.00, writes: 1399.00, response time: 131.95ms (95%), errors: 0.00, reconnects:  0.00
[ 123s] threads: 32, tps: 304.01, reads: 4402.10, writes: 1228.03, response time: 203.54ms (95%), errors: 0.00, reconnects:  0.00
[ 124s] threads: 32, tps: 348.00, reads: 4917.02, writes: 1417.01, response time: 142.12ms (95%), errors: 0.00, reconnects:  0.00
[ 125s] threads: 32, tps: 374.00, reads: 5098.99, writes: 1463.00, response time: 116.78ms (95%), errors: 0.00, reconnects:  0.00
[ 126s] threads: 32, tps: 354.00, reads: 4958.01, writes: 1401.00, response time: 126.49ms (95%), errors: 0.00, reconnects:  0.00
[ 127s] threads: 32, tps: 361.99, reads: 5137.87, writes: 1496.96, response time: 120.36ms (95%), errors: 0.00, reconnects:  0.00
[ 128s] threads: 32, tps: 314.01, reads: 4457.09, writes: 1272.03, response time: 173.00ms (95%), errors: 0.00, reconnects:  0.00
[ 129s] threads: 32, tps: 326.00, reads: 4567.00, writes: 1303.00, response time: 165.95ms (95%), errors: 0.00, reconnects:  0.00
[ 130s] threads: 32, tps: 338.99, reads: 4750.89, writes: 1372.97, response time: 128.29ms (95%), errors: 0.00, reconnects:  0.00
[ 131s] threads: 32, tps: 365.96, reads: 5082.44, writes: 1440.84, response time: 138.59ms (95%), errors: 0.00, reconnects:  0.00
[ 132s] threads: 32, tps: 368.05, reads: 5083.68, writes: 1413.19, response time: 111.78ms (95%), errors: 0.00, reconnects:  0.00
[ 133s] threads: 32, tps: 368.95, reads: 5047.36, writes: 1473.81, response time: 119.97ms (95%), errors: 0.00, reconnects:  0.00
[ 134s] threads: 32, tps: 327.03, reads: 4749.51, writes: 1358.14, response time: 128.98ms (95%), errors: 0.00, reconnects:  0.00
[ 135s] threads: 32, tps: 348.01, reads: 4954.08, writes: 1429.02, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[ 136s] threads: 32, tps: 345.99, reads: 4696.93, writes: 1300.98, response time: 135.96ms (95%), errors: 0.00, reconnects:  0.00
[ 137s] threads: 32, tps: 346.00, reads: 4934.04, writes: 1438.01, response time: 133.86ms (95%), errors: 0.00, reconnects:  0.00
[ 138s] threads: 32, tps: 374.00, reads: 5179.06, writes: 1496.02, response time: 117.20ms (95%), errors: 0.00, reconnects:  0.00
[ 139s] threads: 32, tps: 350.99, reads: 4988.88, writes: 1385.97, response time: 118.72ms (95%), errors: 0.00, reconnects:  0.00
[ 140s] threads: 32, tps: 388.01, reads: 5286.12, writes: 1530.04, response time: 113.50ms (95%), errors: 0.00, reconnects:  0.00
[ 141s] threads: 32, tps: 347.99, reads: 5062.88, writes: 1492.97, response time: 119.11ms (95%), errors: 0.00, reconnects:  0.00
[ 142s] threads: 32, tps: 340.01, reads: 4637.12, writes: 1241.03, response time: 140.21ms (95%), errors: 0.00, reconnects:  0.00
[ 143s] threads: 32, tps: 320.99, reads: 4474.89, writes: 1288.97, response time: 154.73ms (95%), errors: 0.00, reconnects:  0.00
[ 144s] threads: 32, tps: 367.01, reads: 5105.10, writes: 1463.03, response time: 112.12ms (95%), errors: 0.00, reconnects:  0.00
[ 145s] threads: 32, tps: 360.99, reads: 4917.91, writes: 1443.97, response time: 120.40ms (95%), errors: 0.00, reconnects:  0.00
[ 146s] threads: 32, tps: 243.00, reads: 3641.00, writes: 1075.00, response time: 193.67ms (95%), errors: 0.00, reconnects:  0.00
[ 147s] threads: 32, tps: 317.00, reads: 4520.02, writes: 1293.01, response time: 126.72ms (95%), errors: 0.00, reconnects:  0.00
[ 148s] threads: 32, tps: 292.00, reads: 3823.97, writes: 1050.99, response time: 191.19ms (95%), errors: 0.00, reconnects:  0.00
[ 149s] threads: 32, tps: 221.01, reads: 3349.09, writes: 973.03, response time: 226.36ms (95%), errors: 0.00, reconnects:  0.00
[ 150s] threads: 32, tps: 360.99, reads: 4948.92, writes: 1355.98, response time: 116.53ms (95%), errors: 0.00, reconnects:  0.00
[ 151s] threads: 32, tps: 354.79, reads: 4965.10, writes: 1426.17, response time: 120.69ms (95%), errors: 0.00, reconnects:  0.00
[ 152s] threads: 32, tps: 292.17, reads: 4084.35, writes: 1164.67, response time: 194.25ms (95%), errors: 0.00, reconnects:  0.00
[ 153s] threads: 32, tps: 368.01, reads: 5193.12, writes: 1466.03, response time: 109.01ms (95%), errors: 0.00, reconnects:  0.00
[ 154s] threads: 32, tps: 360.00, reads: 5010.93, writes: 1445.98, response time: 118.47ms (95%), errors: 0.00, reconnects:  0.00
[ 155s] threads: 32, tps: 327.00, reads: 4531.95, writes: 1299.98, response time: 175.77ms (95%), errors: 0.00, reconnects:  0.00
[ 156s] threads: 32, tps: 348.99, reads: 4992.89, writes: 1422.97, response time: 125.74ms (95%), errors: 0.00, reconnects:  0.00
[ 157s] threads: 32, tps: 347.02, reads: 4815.23, writes: 1399.07, response time: 135.06ms (95%), errors: 0.00, reconnects:  0.00
[ 158s] threads: 32, tps: 389.00, reads: 5460.00, writes: 1531.00, response time: 107.32ms (95%), errors: 0.00, reconnects:  0.00
[ 159s] threads: 32, tps: 314.00, reads: 4373.00, writes: 1316.00, response time: 146.26ms (95%), errors: 0.00, reconnects:  0.00
[ 160s] threads: 32, tps: 380.99, reads: 5295.90, writes: 1465.97, response time: 112.83ms (95%), errors: 0.00, reconnects:  0.00
[ 161s] threads: 32, tps: 344.01, reads: 4851.08, writes: 1361.02, response time: 128.09ms (95%), errors: 0.00, reconnects:  0.00
[ 162s] threads: 32, tps: 347.00, reads: 4899.94, writes: 1484.98, response time: 129.41ms (95%), errors: 0.00, reconnects:  0.00
[ 163s] threads: 32, tps: 361.00, reads: 5078.00, writes: 1436.00, response time: 126.95ms (95%), errors: 0.00, reconnects:  0.00
[ 164s] threads: 32, tps: 302.00, reads: 4192.04, writes: 1170.01, response time: 179.81ms (95%), errors: 0.00, reconnects:  0.00
[ 165s] threads: 32, tps: 324.00, reads: 4407.02, writes: 1259.01, response time: 185.72ms (95%), errors: 0.00, reconnects:  0.00
[ 166s] threads: 32, tps: 334.00, reads: 4688.01, writes: 1315.00, response time: 147.62ms (95%), errors: 0.00, reconnects:  0.00
[ 167s] threads: 32, tps: 364.00, reads: 5177.99, writes: 1504.00, response time: 118.43ms (95%), errors: 0.00, reconnects:  0.00
[ 168s] threads: 32, tps: 331.00, reads: 4674.01, writes: 1298.00, response time: 140.05ms (95%), errors: 0.00, reconnects:  0.00
[ 169s] threads: 32, tps: 354.96, reads: 4924.44, writes: 1454.83, response time: 136.24ms (95%), errors: 0.00, reconnects:  0.00
[ 170s] threads: 32, tps: 358.03, reads: 5118.49, writes: 1483.14, response time: 118.15ms (95%), errors: 0.00, reconnects:  0.00
[ 171s] threads: 32, tps: 352.00, reads: 4882.95, writes: 1352.99, response time: 132.50ms (95%), errors: 0.00, reconnects:  0.00
[ 172s] threads: 32, tps: 377.01, reads: 5209.15, writes: 1507.04, response time: 107.71ms (95%), errors: 0.00, reconnects:  0.00
[ 173s] threads: 32, tps: 372.98, reads: 5084.79, writes: 1459.94, response time: 117.58ms (95%), errors: 0.00, reconnects:  0.00
[ 174s] threads: 32, tps: 315.01, reads: 4669.11, writes: 1368.03, response time: 136.16ms (95%), errors: 0.00, reconnects:  0.00
[ 175s] threads: 32, tps: 355.00, reads: 4941.03, writes: 1405.01, response time: 147.67ms (95%), errors: 0.00, reconnects:  0.00
[ 176s] threads: 32, tps: 361.00, reads: 5064.04, writes: 1398.01, response time: 118.93ms (95%), errors: 0.00, reconnects:  0.00
[ 177s] threads: 32, tps: 370.00, reads: 5096.01, writes: 1417.00, response time: 120.15ms (95%), errors: 0.00, reconnects:  0.00
[ 178s] threads: 32, tps: 379.00, reads: 5254.02, writes: 1551.01, response time: 111.68ms (95%), errors: 0.00, reconnects:  0.00
[ 179s] threads: 32, tps: 333.99, reads: 4752.86, writes: 1383.96, response time: 150.39ms (95%), errors: 0.00, reconnects:  0.00
[ 180s] threads: 32, tps: 378.00, reads: 5328.00, writes: 1505.00, response time: 107.55ms (95%), errors: 0.00, reconnects:  0.00
[ 181s] threads: 32, tps: 395.01, reads: 5419.13, writes: 1515.04, response time: 106.97ms (95%), errors: 0.00, reconnects:  0.00
[ 182s] threads: 32, tps: 359.95, reads: 5037.36, writes: 1476.81, response time: 126.49ms (95%), errors: 0.00, reconnects:  0.00
[ 183s] threads: 32, tps: 335.03, reads: 4836.50, writes: 1386.14, response time: 127.22ms (95%), errors: 0.00, reconnects:  0.00
[ 184s] threads: 32, tps: 362.01, reads: 4945.12, writes: 1400.03, response time: 129.99ms (95%), errors: 0.00, reconnects:  0.00
[ 185s] threads: 32, tps: 325.99, reads: 4654.88, writes: 1294.97, response time: 133.62ms (95%), errors: 0.00, reconnects:  0.00
[ 186s] threads: 32, tps: 352.00, reads: 4969.03, writes: 1495.01, response time: 120.40ms (95%), errors: 0.00, reconnects:  0.00
[ 187s] threads: 32, tps: 330.00, reads: 4480.00, writes: 1221.00, response time: 180.03ms (95%), errors: 0.00, reconnects:  0.00
[ 188s] threads: 32, tps: 333.99, reads: 4487.83, writes: 1322.95, response time: 170.13ms (95%), errors: 0.00, reconnects:  0.00
[ 189s] threads: 32, tps: 357.02, reads: 5295.31, writes: 1488.09, response time: 119.11ms (95%), errors: 0.00, reconnects:  0.00
[ 190s] threads: 32, tps: 365.98, reads: 5046.71, writes: 1458.92, response time: 141.06ms (95%), errors: 0.00, reconnects:  0.00
[ 191s] threads: 32, tps: 340.01, reads: 4868.21, writes: 1417.06, response time: 113.67ms (95%), errors: 0.00, reconnects:  0.00
[ 192s] threads: 32, tps: 393.00, reads: 5283.04, writes: 1496.01, response time: 175.30ms (95%), errors: 0.00, reconnects:  0.00
[ 193s] threads: 32, tps: 353.00, reads: 5133.03, writes: 1436.01, response time: 125.03ms (95%), errors: 0.00, reconnects:  0.00
[ 194s] threads: 32, tps: 378.90, reads: 5276.55, writes: 1512.58, response time: 122.65ms (95%), errors: 0.00, reconnects:  0.00
[ 195s] threads: 32, tps: 376.10, reads: 5191.42, writes: 1458.40, response time: 115.56ms (95%), errors: 0.00, reconnects:  0.00
[ 196s] threads: 32, tps: 357.99, reads: 5046.86, writes: 1432.96, response time: 112.32ms (95%), errors: 0.00, reconnects:  0.00
[ 197s] threads: 32, tps: 344.01, reads: 4882.15, writes: 1407.04, response time: 127.86ms (95%), errors: 0.00, reconnects:  0.00
[ 198s] threads: 32, tps: 351.99, reads: 4934.84, writes: 1445.95, response time: 130.26ms (95%), errors: 0.00, reconnects:  0.00
[ 199s] threads: 32, tps: 342.01, reads: 4670.11, writes: 1294.03, response time: 163.24ms (95%), errors: 0.00, reconnects:  0.00
[ 200s] threads: 32, tps: 328.00, reads: 4497.00, writes: 1293.00, response time: 183.07ms (95%), errors: 0.00, reconnects:  0.00
[ 201s] threads: 32, tps: 330.99, reads: 4760.92, writes: 1396.98, response time: 166.80ms (95%), errors: 0.00, reconnects:  0.00
[ 202s] threads: 32, tps: 340.00, reads: 4760.00, writes: 1355.00, response time: 134.90ms (95%), errors: 0.00, reconnects:  0.00
[ 203s] threads: 32, tps: 352.00, reads: 4974.02, writes: 1390.01, response time: 134.34ms (95%), errors: 0.00, reconnects:  0.00
[ 204s] threads: 32, tps: 325.00, reads: 4576.07, writes: 1286.02, response time: 163.93ms (95%), errors: 0.00, reconnects:  0.00
[ 205s] threads: 32, tps: 355.00, reads: 4897.01, writes: 1388.00, response time: 119.93ms (95%), errors: 0.00, reconnects:  0.00
[ 206s] threads: 32, tps: 327.00, reads: 4633.00, writes: 1333.00, response time: 137.10ms (95%), errors: 0.00, reconnects:  0.00
[ 207s] threads: 32, tps: 387.00, reads: 5284.02, writes: 1533.01, response time: 113.78ms (95%), errors: 0.00, reconnects:  0.00
[ 208s] threads: 32, tps: 380.00, reads: 5446.96, writes: 1531.99, response time: 111.12ms (95%), errors: 0.00, reconnects:  0.00
[ 209s] threads: 32, tps: 379.99, reads: 5080.91, writes: 1494.97, response time: 115.01ms (95%), errors: 0.00, reconnects:  0.00
[ 210s] threads: 32, tps: 330.00, reads: 4919.03, writes: 1430.01, response time: 140.47ms (95%), errors: 0.00, reconnects:  0.00
[ 211s] threads: 32, tps: 366.00, reads: 4933.98, writes: 1412.99, response time: 119.14ms (95%), errors: 0.00, reconnects:  0.00
[ 212s] threads: 32, tps: 366.01, reads: 5259.11, writes: 1483.03, response time: 137.84ms (95%), errors: 0.00, reconnects:  0.00
[ 213s] threads: 32, tps: 397.99, reads: 5443.87, writes: 1521.96, response time: 107.84ms (95%), errors: 0.00, reconnects:  0.00
[ 214s] threads: 32, tps: 320.00, reads: 4568.04, writes: 1328.01, response time: 199.50ms (95%), errors: 0.00, reconnects:  0.00
[ 215s] threads: 32, tps: 380.00, reads: 5314.05, writes: 1488.01, response time: 115.77ms (95%), errors: 0.00, reconnects:  0.00
[ 216s] threads: 32, tps: 349.00, reads: 4963.03, writes: 1430.01, response time: 126.00ms (95%), errors: 0.00, reconnects:  0.00
[ 217s] threads: 32, tps: 321.99, reads: 4422.89, writes: 1248.97, response time: 185.94ms (95%), errors: 0.00, reconnects:  0.00
[ 218s] threads: 32, tps: 359.00, reads: 5013.03, writes: 1445.01, response time: 162.95ms (95%), errors: 0.00, reconnects:  0.00
[ 219s] threads: 32, tps: 366.00, reads: 5039.96, writes: 1438.99, response time: 115.28ms (95%), errors: 0.00, reconnects:  0.00
[ 220s] threads: 32, tps: 378.01, reads: 5367.14, writes: 1572.04, response time: 107.20ms (95%), errors: 0.00, reconnects:  0.00
[ 221s] threads: 32, tps: 380.99, reads: 5382.83, writes: 1468.95, response time: 109.50ms (95%), errors: 0.00, reconnects:  0.00
[ 222s] threads: 32, tps: 394.01, reads: 5502.16, writes: 1599.05, response time: 106.52ms (95%), errors: 0.00, reconnects:  0.00
[ 223s] threads: 32, tps: 364.99, reads: 5081.88, writes: 1447.97, response time: 127.98ms (95%), errors: 0.00, reconnects:  0.00
[ 224s] threads: 32, tps: 367.01, reads: 5104.12, writes: 1463.04, response time: 123.95ms (95%), errors: 0.00, reconnects:  0.00
[ 225s] threads: 32, tps: 336.00, reads: 4804.99, writes: 1366.00, response time: 154.73ms (95%), errors: 0.00, reconnects:  0.00
[ 226s] threads: 32, tps: 342.99, reads: 4787.86, writes: 1354.96, response time: 176.24ms (95%), errors: 0.00, reconnects:  0.00
[ 227s] threads: 32, tps: 356.00, reads: 5052.06, writes: 1518.02, response time: 113.67ms (95%), errors: 0.00, reconnects:  0.00
[ 228s] threads: 32, tps: 352.00, reads: 4781.99, writes: 1291.00, response time: 151.56ms (95%), errors: 0.00, reconnects:  0.00
[ 229s] threads: 32, tps: 381.00, reads: 5282.99, writes: 1540.00, response time: 109.99ms (95%), errors: 0.00, reconnects:  0.00
[ 230s] threads: 32, tps: 353.98, reads: 4951.72, writes: 1407.92, response time: 127.56ms (95%), errors: 0.00, reconnects:  0.00
[ 231s] threads: 32, tps: 351.02, reads: 5018.32, writes: 1431.09, response time: 136.16ms (95%), errors: 0.00, reconnects:  0.00
[ 232s] threads: 32, tps: 394.01, reads: 5438.09, writes: 1552.03, response time: 105.67ms (95%), errors: 0.00, reconnects:  0.00
[ 233s] threads: 32, tps: 375.94, reads: 5376.12, writes: 1575.74, response time: 112.79ms (95%), errors: 0.00, reconnects:  0.00
[ 234s] threads: 32, tps: 345.05, reads: 4748.70, writes: 1367.20, response time: 157.25ms (95%), errors: 0.00, reconnects:  0.00
[ 235s] threads: 32, tps: 366.00, reads: 4969.96, writes: 1420.99, response time: 146.13ms (95%), errors: 0.00, reconnects:  0.00
[ 236s] threads: 32, tps: 351.00, reads: 5127.01, writes: 1433.00, response time: 120.98ms (95%), errors: 0.00, reconnects:  0.00
[ 237s] threads: 32, tps: 392.01, reads: 5540.13, writes: 1578.04, response time: 105.32ms (95%), errors: 0.00, reconnects:  0.00
[ 238s] threads: 32, tps: 360.00, reads: 4950.01, writes: 1441.00, response time: 126.34ms (95%), errors: 0.00, reconnects:  0.00
[ 239s] threads: 32, tps: 352.99, reads: 4882.83, writes: 1349.95, response time: 140.51ms (95%), errors: 0.00, reconnects:  0.00
[ 240s] threads: 32, tps: 376.01, reads: 5290.08, writes: 1524.02, response time: 118.79ms (95%), errors: 0.00, reconnects:  0.00
[ 241s] threads: 32, tps: 338.00, reads: 4859.00, writes: 1413.00, response time: 145.69ms (95%), errors: 0.00, reconnects:  0.00
[ 242s] threads: 32, tps: 369.00, reads: 5111.00, writes: 1448.00, response time: 120.04ms (95%), errors: 0.00, reconnects:  0.00
[ 243s] threads: 32, tps: 355.00, reads: 5034.06, writes: 1462.02, response time: 133.38ms (95%), errors: 0.00, reconnects:  0.00
[ 244s] threads: 32, tps: 374.99, reads: 5166.93, writes: 1415.98, response time: 122.10ms (95%), errors: 0.00, reconnects:  0.00
[ 245s] threads: 32, tps: 338.01, reads: 4736.08, writes: 1368.02, response time: 132.30ms (95%), errors: 0.00, reconnects:  0.00
[ 246s] threads: 32, tps: 377.99, reads: 5261.93, writes: 1526.98, response time: 120.76ms (95%), errors: 0.00, reconnects:  0.00
[ 247s] threads: 32, tps: 336.01, reads: 4781.07, writes: 1364.02, response time: 174.56ms (95%), errors: 0.00, reconnects:  0.00
[ 248s] threads: 32, tps: 377.00, reads: 5224.01, writes: 1477.00, response time: 118.57ms (95%), errors: 0.00, reconnects:  0.00
[ 249s] threads: 32, tps: 355.00, reads: 5079.96, writes: 1510.99, response time: 115.11ms (95%), errors: 0.00, reconnects:  0.00
[ 250s] threads: 32, tps: 377.96, reads: 5149.49, writes: 1417.86, response time: 140.38ms (95%), errors: 0.00, reconnects:  0.00
[ 251s] threads: 32, tps: 338.03, reads: 4851.43, writes: 1387.12, response time: 188.52ms (95%), errors: 0.00, reconnects:  0.00
[ 252s] threads: 32, tps: 366.01, reads: 4935.11, writes: 1395.03, response time: 169.62ms (95%), errors: 0.00, reconnects:  0.00
[ 253s] threads: 32, tps: 316.99, reads: 4639.88, writes: 1379.96, response time: 158.86ms (95%), errors: 0.00, reconnects:  0.00
[ 254s] threads: 32, tps: 386.00, reads: 5337.01, writes: 1465.00, response time: 117.48ms (95%), errors: 0.00, reconnects:  0.00
[ 255s] threads: 32, tps: 343.00, reads: 4792.01, writes: 1370.00, response time: 183.79ms (95%), errors: 0.00, reconnects:  0.00
[ 256s] threads: 32, tps: 408.94, reads: 5645.21, writes: 1616.77, response time: 105.10ms (95%), errors: 0.00, reconnects:  0.00
[ 257s] threads: 32, tps: 359.06, reads: 5139.80, writes: 1487.23, response time: 121.70ms (95%), errors: 0.00, reconnects:  0.00
[ 258s] threads: 32, tps: 387.97, reads: 5441.53, writes: 1527.87, response time: 108.94ms (95%), errors: 0.00, reconnects:  0.00
[ 259s] threads: 32, tps: 388.03, reads: 5408.37, writes: 1597.11, response time: 107.49ms (95%), errors: 0.00, reconnects:  0.00
[ 260s] threads: 32, tps: 363.00, reads: 5100.98, writes: 1415.99, response time: 125.93ms (95%), errors: 0.00, reconnects:  0.00
[ 261s] threads: 32, tps: 405.01, reads: 5593.13, writes: 1587.04, response time: 107.29ms (95%), errors: 0.00, reconnects:  0.00
[ 262s] threads: 32, tps: 388.88, reads: 5202.41, writes: 1540.53, response time: 147.71ms (95%), errors: 0.00, reconnects:  0.00
[ 263s] threads: 32, tps: 379.11, reads: 5549.63, writes: 1588.47, response time: 109.20ms (95%), errors: 0.00, reconnects:  0.00
[ 264s] threads: 32, tps: 345.00, reads: 4955.98, writes: 1436.00, response time: 128.21ms (95%), errors: 0.00, reconnects:  0.00
[ 265s] threads: 32, tps: 387.01, reads: 5352.08, writes: 1440.02, response time: 120.69ms (95%), errors: 0.00, reconnects:  0.00
[ 266s] threads: 32, tps: 401.98, reads: 5456.79, writes: 1587.94, response time: 111.58ms (95%), errors: 0.00, reconnects:  0.00
[ 267s] threads: 32, tps: 363.00, reads: 5267.05, writes: 1543.02, response time: 116.74ms (95%), errors: 0.00, reconnects:  0.00
[ 268s] threads: 32, tps: 358.01, reads: 4943.15, writes: 1361.04, response time: 174.82ms (95%), errors: 0.00, reconnects:  0.00
[ 269s] threads: 32, tps: 375.99, reads: 5368.85, writes: 1580.95, response time: 109.43ms (95%), errors: 0.00, reconnects:  0.00
[ 270s] threads: 32, tps: 407.00, reads: 5591.01, writes: 1536.00, response time: 113.16ms (95%), errors: 0.00, reconnects:  0.00
[ 271s] threads: 32, tps: 388.00, reads: 5447.05, writes: 1579.01, response time: 105.19ms (95%), errors: 0.00, reconnects:  0.00
[ 272s] threads: 32, tps: 344.99, reads: 4747.80, writes: 1390.94, response time: 147.80ms (95%), errors: 0.00, reconnects:  0.00
[ 273s] threads: 32, tps: 343.01, reads: 4918.14, writes: 1377.04, response time: 149.09ms (95%), errors: 0.00, reconnects:  0.00
[ 274s] threads: 32, tps: 337.00, reads: 4764.07, writes: 1397.02, response time: 127.67ms (95%), errors: 0.00, reconnects:  0.00
[ 275s] threads: 32, tps: 390.99, reads: 5451.89, writes: 1510.97, response time: 118.33ms (95%), errors: 0.00, reconnects:  0.00
[ 276s] threads: 32, tps: 336.00, reads: 4754.00, writes: 1428.00, response time: 167.95ms (95%), errors: 0.00, reconnects:  0.00
[ 277s] threads: 32, tps: 320.01, reads: 4231.13, writes: 1152.04, response time: 156.50ms (95%), errors: 0.00, reconnects:  0.00
[ 278s] threads: 32, tps: 349.99, reads: 5044.91, writes: 1443.97, response time: 117.34ms (95%), errors: 0.00, reconnects:  0.00
[ 279s] threads: 32, tps: 392.00, reads: 5502.04, writes: 1562.01, response time: 109.34ms (95%), errors: 0.00, reconnects:  0.00
[ 280s] threads: 32, tps: 396.00, reads: 5592.97, writes: 1574.99, response time: 112.89ms (95%), errors: 0.00, reconnects:  0.00
[ 281s] threads: 32, tps: 393.00, reads: 5416.94, writes: 1603.98, response time: 114.87ms (95%), errors: 0.00, reconnects:  0.00
[ 282s] threads: 32, tps: 373.01, reads: 5323.09, writes: 1533.03, response time: 115.25ms (95%), errors: 0.00, reconnects:  0.00
[ 283s] threads: 32, tps: 365.00, reads: 4963.98, writes: 1403.00, response time: 121.01ms (95%), errors: 0.00, reconnects:  0.00
[ 284s] threads: 32, tps: 294.95, reads: 4124.28, writes: 1178.79, response time: 163.58ms (95%), errors: 0.00, reconnects:  0.00
[ 285s] threads: 32, tps: 370.06, reads: 5205.90, writes: 1499.26, response time: 114.77ms (95%), errors: 0.00, reconnects:  0.00
[ 286s] threads: 32, tps: 389.01, reads: 5550.11, writes: 1546.03, response time: 108.03ms (95%), errors: 0.00, reconnects:  0.00
[ 287s] threads: 32, tps: 336.00, reads: 4502.95, writes: 1298.99, response time: 217.13ms (95%), errors: 0.00, reconnects:  0.00
[ 288s] threads: 32, tps: 337.00, reads: 4908.93, writes: 1355.98, response time: 144.00ms (95%), errors: 0.00, reconnects:  0.00
[ 289s] threads: 32, tps: 384.96, reads: 5382.48, writes: 1557.85, response time: 115.87ms (95%), errors: 0.00, reconnects:  0.00
[ 290s] threads: 32, tps: 344.04, reads: 4781.50, writes: 1360.14, response time: 175.24ms (95%), errors: 0.00, reconnects:  0.00
[ 291s] threads: 32, tps: 385.00, reads: 5367.99, writes: 1584.00, response time: 109.76ms (95%), errors: 0.00, reconnects:  0.00
[ 292s] threads: 32, tps: 375.00, reads: 5371.01, writes: 1564.00, response time: 104.07ms (95%), errors: 0.00, reconnects:  0.00
[ 293s] threads: 32, tps: 405.99, reads: 5578.89, writes: 1512.97, response time: 122.29ms (95%), errors: 0.00, reconnects:  0.00
[ 294s] threads: 32, tps: 377.79, reads: 5239.15, writes: 1512.18, response time: 114.73ms (95%), errors: 0.00, reconnects:  0.00
[ 295s] threads: 32, tps: 377.22, reads: 5375.13, writes: 1586.92, response time: 113.37ms (95%), errors: 0.00, reconnects:  0.00
[ 296s] threads: 32, tps: 320.00, reads: 4337.98, writes: 1201.99, response time: 167.85ms (95%), errors: 0.00, reconnects:  0.00
[ 297s] threads: 32, tps: 359.97, reads: 4927.64, writes: 1430.90, response time: 126.00ms (95%), errors: 0.00, reconnects:  0.00
[ 298s] threads: 32, tps: 374.03, reads: 5461.39, writes: 1568.11, response time: 110.98ms (95%), errors: 0.00, reconnects:  0.00
[ 299s] threads: 32, tps: 371.96, reads: 5235.40, writes: 1428.84, response time: 115.25ms (95%), errors: 0.00, reconnects:  0.00
[ 300s] threads: 32, tps: 389.04, reads: 5288.52, writes: 1556.15, response time: 110.52ms (95%), errors: 0.00, reconnects:  0.00
[ 301s] threads: 32, tps: 315.99, reads: 4350.84, writes: 1253.95, response time: 165.51ms (95%), errors: 0.00, reconnects:  0.00
[ 302s] threads: 32, tps: 331.01, reads: 4778.19, writes: 1318.05, response time: 161.20ms (95%), errors: 0.00, reconnects:  0.00
[ 303s] threads: 32, tps: 380.00, reads: 5329.02, writes: 1565.01, response time: 111.08ms (95%), errors: 0.00, reconnects:  0.00
[ 304s] threads: 32, tps: 376.00, reads: 5347.96, writes: 1492.99, response time: 122.58ms (95%), errors: 0.00, reconnects:  0.00
[ 305s] threads: 32, tps: 400.99, reads: 5589.88, writes: 1597.96, response time: 112.02ms (95%), errors: 0.00, reconnects:  0.00
[ 306s] threads: 32, tps: 377.02, reads: 5279.22, writes: 1496.06, response time: 115.49ms (95%), errors: 0.00, reconnects:  0.00
[ 307s] threads: 32, tps: 362.97, reads: 5040.65, writes: 1475.90, response time: 122.62ms (95%), errors: 0.00, reconnects:  0.00
[ 308s] threads: 32, tps: 380.02, reads: 5385.29, writes: 1523.08, response time: 112.69ms (95%), errors: 0.00, reconnects:  0.00
[ 309s] threads: 32, tps: 383.99, reads: 5311.92, writes: 1503.98, response time: 124.35ms (95%), errors: 0.00, reconnects:  0.00
[ 310s] threads: 32, tps: 381.00, reads: 5280.01, writes: 1532.00, response time: 109.43ms (95%), errors: 0.00, reconnects:  0.00
[ 311s] threads: 32, tps: 331.97, reads: 4788.55, writes: 1365.87, response time: 181.60ms (95%), errors: 0.00, reconnects:  0.00
[ 312s] threads: 32, tps: 367.04, reads: 5164.52, writes: 1507.15, response time: 118.61ms (95%), errors: 0.00, reconnects:  0.00
[ 313s] threads: 32, tps: 362.00, reads: 4896.05, writes: 1354.01, response time: 179.54ms (95%), errors: 0.00, reconnects:  0.00
[ 314s] threads: 32, tps: 338.00, reads: 4817.06, writes: 1383.02, response time: 147.31ms (95%), errors: 0.00, reconnects:  0.00
[ 315s] threads: 32, tps: 381.99, reads: 5402.88, writes: 1582.96, response time: 109.27ms (95%), errors: 0.00, reconnects:  0.00
[ 316s] threads: 32, tps: 401.00, reads: 5372.02, writes: 1518.00, response time: 109.86ms (95%), errors: 0.00, reconnects:  0.00
[ 317s] threads: 32, tps: 249.00, reads: 3766.02, writes: 1118.01, response time: 186.11ms (95%), errors: 0.00, reconnects:  0.00
[ 318s] threads: 32, tps: 298.99, reads: 4024.91, writes: 1131.97, response time: 153.11ms (95%), errors: 0.00, reconnects:  0.00
[ 319s] threads: 32, tps: 269.01, reads: 3866.09, writes: 1030.02, response time: 165.80ms (95%), errors: 0.00, reconnects:  0.00
[ 320s] threads: 32, tps: 248.00, reads: 3289.98, writes: 977.99, response time: 177.67ms (95%), errors: 0.00, reconnects:  0.00
[ 321s] threads: 32, tps: 220.00, reads: 3314.98, writes: 969.00, response time: 285.97ms (95%), errors: 0.00, reconnects:  0.00
[ 322s] threads: 32, tps: 246.01, reads: 3318.09, writes: 970.03, response time: 159.19ms (95%), errors: 0.00, reconnects:  0.00
[ 323s] threads: 32, tps: 255.00, reads: 3700.93, writes: 1064.98, response time: 174.93ms (95%), errors: 0.00, reconnects:  0.00
[ 324s] threads: 32, tps: 272.00, reads: 3558.00, writes: 992.00, response time: 200.09ms (95%), errors: 0.00, reconnects:  0.00
[ 325s] threads: 32, tps: 219.00, reads: 3297.02, writes: 935.01, response time: 218.11ms (95%), errors: 0.00, reconnects:  0.00
[ 326s] threads: 32, tps: 268.00, reads: 3771.97, writes: 1100.99, response time: 162.66ms (95%), errors: 0.00, reconnects:  0.00
[ 327s] threads: 32, tps: 179.00, reads: 2508.02, writes: 728.00, response time: 217.91ms (95%), errors: 0.00, reconnects:  0.00
[ 328s] threads: 32, tps: 280.00, reads: 3692.02, writes: 1004.01, response time: 196.65ms (95%), errors: 0.00, reconnects:  0.00
[ 329s] threads: 32, tps: 265.00, reads: 3897.93, writes: 1143.98, response time: 181.22ms (95%), errors: 0.00, reconnects:  0.00
[ 330s] threads: 32, tps: 275.00, reads: 3890.06, writes: 1132.02, response time: 151.93ms (95%), errors: 0.00, reconnects:  0.00
[ 331s] threads: 32, tps: 243.00, reads: 3401.97, writes: 970.99, response time: 179.92ms (95%), errors: 0.00, reconnects:  0.00
[ 332s] threads: 32, tps: 289.01, reads: 3886.08, writes: 1081.02, response time: 178.31ms (95%), errors: 0.00, reconnects:  0.00
[ 333s] threads: 32, tps: 211.00, reads: 3005.97, writes: 795.99, response time: 209.85ms (95%), errors: 0.00, reconnects:  0.00
[ 334s] threads: 32, tps: 211.00, reads: 3061.94, writes: 966.98, response time: 176.19ms (95%), errors: 0.00, reconnects:  0.00
[ 335s] threads: 32, tps: 206.00, reads: 2884.02, writes: 825.01, response time: 244.17ms (95%), errors: 0.00, reconnects:  0.00
[ 336s] threads: 32, tps: 246.00, reads: 3365.99, writes: 936.00, response time: 181.00ms (95%), errors: 0.00, reconnects:  0.00
[ 337s] threads: 32, tps: 225.00, reads: 3228.02, writes: 948.01, response time: 178.15ms (95%), errors: 0.00, reconnects:  0.00
[ 338s] threads: 32, tps: 218.99, reads: 2897.87, writes: 827.96, response time: 378.11ms (95%), errors: 0.00, reconnects:  0.00
[ 339s] threads: 32, tps: 222.01, reads: 3274.11, writes: 932.03, response time: 198.54ms (95%), errors: 0.00, reconnects:  0.00
[ 340s] threads: 32, tps: 237.01, reads: 3306.10, writes: 899.03, response time: 204.21ms (95%), errors: 0.00, reconnects:  0.00
[ 341s] threads: 32, tps: 274.00, reads: 3849.97, writes: 1139.99, response time: 169.16ms (95%), errors: 0.00, reconnects:  0.00
[ 342s] threads: 32, tps: 232.98, reads: 3032.74, writes: 844.93, response time: 199.56ms (95%), errors: 0.00, reconnects:  0.00
[ 343s] threads: 32, tps: 216.02, reads: 3253.26, writes: 959.08, response time: 182.91ms (95%), errors: 0.00, reconnects:  0.00
[ 344s] threads: 32, tps: 242.99, reads: 3401.90, writes: 972.97, response time: 201.17ms (95%), errors: 0.00, reconnects:  0.00
[ 345s] threads: 32, tps: 292.01, reads: 3945.17, writes: 1044.04, response time: 192.86ms (95%), errors: 0.00, reconnects:  0.00
[ 346s] threads: 32, tps: 225.00, reads: 3292.97, writes: 1023.99, response time: 185.67ms (95%), errors: 0.00, reconnects:  0.00
[ 347s] threads: 32, tps: 261.00, reads: 3520.97, writes: 959.99, response time: 190.85ms (95%), errors: 0.00, reconnects:  0.00
[ 348s] threads: 32, tps: 208.00, reads: 3045.01, writes: 914.00, response time: 214.29ms (95%), errors: 0.00, reconnects:  0.00
[ 349s] threads: 32, tps: 208.00, reads: 2902.95, writes: 787.99, response time: 221.40ms (95%), errors: 0.00, reconnects:  0.00
[ 350s] threads: 32, tps: 246.01, reads: 3240.11, writes: 902.03, response time: 203.05ms (95%), errors: 0.00, reconnects:  0.00
[ 351s] threads: 32, tps: 203.00, reads: 2903.94, writes: 811.98, response time: 243.22ms (95%), errors: 0.00, reconnects:  0.00
[ 352s] threads: 32, tps: 249.00, reads: 3637.01, writes: 1124.00, response time: 182.63ms (95%), errors: 0.00, reconnects:  0.00
[ 353s] threads: 32, tps: 258.99, reads: 3625.86, writes: 1034.96, response time: 171.05ms (95%), errors: 0.00, reconnects:  0.00
[ 354s] threads: 32, tps: 259.01, reads: 3626.08, writes: 1036.02, response time: 181.65ms (95%), errors: 0.00, reconnects:  0.00
[ 355s] threads: 32, tps: 258.00, reads: 3611.06, writes: 1019.02, response time: 211.04ms (95%), errors: 0.00, reconnects:  0.00
[ 356s] threads: 32, tps: 239.00, reads: 3334.98, writes: 909.99, response time: 198.13ms (95%), errors: 0.00, reconnects:  0.00
[ 357s] threads: 32, tps: 234.00, reads: 3288.02, writes: 996.01, response time: 217.72ms (95%), errors: 0.00, reconnects:  0.00
[ 358s] threads: 32, tps: 286.00, reads: 3991.97, writes: 1111.99, response time: 185.83ms (95%), errors: 0.00, reconnects:  0.00
[ 359s] threads: 32, tps: 274.00, reads: 3848.04, writes: 1128.01, response time: 148.78ms (95%), errors: 0.00, reconnects:  0.00
[ 360s] threads: 32, tps: 273.00, reads: 3807.99, writes: 1078.00, response time: 183.73ms (95%), errors: 0.00, reconnects:  0.00
[ 361s] threads: 32, tps: 324.00, reads: 4209.97, writes: 1205.99, response time: 154.54ms (95%), errors: 0.00, reconnects:  0.00
[ 362s] threads: 32, tps: 194.00, reads: 3038.02, writes: 856.00, response time: 330.56ms (95%), errors: 0.00, reconnects:  0.00
[ 363s] threads: 32, tps: 260.00, reads: 3580.99, writes: 1020.00, response time: 150.52ms (95%), errors: 0.00, reconnects:  0.00
[ 364s] threads: 32, tps: 305.00, reads: 4041.01, writes: 1144.00, response time: 148.91ms (95%), errors: 0.00, reconnects:  0.00
[ 365s] threads: 32, tps: 292.00, reads: 4388.98, writes: 1252.00, response time: 156.92ms (95%), errors: 0.00, reconnects:  0.00
[ 366s] threads: 32, tps: 237.00, reads: 3240.06, writes: 861.02, response time: 211.49ms (95%), errors: 0.00, reconnects:  0.00
[ 367s] threads: 32, tps: 257.00, reads: 3680.97, writes: 1149.99, response time: 162.17ms (95%), errors: 0.00, reconnects:  0.00
[ 368s] threads: 32, tps: 260.00, reads: 3634.01, writes: 989.00, response time: 184.61ms (95%), errors: 0.00, reconnects:  0.00
[ 369s] threads: 32, tps: 252.99, reads: 3497.93, writes: 1007.98, response time: 173.21ms (95%), errors: 0.00, reconnects:  0.00
[ 370s] threads: 32, tps: 281.00, reads: 3981.03, writes: 1173.01, response time: 142.71ms (95%), errors: 0.00, reconnects:  0.00
[ 371s] threads: 32, tps: 226.00, reads: 3009.06, writes: 811.02, response time: 212.69ms (95%), errors: 0.00, reconnects:  0.00
[ 372s] threads: 32, tps: 215.00, reads: 3167.93, writes: 958.98, response time: 237.53ms (95%), errors: 0.00, reconnects:  0.00
[ 373s] threads: 32, tps: 256.00, reads: 3577.94, writes: 1007.98, response time: 191.48ms (95%), errors: 0.00, reconnects:  0.00
[ 374s] threads: 32, tps: 215.01, reads: 3016.07, writes: 876.02, response time: 269.76ms (95%), errors: 0.00, reconnects:  0.00
[ 375s] threads: 32, tps: 292.01, reads: 3868.07, writes: 1041.02, response time: 181.38ms (95%), errors: 0.00, reconnects:  0.00
[ 376s] threads: 32, tps: 264.00, reads: 3849.99, writes: 1095.00, response time: 175.24ms (95%), errors: 0.00, reconnects:  0.00
[ 377s] threads: 32, tps: 275.99, reads: 3921.90, writes: 1152.97, response time: 152.84ms (95%), errors: 0.00, reconnects:  0.00
[ 378s] threads: 32, tps: 239.00, reads: 3322.03, writes: 940.01, response time: 225.21ms (95%), errors: 0.00, reconnects:  0.00
[ 379s] threads: 32, tps: 292.00, reads: 4030.93, writes: 1122.98, response time: 163.54ms (95%), errors: 0.00, reconnects:  0.00
[ 380s] threads: 32, tps: 240.00, reads: 3416.05, writes: 1041.02, response time: 182.42ms (95%), errors: 0.00, reconnects:  0.00
[ 381s] threads: 32, tps: 234.00, reads: 3309.02, writes: 956.00, response time: 225.95ms (95%), errors: 0.00, reconnects:  0.00
[ 382s] threads: 32, tps: 246.00, reads: 3307.00, writes: 881.00, response time: 197.36ms (95%), errors: 0.00, reconnects:  0.00
[ 383s] threads: 32, tps: 212.00, reads: 3105.00, writes: 947.00, response time: 204.33ms (95%), errors: 0.00, reconnects:  0.00
[ 384s] threads: 32, tps: 248.00, reads: 3472.00, writes: 995.00, response time: 188.75ms (95%), errors: 0.00, reconnects:  0.00
[ 385s] threads: 32, tps: 242.00, reads: 3385.99, writes: 960.00, response time: 200.87ms (95%), errors: 0.00, reconnects:  0.00
[ 386s] threads: 32, tps: 215.00, reads: 2958.04, writes: 775.01, response time: 244.82ms (95%), errors: 0.00, reconnects:  0.00
[ 387s] threads: 32, tps: 292.99, reads: 4129.92, writes: 1229.98, response time: 144.60ms (95%), errors: 0.00, reconnects:  0.00
[ 388s] threads: 32, tps: 227.00, reads: 3163.06, writes: 851.02, response time: 235.48ms (95%), errors: 0.00, reconnects:  0.00
[ 389s] threads: 32, tps: 247.00, reads: 3495.94, writes: 1075.98, response time: 162.61ms (95%), errors: 0.00, reconnects:  0.00
[ 390s] threads: 32, tps: 246.00, reads: 3213.02, writes: 889.00, response time: 212.06ms (95%), errors: 0.00, reconnects:  0.00
[ 391s] threads: 32, tps: 237.00, reads: 3327.04, writes: 972.01, response time: 203.90ms (95%), errors: 0.00, reconnects:  0.00
[ 392s] threads: 32, tps: 267.97, reads: 3836.54, writes: 1106.87, response time: 148.69ms (95%), errors: 0.00, reconnects:  0.00
[ 393s] threads: 32, tps: 277.03, reads: 4005.38, writes: 1136.11, response time: 172.38ms (95%), errors: 0.00, reconnects:  0.00
[ 394s] threads: 32, tps: 229.01, reads: 3122.08, writes: 811.02, response time: 188.75ms (95%), errors: 0.00, reconnects:  0.00
[ 395s] threads: 32, tps: 228.00, reads: 3059.00, writes: 922.00, response time: 207.47ms (95%), errors: 0.00, reconnects:  0.00
[ 396s] threads: 32, tps: 247.97, reads: 3572.62, writes: 975.90, response time: 206.17ms (95%), errors: 0.00, reconnects:  0.00
[ 397s] threads: 32, tps: 251.02, reads: 3640.29, writes: 1097.09, response time: 171.51ms (95%), errors: 0.00, reconnects:  0.00
[ 398s] threads: 32, tps: 217.01, reads: 3001.07, writes: 792.02, response time: 241.04ms (95%), errors: 0.00, reconnects:  0.00
[ 399s] threads: 32, tps: 265.00, reads: 3510.02, writes: 1059.01, response time: 173.63ms (95%), errors: 0.00, reconnects:  0.00
[ 400s] threads: 32, tps: 237.00, reads: 3326.98, writes: 983.99, response time: 193.32ms (95%), errors: 0.00, reconnects:  0.00
[ 401s] threads: 32, tps: 254.00, reads: 3786.97, writes: 1086.99, response time: 159.76ms (95%), errors: 0.00, reconnects:  0.00
[ 402s] threads: 32, tps: 267.00, reads: 3738.01, writes: 1068.00, response time: 170.94ms (95%), errors: 0.00, reconnects:  0.00
[ 403s] threads: 32, tps: 318.99, reads: 4457.89, writes: 1246.97, response time: 159.57ms (95%), errors: 0.00, reconnects:  0.00
[ 404s] threads: 32, tps: 262.01, reads: 3603.10, writes: 970.03, response time: 178.53ms (95%), errors: 0.00, reconnects:  0.00
[ 405s] threads: 32, tps: 234.00, reads: 3311.94, writes: 1017.98, response time: 235.83ms (95%), errors: 0.00, reconnects:  0.00
[ 406s] threads: 32, tps: 306.00, reads: 4304.97, writes: 1168.99, response time: 171.35ms (95%), errors: 0.00, reconnects:  0.00
[ 407s] threads: 32, tps: 265.99, reads: 3739.91, writes: 1143.97, response time: 150.39ms (95%), errors: 0.00, reconnects:  0.00
[ 408s] threads: 32, tps: 350.00, reads: 4769.03, writes: 1353.01, response time: 215.84ms (95%), errors: 0.00, reconnects:  0.00
[ 409s] threads: 32, tps: 339.01, reads: 4838.12, writes: 1355.03, response time: 135.39ms (95%), errors: 0.00, reconnects:  0.00
[ 410s] threads: 32, tps: 345.01, reads: 4735.11, writes: 1336.03, response time: 154.59ms (95%), errors: 0.00, reconnects:  0.00
[ 411s] threads: 32, tps: 321.99, reads: 4623.92, writes: 1352.98, response time: 150.61ms (95%), errors: 0.00, reconnects:  0.00
[ 412s] threads: 32, tps: 335.00, reads: 4708.02, writes: 1368.01, response time: 145.12ms (95%), errors: 0.00, reconnects:  0.00
[ 413s] threads: 32, tps: 307.99, reads: 4115.93, writes: 1174.98, response time: 169.62ms (95%), errors: 0.00, reconnects:  0.00
[ 414s] threads: 32, tps: 351.00, reads: 5039.98, writes: 1353.99, response time: 148.38ms (95%), errors: 0.00, reconnects:  0.00
[ 415s] threads: 32, tps: 323.01, reads: 4584.08, writes: 1390.02, response time: 155.84ms (95%), errors: 0.00, reconnects:  0.00
[ 416s] threads: 32, tps: 257.00, reads: 3605.99, writes: 1034.00, response time: 228.67ms (95%), errors: 0.00, reconnects:  0.00
[ 417s] threads: 32, tps: 385.01, reads: 5295.08, writes: 1458.02, response time: 140.68ms (95%), errors: 0.00, reconnects:  0.00
[ 418s] threads: 32, tps: 329.99, reads: 4685.92, writes: 1310.98, response time: 125.66ms (95%), errors: 0.00, reconnects:  0.00
[ 419s] threads: 32, tps: 386.01, reads: 5300.10, writes: 1523.03, response time: 123.10ms (95%), errors: 0.00, reconnects:  0.00
[ 420s] threads: 32, tps: 389.99, reads: 5430.84, writes: 1569.95, response time: 116.22ms (95%), errors: 0.00, reconnects:  0.00
[ 421s] threads: 32, tps: 305.01, reads: 4431.08, writes: 1312.02, response time: 175.30ms (95%), errors: 0.00, reconnects:  0.00
[ 422s] threads: 32, tps: 262.00, reads: 3666.98, writes: 1041.99, response time: 165.21ms (95%), errors: 0.00, reconnects:  0.00
[ 423s] threads: 32, tps: 327.99, reads: 4472.80, writes: 1233.94, response time: 147.31ms (95%), errors: 0.00, reconnects:  0.00
[ 424s] threads: 32, tps: 395.99, reads: 5570.85, writes: 1598.96, response time: 105.04ms (95%), errors: 0.00, reconnects:  0.00
[ 425s] threads: 32, tps: 389.03, reads: 5283.45, writes: 1532.13, response time: 137.39ms (95%), errors: 0.00, reconnects:  0.00
[ 426s] threads: 32, tps: 375.99, reads: 5397.90, writes: 1499.97, response time: 118.22ms (95%), errors: 0.00, reconnects:  0.00
[ 427s] threads: 32, tps: 288.00, reads: 4155.05, writes: 1260.01, response time: 170.84ms (95%), errors: 0.00, reconnects:  0.00
[ 428s] threads: 32, tps: 298.00, reads: 4107.05, writes: 1097.01, response time: 160.67ms (95%), errors: 0.00, reconnects:  0.00
[ 429s] threads: 32, tps: 368.00, reads: 5186.98, writes: 1503.99, response time: 124.28ms (95%), errors: 0.00, reconnects:  0.00
[ 430s] threads: 32, tps: 331.00, reads: 4588.93, writes: 1340.98, response time: 145.52ms (95%), errors: 0.00, reconnects:  0.00
[ 431s] threads: 32, tps: 381.01, reads: 5345.10, writes: 1496.03, response time: 114.56ms (95%), errors: 0.00, reconnects:  0.00
[ 432s] threads: 32, tps: 371.99, reads: 5249.84, writes: 1532.95, response time: 113.06ms (95%), errors: 0.00, reconnects:  0.00
[ 433s] threads: 32, tps: 313.00, reads: 4346.02, writes: 1182.01, response time: 148.29ms (95%), errors: 0.00, reconnects:  0.00
[ 434s] threads: 32, tps: 325.01, reads: 4556.11, writes: 1350.03, response time: 165.16ms (95%), errors: 0.00, reconnects:  0.00
[ 435s] threads: 32, tps: 404.00, reads: 5644.00, writes: 1593.00, response time: 105.86ms (95%), errors: 0.00, reconnects:  0.00
[ 436s] threads: 32, tps: 302.99, reads: 4305.91, writes: 1285.97, response time: 154.63ms (95%), errors: 0.00, reconnects:  0.00
[ 437s] threads: 32, tps: 311.00, reads: 4311.00, writes: 1154.00, response time: 161.83ms (95%), errors: 0.00, reconnects:  0.00
[ 438s] threads: 32, tps: 398.00, reads: 5538.97, writes: 1580.99, response time: 107.32ms (95%), errors: 0.00, reconnects:  0.00
[ 439s] threads: 32, tps: 323.00, reads: 4598.04, writes: 1391.01, response time: 141.31ms (95%), errors: 0.00, reconnects:  0.00
[ 440s] threads: 32, tps: 359.00, reads: 4912.04, writes: 1333.01, response time: 142.03ms (95%), errors: 0.00, reconnects:  0.00
[ 441s] threads: 32, tps: 379.00, reads: 5195.04, writes: 1540.01, response time: 131.79ms (95%), errors: 0.00, reconnects:  0.00
[ 442s] threads: 32, tps: 262.00, reads: 3757.98, writes: 1032.99, response time: 173.99ms (95%), errors: 0.00, reconnects:  0.00
[ 443s] threads: 32, tps: 289.00, reads: 4123.01, writes: 1184.00, response time: 181.82ms (95%), errors: 0.00, reconnects:  0.00
[ 444s] threads: 32, tps: 324.94, reads: 4482.17, writes: 1281.76, response time: 193.50ms (95%), errors: 0.00, reconnects:  0.00
[ 445s] threads: 32, tps: 294.04, reads: 4237.60, writes: 1216.17, response time: 175.93ms (95%), errors: 0.00, reconnects:  0.00
[ 446s] threads: 32, tps: 312.01, reads: 4177.20, writes: 1182.06, response time: 176.82ms (95%), errors: 0.00, reconnects:  0.00
[ 447s] threads: 32, tps: 353.99, reads: 5000.89, writes: 1422.97, response time: 162.51ms (95%), errors: 0.00, reconnects:  0.00
[ 448s] threads: 32, tps: 299.00, reads: 4281.06, writes: 1209.02, response time: 178.15ms (95%), errors: 0.00, reconnects:  0.00
[ 449s] threads: 32, tps: 290.00, reads: 3897.97, writes: 1134.99, response time: 169.31ms (95%), errors: 0.00, reconnects:  0.00
[ 450s] threads: 32, tps: 387.99, reads: 5597.82, writes: 1582.95, response time: 109.56ms (95%), errors: 0.00, reconnects:  0.00
[ 451s] threads: 32, tps: 348.97, reads: 4864.65, writes: 1398.90, response time: 152.56ms (95%), errors: 0.00, reconnects:  0.00
[ 452s] threads: 32, tps: 347.04, reads: 4869.49, writes: 1360.14, response time: 143.40ms (95%), errors: 0.00, reconnects:  0.00
[ 453s] threads: 32, tps: 402.00, reads: 5592.02, writes: 1605.01, response time: 114.19ms (95%), errors: 0.00, reconnects:  0.00
[ 454s] threads: 32, tps: 351.00, reads: 4770.01, writes: 1410.00, response time: 137.14ms (95%), errors: 0.00, reconnects:  0.00
[ 455s] threads: 32, tps: 331.00, reads: 4602.01, writes: 1320.00, response time: 141.90ms (95%), errors: 0.00, reconnects:  0.00
[ 456s] threads: 32, tps: 375.00, reads: 5331.04, writes: 1504.01, response time: 140.76ms (95%), errors: 0.00, reconnects:  0.00
[ 457s] threads: 32, tps: 265.99, reads: 3915.89, writes: 1169.97, response time: 207.91ms (95%), errors: 0.00, reconnects:  0.00
[ 458s] threads: 32, tps: 250.99, reads: 3513.82, writes: 1005.95, response time: 170.59ms (95%), errors: 0.00, reconnects:  0.00
[ 459s] threads: 32, tps: 300.01, reads: 4049.15, writes: 1149.04, response time: 211.36ms (95%), errors: 0.00, reconnects:  0.00
[ 460s] threads: 32, tps: 320.01, reads: 4609.19, writes: 1278.05, response time: 151.83ms (95%), errors: 0.00, reconnects:  0.00
[ 461s] threads: 32, tps: 219.00, reads: 3078.93, writes: 873.98, response time: 225.95ms (95%), errors: 0.00, reconnects:  0.00
[ 462s] threads: 32, tps: 227.00, reads: 3136.99, writes: 899.00, response time: 238.32ms (95%), errors: 0.00, reconnects:  0.00
[ 463s] threads: 32, tps: 298.01, reads: 4191.11, writes: 1151.03, response time: 156.36ms (95%), errors: 0.00, reconnects:  0.00
[ 464s] threads: 32, tps: 349.99, reads: 4841.89, writes: 1440.97, response time: 122.14ms (95%), errors: 0.00, reconnects:  0.00
[ 465s] threads: 32, tps: 390.01, reads: 5447.08, writes: 1545.02, response time: 112.19ms (95%), errors: 0.00, reconnects:  0.00
[ 466s] threads: 32, tps: 255.00, reads: 3671.98, writes: 1096.99, response time: 190.85ms (95%), errors: 0.00, reconnects:  0.00
[ 467s] threads: 32, tps: 344.00, reads: 4705.03, writes: 1275.01, response time: 131.83ms (95%), errors: 0.00, reconnects:  0.00
[ 468s] threads: 32, tps: 328.00, reads: 4679.00, writes: 1383.00, response time: 166.70ms (95%), errors: 0.00, reconnects:  0.00
[ 469s] threads: 32, tps: 356.00, reads: 4749.98, writes: 1327.99, response time: 169.97ms (95%), errors: 0.00, reconnects:  0.00
[ 470s] threads: 32, tps: 327.98, reads: 4716.75, writes: 1353.93, response time: 137.06ms (95%), errors: 0.00, reconnects:  0.00
[ 471s] threads: 32, tps: 333.01, reads: 4775.21, writes: 1382.06, response time: 210.10ms (95%), errors: 0.00, reconnects:  0.00
[ 472s] threads: 32, tps: 329.00, reads: 4622.05, writes: 1348.02, response time: 156.17ms (95%), errors: 0.00, reconnects:  0.00
[ 473s] threads: 32, tps: 318.00, reads: 4300.99, writes: 1160.00, response time: 131.00ms (95%), errors: 0.00, reconnects:  0.00
[ 474s] threads: 32, tps: 366.99, reads: 5279.91, writes: 1559.97, response time: 121.12ms (95%), errors: 0.00, reconnects:  0.00
[ 475s] threads: 32, tps: 392.01, reads: 5435.17, writes: 1485.05, response time: 106.46ms (95%), errors: 0.00, reconnects:  0.00
[ 476s] threads: 32, tps: 361.99, reads: 5016.81, writes: 1497.94, response time: 139.67ms (95%), errors: 0.00, reconnects:  0.00
[ 477s] threads: 32, tps: 382.01, reads: 5385.15, writes: 1470.04, response time: 118.50ms (95%), errors: 0.00, reconnects:  0.00
[ 478s] threads: 32, tps: 352.00, reads: 5007.95, writes: 1519.99, response time: 113.03ms (95%), errors: 0.00, reconnects:  0.00
[ 479s] threads: 32, tps: 258.96, reads: 3499.48, writes: 1001.85, response time: 177.30ms (95%), errors: 0.00, reconnects:  0.00
[ 480s] threads: 32, tps: 384.07, reads: 5340.93, writes: 1481.26, response time: 157.34ms (95%), errors: 0.00, reconnects:  0.00
[ 481s] threads: 32, tps: 362.99, reads: 5088.92, writes: 1466.98, response time: 134.74ms (95%), errors: 0.00, reconnects:  0.00
[ 482s] threads: 32, tps: 327.00, reads: 4576.06, writes: 1278.02, response time: 203.48ms (95%), errors: 0.00, reconnects:  0.00
[ 483s] threads: 32, tps: 390.93, reads: 5542.94, writes: 1573.70, response time: 111.08ms (95%), errors: 0.00, reconnects:  0.00
[ 484s] threads: 32, tps: 353.06, reads: 4681.85, writes: 1393.25, response time: 196.94ms (95%), errors: 0.00, reconnects:  0.00
[ 485s] threads: 32, tps: 219.95, reads: 3041.27, writes: 883.79, response time: 210.16ms (95%), errors: 0.00, reconnects:  0.00
[ 486s] threads: 32, tps: 209.05, reads: 3195.69, writes: 826.18, response time: 238.24ms (95%), errors: 0.00, reconnects:  0.00
[ 487s] threads: 32, tps: 373.01, reads: 5316.14, writes: 1578.04, response time: 110.19ms (95%), errors: 0.00, reconnects:  0.00
[ 488s] threads: 32, tps: 368.00, reads: 5136.02, writes: 1442.01, response time: 130.57ms (95%), errors: 0.00, reconnects:  0.00
[ 489s] threads: 32, tps: 401.98, reads: 5614.77, writes: 1593.93, response time: 112.83ms (95%), errors: 0.00, reconnects:  0.00
[ 490s] threads: 32, tps: 343.01, reads: 4854.19, writes: 1452.06, response time: 123.06ms (95%), errors: 0.00, reconnects:  0.00
[ 491s] threads: 32, tps: 275.98, reads: 3556.78, writes: 1011.94, response time: 183.51ms (95%), errors: 0.00, reconnects:  0.00
[ 492s] threads: 32, tps: 391.02, reads: 5612.33, writes: 1562.09, response time: 109.99ms (95%), errors: 0.00, reconnects:  0.00
[ 493s] threads: 32, tps: 374.99, reads: 5307.90, writes: 1475.97, response time: 117.30ms (95%), errors: 0.00, reconnects:  0.00
[ 494s] threads: 32, tps: 326.00, reads: 4593.95, writes: 1375.98, response time: 154.17ms (95%), errors: 0.00, reconnects:  0.00
[ 495s] threads: 32, tps: 400.01, reads: 5657.21, writes: 1571.06, response time: 107.26ms (95%), errors: 0.00, reconnects:  0.00
[ 496s] threads: 32, tps: 371.99, reads: 5231.90, writes: 1557.97, response time: 111.72ms (95%), errors: 0.00, reconnects:  0.00
[ 497s] threads: 32, tps: 339.01, reads: 4592.09, writes: 1248.02, response time: 156.92ms (95%), errors: 0.00, reconnects:  0.00
[ 498s] threads: 32, tps: 366.00, reads: 5277.97, writes: 1576.99, response time: 121.52ms (95%), errors: 0.00, reconnects:  0.00
[ 499s] threads: 32, tps: 376.01, reads: 5036.07, writes: 1400.02, response time: 152.15ms (95%), errors: 0.00, reconnects:  0.00
[ 500s] threads: 32, tps: 318.00, reads: 4437.96, writes: 1266.99, response time: 163.83ms (95%), errors: 0.00, reconnects:  0.00
[ 501s] threads: 32, tps: 332.99, reads: 4840.89, writes: 1346.97, response time: 155.47ms (95%), errors: 0.00, reconnects:  0.00
[ 502s] threads: 32, tps: 358.01, reads: 4944.13, writes: 1473.04, response time: 140.55ms (95%), errors: 0.00, reconnects:  0.00
[ 503s] threads: 32, tps: 340.99, reads: 4783.92, writes: 1317.98, response time: 131.87ms (95%), errors: 0.00, reconnects:  0.00
[ 504s] threads: 32, tps: 378.01, reads: 5237.07, writes: 1519.02, response time: 120.94ms (95%), errors: 0.00, reconnects:  0.00
[ 505s] threads: 32, tps: 339.99, reads: 4935.89, writes: 1450.97, response time: 138.09ms (95%), errors: 0.00, reconnects:  0.00
[ 506s] threads: 32, tps: 326.01, reads: 4259.11, writes: 1177.03, response time: 147.75ms (95%), errors: 0.00, reconnects:  0.00
[ 507s] threads: 32, tps: 391.00, reads: 5628.99, writes: 1607.00, response time: 107.36ms (95%), errors: 0.00, reconnects:  0.00
[ 508s] threads: 32, tps: 384.00, reads: 5370.01, writes: 1519.00, response time: 109.24ms (95%), errors: 0.00, reconnects:  0.00
[ 509s] threads: 32, tps: 340.99, reads: 4929.89, writes: 1465.97, response time: 120.72ms (95%), errors: 0.00, reconnects:  0.00
[ 510s] threads: 32, tps: 415.95, reads: 5623.38, writes: 1561.83, response time: 114.77ms (95%), errors: 0.00, reconnects:  0.00
[ 511s] threads: 32, tps: 290.03, reads: 4121.49, writes: 1190.14, response time: 170.99ms (95%), errors: 0.00, reconnects:  0.00
[ 512s] threads: 32, tps: 335.00, reads: 4777.04, writes: 1346.01, response time: 126.46ms (95%), errors: 0.00, reconnects:  0.00
[ 513s] threads: 32, tps: 383.00, reads: 5413.94, writes: 1597.98, response time: 103.32ms (95%), errors: 0.00, reconnects:  0.00
[ 514s] threads: 32, tps: 349.00, reads: 4884.96, writes: 1389.99, response time: 159.38ms (95%), errors: 0.00, reconnects:  0.00
[ 515s] threads: 32, tps: 317.73, reads: 4393.31, writes: 1173.01, response time: 182.85ms (95%), errors: 0.00, reconnects:  0.00
[ 516s] threads: 32, tps: 373.32, reads: 5281.47, writes: 1589.35, response time: 119.36ms (95%), errors: 0.00, reconnects:  0.00
[ 517s] threads: 32, tps: 386.00, reads: 5405.02, writes: 1551.00, response time: 115.39ms (95%), errors: 0.00, reconnects:  0.00
[ 518s] threads: 32, tps: 341.00, reads: 4590.94, writes: 1255.98, response time: 158.62ms (95%), errors: 0.00, reconnects:  0.00
[ 519s] threads: 32, tps: 357.01, reads: 4980.11, writes: 1415.03, response time: 116.39ms (95%), errors: 0.00, reconnects:  0.00
[ 520s] threads: 32, tps: 389.00, reads: 5605.00, writes: 1612.00, response time: 107.68ms (95%), errors: 0.00, reconnects:  0.00
[ 521s] threads: 32, tps: 341.00, reads: 4706.99, writes: 1353.00, response time: 131.75ms (95%), errors: 0.00, reconnects:  0.00
[ 522s] threads: 32, tps: 407.99, reads: 5784.90, writes: 1627.97, response time: 106.49ms (95%), errors: 0.00, reconnects:  0.00
[ 523s] threads: 32, tps: 370.01, reads: 5177.11, writes: 1527.03, response time: 114.56ms (95%), errors: 0.00, reconnects:  0.00
[ 524s] threads: 32, tps: 352.00, reads: 4641.99, writes: 1322.00, response time: 155.93ms (95%), errors: 0.00, reconnects:  0.00
[ 525s] threads: 32, tps: 360.00, reads: 5265.99, writes: 1468.00, response time: 121.67ms (95%), errors: 0.00, reconnects:  0.00
[ 526s] threads: 32, tps: 320.99, reads: 4554.88, writes: 1270.97, response time: 139.63ms (95%), errors: 0.00, reconnects:  0.00
[ 527s] threads: 32, tps: 290.01, reads: 3888.11, writes: 1140.03, response time: 339.38ms (95%), errors: 0.00, reconnects:  0.00
[ 528s] threads: 32, tps: 395.44, reads: 5621.02, writes: 1607.72, response time: 107.97ms (95%), errors: 0.00, reconnects:  0.00
[ 529s] threads: 32, tps: 342.48, reads: 4823.72, writes: 1375.92, response time: 141.52ms (95%), errors: 0.00, reconnects:  0.00
[ 530s] threads: 32, tps: 267.00, reads: 3779.03, writes: 1083.01, response time: 170.53ms (95%), errors: 0.00, reconnects:  0.00
[ 531s] threads: 32, tps: 367.01, reads: 5163.08, writes: 1452.02, response time: 120.51ms (95%), errors: 0.00, reconnects:  0.00
[ 532s] threads: 32, tps: 314.00, reads: 4425.96, writes: 1348.99, response time: 232.33ms (95%), errors: 0.00, reconnects:  0.00
[ 533s] threads: 32, tps: 342.00, reads: 4675.06, writes: 1310.02, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[ 534s] threads: 32, tps: 406.99, reads: 5572.93, writes: 1566.98, response time: 107.29ms (95%), errors: 0.00, reconnects:  0.00
[ 535s] threads: 32, tps: 340.01, reads: 4842.07, writes: 1370.02, response time: 149.76ms (95%), errors: 0.00, reconnects:  0.00
[ 536s] threads: 32, tps: 282.99, reads: 3919.89, writes: 1121.97, response time: 171.92ms (95%), errors: 0.00, reconnects:  0.00
[ 537s] threads: 32, tps: 375.00, reads: 5410.06, writes: 1569.02, response time: 105.64ms (95%), errors: 0.00, reconnects:  0.00
[ 538s] threads: 32, tps: 368.00, reads: 5190.06, writes: 1522.02, response time: 125.93ms (95%), errors: 0.00, reconnects:  0.00
[ 539s] threads: 32, tps: 338.00, reads: 4578.04, writes: 1233.01, response time: 169.82ms (95%), errors: 0.00, reconnects:  0.00
[ 540s] threads: 32, tps: 354.00, reads: 4899.98, writes: 1421.99, response time: 143.23ms (95%), errors: 0.00, reconnects:  0.00
[ 541s] threads: 32, tps: 409.00, reads: 5767.01, writes: 1631.00, response time: 107.58ms (95%), errors: 0.00, reconnects:  0.00
[ 542s] threads: 32, tps: 314.00, reads: 4355.98, writes: 1255.99, response time: 159.90ms (95%), errors: 0.00, reconnects:  0.00
[ 543s] threads: 32, tps: 354.99, reads: 5150.88, writes: 1477.97, response time: 142.80ms (95%), errors: 0.00, reconnects:  0.00
[ 544s] threads: 32, tps: 417.00, reads: 5630.06, writes: 1628.02, response time: 106.14ms (95%), errors: 0.00, reconnects:  0.00
[ 545s] threads: 32, tps: 338.00, reads: 4926.07, writes: 1396.02, response time: 130.42ms (95%), errors: 0.00, reconnects:  0.00
[ 546s] threads: 32, tps: 385.00, reads: 5379.02, writes: 1505.01, response time: 119.61ms (95%), errors: 0.00, reconnects:  0.00
[ 547s] threads: 32, tps: 341.99, reads: 4798.90, writes: 1435.97, response time: 165.46ms (95%), errors: 0.00, reconnects:  0.00
[ 548s] threads: 32, tps: 321.01, reads: 4424.07, writes: 1185.02, response time: 156.78ms (95%), errors: 0.00, reconnects:  0.00
[ 549s] threads: 32, tps: 386.00, reads: 5448.98, writes: 1602.00, response time: 108.26ms (95%), errors: 0.00, reconnects:  0.00
[ 550s] threads: 32, tps: 396.00, reads: 5438.96, writes: 1580.99, response time: 104.79ms (95%), errors: 0.00, reconnects:  0.00
[ 551s] threads: 32, tps: 362.01, reads: 5071.07, writes: 1412.02, response time: 128.40ms (95%), errors: 0.00, reconnects:  0.00
[ 552s] threads: 32, tps: 387.00, reads: 5341.96, writes: 1523.99, response time: 116.32ms (95%), errors: 0.00, reconnects:  0.00
[ 553s] threads: 32, tps: 389.00, reads: 5543.97, writes: 1592.99, response time: 116.85ms (95%), errors: 0.00, reconnects:  0.00
[ 554s] threads: 32, tps: 252.00, reads: 3662.98, writes: 1058.99, response time: 175.82ms (95%), errors: 0.00, reconnects:  0.00
[ 555s] threads: 32, tps: 397.01, reads: 5374.08, writes: 1536.02, response time: 124.58ms (95%), errors: 0.00, reconnects:  0.00
[ 556s] threads: 32, tps: 357.00, reads: 5110.99, writes: 1411.00, response time: 142.37ms (95%), errors: 0.00, reconnects:  0.00
[ 557s] threads: 32, tps: 250.00, reads: 3397.96, writes: 988.99, response time: 309.95ms (95%), errors: 0.00, reconnects:  0.00
[ 558s] threads: 32, tps: 378.01, reads: 5371.11, writes: 1553.03, response time: 118.89ms (95%), errors: 0.00, reconnects:  0.00
[ 559s] threads: 32, tps: 389.00, reads: 5492.99, writes: 1543.00, response time: 114.08ms (95%), errors: 0.00, reconnects:  0.00
[ 560s] threads: 32, tps: 342.00, reads: 4722.99, writes: 1339.00, response time: 131.71ms (95%), errors: 0.00, reconnects:  0.00
[ 561s] threads: 32, tps: 357.99, reads: 5099.91, writes: 1521.97, response time: 126.12ms (95%), errors: 0.00, reconnects:  0.00
[ 562s] threads: 32, tps: 414.99, reads: 5505.87, writes: 1562.96, response time: 110.42ms (95%), errors: 0.00, reconnects:  0.00
[ 563s] threads: 32, tps: 272.01, reads: 4003.16, writes: 1088.04, response time: 165.70ms (95%), errors: 0.00, reconnects:  0.00
[ 564s] threads: 32, tps: 401.96, reads: 5625.48, writes: 1620.85, response time: 107.26ms (95%), errors: 0.00, reconnects:  0.00
[ 565s] threads: 32, tps: 378.03, reads: 5381.39, writes: 1545.11, response time: 114.87ms (95%), errors: 0.00, reconnects:  0.00
[ 566s] threads: 32, tps: 264.99, reads: 3767.91, writes: 1140.97, response time: 170.94ms (95%), errors: 0.00, reconnects:  0.00
[ 567s] threads: 32, tps: 399.01, reads: 5519.10, writes: 1545.03, response time: 159.81ms (95%), errors: 0.00, reconnects:  0.00
[ 568s] threads: 32, tps: 408.00, reads: 5672.05, writes: 1609.02, response time: 109.34ms (95%), errors: 0.00, reconnects:  0.00
[ 569s] threads: 32, tps: 309.99, reads: 4315.93, writes: 1221.98, response time: 162.36ms (95%), errors: 0.00, reconnects:  0.00
[ 570s] threads: 32, tps: 403.01, reads: 5680.12, writes: 1617.03, response time: 104.66ms (95%), errors: 0.00, reconnects:  0.00
[ 571s] threads: 32, tps: 401.99, reads: 5602.89, writes: 1602.97, response time: 109.14ms (95%), errors: 0.00, reconnects:  0.00
[ 572s] threads: 32, tps: 319.00, reads: 4349.06, writes: 1281.02, response time: 202.02ms (95%), errors: 0.00, reconnects:  0.00
[ 573s] threads: 32, tps: 402.01, reads: 5696.10, writes: 1580.03, response time: 102.58ms (95%), errors: 0.00, reconnects:  0.00
[ 574s] threads: 32, tps: 380.00, reads: 5344.94, writes: 1529.98, response time: 114.70ms (95%), errors: 0.00, reconnects:  0.00
[ 575s] threads: 32, tps: 320.00, reads: 4604.00, writes: 1351.00, response time: 137.55ms (95%), errors: 0.00, reconnects:  0.00
[ 576s] threads: 32, tps: 364.00, reads: 4962.98, writes: 1363.99, response time: 169.47ms (95%), errors: 0.00, reconnects:  0.00
[ 577s] threads: 32, tps: 388.00, reads: 5480.02, writes: 1599.01, response time: 114.80ms (95%), errors: 0.00, reconnects:  0.00
[ 578s] threads: 32, tps: 309.00, reads: 4316.05, writes: 1210.01, response time: 192.57ms (95%), errors: 0.00, reconnects:  0.00
[ 579s] threads: 32, tps: 398.00, reads: 5648.01, writes: 1652.00, response time: 102.58ms (95%), errors: 0.00, reconnects:  0.00
[ 580s] threads: 32, tps: 359.00, reads: 5009.00, writes: 1408.00, response time: 129.44ms (95%), errors: 0.00, reconnects:  0.00
[ 581s] threads: 32, tps: 306.00, reads: 4269.93, writes: 1234.98, response time: 198.07ms (95%), errors: 0.00, reconnects:  0.00
[ 582s] threads: 32, tps: 399.01, reads: 5489.09, writes: 1536.02, response time: 117.66ms (95%), errors: 0.00, reconnects:  0.00
[ 583s] threads: 32, tps: 396.00, reads: 5557.00, writes: 1612.00, response time: 103.72ms (95%), errors: 0.00, reconnects:  0.00
[ 584s] threads: 32, tps: 328.00, reads: 4709.00, writes: 1331.00, response time: 147.75ms (95%), errors: 0.00, reconnects:  0.00
[ 585s] threads: 32, tps: 385.99, reads: 5346.92, writes: 1548.98, response time: 121.74ms (95%), errors: 0.00, reconnects:  0.00
[ 586s] threads: 32, tps: 392.95, reads: 5418.35, writes: 1550.81, response time: 109.04ms (95%), errors: 0.00, reconnects:  0.00
[ 587s] threads: 32, tps: 288.00, reads: 4045.05, writes: 1140.01, response time: 292.82ms (95%), errors: 0.00, reconnects:  0.00
[ 588s] threads: 32, tps: 424.04, reads: 5822.59, writes: 1704.17, response time: 104.28ms (95%), errors: 0.00, reconnects:  0.00
[ 589s] threads: 32, tps: 384.99, reads: 5625.91, writes: 1570.97, response time: 105.48ms (95%), errors: 0.00, reconnects:  0.00
[ 590s] threads: 32, tps: 293.01, reads: 4088.08, writes: 1184.02, response time: 175.40ms (95%), errors: 0.00, reconnects:  0.00
[ 591s] threads: 32, tps: 398.87, reads: 5499.15, writes: 1588.47, response time: 109.30ms (95%), errors: 0.00, reconnects:  0.00
[ 592s] threads: 32, tps: 368.13, reads: 5275.86, writes: 1487.52, response time: 111.18ms (95%), errors: 0.00, reconnects:  0.00
[ 593s] threads: 32, tps: 320.00, reads: 4214.94, writes: 1208.98, response time: 149.71ms (95%), errors: 0.00, reconnects:  0.00
[ 594s] threads: 32, tps: 369.99, reads: 5391.92, writes: 1501.98, response time: 128.09ms (95%), errors: 0.00, reconnects:  0.00
[ 595s] threads: 32, tps: 422.01, reads: 5743.16, writes: 1660.05, response time: 104.79ms (95%), errors: 0.00, reconnects:  0.00
[ 596s] threads: 32, tps: 284.00, reads: 4063.01, writes: 1142.00, response time: 211.42ms (95%), errors: 0.00, reconnects:  0.00
[ 597s] threads: 32, tps: 362.99, reads: 4952.92, writes: 1439.98, response time: 148.91ms (95%), errors: 0.00, reconnects:  0.00
[ 598s] threads: 32, tps: 348.00, reads: 5008.07, writes: 1451.02, response time: 129.83ms (95%), errors: 0.00, reconnects:  0.00
[ 599s] threads: 32, tps: 289.00, reads: 4145.93, writes: 1152.98, response time: 202.44ms (95%), errors: 0.00, reconnects:  0.00
[ 600s] threads: 32, tps: 399.01, reads: 5461.11, writes: 1553.03, response time: 133.98ms (95%), errors: 0.00, reconnects:  0.00
OLTP test statistics:
    queries performed:
        read:                            2773638
        write:                           792468
        other:                           396234
        total:                           3962340
    transactions:                        198117 (330.16 per sec.)
    read/write requests:                 3566106 (5942.79 per sec.)
    other operations:                    396234 (660.31 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          600.0722s
    total number of events:              198117
    total time taken by event execution: 19200.3205s
    response time:
         min:                                 28.03ms
         avg:                                 96.91ms
         max:                               1212.17ms
         approx.  95 percentile:             157.20ms

Threads fairness:
    events (avg/stddev):           6191.1562/14.19
    execution time (avg/stddev):   600.0100/0.02

[oracle@sjjh admin]$ sysbench --test=/sysbench-0.5/tests/db/oltp.lua --db-driver=oracle --oltp-table-name=sysbench --oltp-table-size=250000 --oltp-tables-count=25 --oracle-db=sjjh --oracle-user=sysbench --oracle-password=sysbench --max-time=600 --max-requests=10000000 --num-threads=32 --report-interval=1 cleanup
sysbench 0.5:  multi-threaded system evaluation benchmark

Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...
Dropping table 'sbtest5'...
Dropping table 'sbtest6'...
Dropping table 'sbtest7'...
Dropping table 'sbtest8'...
Dropping table 'sbtest9'...
Dropping table 'sbtest10'...
Dropping table 'sbtest11'...
Dropping table 'sbtest12'...
Dropping table 'sbtest13'...
Dropping table 'sbtest14'...
Dropping table 'sbtest15'...
Dropping table 'sbtest16'...
Dropping table 'sbtest17'...
Dropping table 'sbtest18'...
Dropping table 'sbtest19'...
Dropping table 'sbtest20'...
Dropping table 'sbtest21'...
Dropping table 'sbtest22'...
Dropping table 'sbtest23'...
Dropping table 'sbtest24'...
Dropping table 'sbtest25'...
]]>
http://www.jydba.net/index.php/archives/3453/feed 0
sysbench压测Oracle 12C http://www.jydba.net/index.php/archives/3451 http://www.jydba.net/index.php/archives/3451#respond Tue, 14 Feb 2023 03:42:44 +0000 http://www.jydba.net/?p=3451 sysbench压测Oracle 12C

sysbench是一款测试工具主要包括以下几种方式的测试:
1、cpu性能
2、磁盘io性能
3、调度程式性能
4、内存分配及传输速度
5、POSIX线程性能
6、数据库性能(OLTP基准测试)现在sysbench主要支持 MySQL,pgsql,oracle 这3种数据库,默认支持MySQL,想要支持pgsql和oracle需要在编译时指定参数

环境介绍

名称	             版本
sysbench软件版本	sysbench 0.5
操作系统	        oracle linux 7.1
Oracle	          12.2.0.1

安装
1.安装依赖包

[root@shard1 /]# yum -y install make m4  autoconf automake libtool pkgconfig libaio-devel

2.解压sysbench软件

[root@shard1 /]# unzip sysbench-0.5.zip
Archive:  sysbench-0.5.zip
b23a7db377916e424cb555108dc5f784f615993b
   creating: sysbench-0.5/
  inflating: sysbench-0.5/.gitignore
  inflating: sysbench-0.5/.travis.yml
  inflating: sysbench-0.5/COPYING
  inflating: sysbench-0.5/ChangeLog
  inflating: sysbench-0.5/Makefile.am
  inflating: sysbench-0.5/README-WIN.txt
  inflating: sysbench-0.5/README.md
 extracting: sysbench-0.5/TODO
  inflating: sysbench-0.5/autogen.sh
   creating: sysbench-0.5/config/
  inflating: sysbench-0.5/config/config.rpath
  inflating: sysbench-0.5/configure.ac
   creating: sysbench-0.5/doc/
  inflating: sysbench-0.5/doc/Makefile.am
  inflating: sysbench-0.5/doc/manual.xml
   creating: sysbench-0.5/doc/xsl/
  inflating: sysbench-0.5/doc/xsl/Makefile.am
  inflating: sysbench-0.5/doc/xsl/catalog.xml.in
  inflating: sysbench-0.5/doc/xsl/xhtml-chunk.xsl
  inflating: sysbench-0.5/doc/xsl/xhtml-common.xsl
  inflating: sysbench-0.5/doc/xsl/xhtml.xsl
  inflating: sysbench-0.5/install-sh
   creating: sysbench-0.5/m4/
  inflating: sysbench-0.5/m4/ac_check_aio.m4
  inflating: sysbench-0.5/m4/ac_check_mysqlr.m4
  inflating: sysbench-0.5/m4/ac_check_pgsql.m4
  inflating: sysbench-0.5/m4/ac_lua_devel.m4
  inflating: sysbench-0.5/m4/acx_pthread.m4
  inflating: sysbench-0.5/m4/ax_check_docbook.m4
  inflating: sysbench-0.5/m4/extensions.m4
  inflating: sysbench-0.5/m4/lib-ld.m4
  inflating: sysbench-0.5/m4/lib-link.m4
  inflating: sysbench-0.5/m4/lib-prefix.m4
  inflating: sysbench-0.5/missing
  inflating: sysbench-0.5/mkinstalldirs
   creating: sysbench-0.5/sysbench/
  inflating: sysbench-0.5/sysbench/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/Makefile.am
  inflating: sysbench-0.5/sysbench/db_driver.c
  inflating: sysbench-0.5/sysbench/db_driver.h
   creating: sysbench-0.5/sysbench/drivers/
  inflating: sysbench-0.5/sysbench/drivers/Makefile.am
   creating: sysbench-0.5/sysbench/drivers/attachsql/
  inflating: sysbench-0.5/sysbench/drivers/attachsql/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/attachsql/drv_attachsql.c
   creating: sysbench-0.5/sysbench/drivers/drizzle/
  inflating: sysbench-0.5/sysbench/drivers/drizzle/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/drizzle/drv_drizzle.c
   creating: sysbench-0.5/sysbench/drivers/mysql/
  inflating: sysbench-0.5/sysbench/drivers/mysql/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/drivers/mysql/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/mysql/drv_mysql.c
   creating: sysbench-0.5/sysbench/drivers/oracle/
  inflating: sysbench-0.5/sysbench/drivers/oracle/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/oracle/drv_oracle.c
   creating: sysbench-0.5/sysbench/drivers/pgsql/
  inflating: sysbench-0.5/sysbench/drivers/pgsql/Makefile.am
  inflating: sysbench-0.5/sysbench/drivers/pgsql/drv_pgsql.c
  inflating: sysbench-0.5/sysbench/sb_barrier.c
  inflating: sysbench-0.5/sysbench/sb_barrier.h
  inflating: sysbench-0.5/sysbench/sb_list.h
  inflating: sysbench-0.5/sysbench/sb_logger.c
  inflating: sysbench-0.5/sysbench/sb_logger.h
  inflating: sysbench-0.5/sysbench/sb_options.c
  inflating: sysbench-0.5/sysbench/sb_options.h
  inflating: sysbench-0.5/sysbench/sb_percentile.c
  inflating: sysbench-0.5/sysbench/sb_percentile.h
  inflating: sysbench-0.5/sysbench/sb_timer.c
  inflating: sysbench-0.5/sysbench/sb_timer.h
  inflating: sysbench-0.5/sysbench/sb_win.c
  inflating: sysbench-0.5/sysbench/sb_win.h
   creating: sysbench-0.5/sysbench/scripting/
  inflating: sysbench-0.5/sysbench/scripting/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/scripting/Makefile.am
   creating: sysbench-0.5/sysbench/scripting/lua/
  inflating: sysbench-0.5/sysbench/scripting/lua/COPYRIGHT
  inflating: sysbench-0.5/sysbench/scripting/lua/Makefile.am
  inflating: sysbench-0.5/sysbench/scripting/lua/README
   creating: sysbench-0.5/sysbench/scripting/lua/src/
  inflating: sysbench-0.5/sysbench/scripting/lua/src/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/scripting/lua/src/Makefile.am
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lapi.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lapi.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lauxlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lauxlib.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lbaselib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lcode.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lcode.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldblib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldebug.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldebug.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldo.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldo.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ldump.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lfunc.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lfunc.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lgc.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lgc.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/linit.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/liolib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/llex.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/llex.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/llimits.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lmathlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lmem.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lmem.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/loadlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lobject.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lobject.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lopcodes.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lopcodes.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/loslib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lparser.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lparser.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstate.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstate.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstring.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstring.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lstrlib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltable.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltable.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltablib.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltm.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/ltm.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lua.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/luaconf.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lualib.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lundump.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lundump.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lvm.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lvm.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lzio.c
  inflating: sysbench-0.5/sysbench/scripting/lua/src/lzio.h
  inflating: sysbench-0.5/sysbench/scripting/lua/src/print.c
  inflating: sysbench-0.5/sysbench/scripting/sb_script.c
  inflating: sysbench-0.5/sysbench/scripting/sb_script.h
  inflating: sysbench-0.5/sysbench/scripting/script_lua.c
  inflating: sysbench-0.5/sysbench/scripting/script_lua.h
  inflating: sysbench-0.5/sysbench/sysbench.c
  inflating: sysbench-0.5/sysbench/sysbench.h
   creating: sysbench-0.5/sysbench/tests/
  inflating: sysbench-0.5/sysbench/tests/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/Makefile.am
   creating: sysbench-0.5/sysbench/tests/cpu/
  inflating: sysbench-0.5/sysbench/tests/cpu/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/cpu/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/cpu/sb_cpu.c
   creating: sysbench-0.5/sysbench/tests/db/
  inflating: sysbench-0.5/sysbench/tests/db/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/db/bulk_insert.lua
  inflating: sysbench-0.5/sysbench/tests/db/common.lua
  inflating: sysbench-0.5/sysbench/tests/db/delete.lua
  inflating: sysbench-0.5/sysbench/tests/db/insert.lua
  inflating: sysbench-0.5/sysbench/tests/db/oltp.lua
  inflating: sysbench-0.5/sysbench/tests/db/oltp_simple.lua
  inflating: sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
  inflating: sysbench-0.5/sysbench/tests/db/select.lua
  inflating: sysbench-0.5/sysbench/tests/db/select_random_points.lua
  inflating: sysbench-0.5/sysbench/tests/db/select_random_ranges.lua
  inflating: sysbench-0.5/sysbench/tests/db/update_index.lua
  inflating: sysbench-0.5/sysbench/tests/db/update_non_index.lua
   creating: sysbench-0.5/sysbench/tests/fileio/
  inflating: sysbench-0.5/sysbench/tests/fileio/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/fileio/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/fileio/crc32.c
  inflating: sysbench-0.5/sysbench/tests/fileio/crc32.h
  inflating: sysbench-0.5/sysbench/tests/fileio/crc32tbl.h
  inflating: sysbench-0.5/sysbench/tests/fileio/sb_fileio.c
   creating: sysbench-0.5/sysbench/tests/memory/
  inflating: sysbench-0.5/sysbench/tests/memory/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/memory/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/memory/sb_memory.c
   creating: sysbench-0.5/sysbench/tests/mutex/
  inflating: sysbench-0.5/sysbench/tests/mutex/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/mutex/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/mutex/sb_mutex.c
  inflating: sysbench-0.5/sysbench/tests/sb_cpu.h
  inflating: sysbench-0.5/sysbench/tests/sb_fileio.h
  inflating: sysbench-0.5/sysbench/tests/sb_memory.h
  inflating: sysbench-0.5/sysbench/tests/sb_mutex.h
  inflating: sysbench-0.5/sysbench/tests/sb_threads.h
   creating: sysbench-0.5/sysbench/tests/threads/
  inflating: sysbench-0.5/sysbench/tests/threads/CMakeLists.txt
  inflating: sysbench-0.5/sysbench/tests/threads/Makefile.am
  inflating: sysbench-0.5/sysbench/tests/threads/sb_threads.c
   creating: sysbench-0.5/tests/
  inflating: sysbench-0.5/tests/Makefile.am
  inflating: sysbench-0.5/tests/README.md
   creating: sysbench-0.5/tests/include/
  inflating: sysbench-0.5/tests/include/config.sh.in
  inflating: sysbench-0.5/tests/include/drv_common.sh
  inflating: sysbench-0.5/tests/include/script_oltp_common.sh
   creating: sysbench-0.5/tests/t/
 extracting: sysbench-0.5/tests/t/1st.t
  inflating: sysbench-0.5/tests/t/api_basic.t
  inflating: sysbench-0.5/tests/t/api_rand.t
  inflating: sysbench-0.5/tests/t/api_sql.t
  inflating: sysbench-0.5/tests/t/cleanup.t
  inflating: sysbench-0.5/tests/t/commands.t
  inflating: sysbench-0.5/tests/t/drivers.t
  inflating: sysbench-0.5/tests/t/drv_mysql.t
  inflating: sysbench-0.5/tests/t/drv_pgsql.t
  inflating: sysbench-0.5/tests/t/help.t
  inflating: sysbench-0.5/tests/t/help_drv_mysql.t
  inflating: sysbench-0.5/tests/t/help_drv_pgsql.t
  inflating: sysbench-0.5/tests/t/prepare.t
  inflating: sysbench-0.5/tests/t/run.t
  inflating: sysbench-0.5/tests/t/script_oltp_mysql.t
  inflating: sysbench-0.5/tests/t/script_oltp_pgsql.t
  inflating: sysbench-0.5/tests/t/test_cpu.t
  inflating: sysbench-0.5/tests/t/test_fileio.t
  inflating: sysbench-0.5/tests/t/test_memory.t
  inflating: sysbench-0.5/tests/t/test_mutex.t
  inflating: sysbench-0.5/tests/t/test_threads.t
  inflating: sysbench-0.5/tests/t/tests.t
  inflating: sysbench-0.5/tests/t/version.t
  inflating: sysbench-0.5/tests/test_run.sh

3.配置环境变量,使用实际的ORACLE_HOME目录

export CC=cc
export CXX=c++
export CFLAGS="-m64 -I /u01/app/oracle/product/12.2.0/db/rdbms/public"
export CXXFLAGS="$CFLAGS"
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db
export LD_LIBRARY_PATH=/u01/app/oracle/product/12.2.0/db/lib

[root@shard1 /]# export CC=cc
[root@shard1 /]# export CXX=c++
[root@shard1 /]# export CFLAGS="-m64 -I /u01/app/oracle/product/12.2.0/db/rdbms/public"
[root@shard1 /]# export CXXFLAGS="$CFLAGS"
[root@shard1 /]# export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db
[root@shard1 /]# export LD_LIBRARY_PATH=/u01/app/oracle/product/12.2.0/db/lib

4.运行autogen.sh,生成configure目录

[root@shard1 sysbench-0.5]# ./autogen.sh
./autogen.sh: running `aclocal -I m4'
./autogen.sh: running `libtoolize --copy --force'
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
./autogen.sh: running `autoheader'
./autogen.sh: running `automake -c --foreign --add-missing'
configure.ac:27: installing 'config/ar-lib'
configure.ac:25: installing 'config/compile'
configure.ac:11: installing 'config/config.guess'
configure.ac:11: installing 'config/config.sub'
configure.ac:16: installing 'config/install-sh'
configure.ac:16: installing 'config/missing'
sysbench/Makefile.am: installing 'config/depcomp'
parallel-tests: installing 'config/test-driver'
./autogen.sh: running `autoconf'
Libtoolized with: libtoolize (GNU libtool) 2.4.2
Automade with: automake (GNU automake) 1.13.4
Configured with: autoconf (GNU Autoconf) 2.69

5.编译参数配置,加上–with-oracle

[root@shard1 sysbench-0.5]# ./configure --with-oracle --libdir=/u01/app/oracle/product/12.2.0/db/lib --without-mysql
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking dependency style of cc... gcc3
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) cc
checking whether we are using the GNU C compiler... (cached) yes
checking whether cc accepts -g... (cached) yes
checking for cc option to accept ISO C89... (cached) none needed
checking dependency style of cc... (cached) gcc3
checking how to run the C preprocessor... cc -E
checking whether cc understands -c and -o together... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether __SUNPRO_C is declared... no
checking "C Compiler version"... "cc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)"
checking whether to compile with MySQL support... (cached) no
checking whether to compile with Drizzle support... (cached) yes
checking whether to compile with libattachsql support... (cached) yes
checking whether to compile with Oracle support... (cached) yes
checking whether to compile with PostgreSQL support... (cached) no
checking whether to compile with Lua support... (cached) yes
checking whether SHM_HUGETLB is declared... yes
checking whether O_SYNC is declared... yes
checking for xsltproc... xsltproc
checking whether xsltproc works... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for sqrt in -lm... yes
checking for ld used by GCC... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for libdrizzle... no
checking for libattachsql... no
checking libaio.h usability... yes
checking libaio.h presence... yes
checking for libaio.h... yes
checking for io_queue_init in -laio... yes
checking if io_getevents() has an old interface... no
checking for malloc in -lumem... no
checking for malloc in -lmtmalloc... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/aio.h usability... no
checking sys/aio.h presence... no
checking for sys/aio.h... no
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking thread.h usability... no
checking thread.h presence... no
checking for thread.h... no
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for inline... inline
checking for off_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking size of size_t... 8
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether strerror_r is declared... yes
checking for strerror_r... yes
checking whether strerror_r returns char *... yes
checking whether clock_gettime is declared... yes
checking for library containing clock_gettime... none required
checking for alarm... yes
checking for directio... no
checking for fdatasync... yes
checking for gettimeofday... yes
checking for lrand48... yes
checking for drand48... yes
checking for memalign... yes
checking for memset... yes
checking for mkstemp... yes
checking for popen... yes
checking for posix_memalign... yes
checking for pthread_yield... yes
checking for _setjmp... yes
checking for setvbuf... yes
checking for sqrt... yes
checking for strdup... yes
checking for thr_setconcurrency... no
checking for valloc... yes
checking for pthread_once... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/xsl/Makefile
config.status: creating doc/xsl/catalog.xml
config.status: creating doc/Makefile
config.status: creating sysbench/Makefile
config.status: creating sysbench/drivers/Makefile
config.status: creating sysbench/drivers/mysql/Makefile
config.status: creating sysbench/drivers/drizzle/Makefile
config.status: creating sysbench/drivers/oracle/Makefile
config.status: creating sysbench/drivers/pgsql/Makefile
config.status: creating sysbench/drivers/attachsql/Makefile
config.status: creating sysbench/tests/Makefile
config.status: creating sysbench/tests/cpu/Makefile
config.status: creating sysbench/tests/fileio/Makefile
config.status: creating sysbench/tests/memory/Makefile
config.status: creating sysbench/tests/threads/Makefile
config.status: creating sysbench/tests/mutex/Makefile
config.status: creating sysbench/tests/db/Makefile
config.status: creating sysbench/scripting/Makefile
config.status: creating sysbench/scripting/lua/Makefile
config.status: creating sysbench/scripting/lua/src/Makefile
config.status: creating tests/Makefile
config.status: creating tests/include/config.sh
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

6.编译及安装,注意这里要带上oracle的一个so

[oracle@shard1 lib]$ pwd
/u01/app/oracle/product/12.2.0/db/lib
[oracle@shard1 lib]$ ls -lrt libclntsh.so
lrwxrwxrwx. 1 oracle oinstall 17 102 2017 libclntsh.so -> libclntsh.so.12.1


[root@shard1 sysbench-0.5]# make ORA_LIBS=/u01/app/oracle/product/12.2.0/db/lib/libclntsh.so -j 4
[root@shard1 sysbench-0.5]# make install

[root@shard1 sysbench-0.5]# which sysbench
/usr/local/bin/sysbench

7.设置sysbench到path环境变量

[root@shard1 sysbench-0.5]# echo "export PATH=$PATH:/usr/local/sysbench/bin">>/etc/profile
[root@shard1 sysbench-0.5]# source /etc/profile

8.验证安装是否成功

[oracle@shard1 ~]$ sysbench
Missing required command argument.
Usage:
  sysbench --test= [options]... 

Commands: prepare run cleanup help version

General options:
  --num-threads=N             number of threads to use [1]
  --max-requests=N            limit for total number of requests [10000]
  --max-time=N                limit for total execution time in seconds [0]
  --forced-shutdown=STRING    amount of time to wait after --max-time before forcing shutdown [off]
  --thread-stack-size=SIZE    size of stack per thread [64K]
  --tx-rate=N                 target transaction rate (tps) [0]
  --report-interval=N         periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
  --report-checkpoints=[LIST,...]dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []
  --test=STRING               test to run
  --debug=[on|off]            print more debugging info [off]
  --validate=[on|off]         perform validation checks where possible [off]
  --help=[on|off]             print help and exit
  --version=[on|off]          print version and exit [off]
  --rand-init=[on|off]        initialize random number generator [off]
  --rand-type=STRING          random numbers distribution {uniform,gaussian,special,pareto} [special]
  --rand-spec-iter=N          number of iterations used for numbers generation [12]
  --rand-spec-pct=N           percentage of values to be treated as 'special' (for special distribution) [1]
  --rand-spec-res=N           percentage of 'special' values to use (for special distribution) [75]
  --rand-seed=N               seed for random number generator, ignored when 0 [0]
  --rand-pareto-h=N           parameter h for pareto distibution [0.2]
  --config-file=FILENAME      File containing command line options

Log options:
  --verbosity=N      verbosity level {5 - debug, 0 - only critical messages} [3]

  --percentile=N      percentile rank of query response times to count [95]

General database options:

  --db-driver=STRING  specifies database driver to use ('help' to get list of available drivers)
  --db-ps-mode=STRING prepared statements usage mode {auto, disable} [auto]
  --db-debug=[on|off] print database-specific debug information [off]


Compiled-in database drivers:
  oracle - Oracle driver

oracle options:
  --oracle-user=STRING     Oracle user [sbtest]
  --oracle-password=STRING Oracle password []
  --oracle-db=STRING       Oracle database name [sbtest]

Compiled-in tests:
  fileio - File I/O test
  cpu - CPU performance test
  memory - Memory functions speed test
  threads - Threads subsystem performance test
  mutex - Mutex performance test

See 'sysbench --test= help' for a list of options for each test.

9.将.lua文件存储在sysbench-0.5/tests/db

[root@shard1 /]# unzip sysbench_lua-master.zip
Archive:  sysbench_lua-master.zip
f2ceb6cdf7315dbb8dd5f43d9c6757320a80a270
   creating: sysbench_lua-master/
  inflating: sysbench_lua-master/README.md
   creating: sysbench_lua-master/lua/
  inflating: sysbench_lua-master/lua/common.lua
  inflating: sysbench_lua-master/lua/delete.lua
  inflating: sysbench_lua-master/lua/insert.lua
  inflating: sysbench_lua-master/lua/oltp.lua
  inflating: sysbench_lua-master/lua/oltp_simple.lua
  inflating: sysbench_lua-master/lua/parallel_prepare.lua
  inflating: sysbench_lua-master/lua/select.lua
  inflating: sysbench_lua-master/lua/select_ora.lua
  inflating: sysbench_lua-master/lua/select_random_points.lua
  inflating: sysbench_lua-master/lua/select_random_ranges.lua
  inflating: sysbench_lua-master/lua/update_index.lua
  inflating: sysbench_lua-master/lua/update_index_ora.lua
  inflating: sysbench_lua-master/lua/update_index_pg_with_prepare.lua
  inflating: sysbench_lua-master/lua/update_index_with_commit.lua
  inflating: sysbench_lua-master/lua/update_non_index.lua
  inflating: sysbench_lua-master/lua/update_non_index_pg_with_prepare.lua
  inflating: sysbench_lua-master/lua/update_non_index_with_commit.lua

[root@shard1 db]#  cd /sysbench_lua-master/lua
[root@shard1 lua]# ls
common.lua  insert.lua  oltp_simple.lua       select.lua      select_random_points.lua  update_index.lua      update_index_pg_with_prepare.lua  update_non_index.lua                  update_non_index_with_commit.lua
delete.lua  oltp.lua    parallel_prepare.lua  select_ora.lua  select_random_ranges.lua  update_index_ora.lua  update_index_with_commit.lua      update_non_index_pg_with_prepare.lua
[root@shard1 lua]# cp *.lua /sysbench-0.5/tests/db/
[root@shard1 lua]# cd /sysbench-0.5/tests/db/
[root@shard1 db]# ls -lrt
2
-rw-r--r-- 1 root root  526 110 11:05 select_ora.lua
-rw-r--r-- 1 root root  343 110 11:05 select.lua
-rw-r--r-- 1 root root  425 110 11:05 parallel_prepare.lua
-rw-r--r-- 1 root root  342 110 11:05 oltp_simple.lua
-rw-r--r-- 1 root root 3139 110 11:05 oltp.lua
-rw-r--r-- 1 root root  830 110 11:05 insert.lua
-rw-r--r-- 1 root root  340 110 11:05 delete.lua
-rw-r--r-- 1 root root 4576 110 11:05 common.lua
-rw-r--r-- 1 root root  595 110 11:05 update_non_index_with_commit.lua
-rw-r--r-- 1 root root  640 110 11:05 update_non_index_pg_with_prepare.lua
-rw-r--r-- 1 root root  552 110 11:05 update_non_index.lua
-rw-r--r-- 1 root root  386 110 11:05 update_index_with_commit.lua
-rw-r--r-- 1 root root  496 110 11:05 update_index_pg_with_prepare.lua
-rw-r--r-- 1 root root  551 110 11:05 update_index_ora.lua
-rw-r--r-- 1 root root  343 110 11:05 update_index.lua
-rw-r--r-- 1 root root 4066 110 11:05 select_random_ranges.lua
-rw-r--r-- 1 root root 3964 110 11:05 select_random_points.lua

测试
1.创建测试用户

SQL> create user sysbench identified by sysbench default tablespace users;

User created.

SQL> grant connect,resource,dba to sysbench;

Grant succeeded.

2.准备数据,lua文件需要指定绝对路径 需要进去oracle用户,并且数据库TNS配置在tnsnames.ora中

[oracle@shard1 admin]$ cat tnsnames.ora
SHARDCAT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = shard1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = shardcat)
    )
  )


[oracle@sjjh admin]$ sysbench --test=/sysbench-0.5/tests/db/oltp.lua --db-driver=oracle --oltp-table-name=sysbench --oltp-table-size=250000 --oltp-tables-count=25 --oracle-db=sjjh --oracle-user=sysbench --oracle-password=sysbench --max-time=600 --max-requests=10000000 --num-threads=32 --report-interval=1 prepare
sysbench 0.5:  multi-threaded system evaluation benchmark

Creating table 'sbtest1'...
Inserting 250000 records into 'sbtest1'
Creating table 'sbtest2'...
Inserting 250000 records into 'sbtest2'
Creating table 'sbtest3'...
Inserting 250000 records into 'sbtest3'
Creating table 'sbtest4'...
Inserting 250000 records into 'sbtest4'
Creating table 'sbtest5'...
Inserting 250000 records into 'sbtest5'
Creating table 'sbtest6'...
Inserting 250000 records into 'sbtest6'
Creating table 'sbtest7'...
Inserting 250000 records into 'sbtest7'
Creating table 'sbtest8'...
Inserting 250000 records into 'sbtest8'
Creating table 'sbtest9'...
Inserting 250000 records into 'sbtest9'
Creating table 'sbtest10'...
Inserting 250000 records into 'sbtest10'
Creating table 'sbtest11'...
Inserting 250000 records into 'sbtest11'
Creating table 'sbtest12'...
Inserting 250000 records into 'sbtest12'
Creating table 'sbtest13'...
Inserting 250000 records into 'sbtest13'
Creating table 'sbtest14'...
Inserting 250000 records into 'sbtest14'
Creating table 'sbtest15'...
Inserting 250000 records into 'sbtest15'
Creating table 'sbtest16'...
Inserting 250000 records into 'sbtest16'
Creating table 'sbtest17'...
Inserting 250000 records into 'sbtest17'
Creating table 'sbtest18'...
Inserting 250000 records into 'sbtest18'
Creating table 'sbtest19'...
Inserting 250000 records into 'sbtest19'
Creating table 'sbtest20'...
Inserting 250000 records into 'sbtest20'
Creating table 'sbtest21'...
Inserting 250000 records into 'sbtest21'
Creating table 'sbtest22'...
Inserting 250000 records into 'sbtest22'
Creating table 'sbtest23'...
Inserting 250000 records into 'sbtest23'
Creating table 'sbtest24'...
Inserting 250000 records into 'sbtest24'
Creating table 'sbtest25'...
Inserting 250000 records into 'sbtest25'

[oracle@sjjh admin]$ sysbench --test=/sysbench-0.5/tests/db/oltp.lua --db-driver=oracle --oltp-table-name=sysbench --oltp-table-size=250000 --oltp-tables-count=25 --oracle-db=sjjh --oracle-user=sysbench --oracle-password=sysbench --max-time=600 --max-requests=10000000 --num-threads=32 --report-interval=1 run
sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 32
Report intermediate results every 1 second(s)
Random number generator seed is 0 and will be ignored


Initializing worker threads...

Threads started!

[   1s] threads: 32, tps: 193.63, reads: 2939.43, writes: 792.50, response time: 381.18ms (95%), errors: 0.00, reconnects:  0.00
[   2s] threads: 32, tps: 254.03, reads: 3611.49, writes: 1015.14, response time: 181.98ms (95%), errors: 0.00, reconnects:  0.00
[   3s] threads: 32, tps: 267.99, reads: 3887.91, writes: 1105.97, response time: 156.17ms (95%), errors: 0.00, reconnects:  0.00
[   4s] threads: 32, tps: 295.00, reads: 3854.02, writes: 1129.00, response time: 150.21ms (95%), errors: 0.00, reconnects:  0.00
[   5s] threads: 32, tps: 270.00, reads: 3867.02, writes: 1105.00, response time: 153.39ms (95%), errors: 0.00, reconnects:  0.00
[   6s] threads: 32, tps: 271.00, reads: 3825.97, writes: 1099.99, response time: 153.76ms (95%), errors: 0.00, reconnects:  0.00
[   7s] threads: 32, tps: 267.01, reads: 3880.10, writes: 1091.03, response time: 174.88ms (95%), errors: 0.00, reconnects:  0.00
[   8s] threads: 32, tps: 289.99, reads: 4054.90, writes: 1143.97, response time: 141.61ms (95%), errors: 0.00, reconnects:  0.00
[   9s] threads: 32, tps: 279.00, reads: 3897.03, writes: 1127.01, response time: 190.62ms (95%), errors: 0.00, reconnects:  0.00
[  10s] threads: 32, tps: 268.00, reads: 3746.98, writes: 1074.99, response time: 201.17ms (95%), errors: 0.00, reconnects:  0.00
[  11s] threads: 32, tps: 297.99, reads: 3987.83, writes: 1136.95, response time: 147.84ms (95%), errors: 0.00, reconnects:  0.00
[  12s] threads: 32, tps: 297.01, reads: 4255.20, writes: 1208.06, response time: 142.07ms (95%), errors: 0.00, reconnects:  0.00
[  13s] threads: 32, tps: 304.96, reads: 4248.48, writes: 1225.85, response time: 145.12ms (95%), errors: 0.00, reconnects:  0.00
[  14s] threads: 32, tps: 296.04, reads: 4177.59, writes: 1185.17, response time: 144.60ms (95%), errors: 0.00, reconnects:  0.00
[  15s] threads: 32, tps: 302.99, reads: 4357.84, writes: 1256.95, response time: 148.51ms (95%), errors: 0.00, reconnects:  0.00
[  16s] threads: 32, tps: 298.01, reads: 4097.07, writes: 1166.02, response time: 194.31ms (95%), errors: 0.00, reconnects:  0.00
[  17s] threads: 32, tps: 311.00, reads: 4312.98, writes: 1202.99, response time: 132.82ms (95%), errors: 0.00, reconnects:  0.00
[  18s] threads: 32, tps: 274.00, reads: 3973.01, writes: 1202.00, response time: 151.43ms (95%), errors: 0.00, reconnects:  0.00
[  19s] threads: 32, tps: 300.00, reads: 4070.02, writes: 1101.01, response time: 179.71ms (95%), errors: 0.00, reconnects:  0.00
[  20s] threads: 32, tps: 306.00, reads: 4347.07, writes: 1270.02, response time: 144.78ms (95%), errors: 0.00, reconnects:  0.00
[  21s] threads: 32, tps: 285.00, reads: 3910.99, writes: 1075.00, response time: 177.94ms (95%), errors: 0.00, reconnects:  0.00
[  22s] threads: 32, tps: 302.99, reads: 4350.84, writes: 1249.96, response time: 151.79ms (95%), errors: 0.00, reconnects:  0.00
[  23s] threads: 32, tps: 313.01, reads: 4256.07, writes: 1261.02, response time: 141.78ms (95%), errors: 0.00, reconnects:  0.00
[  24s] threads: 32, tps: 300.01, reads: 4042.08, writes: 1155.02, response time: 160.58ms (95%), errors: 0.00, reconnects:  0.00
[  25s] threads: 32, tps: 318.00, reads: 4708.94, writes: 1304.98, response time: 123.46ms (95%), errors: 0.00, reconnects:  0.00
[  26s] threads: 32, tps: 318.99, reads: 4360.92, writes: 1260.98, response time: 142.24ms (95%), errors: 0.00, reconnects:  0.00
[  27s] threads: 32, tps: 316.01, reads: 4531.16, writes: 1281.05, response time: 128.56ms (95%), errors: 0.00, reconnects:  0.00
[  28s] threads: 32, tps: 307.00, reads: 4296.94, writes: 1279.98, response time: 163.10ms (95%), errors: 0.00, reconnects:  0.00
[  29s] threads: 32, tps: 293.00, reads: 4101.96, writes: 1156.99, response time: 196.06ms (95%), errors: 0.00, reconnects:  0.00
[  30s] threads: 32, tps: 309.00, reads: 4371.06, writes: 1274.02, response time: 132.46ms (95%), errors: 0.00, reconnects:  0.00
[  31s] threads: 32, tps: 289.00, reads: 3932.93, writes: 1111.98, response time: 206.17ms (95%), errors: 0.00, reconnects:  0.00
[  32s] threads: 32, tps: 334.00, reads: 4695.96, writes: 1307.99, response time: 130.22ms (95%), errors: 0.00, reconnects:  0.00
[  33s] threads: 32, tps: 280.01, reads: 3995.12, writes: 1176.03, response time: 206.73ms (95%), errors: 0.00, reconnects:  0.00
[  34s] threads: 32, tps: 334.00, reads: 4484.98, writes: 1291.99, response time: 142.07ms (95%), errors: 0.00, reconnects:  0.00
[  35s] threads: 32, tps: 319.00, reads: 4671.97, writes: 1322.99, response time: 122.95ms (95%), errors: 0.00, reconnects:  0.00
[  36s] threads: 32, tps: 308.00, reads: 4333.04, writes: 1261.01, response time: 126.72ms (95%), errors: 0.00, reconnects:  0.00
[  37s] threads: 32, tps: 332.97, reads: 4528.63, writes: 1255.90, response time: 156.03ms (95%), errors: 0.00, reconnects:  0.00
[  38s] threads: 32, tps: 336.02, reads: 4702.32, writes: 1304.09, response time: 128.59ms (95%), errors: 0.00, reconnects:  0.00
[  39s] threads: 32, tps: 323.00, reads: 4603.01, writes: 1349.00, response time: 129.99ms (95%), errors: 0.00, reconnects:  0.00
[  40s] threads: 32, tps: 341.91, reads: 4618.82, writes: 1338.66, response time: 130.96ms (95%), errors: 0.00, reconnects:  0.00
[  41s] threads: 32, tps: 305.07, reads: 4395.94, writes: 1218.26, response time: 171.76ms (95%), errors: 0.00, reconnects:  0.00
[  42s] threads: 32, tps: 321.01, reads: 4574.20, writes: 1343.06, response time: 123.02ms (95%), errors: 0.00, reconnects:  0.00
[  43s] threads: 32, tps: 319.01, reads: 4298.11, writes: 1215.03, response time: 141.82ms (95%), errors: 0.00, reconnects:  0.00
[  44s] threads: 32, tps: 314.99, reads: 4544.90, writes: 1282.97, response time: 144.39ms (95%), errors: 0.00, reconnects:  0.00
[  45s] threads: 32, tps: 287.00, reads: 4068.02, writes: 1217.01, response time: 191.77ms (95%), errors: 0.00, reconnects:  0.00
[  46s] threads: 32, tps: 340.98, reads: 4629.77, writes: 1246.94, response time: 135.96ms (95%), errors: 0.00, reconnects:  0.00
[  47s] threads: 32, tps: 325.01, reads: 4626.17, writes: 1306.05, response time: 123.76ms (95%), errors: 0.00, reconnects:  0.00
[  48s] threads: 32, tps: 341.00, reads: 4773.01, writes: 1428.00, response time: 123.24ms (95%), errors: 0.00, reconnects:  0.00
[  49s] threads: 32, tps: 343.00, reads: 4723.06, writes: 1314.02, response time: 120.61ms (95%), errors: 0.00, reconnects:  0.00
[  50s] threads: 32, tps: 328.00, reads: 4604.96, writes: 1352.99, response time: 137.88ms (95%), errors: 0.00, reconnects:  0.00
[  51s] threads: 32, tps: 330.99, reads: 4719.90, writes: 1344.97, response time: 135.92ms (95%), errors: 0.00, reconnects:  0.00
[  52s] threads: 32, tps: 360.00, reads: 4867.04, writes: 1399.01, response time: 123.61ms (95%), errors: 0.00, reconnects:  0.00
[  53s] threads: 32, tps: 298.01, reads: 4214.08, writes: 1208.02, response time: 168.76ms (95%), errors: 0.00, reconnects:  0.00
[  54s] threads: 32, tps: 343.89, reads: 4698.55, writes: 1331.59, response time: 130.07ms (95%), errors: 0.00, reconnects:  0.00
[  55s] threads: 32, tps: 275.08, reads: 4147.25, writes: 1211.37, response time: 185.11ms (95%), errors: 0.00, reconnects:  0.00
[  56s] threads: 32, tps: 309.01, reads: 4289.08, writes: 1182.02, response time: 153.57ms (95%), errors: 0.00, reconnects:  0.00
[  57s] threads: 32, tps: 322.99, reads: 4494.91, writes: 1264.98, response time: 179.28ms (95%), errors: 0.00, reconnects:  0.00
[  58s] threads: 32, tps: 300.00, reads: 4186.94, writes: 1222.98, response time: 154.91ms (95%), errors: 0.00, reconnects:  0.00
[  59s] threads: 32, tps: 335.00, reads: 4638.05, writes: 1286.01, response time: 151.15ms (95%), errors: 0.00, reconnects:  0.00
[  60s] threads: 32, tps: 310.01, reads: 4353.11, writes: 1263.03, response time: 184.89ms (95%), errors: 0.00, reconnects:  0.00
[  61s] threads: 32, tps: 318.99, reads: 4528.81, writes: 1278.95, response time: 168.71ms (95%), errors: 0.00, reconnects:  0.00
[  62s] threads: 32, tps: 337.00, reads: 4681.06, writes: 1338.02, response time: 147.62ms (95%), errors: 0.00, reconnects:  0.00
[  63s] threads: 32, tps: 345.00, reads: 4830.05, writes: 1361.02, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[  64s] threads: 32, tps: 332.00, reads: 4660.98, writes: 1386.99, response time: 123.87ms (95%), errors: 0.00, reconnects:  0.00
[  65s] threads: 32, tps: 317.00, reads: 4494.98, writes: 1300.99, response time: 173.26ms (95%), errors: 0.00, reconnects:  0.00
[  66s] threads: 32, tps: 341.00, reads: 4772.93, writes: 1339.98, response time: 128.52ms (95%), errors: 0.00, reconnects:  0.00
[  67s] threads: 32, tps: 300.01, reads: 4011.18, writes: 1163.05, response time: 140.13ms (95%), errors: 0.00, reconnects:  0.00
[  68s] threads: 32, tps: 309.00, reads: 4331.98, writes: 1222.99, response time: 238.46ms (95%), errors: 0.00, reconnects:  0.00
[  69s] threads: 32, tps: 322.99, reads: 4679.90, writes: 1329.97, response time: 169.26ms (95%), errors: 0.00, reconnects:  0.00
[  70s] threads: 32, tps: 353.93, reads: 4895.04, writes: 1354.73, response time: 118.89ms (95%), errors: 0.00, reconnects:  0.00
[  71s] threads: 32, tps: 339.07, reads: 4717.98, writes: 1373.28, response time: 131.87ms (95%), errors: 0.00, reconnects:  0.00
[  72s] threads: 32, tps: 322.00, reads: 4472.01, writes: 1309.00, response time: 149.71ms (95%), errors: 0.00, reconnects:  0.00
[  73s] threads: 32, tps: 308.00, reads: 4313.95, writes: 1234.99, response time: 146.92ms (95%), errors: 0.00, reconnects:  0.00
[  74s] threads: 32, tps: 335.00, reads: 4647.02, writes: 1307.01, response time: 133.78ms (95%), errors: 0.00, reconnects:  0.00
[  75s] threads: 32, tps: 356.00, reads: 4998.99, writes: 1427.00, response time: 121.78ms (95%), errors: 0.00, reconnects:  0.00
[  76s] threads: 32, tps: 347.00, reads: 4898.01, writes: 1390.00, response time: 124.47ms (95%), errors: 0.00, reconnects:  0.00
[  77s] threads: 32, tps: 353.00, reads: 4987.02, writes: 1425.01, response time: 121.78ms (95%), errors: 0.00, reconnects:  0.00
[  78s] threads: 32, tps: 320.00, reads: 4449.97, writes: 1303.99, response time: 208.91ms (95%), errors: 0.00, reconnects:  0.00
[  79s] threads: 32, tps: 348.00, reads: 4819.00, writes: 1363.00, response time: 122.21ms (95%), errors: 0.00, reconnects:  0.00
[  80s] threads: 32, tps: 297.00, reads: 4221.07, writes: 1220.02, response time: 166.90ms (95%), errors: 0.00, reconnects:  0.00
[  81s] threads: 32, tps: 328.99, reads: 4644.85, writes: 1303.96, response time: 137.80ms (95%), errors: 0.00, reconnects:  0.00
[  82s] threads: 32, tps: 327.97, reads: 4574.64, writes: 1316.90, response time: 148.86ms (95%), errors: 0.00, reconnects:  0.00
[  83s] threads: 32, tps: 344.04, reads: 4840.55, writes: 1351.15, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[  84s] threads: 32, tps: 351.98, reads: 4789.74, writes: 1399.92, response time: 124.80ms (95%), errors: 0.00, reconnects:  0.00
[  85s] threads: 32, tps: 296.01, reads: 4302.14, writes: 1249.04, response time: 166.55ms (95%), errors: 0.00, reconnects:  0.00
[  86s] threads: 32, tps: 332.99, reads: 4558.89, writes: 1279.97, response time: 146.13ms (95%), errors: 0.00, reconnects:  0.00
[  87s] threads: 32, tps: 323.01, reads: 4473.21, writes: 1291.06, response time: 154.86ms (95%), errors: 0.00, reconnects:  0.00
[  88s] threads: 32, tps: 345.00, reads: 4957.94, writes: 1396.98, response time: 129.79ms (95%), errors: 0.00, reconnects:  0.00
[  89s] threads: 32, tps: 327.00, reads: 4489.93, writes: 1285.98, response time: 136.00ms (95%), errors: 0.00, reconnects:  0.00
[  90s] threads: 32, tps: 362.01, reads: 5145.08, writes: 1453.02, response time: 115.08ms (95%), errors: 0.00, reconnects:  0.00
[  91s] threads: 32, tps: 350.00, reads: 4819.95, writes: 1391.99, response time: 142.80ms (95%), errors: 0.00, reconnects:  0.00
[  92s] threads: 32, tps: 310.00, reads: 4515.03, writes: 1325.01, response time: 157.81ms (95%), errors: 0.00, reconnects:  0.00
[  93s] threads: 32, tps: 312.00, reads: 4374.02, writes: 1267.01, response time: 133.26ms (95%), errors: 0.00, reconnects:  0.00
[  94s] threads: 32, tps: 340.00, reads: 4684.99, writes: 1254.00, response time: 222.26ms (95%), errors: 0.00, reconnects:  0.00
[  95s] threads: 32, tps: 349.00, reads: 4889.06, writes: 1410.02, response time: 121.85ms (95%), errors: 0.00, reconnects:  0.00
[  96s] threads: 32, tps: 343.99, reads: 4776.86, writes: 1383.96, response time: 135.47ms (95%), errors: 0.00, reconnects:  0.00
[  97s] threads: 32, tps: 341.01, reads: 4677.12, writes: 1340.04, response time: 136.28ms (95%), errors: 0.00, reconnects:  0.00
[  98s] threads: 32, tps: 313.00, reads: 4432.93, writes: 1280.98, response time: 172.80ms (95%), errors: 0.00, reconnects:  0.00
[  99s] threads: 32, tps: 358.00, reads: 4953.01, writes: 1383.00, response time: 121.81ms (95%), errors: 0.00, reconnects:  0.00
[ 100s] threads: 32, tps: 337.99, reads: 4868.87, writes: 1410.96, response time: 118.18ms (95%), errors: 0.00, reconnects:  0.00
[ 101s] threads: 32, tps: 339.01, reads: 4697.16, writes: 1301.04, response time: 132.66ms (95%), errors: 0.00, reconnects:  0.00
[ 102s] threads: 32, tps: 337.00, reads: 4741.97, writes: 1385.99, response time: 136.73ms (95%), errors: 0.00, reconnects:  0.00
[ 103s] threads: 32, tps: 316.00, reads: 4489.00, writes: 1296.00, response time: 178.95ms (95%), errors: 0.00, reconnects:  0.00
[ 104s] threads: 32, tps: 368.00, reads: 5075.99, writes: 1405.00, response time: 115.46ms (95%), errors: 0.00, reconnects:  0.00
[ 105s] threads: 32, tps: 356.00, reads: 4953.01, writes: 1445.00, response time: 121.81ms (95%), errors: 0.00, reconnects:  0.00
[ 106s] threads: 32, tps: 318.99, reads: 4472.89, writes: 1276.97, response time: 169.36ms (95%), errors: 0.00, reconnects:  0.00
[ 107s] threads: 32, tps: 351.84, reads: 4843.87, writes: 1412.38, response time: 140.00ms (95%), errors: 0.00, reconnects:  0.00
[ 108s] threads: 32, tps: 351.16, reads: 4884.20, writes: 1406.63, response time: 129.83ms (95%), errors: 0.00, reconnects:  0.00
[ 109s] threads: 32, tps: 355.00, reads: 5105.00, writes: 1428.00, response time: 119.86ms (95%), errors: 0.00, reconnects:  0.00
[ 110s] threads: 32, tps: 359.01, reads: 4830.14, writes: 1392.04, response time: 121.09ms (95%), errors: 0.00, reconnects:  0.00
[ 111s] threads: 32, tps: 353.00, reads: 5070.01, writes: 1424.00, response time: 118.72ms (95%), errors: 0.00, reconnects:  0.00
[ 112s] threads: 32, tps: 349.99, reads: 4980.91, writes: 1447.97, response time: 127.10ms (95%), errors: 0.00, reconnects:  0.00
[ 113s] threads: 32, tps: 318.01, reads: 4486.08, writes: 1242.02, response time: 175.66ms (95%), errors: 0.00, reconnects:  0.00
[ 114s] threads: 32, tps: 344.99, reads: 4861.91, writes: 1445.97, response time: 127.10ms (95%), errors: 0.00, reconnects:  0.00
[ 115s] threads: 32, tps: 320.00, reads: 4415.97, writes: 1188.99, response time: 160.05ms (95%), errors: 0.00, reconnects:  0.00
[ 116s] threads: 32, tps: 314.00, reads: 4468.96, writes: 1344.99, response time: 132.82ms (95%), errors: 0.00, reconnects:  0.00
[ 117s] threads: 32, tps: 369.01, reads: 5009.17, writes: 1426.05, response time: 143.18ms (95%), errors: 0.00, reconnects:  0.00
[ 118s] threads: 32, tps: 343.99, reads: 5002.89, writes: 1459.97, response time: 115.73ms (95%), errors: 0.00, reconnects:  0.00
[ 119s] threads: 32, tps: 343.00, reads: 4781.00, writes: 1327.00, response time: 173.21ms (95%), errors: 0.00, reconnects:  0.00
[ 120s] threads: 32, tps: 370.01, reads: 5124.11, writes: 1466.03, response time: 114.87ms (95%), errors: 0.00, reconnects:  0.00
[ 121s] threads: 32, tps: 319.99, reads: 4556.89, writes: 1333.97, response time: 141.48ms (95%), errors: 0.00, reconnects:  0.00
[ 122s] threads: 32, tps: 377.00, reads: 5042.00, writes: 1399.00, response time: 131.95ms (95%), errors: 0.00, reconnects:  0.00
[ 123s] threads: 32, tps: 304.01, reads: 4402.10, writes: 1228.03, response time: 203.54ms (95%), errors: 0.00, reconnects:  0.00
[ 124s] threads: 32, tps: 348.00, reads: 4917.02, writes: 1417.01, response time: 142.12ms (95%), errors: 0.00, reconnects:  0.00
[ 125s] threads: 32, tps: 374.00, reads: 5098.99, writes: 1463.00, response time: 116.78ms (95%), errors: 0.00, reconnects:  0.00
[ 126s] threads: 32, tps: 354.00, reads: 4958.01, writes: 1401.00, response time: 126.49ms (95%), errors: 0.00, reconnects:  0.00
[ 127s] threads: 32, tps: 361.99, reads: 5137.87, writes: 1496.96, response time: 120.36ms (95%), errors: 0.00, reconnects:  0.00
[ 128s] threads: 32, tps: 314.01, reads: 4457.09, writes: 1272.03, response time: 173.00ms (95%), errors: 0.00, reconnects:  0.00
[ 129s] threads: 32, tps: 326.00, reads: 4567.00, writes: 1303.00, response time: 165.95ms (95%), errors: 0.00, reconnects:  0.00
[ 130s] threads: 32, tps: 338.99, reads: 4750.89, writes: 1372.97, response time: 128.29ms (95%), errors: 0.00, reconnects:  0.00
[ 131s] threads: 32, tps: 365.96, reads: 5082.44, writes: 1440.84, response time: 138.59ms (95%), errors: 0.00, reconnects:  0.00
[ 132s] threads: 32, tps: 368.05, reads: 5083.68, writes: 1413.19, response time: 111.78ms (95%), errors: 0.00, reconnects:  0.00
[ 133s] threads: 32, tps: 368.95, reads: 5047.36, writes: 1473.81, response time: 119.97ms (95%), errors: 0.00, reconnects:  0.00
[ 134s] threads: 32, tps: 327.03, reads: 4749.51, writes: 1358.14, response time: 128.98ms (95%), errors: 0.00, reconnects:  0.00
[ 135s] threads: 32, tps: 348.01, reads: 4954.08, writes: 1429.02, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[ 136s] threads: 32, tps: 345.99, reads: 4696.93, writes: 1300.98, response time: 135.96ms (95%), errors: 0.00, reconnects:  0.00
[ 137s] threads: 32, tps: 346.00, reads: 4934.04, writes: 1438.01, response time: 133.86ms (95%), errors: 0.00, reconnects:  0.00
[ 138s] threads: 32, tps: 374.00, reads: 5179.06, writes: 1496.02, response time: 117.20ms (95%), errors: 0.00, reconnects:  0.00
[ 139s] threads: 32, tps: 350.99, reads: 4988.88, writes: 1385.97, response time: 118.72ms (95%), errors: 0.00, reconnects:  0.00
[ 140s] threads: 32, tps: 388.01, reads: 5286.12, writes: 1530.04, response time: 113.50ms (95%), errors: 0.00, reconnects:  0.00
[ 141s] threads: 32, tps: 347.99, reads: 5062.88, writes: 1492.97, response time: 119.11ms (95%), errors: 0.00, reconnects:  0.00
[ 142s] threads: 32, tps: 340.01, reads: 4637.12, writes: 1241.03, response time: 140.21ms (95%), errors: 0.00, reconnects:  0.00
[ 143s] threads: 32, tps: 320.99, reads: 4474.89, writes: 1288.97, response time: 154.73ms (95%), errors: 0.00, reconnects:  0.00
[ 144s] threads: 32, tps: 367.01, reads: 5105.10, writes: 1463.03, response time: 112.12ms (95%), errors: 0.00, reconnects:  0.00
[ 145s] threads: 32, tps: 360.99, reads: 4917.91, writes: 1443.97, response time: 120.40ms (95%), errors: 0.00, reconnects:  0.00
[ 146s] threads: 32, tps: 243.00, reads: 3641.00, writes: 1075.00, response time: 193.67ms (95%), errors: 0.00, reconnects:  0.00
[ 147s] threads: 32, tps: 317.00, reads: 4520.02, writes: 1293.01, response time: 126.72ms (95%), errors: 0.00, reconnects:  0.00
[ 148s] threads: 32, tps: 292.00, reads: 3823.97, writes: 1050.99, response time: 191.19ms (95%), errors: 0.00, reconnects:  0.00
[ 149s] threads: 32, tps: 221.01, reads: 3349.09, writes: 973.03, response time: 226.36ms (95%), errors: 0.00, reconnects:  0.00
[ 150s] threads: 32, tps: 360.99, reads: 4948.92, writes: 1355.98, response time: 116.53ms (95%), errors: 0.00, reconnects:  0.00
[ 151s] threads: 32, tps: 354.79, reads: 4965.10, writes: 1426.17, response time: 120.69ms (95%), errors: 0.00, reconnects:  0.00
[ 152s] threads: 32, tps: 292.17, reads: 4084.35, writes: 1164.67, response time: 194.25ms (95%), errors: 0.00, reconnects:  0.00
[ 153s] threads: 32, tps: 368.01, reads: 5193.12, writes: 1466.03, response time: 109.01ms (95%), errors: 0.00, reconnects:  0.00
[ 154s] threads: 32, tps: 360.00, reads: 5010.93, writes: 1445.98, response time: 118.47ms (95%), errors: 0.00, reconnects:  0.00
[ 155s] threads: 32, tps: 327.00, reads: 4531.95, writes: 1299.98, response time: 175.77ms (95%), errors: 0.00, reconnects:  0.00
[ 156s] threads: 32, tps: 348.99, reads: 4992.89, writes: 1422.97, response time: 125.74ms (95%), errors: 0.00, reconnects:  0.00
[ 157s] threads: 32, tps: 347.02, reads: 4815.23, writes: 1399.07, response time: 135.06ms (95%), errors: 0.00, reconnects:  0.00
[ 158s] threads: 32, tps: 389.00, reads: 5460.00, writes: 1531.00, response time: 107.32ms (95%), errors: 0.00, reconnects:  0.00
[ 159s] threads: 32, tps: 314.00, reads: 4373.00, writes: 1316.00, response time: 146.26ms (95%), errors: 0.00, reconnects:  0.00
[ 160s] threads: 32, tps: 380.99, reads: 5295.90, writes: 1465.97, response time: 112.83ms (95%), errors: 0.00, reconnects:  0.00
[ 161s] threads: 32, tps: 344.01, reads: 4851.08, writes: 1361.02, response time: 128.09ms (95%), errors: 0.00, reconnects:  0.00
[ 162s] threads: 32, tps: 347.00, reads: 4899.94, writes: 1484.98, response time: 129.41ms (95%), errors: 0.00, reconnects:  0.00
[ 163s] threads: 32, tps: 361.00, reads: 5078.00, writes: 1436.00, response time: 126.95ms (95%), errors: 0.00, reconnects:  0.00
[ 164s] threads: 32, tps: 302.00, reads: 4192.04, writes: 1170.01, response time: 179.81ms (95%), errors: 0.00, reconnects:  0.00
[ 165s] threads: 32, tps: 324.00, reads: 4407.02, writes: 1259.01, response time: 185.72ms (95%), errors: 0.00, reconnects:  0.00
[ 166s] threads: 32, tps: 334.00, reads: 4688.01, writes: 1315.00, response time: 147.62ms (95%), errors: 0.00, reconnects:  0.00
[ 167s] threads: 32, tps: 364.00, reads: 5177.99, writes: 1504.00, response time: 118.43ms (95%), errors: 0.00, reconnects:  0.00
[ 168s] threads: 32, tps: 331.00, reads: 4674.01, writes: 1298.00, response time: 140.05ms (95%), errors: 0.00, reconnects:  0.00
[ 169s] threads: 32, tps: 354.96, reads: 4924.44, writes: 1454.83, response time: 136.24ms (95%), errors: 0.00, reconnects:  0.00
[ 170s] threads: 32, tps: 358.03, reads: 5118.49, writes: 1483.14, response time: 118.15ms (95%), errors: 0.00, reconnects:  0.00
[ 171s] threads: 32, tps: 352.00, reads: 4882.95, writes: 1352.99, response time: 132.50ms (95%), errors: 0.00, reconnects:  0.00
[ 172s] threads: 32, tps: 377.01, reads: 5209.15, writes: 1507.04, response time: 107.71ms (95%), errors: 0.00, reconnects:  0.00
[ 173s] threads: 32, tps: 372.98, reads: 5084.79, writes: 1459.94, response time: 117.58ms (95%), errors: 0.00, reconnects:  0.00
[ 174s] threads: 32, tps: 315.01, reads: 4669.11, writes: 1368.03, response time: 136.16ms (95%), errors: 0.00, reconnects:  0.00
[ 175s] threads: 32, tps: 355.00, reads: 4941.03, writes: 1405.01, response time: 147.67ms (95%), errors: 0.00, reconnects:  0.00
[ 176s] threads: 32, tps: 361.00, reads: 5064.04, writes: 1398.01, response time: 118.93ms (95%), errors: 0.00, reconnects:  0.00
[ 177s] threads: 32, tps: 370.00, reads: 5096.01, writes: 1417.00, response time: 120.15ms (95%), errors: 0.00, reconnects:  0.00
[ 178s] threads: 32, tps: 379.00, reads: 5254.02, writes: 1551.01, response time: 111.68ms (95%), errors: 0.00, reconnects:  0.00
[ 179s] threads: 32, tps: 333.99, reads: 4752.86, writes: 1383.96, response time: 150.39ms (95%), errors: 0.00, reconnects:  0.00
[ 180s] threads: 32, tps: 378.00, reads: 5328.00, writes: 1505.00, response time: 107.55ms (95%), errors: 0.00, reconnects:  0.00
[ 181s] threads: 32, tps: 395.01, reads: 5419.13, writes: 1515.04, response time: 106.97ms (95%), errors: 0.00, reconnects:  0.00
[ 182s] threads: 32, tps: 359.95, reads: 5037.36, writes: 1476.81, response time: 126.49ms (95%), errors: 0.00, reconnects:  0.00
[ 183s] threads: 32, tps: 335.03, reads: 4836.50, writes: 1386.14, response time: 127.22ms (95%), errors: 0.00, reconnects:  0.00
[ 184s] threads: 32, tps: 362.01, reads: 4945.12, writes: 1400.03, response time: 129.99ms (95%), errors: 0.00, reconnects:  0.00
[ 185s] threads: 32, tps: 325.99, reads: 4654.88, writes: 1294.97, response time: 133.62ms (95%), errors: 0.00, reconnects:  0.00
[ 186s] threads: 32, tps: 352.00, reads: 4969.03, writes: 1495.01, response time: 120.40ms (95%), errors: 0.00, reconnects:  0.00
[ 187s] threads: 32, tps: 330.00, reads: 4480.00, writes: 1221.00, response time: 180.03ms (95%), errors: 0.00, reconnects:  0.00
[ 188s] threads: 32, tps: 333.99, reads: 4487.83, writes: 1322.95, response time: 170.13ms (95%), errors: 0.00, reconnects:  0.00
[ 189s] threads: 32, tps: 357.02, reads: 5295.31, writes: 1488.09, response time: 119.11ms (95%), errors: 0.00, reconnects:  0.00
[ 190s] threads: 32, tps: 365.98, reads: 5046.71, writes: 1458.92, response time: 141.06ms (95%), errors: 0.00, reconnects:  0.00
[ 191s] threads: 32, tps: 340.01, reads: 4868.21, writes: 1417.06, response time: 113.67ms (95%), errors: 0.00, reconnects:  0.00
[ 192s] threads: 32, tps: 393.00, reads: 5283.04, writes: 1496.01, response time: 175.30ms (95%), errors: 0.00, reconnects:  0.00
[ 193s] threads: 32, tps: 353.00, reads: 5133.03, writes: 1436.01, response time: 125.03ms (95%), errors: 0.00, reconnects:  0.00
[ 194s] threads: 32, tps: 378.90, reads: 5276.55, writes: 1512.58, response time: 122.65ms (95%), errors: 0.00, reconnects:  0.00
[ 195s] threads: 32, tps: 376.10, reads: 5191.42, writes: 1458.40, response time: 115.56ms (95%), errors: 0.00, reconnects:  0.00
[ 196s] threads: 32, tps: 357.99, reads: 5046.86, writes: 1432.96, response time: 112.32ms (95%), errors: 0.00, reconnects:  0.00
[ 197s] threads: 32, tps: 344.01, reads: 4882.15, writes: 1407.04, response time: 127.86ms (95%), errors: 0.00, reconnects:  0.00
[ 198s] threads: 32, tps: 351.99, reads: 4934.84, writes: 1445.95, response time: 130.26ms (95%), errors: 0.00, reconnects:  0.00
[ 199s] threads: 32, tps: 342.01, reads: 4670.11, writes: 1294.03, response time: 163.24ms (95%), errors: 0.00, reconnects:  0.00
[ 200s] threads: 32, tps: 328.00, reads: 4497.00, writes: 1293.00, response time: 183.07ms (95%), errors: 0.00, reconnects:  0.00
[ 201s] threads: 32, tps: 330.99, reads: 4760.92, writes: 1396.98, response time: 166.80ms (95%), errors: 0.00, reconnects:  0.00
[ 202s] threads: 32, tps: 340.00, reads: 4760.00, writes: 1355.00, response time: 134.90ms (95%), errors: 0.00, reconnects:  0.00
[ 203s] threads: 32, tps: 352.00, reads: 4974.02, writes: 1390.01, response time: 134.34ms (95%), errors: 0.00, reconnects:  0.00
[ 204s] threads: 32, tps: 325.00, reads: 4576.07, writes: 1286.02, response time: 163.93ms (95%), errors: 0.00, reconnects:  0.00
[ 205s] threads: 32, tps: 355.00, reads: 4897.01, writes: 1388.00, response time: 119.93ms (95%), errors: 0.00, reconnects:  0.00
[ 206s] threads: 32, tps: 327.00, reads: 4633.00, writes: 1333.00, response time: 137.10ms (95%), errors: 0.00, reconnects:  0.00
[ 207s] threads: 32, tps: 387.00, reads: 5284.02, writes: 1533.01, response time: 113.78ms (95%), errors: 0.00, reconnects:  0.00
[ 208s] threads: 32, tps: 380.00, reads: 5446.96, writes: 1531.99, response time: 111.12ms (95%), errors: 0.00, reconnects:  0.00
[ 209s] threads: 32, tps: 379.99, reads: 5080.91, writes: 1494.97, response time: 115.01ms (95%), errors: 0.00, reconnects:  0.00
[ 210s] threads: 32, tps: 330.00, reads: 4919.03, writes: 1430.01, response time: 140.47ms (95%), errors: 0.00, reconnects:  0.00
[ 211s] threads: 32, tps: 366.00, reads: 4933.98, writes: 1412.99, response time: 119.14ms (95%), errors: 0.00, reconnects:  0.00
[ 212s] threads: 32, tps: 366.01, reads: 5259.11, writes: 1483.03, response time: 137.84ms (95%), errors: 0.00, reconnects:  0.00
[ 213s] threads: 32, tps: 397.99, reads: 5443.87, writes: 1521.96, response time: 107.84ms (95%), errors: 0.00, reconnects:  0.00
[ 214s] threads: 32, tps: 320.00, reads: 4568.04, writes: 1328.01, response time: 199.50ms (95%), errors: 0.00, reconnects:  0.00
[ 215s] threads: 32, tps: 380.00, reads: 5314.05, writes: 1488.01, response time: 115.77ms (95%), errors: 0.00, reconnects:  0.00
[ 216s] threads: 32, tps: 349.00, reads: 4963.03, writes: 1430.01, response time: 126.00ms (95%), errors: 0.00, reconnects:  0.00
[ 217s] threads: 32, tps: 321.99, reads: 4422.89, writes: 1248.97, response time: 185.94ms (95%), errors: 0.00, reconnects:  0.00
[ 218s] threads: 32, tps: 359.00, reads: 5013.03, writes: 1445.01, response time: 162.95ms (95%), errors: 0.00, reconnects:  0.00
[ 219s] threads: 32, tps: 366.00, reads: 5039.96, writes: 1438.99, response time: 115.28ms (95%), errors: 0.00, reconnects:  0.00
[ 220s] threads: 32, tps: 378.01, reads: 5367.14, writes: 1572.04, response time: 107.20ms (95%), errors: 0.00, reconnects:  0.00
[ 221s] threads: 32, tps: 380.99, reads: 5382.83, writes: 1468.95, response time: 109.50ms (95%), errors: 0.00, reconnects:  0.00
[ 222s] threads: 32, tps: 394.01, reads: 5502.16, writes: 1599.05, response time: 106.52ms (95%), errors: 0.00, reconnects:  0.00
[ 223s] threads: 32, tps: 364.99, reads: 5081.88, writes: 1447.97, response time: 127.98ms (95%), errors: 0.00, reconnects:  0.00
[ 224s] threads: 32, tps: 367.01, reads: 5104.12, writes: 1463.04, response time: 123.95ms (95%), errors: 0.00, reconnects:  0.00
[ 225s] threads: 32, tps: 336.00, reads: 4804.99, writes: 1366.00, response time: 154.73ms (95%), errors: 0.00, reconnects:  0.00
[ 226s] threads: 32, tps: 342.99, reads: 4787.86, writes: 1354.96, response time: 176.24ms (95%), errors: 0.00, reconnects:  0.00
[ 227s] threads: 32, tps: 356.00, reads: 5052.06, writes: 1518.02, response time: 113.67ms (95%), errors: 0.00, reconnects:  0.00
[ 228s] threads: 32, tps: 352.00, reads: 4781.99, writes: 1291.00, response time: 151.56ms (95%), errors: 0.00, reconnects:  0.00
[ 229s] threads: 32, tps: 381.00, reads: 5282.99, writes: 1540.00, response time: 109.99ms (95%), errors: 0.00, reconnects:  0.00
[ 230s] threads: 32, tps: 353.98, reads: 4951.72, writes: 1407.92, response time: 127.56ms (95%), errors: 0.00, reconnects:  0.00
[ 231s] threads: 32, tps: 351.02, reads: 5018.32, writes: 1431.09, response time: 136.16ms (95%), errors: 0.00, reconnects:  0.00
[ 232s] threads: 32, tps: 394.01, reads: 5438.09, writes: 1552.03, response time: 105.67ms (95%), errors: 0.00, reconnects:  0.00
[ 233s] threads: 32, tps: 375.94, reads: 5376.12, writes: 1575.74, response time: 112.79ms (95%), errors: 0.00, reconnects:  0.00
[ 234s] threads: 32, tps: 345.05, reads: 4748.70, writes: 1367.20, response time: 157.25ms (95%), errors: 0.00, reconnects:  0.00
[ 235s] threads: 32, tps: 366.00, reads: 4969.96, writes: 1420.99, response time: 146.13ms (95%), errors: 0.00, reconnects:  0.00
[ 236s] threads: 32, tps: 351.00, reads: 5127.01, writes: 1433.00, response time: 120.98ms (95%), errors: 0.00, reconnects:  0.00
[ 237s] threads: 32, tps: 392.01, reads: 5540.13, writes: 1578.04, response time: 105.32ms (95%), errors: 0.00, reconnects:  0.00
[ 238s] threads: 32, tps: 360.00, reads: 4950.01, writes: 1441.00, response time: 126.34ms (95%), errors: 0.00, reconnects:  0.00
[ 239s] threads: 32, tps: 352.99, reads: 4882.83, writes: 1349.95, response time: 140.51ms (95%), errors: 0.00, reconnects:  0.00
[ 240s] threads: 32, tps: 376.01, reads: 5290.08, writes: 1524.02, response time: 118.79ms (95%), errors: 0.00, reconnects:  0.00
[ 241s] threads: 32, tps: 338.00, reads: 4859.00, writes: 1413.00, response time: 145.69ms (95%), errors: 0.00, reconnects:  0.00
[ 242s] threads: 32, tps: 369.00, reads: 5111.00, writes: 1448.00, response time: 120.04ms (95%), errors: 0.00, reconnects:  0.00
[ 243s] threads: 32, tps: 355.00, reads: 5034.06, writes: 1462.02, response time: 133.38ms (95%), errors: 0.00, reconnects:  0.00
[ 244s] threads: 32, tps: 374.99, reads: 5166.93, writes: 1415.98, response time: 122.10ms (95%), errors: 0.00, reconnects:  0.00
[ 245s] threads: 32, tps: 338.01, reads: 4736.08, writes: 1368.02, response time: 132.30ms (95%), errors: 0.00, reconnects:  0.00
[ 246s] threads: 32, tps: 377.99, reads: 5261.93, writes: 1526.98, response time: 120.76ms (95%), errors: 0.00, reconnects:  0.00
[ 247s] threads: 32, tps: 336.01, reads: 4781.07, writes: 1364.02, response time: 174.56ms (95%), errors: 0.00, reconnects:  0.00
[ 248s] threads: 32, tps: 377.00, reads: 5224.01, writes: 1477.00, response time: 118.57ms (95%), errors: 0.00, reconnects:  0.00
[ 249s] threads: 32, tps: 355.00, reads: 5079.96, writes: 1510.99, response time: 115.11ms (95%), errors: 0.00, reconnects:  0.00
[ 250s] threads: 32, tps: 377.96, reads: 5149.49, writes: 1417.86, response time: 140.38ms (95%), errors: 0.00, reconnects:  0.00
[ 251s] threads: 32, tps: 338.03, reads: 4851.43, writes: 1387.12, response time: 188.52ms (95%), errors: 0.00, reconnects:  0.00
[ 252s] threads: 32, tps: 366.01, reads: 4935.11, writes: 1395.03, response time: 169.62ms (95%), errors: 0.00, reconnects:  0.00
[ 253s] threads: 32, tps: 316.99, reads: 4639.88, writes: 1379.96, response time: 158.86ms (95%), errors: 0.00, reconnects:  0.00
[ 254s] threads: 32, tps: 386.00, reads: 5337.01, writes: 1465.00, response time: 117.48ms (95%), errors: 0.00, reconnects:  0.00
[ 255s] threads: 32, tps: 343.00, reads: 4792.01, writes: 1370.00, response time: 183.79ms (95%), errors: 0.00, reconnects:  0.00
[ 256s] threads: 32, tps: 408.94, reads: 5645.21, writes: 1616.77, response time: 105.10ms (95%), errors: 0.00, reconnects:  0.00
[ 257s] threads: 32, tps: 359.06, reads: 5139.80, writes: 1487.23, response time: 121.70ms (95%), errors: 0.00, reconnects:  0.00
[ 258s] threads: 32, tps: 387.97, reads: 5441.53, writes: 1527.87, response time: 108.94ms (95%), errors: 0.00, reconnects:  0.00
[ 259s] threads: 32, tps: 388.03, reads: 5408.37, writes: 1597.11, response time: 107.49ms (95%), errors: 0.00, reconnects:  0.00
[ 260s] threads: 32, tps: 363.00, reads: 5100.98, writes: 1415.99, response time: 125.93ms (95%), errors: 0.00, reconnects:  0.00
[ 261s] threads: 32, tps: 405.01, reads: 5593.13, writes: 1587.04, response time: 107.29ms (95%), errors: 0.00, reconnects:  0.00
[ 262s] threads: 32, tps: 388.88, reads: 5202.41, writes: 1540.53, response time: 147.71ms (95%), errors: 0.00, reconnects:  0.00
[ 263s] threads: 32, tps: 379.11, reads: 5549.63, writes: 1588.47, response time: 109.20ms (95%), errors: 0.00, reconnects:  0.00
[ 264s] threads: 32, tps: 345.00, reads: 4955.98, writes: 1436.00, response time: 128.21ms (95%), errors: 0.00, reconnects:  0.00
[ 265s] threads: 32, tps: 387.01, reads: 5352.08, writes: 1440.02, response time: 120.69ms (95%), errors: 0.00, reconnects:  0.00
[ 266s] threads: 32, tps: 401.98, reads: 5456.79, writes: 1587.94, response time: 111.58ms (95%), errors: 0.00, reconnects:  0.00
[ 267s] threads: 32, tps: 363.00, reads: 5267.05, writes: 1543.02, response time: 116.74ms (95%), errors: 0.00, reconnects:  0.00
[ 268s] threads: 32, tps: 358.01, reads: 4943.15, writes: 1361.04, response time: 174.82ms (95%), errors: 0.00, reconnects:  0.00
[ 269s] threads: 32, tps: 375.99, reads: 5368.85, writes: 1580.95, response time: 109.43ms (95%), errors: 0.00, reconnects:  0.00
[ 270s] threads: 32, tps: 407.00, reads: 5591.01, writes: 1536.00, response time: 113.16ms (95%), errors: 0.00, reconnects:  0.00
[ 271s] threads: 32, tps: 388.00, reads: 5447.05, writes: 1579.01, response time: 105.19ms (95%), errors: 0.00, reconnects:  0.00
[ 272s] threads: 32, tps: 344.99, reads: 4747.80, writes: 1390.94, response time: 147.80ms (95%), errors: 0.00, reconnects:  0.00
[ 273s] threads: 32, tps: 343.01, reads: 4918.14, writes: 1377.04, response time: 149.09ms (95%), errors: 0.00, reconnects:  0.00
[ 274s] threads: 32, tps: 337.00, reads: 4764.07, writes: 1397.02, response time: 127.67ms (95%), errors: 0.00, reconnects:  0.00
[ 275s] threads: 32, tps: 390.99, reads: 5451.89, writes: 1510.97, response time: 118.33ms (95%), errors: 0.00, reconnects:  0.00
[ 276s] threads: 32, tps: 336.00, reads: 4754.00, writes: 1428.00, response time: 167.95ms (95%), errors: 0.00, reconnects:  0.00
[ 277s] threads: 32, tps: 320.01, reads: 4231.13, writes: 1152.04, response time: 156.50ms (95%), errors: 0.00, reconnects:  0.00
[ 278s] threads: 32, tps: 349.99, reads: 5044.91, writes: 1443.97, response time: 117.34ms (95%), errors: 0.00, reconnects:  0.00
[ 279s] threads: 32, tps: 392.00, reads: 5502.04, writes: 1562.01, response time: 109.34ms (95%), errors: 0.00, reconnects:  0.00
[ 280s] threads: 32, tps: 396.00, reads: 5592.97, writes: 1574.99, response time: 112.89ms (95%), errors: 0.00, reconnects:  0.00
[ 281s] threads: 32, tps: 393.00, reads: 5416.94, writes: 1603.98, response time: 114.87ms (95%), errors: 0.00, reconnects:  0.00
[ 282s] threads: 32, tps: 373.01, reads: 5323.09, writes: 1533.03, response time: 115.25ms (95%), errors: 0.00, reconnects:  0.00
[ 283s] threads: 32, tps: 365.00, reads: 4963.98, writes: 1403.00, response time: 121.01ms (95%), errors: 0.00, reconnects:  0.00
[ 284s] threads: 32, tps: 294.95, reads: 4124.28, writes: 1178.79, response time: 163.58ms (95%), errors: 0.00, reconnects:  0.00
[ 285s] threads: 32, tps: 370.06, reads: 5205.90, writes: 1499.26, response time: 114.77ms (95%), errors: 0.00, reconnects:  0.00
[ 286s] threads: 32, tps: 389.01, reads: 5550.11, writes: 1546.03, response time: 108.03ms (95%), errors: 0.00, reconnects:  0.00
[ 287s] threads: 32, tps: 336.00, reads: 4502.95, writes: 1298.99, response time: 217.13ms (95%), errors: 0.00, reconnects:  0.00
[ 288s] threads: 32, tps: 337.00, reads: 4908.93, writes: 1355.98, response time: 144.00ms (95%), errors: 0.00, reconnects:  0.00
[ 289s] threads: 32, tps: 384.96, reads: 5382.48, writes: 1557.85, response time: 115.87ms (95%), errors: 0.00, reconnects:  0.00
[ 290s] threads: 32, tps: 344.04, reads: 4781.50, writes: 1360.14, response time: 175.24ms (95%), errors: 0.00, reconnects:  0.00
[ 291s] threads: 32, tps: 385.00, reads: 5367.99, writes: 1584.00, response time: 109.76ms (95%), errors: 0.00, reconnects:  0.00
[ 292s] threads: 32, tps: 375.00, reads: 5371.01, writes: 1564.00, response time: 104.07ms (95%), errors: 0.00, reconnects:  0.00
[ 293s] threads: 32, tps: 405.99, reads: 5578.89, writes: 1512.97, response time: 122.29ms (95%), errors: 0.00, reconnects:  0.00
[ 294s] threads: 32, tps: 377.79, reads: 5239.15, writes: 1512.18, response time: 114.73ms (95%), errors: 0.00, reconnects:  0.00
[ 295s] threads: 32, tps: 377.22, reads: 5375.13, writes: 1586.92, response time: 113.37ms (95%), errors: 0.00, reconnects:  0.00
[ 296s] threads: 32, tps: 320.00, reads: 4337.98, writes: 1201.99, response time: 167.85ms (95%), errors: 0.00, reconnects:  0.00
[ 297s] threads: 32, tps: 359.97, reads: 4927.64, writes: 1430.90, response time: 126.00ms (95%), errors: 0.00, reconnects:  0.00
[ 298s] threads: 32, tps: 374.03, reads: 5461.39, writes: 1568.11, response time: 110.98ms (95%), errors: 0.00, reconnects:  0.00
[ 299s] threads: 32, tps: 371.96, reads: 5235.40, writes: 1428.84, response time: 115.25ms (95%), errors: 0.00, reconnects:  0.00
[ 300s] threads: 32, tps: 389.04, reads: 5288.52, writes: 1556.15, response time: 110.52ms (95%), errors: 0.00, reconnects:  0.00
[ 301s] threads: 32, tps: 315.99, reads: 4350.84, writes: 1253.95, response time: 165.51ms (95%), errors: 0.00, reconnects:  0.00
[ 302s] threads: 32, tps: 331.01, reads: 4778.19, writes: 1318.05, response time: 161.20ms (95%), errors: 0.00, reconnects:  0.00
[ 303s] threads: 32, tps: 380.00, reads: 5329.02, writes: 1565.01, response time: 111.08ms (95%), errors: 0.00, reconnects:  0.00
[ 304s] threads: 32, tps: 376.00, reads: 5347.96, writes: 1492.99, response time: 122.58ms (95%), errors: 0.00, reconnects:  0.00
[ 305s] threads: 32, tps: 400.99, reads: 5589.88, writes: 1597.96, response time: 112.02ms (95%), errors: 0.00, reconnects:  0.00
[ 306s] threads: 32, tps: 377.02, reads: 5279.22, writes: 1496.06, response time: 115.49ms (95%), errors: 0.00, reconnects:  0.00
[ 307s] threads: 32, tps: 362.97, reads: 5040.65, writes: 1475.90, response time: 122.62ms (95%), errors: 0.00, reconnects:  0.00
[ 308s] threads: 32, tps: 380.02, reads: 5385.29, writes: 1523.08, response time: 112.69ms (95%), errors: 0.00, reconnects:  0.00
[ 309s] threads: 32, tps: 383.99, reads: 5311.92, writes: 1503.98, response time: 124.35ms (95%), errors: 0.00, reconnects:  0.00
[ 310s] threads: 32, tps: 381.00, reads: 5280.01, writes: 1532.00, response time: 109.43ms (95%), errors: 0.00, reconnects:  0.00
[ 311s] threads: 32, tps: 331.97, reads: 4788.55, writes: 1365.87, response time: 181.60ms (95%), errors: 0.00, reconnects:  0.00
[ 312s] threads: 32, tps: 367.04, reads: 5164.52, writes: 1507.15, response time: 118.61ms (95%), errors: 0.00, reconnects:  0.00
[ 313s] threads: 32, tps: 362.00, reads: 4896.05, writes: 1354.01, response time: 179.54ms (95%), errors: 0.00, reconnects:  0.00
[ 314s] threads: 32, tps: 338.00, reads: 4817.06, writes: 1383.02, response time: 147.31ms (95%), errors: 0.00, reconnects:  0.00
[ 315s] threads: 32, tps: 381.99, reads: 5402.88, writes: 1582.96, response time: 109.27ms (95%), errors: 0.00, reconnects:  0.00
[ 316s] threads: 32, tps: 401.00, reads: 5372.02, writes: 1518.00, response time: 109.86ms (95%), errors: 0.00, reconnects:  0.00
[ 317s] threads: 32, tps: 249.00, reads: 3766.02, writes: 1118.01, response time: 186.11ms (95%), errors: 0.00, reconnects:  0.00
[ 318s] threads: 32, tps: 298.99, reads: 4024.91, writes: 1131.97, response time: 153.11ms (95%), errors: 0.00, reconnects:  0.00
[ 319s] threads: 32, tps: 269.01, reads: 3866.09, writes: 1030.02, response time: 165.80ms (95%), errors: 0.00, reconnects:  0.00
[ 320s] threads: 32, tps: 248.00, reads: 3289.98, writes: 977.99, response time: 177.67ms (95%), errors: 0.00, reconnects:  0.00
[ 321s] threads: 32, tps: 220.00, reads: 3314.98, writes: 969.00, response time: 285.97ms (95%), errors: 0.00, reconnects:  0.00
[ 322s] threads: 32, tps: 246.01, reads: 3318.09, writes: 970.03, response time: 159.19ms (95%), errors: 0.00, reconnects:  0.00
[ 323s] threads: 32, tps: 255.00, reads: 3700.93, writes: 1064.98, response time: 174.93ms (95%), errors: 0.00, reconnects:  0.00
[ 324s] threads: 32, tps: 272.00, reads: 3558.00, writes: 992.00, response time: 200.09ms (95%), errors: 0.00, reconnects:  0.00
[ 325s] threads: 32, tps: 219.00, reads: 3297.02, writes: 935.01, response time: 218.11ms (95%), errors: 0.00, reconnects:  0.00
[ 326s] threads: 32, tps: 268.00, reads: 3771.97, writes: 1100.99, response time: 162.66ms (95%), errors: 0.00, reconnects:  0.00
[ 327s] threads: 32, tps: 179.00, reads: 2508.02, writes: 728.00, response time: 217.91ms (95%), errors: 0.00, reconnects:  0.00
[ 328s] threads: 32, tps: 280.00, reads: 3692.02, writes: 1004.01, response time: 196.65ms (95%), errors: 0.00, reconnects:  0.00
[ 329s] threads: 32, tps: 265.00, reads: 3897.93, writes: 1143.98, response time: 181.22ms (95%), errors: 0.00, reconnects:  0.00
[ 330s] threads: 32, tps: 275.00, reads: 3890.06, writes: 1132.02, response time: 151.93ms (95%), errors: 0.00, reconnects:  0.00
[ 331s] threads: 32, tps: 243.00, reads: 3401.97, writes: 970.99, response time: 179.92ms (95%), errors: 0.00, reconnects:  0.00
[ 332s] threads: 32, tps: 289.01, reads: 3886.08, writes: 1081.02, response time: 178.31ms (95%), errors: 0.00, reconnects:  0.00
[ 333s] threads: 32, tps: 211.00, reads: 3005.97, writes: 795.99, response time: 209.85ms (95%), errors: 0.00, reconnects:  0.00
[ 334s] threads: 32, tps: 211.00, reads: 3061.94, writes: 966.98, response time: 176.19ms (95%), errors: 0.00, reconnects:  0.00
[ 335s] threads: 32, tps: 206.00, reads: 2884.02, writes: 825.01, response time: 244.17ms (95%), errors: 0.00, reconnects:  0.00
[ 336s] threads: 32, tps: 246.00, reads: 3365.99, writes: 936.00, response time: 181.00ms (95%), errors: 0.00, reconnects:  0.00
[ 337s] threads: 32, tps: 225.00, reads: 3228.02, writes: 948.01, response time: 178.15ms (95%), errors: 0.00, reconnects:  0.00
[ 338s] threads: 32, tps: 218.99, reads: 2897.87, writes: 827.96, response time: 378.11ms (95%), errors: 0.00, reconnects:  0.00
[ 339s] threads: 32, tps: 222.01, reads: 3274.11, writes: 932.03, response time: 198.54ms (95%), errors: 0.00, reconnects:  0.00
[ 340s] threads: 32, tps: 237.01, reads: 3306.10, writes: 899.03, response time: 204.21ms (95%), errors: 0.00, reconnects:  0.00
[ 341s] threads: 32, tps: 274.00, reads: 3849.97, writes: 1139.99, response time: 169.16ms (95%), errors: 0.00, reconnects:  0.00
[ 342s] threads: 32, tps: 232.98, reads: 3032.74, writes: 844.93, response time: 199.56ms (95%), errors: 0.00, reconnects:  0.00
[ 343s] threads: 32, tps: 216.02, reads: 3253.26, writes: 959.08, response time: 182.91ms (95%), errors: 0.00, reconnects:  0.00
[ 344s] threads: 32, tps: 242.99, reads: 3401.90, writes: 972.97, response time: 201.17ms (95%), errors: 0.00, reconnects:  0.00
[ 345s] threads: 32, tps: 292.01, reads: 3945.17, writes: 1044.04, response time: 192.86ms (95%), errors: 0.00, reconnects:  0.00
[ 346s] threads: 32, tps: 225.00, reads: 3292.97, writes: 1023.99, response time: 185.67ms (95%), errors: 0.00, reconnects:  0.00
[ 347s] threads: 32, tps: 261.00, reads: 3520.97, writes: 959.99, response time: 190.85ms (95%), errors: 0.00, reconnects:  0.00
[ 348s] threads: 32, tps: 208.00, reads: 3045.01, writes: 914.00, response time: 214.29ms (95%), errors: 0.00, reconnects:  0.00
[ 349s] threads: 32, tps: 208.00, reads: 2902.95, writes: 787.99, response time: 221.40ms (95%), errors: 0.00, reconnects:  0.00
[ 350s] threads: 32, tps: 246.01, reads: 3240.11, writes: 902.03, response time: 203.05ms (95%), errors: 0.00, reconnects:  0.00
[ 351s] threads: 32, tps: 203.00, reads: 2903.94, writes: 811.98, response time: 243.22ms (95%), errors: 0.00, reconnects:  0.00
[ 352s] threads: 32, tps: 249.00, reads: 3637.01, writes: 1124.00, response time: 182.63ms (95%), errors: 0.00, reconnects:  0.00
[ 353s] threads: 32, tps: 258.99, reads: 3625.86, writes: 1034.96, response time: 171.05ms (95%), errors: 0.00, reconnects:  0.00
[ 354s] threads: 32, tps: 259.01, reads: 3626.08, writes: 1036.02, response time: 181.65ms (95%), errors: 0.00, reconnects:  0.00
[ 355s] threads: 32, tps: 258.00, reads: 3611.06, writes: 1019.02, response time: 211.04ms (95%), errors: 0.00, reconnects:  0.00
[ 356s] threads: 32, tps: 239.00, reads: 3334.98, writes: 909.99, response time: 198.13ms (95%), errors: 0.00, reconnects:  0.00
[ 357s] threads: 32, tps: 234.00, reads: 3288.02, writes: 996.01, response time: 217.72ms (95%), errors: 0.00, reconnects:  0.00
[ 358s] threads: 32, tps: 286.00, reads: 3991.97, writes: 1111.99, response time: 185.83ms (95%), errors: 0.00, reconnects:  0.00
[ 359s] threads: 32, tps: 274.00, reads: 3848.04, writes: 1128.01, response time: 148.78ms (95%), errors: 0.00, reconnects:  0.00
[ 360s] threads: 32, tps: 273.00, reads: 3807.99, writes: 1078.00, response time: 183.73ms (95%), errors: 0.00, reconnects:  0.00
[ 361s] threads: 32, tps: 324.00, reads: 4209.97, writes: 1205.99, response time: 154.54ms (95%), errors: 0.00, reconnects:  0.00
[ 362s] threads: 32, tps: 194.00, reads: 3038.02, writes: 856.00, response time: 330.56ms (95%), errors: 0.00, reconnects:  0.00
[ 363s] threads: 32, tps: 260.00, reads: 3580.99, writes: 1020.00, response time: 150.52ms (95%), errors: 0.00, reconnects:  0.00
[ 364s] threads: 32, tps: 305.00, reads: 4041.01, writes: 1144.00, response time: 148.91ms (95%), errors: 0.00, reconnects:  0.00
[ 365s] threads: 32, tps: 292.00, reads: 4388.98, writes: 1252.00, response time: 156.92ms (95%), errors: 0.00, reconnects:  0.00
[ 366s] threads: 32, tps: 237.00, reads: 3240.06, writes: 861.02, response time: 211.49ms (95%), errors: 0.00, reconnects:  0.00
[ 367s] threads: 32, tps: 257.00, reads: 3680.97, writes: 1149.99, response time: 162.17ms (95%), errors: 0.00, reconnects:  0.00
[ 368s] threads: 32, tps: 260.00, reads: 3634.01, writes: 989.00, response time: 184.61ms (95%), errors: 0.00, reconnects:  0.00
[ 369s] threads: 32, tps: 252.99, reads: 3497.93, writes: 1007.98, response time: 173.21ms (95%), errors: 0.00, reconnects:  0.00
[ 370s] threads: 32, tps: 281.00, reads: 3981.03, writes: 1173.01, response time: 142.71ms (95%), errors: 0.00, reconnects:  0.00
[ 371s] threads: 32, tps: 226.00, reads: 3009.06, writes: 811.02, response time: 212.69ms (95%), errors: 0.00, reconnects:  0.00
[ 372s] threads: 32, tps: 215.00, reads: 3167.93, writes: 958.98, response time: 237.53ms (95%), errors: 0.00, reconnects:  0.00
[ 373s] threads: 32, tps: 256.00, reads: 3577.94, writes: 1007.98, response time: 191.48ms (95%), errors: 0.00, reconnects:  0.00
[ 374s] threads: 32, tps: 215.01, reads: 3016.07, writes: 876.02, response time: 269.76ms (95%), errors: 0.00, reconnects:  0.00
[ 375s] threads: 32, tps: 292.01, reads: 3868.07, writes: 1041.02, response time: 181.38ms (95%), errors: 0.00, reconnects:  0.00
[ 376s] threads: 32, tps: 264.00, reads: 3849.99, writes: 1095.00, response time: 175.24ms (95%), errors: 0.00, reconnects:  0.00
[ 377s] threads: 32, tps: 275.99, reads: 3921.90, writes: 1152.97, response time: 152.84ms (95%), errors: 0.00, reconnects:  0.00
[ 378s] threads: 32, tps: 239.00, reads: 3322.03, writes: 940.01, response time: 225.21ms (95%), errors: 0.00, reconnects:  0.00
[ 379s] threads: 32, tps: 292.00, reads: 4030.93, writes: 1122.98, response time: 163.54ms (95%), errors: 0.00, reconnects:  0.00
[ 380s] threads: 32, tps: 240.00, reads: 3416.05, writes: 1041.02, response time: 182.42ms (95%), errors: 0.00, reconnects:  0.00
[ 381s] threads: 32, tps: 234.00, reads: 3309.02, writes: 956.00, response time: 225.95ms (95%), errors: 0.00, reconnects:  0.00
[ 382s] threads: 32, tps: 246.00, reads: 3307.00, writes: 881.00, response time: 197.36ms (95%), errors: 0.00, reconnects:  0.00
[ 383s] threads: 32, tps: 212.00, reads: 3105.00, writes: 947.00, response time: 204.33ms (95%), errors: 0.00, reconnects:  0.00
[ 384s] threads: 32, tps: 248.00, reads: 3472.00, writes: 995.00, response time: 188.75ms (95%), errors: 0.00, reconnects:  0.00
[ 385s] threads: 32, tps: 242.00, reads: 3385.99, writes: 960.00, response time: 200.87ms (95%), errors: 0.00, reconnects:  0.00
[ 386s] threads: 32, tps: 215.00, reads: 2958.04, writes: 775.01, response time: 244.82ms (95%), errors: 0.00, reconnects:  0.00
[ 387s] threads: 32, tps: 292.99, reads: 4129.92, writes: 1229.98, response time: 144.60ms (95%), errors: 0.00, reconnects:  0.00
[ 388s] threads: 32, tps: 227.00, reads: 3163.06, writes: 851.02, response time: 235.48ms (95%), errors: 0.00, reconnects:  0.00
[ 389s] threads: 32, tps: 247.00, reads: 3495.94, writes: 1075.98, response time: 162.61ms (95%), errors: 0.00, reconnects:  0.00
[ 390s] threads: 32, tps: 246.00, reads: 3213.02, writes: 889.00, response time: 212.06ms (95%), errors: 0.00, reconnects:  0.00
[ 391s] threads: 32, tps: 237.00, reads: 3327.04, writes: 972.01, response time: 203.90ms (95%), errors: 0.00, reconnects:  0.00
[ 392s] threads: 32, tps: 267.97, reads: 3836.54, writes: 1106.87, response time: 148.69ms (95%), errors: 0.00, reconnects:  0.00
[ 393s] threads: 32, tps: 277.03, reads: 4005.38, writes: 1136.11, response time: 172.38ms (95%), errors: 0.00, reconnects:  0.00
[ 394s] threads: 32, tps: 229.01, reads: 3122.08, writes: 811.02, response time: 188.75ms (95%), errors: 0.00, reconnects:  0.00
[ 395s] threads: 32, tps: 228.00, reads: 3059.00, writes: 922.00, response time: 207.47ms (95%), errors: 0.00, reconnects:  0.00
[ 396s] threads: 32, tps: 247.97, reads: 3572.62, writes: 975.90, response time: 206.17ms (95%), errors: 0.00, reconnects:  0.00
[ 397s] threads: 32, tps: 251.02, reads: 3640.29, writes: 1097.09, response time: 171.51ms (95%), errors: 0.00, reconnects:  0.00
[ 398s] threads: 32, tps: 217.01, reads: 3001.07, writes: 792.02, response time: 241.04ms (95%), errors: 0.00, reconnects:  0.00
[ 399s] threads: 32, tps: 265.00, reads: 3510.02, writes: 1059.01, response time: 173.63ms (95%), errors: 0.00, reconnects:  0.00
[ 400s] threads: 32, tps: 237.00, reads: 3326.98, writes: 983.99, response time: 193.32ms (95%), errors: 0.00, reconnects:  0.00
[ 401s] threads: 32, tps: 254.00, reads: 3786.97, writes: 1086.99, response time: 159.76ms (95%), errors: 0.00, reconnects:  0.00
[ 402s] threads: 32, tps: 267.00, reads: 3738.01, writes: 1068.00, response time: 170.94ms (95%), errors: 0.00, reconnects:  0.00
[ 403s] threads: 32, tps: 318.99, reads: 4457.89, writes: 1246.97, response time: 159.57ms (95%), errors: 0.00, reconnects:  0.00
[ 404s] threads: 32, tps: 262.01, reads: 3603.10, writes: 970.03, response time: 178.53ms (95%), errors: 0.00, reconnects:  0.00
[ 405s] threads: 32, tps: 234.00, reads: 3311.94, writes: 1017.98, response time: 235.83ms (95%), errors: 0.00, reconnects:  0.00
[ 406s] threads: 32, tps: 306.00, reads: 4304.97, writes: 1168.99, response time: 171.35ms (95%), errors: 0.00, reconnects:  0.00
[ 407s] threads: 32, tps: 265.99, reads: 3739.91, writes: 1143.97, response time: 150.39ms (95%), errors: 0.00, reconnects:  0.00
[ 408s] threads: 32, tps: 350.00, reads: 4769.03, writes: 1353.01, response time: 215.84ms (95%), errors: 0.00, reconnects:  0.00
[ 409s] threads: 32, tps: 339.01, reads: 4838.12, writes: 1355.03, response time: 135.39ms (95%), errors: 0.00, reconnects:  0.00
[ 410s] threads: 32, tps: 345.01, reads: 4735.11, writes: 1336.03, response time: 154.59ms (95%), errors: 0.00, reconnects:  0.00
[ 411s] threads: 32, tps: 321.99, reads: 4623.92, writes: 1352.98, response time: 150.61ms (95%), errors: 0.00, reconnects:  0.00
[ 412s] threads: 32, tps: 335.00, reads: 4708.02, writes: 1368.01, response time: 145.12ms (95%), errors: 0.00, reconnects:  0.00
[ 413s] threads: 32, tps: 307.99, reads: 4115.93, writes: 1174.98, response time: 169.62ms (95%), errors: 0.00, reconnects:  0.00
[ 414s] threads: 32, tps: 351.00, reads: 5039.98, writes: 1353.99, response time: 148.38ms (95%), errors: 0.00, reconnects:  0.00
[ 415s] threads: 32, tps: 323.01, reads: 4584.08, writes: 1390.02, response time: 155.84ms (95%), errors: 0.00, reconnects:  0.00
[ 416s] threads: 32, tps: 257.00, reads: 3605.99, writes: 1034.00, response time: 228.67ms (95%), errors: 0.00, reconnects:  0.00
[ 417s] threads: 32, tps: 385.01, reads: 5295.08, writes: 1458.02, response time: 140.68ms (95%), errors: 0.00, reconnects:  0.00
[ 418s] threads: 32, tps: 329.99, reads: 4685.92, writes: 1310.98, response time: 125.66ms (95%), errors: 0.00, reconnects:  0.00
[ 419s] threads: 32, tps: 386.01, reads: 5300.10, writes: 1523.03, response time: 123.10ms (95%), errors: 0.00, reconnects:  0.00
[ 420s] threads: 32, tps: 389.99, reads: 5430.84, writes: 1569.95, response time: 116.22ms (95%), errors: 0.00, reconnects:  0.00
[ 421s] threads: 32, tps: 305.01, reads: 4431.08, writes: 1312.02, response time: 175.30ms (95%), errors: 0.00, reconnects:  0.00
[ 422s] threads: 32, tps: 262.00, reads: 3666.98, writes: 1041.99, response time: 165.21ms (95%), errors: 0.00, reconnects:  0.00
[ 423s] threads: 32, tps: 327.99, reads: 4472.80, writes: 1233.94, response time: 147.31ms (95%), errors: 0.00, reconnects:  0.00
[ 424s] threads: 32, tps: 395.99, reads: 5570.85, writes: 1598.96, response time: 105.04ms (95%), errors: 0.00, reconnects:  0.00
[ 425s] threads: 32, tps: 389.03, reads: 5283.45, writes: 1532.13, response time: 137.39ms (95%), errors: 0.00, reconnects:  0.00
[ 426s] threads: 32, tps: 375.99, reads: 5397.90, writes: 1499.97, response time: 118.22ms (95%), errors: 0.00, reconnects:  0.00
[ 427s] threads: 32, tps: 288.00, reads: 4155.05, writes: 1260.01, response time: 170.84ms (95%), errors: 0.00, reconnects:  0.00
[ 428s] threads: 32, tps: 298.00, reads: 4107.05, writes: 1097.01, response time: 160.67ms (95%), errors: 0.00, reconnects:  0.00
[ 429s] threads: 32, tps: 368.00, reads: 5186.98, writes: 1503.99, response time: 124.28ms (95%), errors: 0.00, reconnects:  0.00
[ 430s] threads: 32, tps: 331.00, reads: 4588.93, writes: 1340.98, response time: 145.52ms (95%), errors: 0.00, reconnects:  0.00
[ 431s] threads: 32, tps: 381.01, reads: 5345.10, writes: 1496.03, response time: 114.56ms (95%), errors: 0.00, reconnects:  0.00
[ 432s] threads: 32, tps: 371.99, reads: 5249.84, writes: 1532.95, response time: 113.06ms (95%), errors: 0.00, reconnects:  0.00
[ 433s] threads: 32, tps: 313.00, reads: 4346.02, writes: 1182.01, response time: 148.29ms (95%), errors: 0.00, reconnects:  0.00
[ 434s] threads: 32, tps: 325.01, reads: 4556.11, writes: 1350.03, response time: 165.16ms (95%), errors: 0.00, reconnects:  0.00
[ 435s] threads: 32, tps: 404.00, reads: 5644.00, writes: 1593.00, response time: 105.86ms (95%), errors: 0.00, reconnects:  0.00
[ 436s] threads: 32, tps: 302.99, reads: 4305.91, writes: 1285.97, response time: 154.63ms (95%), errors: 0.00, reconnects:  0.00
[ 437s] threads: 32, tps: 311.00, reads: 4311.00, writes: 1154.00, response time: 161.83ms (95%), errors: 0.00, reconnects:  0.00
[ 438s] threads: 32, tps: 398.00, reads: 5538.97, writes: 1580.99, response time: 107.32ms (95%), errors: 0.00, reconnects:  0.00
[ 439s] threads: 32, tps: 323.00, reads: 4598.04, writes: 1391.01, response time: 141.31ms (95%), errors: 0.00, reconnects:  0.00
[ 440s] threads: 32, tps: 359.00, reads: 4912.04, writes: 1333.01, response time: 142.03ms (95%), errors: 0.00, reconnects:  0.00
[ 441s] threads: 32, tps: 379.00, reads: 5195.04, writes: 1540.01, response time: 131.79ms (95%), errors: 0.00, reconnects:  0.00
[ 442s] threads: 32, tps: 262.00, reads: 3757.98, writes: 1032.99, response time: 173.99ms (95%), errors: 0.00, reconnects:  0.00
[ 443s] threads: 32, tps: 289.00, reads: 4123.01, writes: 1184.00, response time: 181.82ms (95%), errors: 0.00, reconnects:  0.00
[ 444s] threads: 32, tps: 324.94, reads: 4482.17, writes: 1281.76, response time: 193.50ms (95%), errors: 0.00, reconnects:  0.00
[ 445s] threads: 32, tps: 294.04, reads: 4237.60, writes: 1216.17, response time: 175.93ms (95%), errors: 0.00, reconnects:  0.00
[ 446s] threads: 32, tps: 312.01, reads: 4177.20, writes: 1182.06, response time: 176.82ms (95%), errors: 0.00, reconnects:  0.00
[ 447s] threads: 32, tps: 353.99, reads: 5000.89, writes: 1422.97, response time: 162.51ms (95%), errors: 0.00, reconnects:  0.00
[ 448s] threads: 32, tps: 299.00, reads: 4281.06, writes: 1209.02, response time: 178.15ms (95%), errors: 0.00, reconnects:  0.00
[ 449s] threads: 32, tps: 290.00, reads: 3897.97, writes: 1134.99, response time: 169.31ms (95%), errors: 0.00, reconnects:  0.00
[ 450s] threads: 32, tps: 387.99, reads: 5597.82, writes: 1582.95, response time: 109.56ms (95%), errors: 0.00, reconnects:  0.00
[ 451s] threads: 32, tps: 348.97, reads: 4864.65, writes: 1398.90, response time: 152.56ms (95%), errors: 0.00, reconnects:  0.00
[ 452s] threads: 32, tps: 347.04, reads: 4869.49, writes: 1360.14, response time: 143.40ms (95%), errors: 0.00, reconnects:  0.00
[ 453s] threads: 32, tps: 402.00, reads: 5592.02, writes: 1605.01, response time: 114.19ms (95%), errors: 0.00, reconnects:  0.00
[ 454s] threads: 32, tps: 351.00, reads: 4770.01, writes: 1410.00, response time: 137.14ms (95%), errors: 0.00, reconnects:  0.00
[ 455s] threads: 32, tps: 331.00, reads: 4602.01, writes: 1320.00, response time: 141.90ms (95%), errors: 0.00, reconnects:  0.00
[ 456s] threads: 32, tps: 375.00, reads: 5331.04, writes: 1504.01, response time: 140.76ms (95%), errors: 0.00, reconnects:  0.00
[ 457s] threads: 32, tps: 265.99, reads: 3915.89, writes: 1169.97, response time: 207.91ms (95%), errors: 0.00, reconnects:  0.00
[ 458s] threads: 32, tps: 250.99, reads: 3513.82, writes: 1005.95, response time: 170.59ms (95%), errors: 0.00, reconnects:  0.00
[ 459s] threads: 32, tps: 300.01, reads: 4049.15, writes: 1149.04, response time: 211.36ms (95%), errors: 0.00, reconnects:  0.00
[ 460s] threads: 32, tps: 320.01, reads: 4609.19, writes: 1278.05, response time: 151.83ms (95%), errors: 0.00, reconnects:  0.00
[ 461s] threads: 32, tps: 219.00, reads: 3078.93, writes: 873.98, response time: 225.95ms (95%), errors: 0.00, reconnects:  0.00
[ 462s] threads: 32, tps: 227.00, reads: 3136.99, writes: 899.00, response time: 238.32ms (95%), errors: 0.00, reconnects:  0.00
[ 463s] threads: 32, tps: 298.01, reads: 4191.11, writes: 1151.03, response time: 156.36ms (95%), errors: 0.00, reconnects:  0.00
[ 464s] threads: 32, tps: 349.99, reads: 4841.89, writes: 1440.97, response time: 122.14ms (95%), errors: 0.00, reconnects:  0.00
[ 465s] threads: 32, tps: 390.01, reads: 5447.08, writes: 1545.02, response time: 112.19ms (95%), errors: 0.00, reconnects:  0.00
[ 466s] threads: 32, tps: 255.00, reads: 3671.98, writes: 1096.99, response time: 190.85ms (95%), errors: 0.00, reconnects:  0.00
[ 467s] threads: 32, tps: 344.00, reads: 4705.03, writes: 1275.01, response time: 131.83ms (95%), errors: 0.00, reconnects:  0.00
[ 468s] threads: 32, tps: 328.00, reads: 4679.00, writes: 1383.00, response time: 166.70ms (95%), errors: 0.00, reconnects:  0.00
[ 469s] threads: 32, tps: 356.00, reads: 4749.98, writes: 1327.99, response time: 169.97ms (95%), errors: 0.00, reconnects:  0.00
[ 470s] threads: 32, tps: 327.98, reads: 4716.75, writes: 1353.93, response time: 137.06ms (95%), errors: 0.00, reconnects:  0.00
[ 471s] threads: 32, tps: 333.01, reads: 4775.21, writes: 1382.06, response time: 210.10ms (95%), errors: 0.00, reconnects:  0.00
[ 472s] threads: 32, tps: 329.00, reads: 4622.05, writes: 1348.02, response time: 156.17ms (95%), errors: 0.00, reconnects:  0.00
[ 473s] threads: 32, tps: 318.00, reads: 4300.99, writes: 1160.00, response time: 131.00ms (95%), errors: 0.00, reconnects:  0.00
[ 474s] threads: 32, tps: 366.99, reads: 5279.91, writes: 1559.97, response time: 121.12ms (95%), errors: 0.00, reconnects:  0.00
[ 475s] threads: 32, tps: 392.01, reads: 5435.17, writes: 1485.05, response time: 106.46ms (95%), errors: 0.00, reconnects:  0.00
[ 476s] threads: 32, tps: 361.99, reads: 5016.81, writes: 1497.94, response time: 139.67ms (95%), errors: 0.00, reconnects:  0.00
[ 477s] threads: 32, tps: 382.01, reads: 5385.15, writes: 1470.04, response time: 118.50ms (95%), errors: 0.00, reconnects:  0.00
[ 478s] threads: 32, tps: 352.00, reads: 5007.95, writes: 1519.99, response time: 113.03ms (95%), errors: 0.00, reconnects:  0.00
[ 479s] threads: 32, tps: 258.96, reads: 3499.48, writes: 1001.85, response time: 177.30ms (95%), errors: 0.00, reconnects:  0.00
[ 480s] threads: 32, tps: 384.07, reads: 5340.93, writes: 1481.26, response time: 157.34ms (95%), errors: 0.00, reconnects:  0.00
[ 481s] threads: 32, tps: 362.99, reads: 5088.92, writes: 1466.98, response time: 134.74ms (95%), errors: 0.00, reconnects:  0.00
[ 482s] threads: 32, tps: 327.00, reads: 4576.06, writes: 1278.02, response time: 203.48ms (95%), errors: 0.00, reconnects:  0.00
[ 483s] threads: 32, tps: 390.93, reads: 5542.94, writes: 1573.70, response time: 111.08ms (95%), errors: 0.00, reconnects:  0.00
[ 484s] threads: 32, tps: 353.06, reads: 4681.85, writes: 1393.25, response time: 196.94ms (95%), errors: 0.00, reconnects:  0.00
[ 485s] threads: 32, tps: 219.95, reads: 3041.27, writes: 883.79, response time: 210.16ms (95%), errors: 0.00, reconnects:  0.00
[ 486s] threads: 32, tps: 209.05, reads: 3195.69, writes: 826.18, response time: 238.24ms (95%), errors: 0.00, reconnects:  0.00
[ 487s] threads: 32, tps: 373.01, reads: 5316.14, writes: 1578.04, response time: 110.19ms (95%), errors: 0.00, reconnects:  0.00
[ 488s] threads: 32, tps: 368.00, reads: 5136.02, writes: 1442.01, response time: 130.57ms (95%), errors: 0.00, reconnects:  0.00
[ 489s] threads: 32, tps: 401.98, reads: 5614.77, writes: 1593.93, response time: 112.83ms (95%), errors: 0.00, reconnects:  0.00
[ 490s] threads: 32, tps: 343.01, reads: 4854.19, writes: 1452.06, response time: 123.06ms (95%), errors: 0.00, reconnects:  0.00
[ 491s] threads: 32, tps: 275.98, reads: 3556.78, writes: 1011.94, response time: 183.51ms (95%), errors: 0.00, reconnects:  0.00
[ 492s] threads: 32, tps: 391.02, reads: 5612.33, writes: 1562.09, response time: 109.99ms (95%), errors: 0.00, reconnects:  0.00
[ 493s] threads: 32, tps: 374.99, reads: 5307.90, writes: 1475.97, response time: 117.30ms (95%), errors: 0.00, reconnects:  0.00
[ 494s] threads: 32, tps: 326.00, reads: 4593.95, writes: 1375.98, response time: 154.17ms (95%), errors: 0.00, reconnects:  0.00
[ 495s] threads: 32, tps: 400.01, reads: 5657.21, writes: 1571.06, response time: 107.26ms (95%), errors: 0.00, reconnects:  0.00
[ 496s] threads: 32, tps: 371.99, reads: 5231.90, writes: 1557.97, response time: 111.72ms (95%), errors: 0.00, reconnects:  0.00
[ 497s] threads: 32, tps: 339.01, reads: 4592.09, writes: 1248.02, response time: 156.92ms (95%), errors: 0.00, reconnects:  0.00
[ 498s] threads: 32, tps: 366.00, reads: 5277.97, writes: 1576.99, response time: 121.52ms (95%), errors: 0.00, reconnects:  0.00
[ 499s] threads: 32, tps: 376.01, reads: 5036.07, writes: 1400.02, response time: 152.15ms (95%), errors: 0.00, reconnects:  0.00
[ 500s] threads: 32, tps: 318.00, reads: 4437.96, writes: 1266.99, response time: 163.83ms (95%), errors: 0.00, reconnects:  0.00
[ 501s] threads: 32, tps: 332.99, reads: 4840.89, writes: 1346.97, response time: 155.47ms (95%), errors: 0.00, reconnects:  0.00
[ 502s] threads: 32, tps: 358.01, reads: 4944.13, writes: 1473.04, response time: 140.55ms (95%), errors: 0.00, reconnects:  0.00
[ 503s] threads: 32, tps: 340.99, reads: 4783.92, writes: 1317.98, response time: 131.87ms (95%), errors: 0.00, reconnects:  0.00
[ 504s] threads: 32, tps: 378.01, reads: 5237.07, writes: 1519.02, response time: 120.94ms (95%), errors: 0.00, reconnects:  0.00
[ 505s] threads: 32, tps: 339.99, reads: 4935.89, writes: 1450.97, response time: 138.09ms (95%), errors: 0.00, reconnects:  0.00
[ 506s] threads: 32, tps: 326.01, reads: 4259.11, writes: 1177.03, response time: 147.75ms (95%), errors: 0.00, reconnects:  0.00
[ 507s] threads: 32, tps: 391.00, reads: 5628.99, writes: 1607.00, response time: 107.36ms (95%), errors: 0.00, reconnects:  0.00
[ 508s] threads: 32, tps: 384.00, reads: 5370.01, writes: 1519.00, response time: 109.24ms (95%), errors: 0.00, reconnects:  0.00
[ 509s] threads: 32, tps: 340.99, reads: 4929.89, writes: 1465.97, response time: 120.72ms (95%), errors: 0.00, reconnects:  0.00
[ 510s] threads: 32, tps: 415.95, reads: 5623.38, writes: 1561.83, response time: 114.77ms (95%), errors: 0.00, reconnects:  0.00
[ 511s] threads: 32, tps: 290.03, reads: 4121.49, writes: 1190.14, response time: 170.99ms (95%), errors: 0.00, reconnects:  0.00
[ 512s] threads: 32, tps: 335.00, reads: 4777.04, writes: 1346.01, response time: 126.46ms (95%), errors: 0.00, reconnects:  0.00
[ 513s] threads: 32, tps: 383.00, reads: 5413.94, writes: 1597.98, response time: 103.32ms (95%), errors: 0.00, reconnects:  0.00
[ 514s] threads: 32, tps: 349.00, reads: 4884.96, writes: 1389.99, response time: 159.38ms (95%), errors: 0.00, reconnects:  0.00
[ 515s] threads: 32, tps: 317.73, reads: 4393.31, writes: 1173.01, response time: 182.85ms (95%), errors: 0.00, reconnects:  0.00
[ 516s] threads: 32, tps: 373.32, reads: 5281.47, writes: 1589.35, response time: 119.36ms (95%), errors: 0.00, reconnects:  0.00
[ 517s] threads: 32, tps: 386.00, reads: 5405.02, writes: 1551.00, response time: 115.39ms (95%), errors: 0.00, reconnects:  0.00
[ 518s] threads: 32, tps: 341.00, reads: 4590.94, writes: 1255.98, response time: 158.62ms (95%), errors: 0.00, reconnects:  0.00
[ 519s] threads: 32, tps: 357.01, reads: 4980.11, writes: 1415.03, response time: 116.39ms (95%), errors: 0.00, reconnects:  0.00
[ 520s] threads: 32, tps: 389.00, reads: 5605.00, writes: 1612.00, response time: 107.68ms (95%), errors: 0.00, reconnects:  0.00
[ 521s] threads: 32, tps: 341.00, reads: 4706.99, writes: 1353.00, response time: 131.75ms (95%), errors: 0.00, reconnects:  0.00
[ 522s] threads: 32, tps: 407.99, reads: 5784.90, writes: 1627.97, response time: 106.49ms (95%), errors: 0.00, reconnects:  0.00
[ 523s] threads: 32, tps: 370.01, reads: 5177.11, writes: 1527.03, response time: 114.56ms (95%), errors: 0.00, reconnects:  0.00
[ 524s] threads: 32, tps: 352.00, reads: 4641.99, writes: 1322.00, response time: 155.93ms (95%), errors: 0.00, reconnects:  0.00
[ 525s] threads: 32, tps: 360.00, reads: 5265.99, writes: 1468.00, response time: 121.67ms (95%), errors: 0.00, reconnects:  0.00
[ 526s] threads: 32, tps: 320.99, reads: 4554.88, writes: 1270.97, response time: 139.63ms (95%), errors: 0.00, reconnects:  0.00
[ 527s] threads: 32, tps: 290.01, reads: 3888.11, writes: 1140.03, response time: 339.38ms (95%), errors: 0.00, reconnects:  0.00
[ 528s] threads: 32, tps: 395.44, reads: 5621.02, writes: 1607.72, response time: 107.97ms (95%), errors: 0.00, reconnects:  0.00
[ 529s] threads: 32, tps: 342.48, reads: 4823.72, writes: 1375.92, response time: 141.52ms (95%), errors: 0.00, reconnects:  0.00
[ 530s] threads: 32, tps: 267.00, reads: 3779.03, writes: 1083.01, response time: 170.53ms (95%), errors: 0.00, reconnects:  0.00
[ 531s] threads: 32, tps: 367.01, reads: 5163.08, writes: 1452.02, response time: 120.51ms (95%), errors: 0.00, reconnects:  0.00
[ 532s] threads: 32, tps: 314.00, reads: 4425.96, writes: 1348.99, response time: 232.33ms (95%), errors: 0.00, reconnects:  0.00
[ 533s] threads: 32, tps: 342.00, reads: 4675.06, writes: 1310.02, response time: 130.69ms (95%), errors: 0.00, reconnects:  0.00
[ 534s] threads: 32, tps: 406.99, reads: 5572.93, writes: 1566.98, response time: 107.29ms (95%), errors: 0.00, reconnects:  0.00
[ 535s] threads: 32, tps: 340.01, reads: 4842.07, writes: 1370.02, response time: 149.76ms (95%), errors: 0.00, reconnects:  0.00
[ 536s] threads: 32, tps: 282.99, reads: 3919.89, writes: 1121.97, response time: 171.92ms (95%), errors: 0.00, reconnects:  0.00
[ 537s] threads: 32, tps: 375.00, reads: 5410.06, writes: 1569.02, response time: 105.64ms (95%), errors: 0.00, reconnects:  0.00
[ 538s] threads: 32, tps: 368.00, reads: 5190.06, writes: 1522.02, response time: 125.93ms (95%), errors: 0.00, reconnects:  0.00
[ 539s] threads: 32, tps: 338.00, reads: 4578.04, writes: 1233.01, response time: 169.82ms (95%), errors: 0.00, reconnects:  0.00
[ 540s] threads: 32, tps: 354.00, reads: 4899.98, writes: 1421.99, response time: 143.23ms (95%), errors: 0.00, reconnects:  0.00
[ 541s] threads: 32, tps: 409.00, reads: 5767.01, writes: 1631.00, response time: 107.58ms (95%), errors: 0.00, reconnects:  0.00
[ 542s] threads: 32, tps: 314.00, reads: 4355.98, writes: 1255.99, response time: 159.90ms (95%), errors: 0.00, reconnects:  0.00
[ 543s] threads: 32, tps: 354.99, reads: 5150.88, writes: 1477.97, response time: 142.80ms (95%), errors: 0.00, reconnects:  0.00
[ 544s] threads: 32, tps: 417.00, reads: 5630.06, writes: 1628.02, response time: 106.14ms (95%), errors: 0.00, reconnects:  0.00
[ 545s] threads: 32, tps: 338.00, reads: 4926.07, writes: 1396.02, response time: 130.42ms (95%), errors: 0.00, reconnects:  0.00
[ 546s] threads: 32, tps: 385.00, reads: 5379.02, writes: 1505.01, response time: 119.61ms (95%), errors: 0.00, reconnects:  0.00
[ 547s] threads: 32, tps: 341.99, reads: 4798.90, writes: 1435.97, response time: 165.46ms (95%), errors: 0.00, reconnects:  0.00
[ 548s] threads: 32, tps: 321.01, reads: 4424.07, writes: 1185.02, response time: 156.78ms (95%), errors: 0.00, reconnects:  0.00
[ 549s] threads: 32, tps: 386.00, reads: 5448.98, writes: 1602.00, response time: 108.26ms (95%), errors: 0.00, reconnects:  0.00
[ 550s] threads: 32, tps: 396.00, reads: 5438.96, writes: 1580.99, response time: 104.79ms (95%), errors: 0.00, reconnects:  0.00
[ 551s] threads: 32, tps: 362.01, reads: 5071.07, writes: 1412.02, response time: 128.40ms (95%), errors: 0.00, reconnects:  0.00
[ 552s] threads: 32, tps: 387.00, reads: 5341.96, writes: 1523.99, response time: 116.32ms (95%), errors: 0.00, reconnects:  0.00
[ 553s] threads: 32, tps: 389.00, reads: 5543.97, writes: 1592.99, response time: 116.85ms (95%), errors: 0.00, reconnects:  0.00
[ 554s] threads: 32, tps: 252.00, reads: 3662.98, writes: 1058.99, response time: 175.82ms (95%), errors: 0.00, reconnects:  0.00
[ 555s] threads: 32, tps: 397.01, reads: 5374.08, writes: 1536.02, response time: 124.58ms (95%), errors: 0.00, reconnects:  0.00
[ 556s] threads: 32, tps: 357.00, reads: 5110.99, writes: 1411.00, response time: 142.37ms (95%), errors: 0.00, reconnects:  0.00
[ 557s] threads: 32, tps: 250.00, reads: 3397.96, writes: 988.99, response time: 309.95ms (95%), errors: 0.00, reconnects:  0.00
[ 558s] threads: 32, tps: 378.01, reads: 5371.11, writes: 1553.03, response time: 118.89ms (95%), errors: 0.00, reconnects:  0.00
[ 559s] threads: 32, tps: 389.00, reads: 5492.99, writes: 1543.00, response time: 114.08ms (95%), errors: 0.00, reconnects:  0.00
[ 560s] threads: 32, tps: 342.00, reads: 4722.99, writes: 1339.00, response time: 131.71ms (95%), errors: 0.00, reconnects:  0.00
[ 561s] threads: 32, tps: 357.99, reads: 5099.91, writes: 1521.97, response time: 126.12ms (95%), errors: 0.00, reconnects:  0.00
[ 562s] threads: 32, tps: 414.99, reads: 5505.87, writes: 1562.96, response time: 110.42ms (95%), errors: 0.00, reconnects:  0.00
[ 563s] threads: 32, tps: 272.01, reads: 4003.16, writes: 1088.04, response time: 165.70ms (95%), errors: 0.00, reconnects:  0.00
[ 564s] threads: 32, tps: 401.96, reads: 5625.48, writes: 1620.85, response time: 107.26ms (95%), errors: 0.00, reconnects:  0.00
[ 565s] threads: 32, tps: 378.03, reads: 5381.39, writes: 1545.11, response time: 114.87ms (95%), errors: 0.00, reconnects:  0.00
[ 566s] threads: 32, tps: 264.99, reads: 3767.91, writes: 1140.97, response time: 170.94ms (95%), errors: 0.00, reconnects:  0.00
[ 567s] threads: 32, tps: 399.01, reads: 5519.10, writes: 1545.03, response time: 159.81ms (95%), errors: 0.00, reconnects:  0.00
[ 568s] threads: 32, tps: 408.00, reads: 5672.05, writes: 1609.02, response time: 109.34ms (95%), errors: 0.00, reconnects:  0.00
[ 569s] threads: 32, tps: 309.99, reads: 4315.93, writes: 1221.98, response time: 162.36ms (95%), errors: 0.00, reconnects:  0.00
[ 570s] threads: 32, tps: 403.01, reads: 5680.12, writes: 1617.03, response time: 104.66ms (95%), errors: 0.00, reconnects:  0.00
[ 571s] threads: 32, tps: 401.99, reads: 5602.89, writes: 1602.97, response time: 109.14ms (95%), errors: 0.00, reconnects:  0.00
[ 572s] threads: 32, tps: 319.00, reads: 4349.06, writes: 1281.02, response time: 202.02ms (95%), errors: 0.00, reconnects:  0.00
[ 573s] threads: 32, tps: 402.01, reads: 5696.10, writes: 1580.03, response time: 102.58ms (95%), errors: 0.00, reconnects:  0.00
[ 574s] threads: 32, tps: 380.00, reads: 5344.94, writes: 1529.98, response time: 114.70ms (95%), errors: 0.00, reconnects:  0.00
[ 575s] threads: 32, tps: 320.00, reads: 4604.00, writes: 1351.00, response time: 137.55ms (95%), errors: 0.00, reconnects:  0.00
[ 576s] threads: 32, tps: 364.00, reads: 4962.98, writes: 1363.99, response time: 169.47ms (95%), errors: 0.00, reconnects:  0.00
[ 577s] threads: 32, tps: 388.00, reads: 5480.02, writes: 1599.01, response time: 114.80ms (95%), errors: 0.00, reconnects:  0.00
[ 578s] threads: 32, tps: 309.00, reads: 4316.05, writes: 1210.01, response time: 192.57ms (95%), errors: 0.00, reconnects:  0.00
[ 579s] threads: 32, tps: 398.00, reads: 5648.01, writes: 1652.00, response time: 102.58ms (95%), errors: 0.00, reconnects:  0.00
[ 580s] threads: 32, tps: 359.00, reads: 5009.00, writes: 1408.00, response time: 129.44ms (95%), errors: 0.00, reconnects:  0.00
[ 581s] threads: 32, tps: 306.00, reads: 4269.93, writes: 1234.98, response time: 198.07ms (95%), errors: 0.00, reconnects:  0.00
[ 582s] threads: 32, tps: 399.01, reads: 5489.09, writes: 1536.02, response time: 117.66ms (95%), errors: 0.00, reconnects:  0.00
[ 583s] threads: 32, tps: 396.00, reads: 5557.00, writes: 1612.00, response time: 103.72ms (95%), errors: 0.00, reconnects:  0.00
[ 584s] threads: 32, tps: 328.00, reads: 4709.00, writes: 1331.00, response time: 147.75ms (95%), errors: 0.00, reconnects:  0.00
[ 585s] threads: 32, tps: 385.99, reads: 5346.92, writes: 1548.98, response time: 121.74ms (95%), errors: 0.00, reconnects:  0.00
[ 586s] threads: 32, tps: 392.95, reads: 5418.35, writes: 1550.81, response time: 109.04ms (95%), errors: 0.00, reconnects:  0.00
[ 587s] threads: 32, tps: 288.00, reads: 4045.05, writes: 1140.01, response time: 292.82ms (95%), errors: 0.00, reconnects:  0.00
[ 588s] threads: 32, tps: 424.04, reads: 5822.59, writes: 1704.17, response time: 104.28ms (95%), errors: 0.00, reconnects:  0.00
[ 589s] threads: 32, tps: 384.99, reads: 5625.91, writes: 1570.97, response time: 105.48ms (95%), errors: 0.00, reconnects:  0.00
[ 590s] threads: 32, tps: 293.01, reads: 4088.08, writes: 1184.02, response time: 175.40ms (95%), errors: 0.00, reconnects:  0.00
[ 591s] threads: 32, tps: 398.87, reads: 5499.15, writes: 1588.47, response time: 109.30ms (95%), errors: 0.00, reconnects:  0.00
[ 592s] threads: 32, tps: 368.13, reads: 5275.86, writes: 1487.52, response time: 111.18ms (95%), errors: 0.00, reconnects:  0.00
[ 593s] threads: 32, tps: 320.00, reads: 4214.94, writes: 1208.98, response time: 149.71ms (95%), errors: 0.00, reconnects:  0.00
[ 594s] threads: 32, tps: 369.99, reads: 5391.92, writes: 1501.98, response time: 128.09ms (95%), errors: 0.00, reconnects:  0.00
[ 595s] threads: 32, tps: 422.01, reads: 5743.16, writes: 1660.05, response time: 104.79ms (95%), errors: 0.00, reconnects:  0.00
[ 596s] threads: 32, tps: 284.00, reads: 4063.01, writes: 1142.00, response time: 211.42ms (95%), errors: 0.00, reconnects:  0.00
[ 597s] threads: 32, tps: 362.99, reads: 4952.92, writes: 1439.98, response time: 148.91ms (95%), errors: 0.00, reconnects:  0.00
[ 598s] threads: 32, tps: 348.00, reads: 5008.07, writes: 1451.02, response time: 129.83ms (95%), errors: 0.00, reconnects:  0.00
[ 599s] threads: 32, tps: 289.00, reads: 4145.93, writes: 1152.98, response time: 202.44ms (95%), errors: 0.00, reconnects:  0.00
[ 600s] threads: 32, tps: 399.01, reads: 5461.11, writes: 1553.03, response time: 133.98ms (95%), errors: 0.00, reconnects:  0.00
OLTP test statistics:
    queries performed:
        read:                            2773638
        write:                           792468
        other:                           396234
        total:                           3962340
    transactions:                        198117 (330.16 per sec.)
    read/write requests:                 3566106 (5942.79 per sec.)
    other operations:                    396234 (660.31 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          600.0722s
    total number of events:              198117
    total time taken by event execution: 19200.3205s
    response time:
         min:                                 28.03ms
         avg:                                 96.91ms
         max:                               1212.17ms
         approx.  95 percentile:             157.20ms

Threads fairness:
    events (avg/stddev):           6191.1562/14.19
    execution time (avg/stddev):   600.0100/0.02

[oracle@sjjh admin]$ sysbench --test=/sysbench-0.5/tests/db/oltp.lua --db-driver=oracle --oltp-table-name=sysbench --oltp-table-size=250000 --oltp-tables-count=25 --oracle-db=sjjh --oracle-user=sysbench --oracle-password=sysbench --max-time=600 --max-requests=10000000 --num-threads=32 --report-interval=1 cleanup
sysbench 0.5:  multi-threaded system evaluation benchmark

Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...
Dropping table 'sbtest5'...
Dropping table 'sbtest6'...
Dropping table 'sbtest7'...
Dropping table 'sbtest8'...
Dropping table 'sbtest9'...
Dropping table 'sbtest10'...
Dropping table 'sbtest11'...
Dropping table 'sbtest12'...
Dropping table 'sbtest13'...
Dropping table 'sbtest14'...
Dropping table 'sbtest15'...
Dropping table 'sbtest16'...
Dropping table 'sbtest17'...
Dropping table 'sbtest18'...
Dropping table 'sbtest19'...
Dropping table 'sbtest20'...
Dropping table 'sbtest21'...
Dropping table 'sbtest22'...
Dropping table 'sbtest23'...
Dropping table 'sbtest24'...
Dropping table 'sbtest25'...
]]>
http://www.jydba.net/index.php/archives/3451/feed 0
Oracle 11G RAC复制备库RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038故障 http://www.jydba.net/index.php/archives/3427 http://www.jydba.net/index.php/archives/3427#respond Mon, 26 Sep 2022 00:54:50 +0000 http://www.jydba.net/?p=3427 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
]]>
http://www.jydba.net/index.php/archives/3427/feed 0
Oracle Linux 6.7 静默认安装Oracle 11g http://www.jydba.net/index.php/archives/3424 http://www.jydba.net/index.php/archives/3424#respond Tue, 20 Sep 2022 01:24:27 +0000 http://www.jydba.net/?p=3424 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>
]]>
http://www.jydba.net/index.php/archives/3424/feed 0
Oracle Linux 7.1 静默安装Oracle 18c RAC http://www.jydba.net/index.php/archives/3419 http://www.jydba.net/index.php/archives/3419#respond Wed, 14 Sep 2022 08:12:47 +0000 http://www.jydba.net/?p=3419 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
]]>
http://www.jydba.net/index.php/archives/3419/feed 0
Oracle索引访问路径因没有新的统计信息而改变 http://www.jydba.net/index.php/archives/3262 http://www.jydba.net/index.php/archives/3262#respond Thu, 08 Apr 2021 08:06:38 +0000 http://www.jydba.net/?p=3262 索引访问路径因没有新的统计信息而改变
在生产环境中,同一个查询的执行路径经常变化,甚至在没有任何相关变化的情况下也是如此。你确认没有收集新的统计信息(事实上,你甚至可能已经锁定了统计信息,以防止执行计划的变化)。在Oracle Database 11g之前的版本中,基数据反馈功能和自动查询调优功能,如果没有任何东西真正改变(即统计信息,实例参数等),对目前直方图的绑定窥视之类的东西没有起作用,那么执行计划几乎保持不变。然而,尽管你绝对肯定优化器不应该改变任何的执行计划,但它确实改变了。这怎么可能呢,嗯,大多数数据库都是“活体”,由于不断进行的交易数据而不断变化。事实上,如果基础数据发生了重大修改,但没有收集新的统计信息以反映这些变化,因为优化器根据不同访问路径的成本做出决定,而成本可能因为数据的变化而改变,所以执行可能将改变。

如果不随着数据的变化对优化器统计信息进行更新,在某些情况下,优化器将很可能错误地估计基数,也就是预期查询返回的行数。如果应用程序往表中添加了大量数据,而没有收集新的统计信息,你可能会认为,因为优化器不知道有新的数据,所以它会继续使用原来的执行计划(计划目前有效)。实际上,如果基于成本的优化器算错了查询真正的选择性和基数,那么随首时间的推移,它有时会改变其执行计划。在输入数量非常大的新数据后,为了执行相同的查询,优化器可能使用不同的计划,因为它低估了查询现在将检索的行数。如果在加入大量的数据之前,全表扫描是最优策略,那么在加入另外的数据后,优化器可能误以为使用索引效果会更好,而实际上全表扫描可能仍然是最好的方法。

1 使用不等条件
使用不等条件的语句,比如select * from emp where department_id<>10有时可能会导致优化器不使用索引。原因是如果优化器猜测某个查询将从表中选择大多数的值,它往往就不会使用索引。如果是这种情况,对表执行全表扫描可能是更有效的。通常情况下,优化器使用公式(1-(1/num_distinct))* num_rows估算基数。换句话说,如果某个列有1000行,其中不同的值有4个,那么基数为750。我们假设,表中大部分行满足为不等条件指定的值。在这种情况下,你可能会认为优化器会使用索引扫描,因为,毕竟所要检索的是不包含在不等条件中指定的值的所有行。然而,在指定<>操作符时,优化器会简单地忽略任何可能有的索引,即使数据分布不均,且<>条件将导致检索表中很小一部分行也是如此。在这种情况下,优化器只是倾向于执行全表扫描,而不是”正确“地选择索引。

运行这个例子中的查询,结果如下:

SQL> select * from emp where department_id<>10;

105 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 3956160932

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |   105 |  7245 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| EMP  |   105 |  7245 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("DEPARTMENT_ID"<>10)

<>子句导致优化器跳过department_id列上的索引。可以尝试用index提供示强制使用索引,如下所示:

SQL> select /*+ index(emp,dept_idx) */ * from emp where department_id<>10;

105 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 169023637

------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |          |   105 |  7245 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMP      |   105 |  7245 |     2   (0)| 00:00:01 |
|*  2 |   INDEX FULL SCAN                   | DEPT_IDX |   104 |       |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter("DEPARTMENT_ID"<>10)

index提示使优化器用全索引扫描替换了全表扫描,虽然这是较好的,但不如索引范围扫描那么好。全索引扫描必须读取包含<>操作符中指定的值的所有叶节点,因此它不是非常有效的方法。(然而,在其他情况下,优化器可能会因为指定index提示而执行索引范围扫描。)指定<>条件的问题是,优化器甚至可能在查询返回表中很小一部分行时也跳过索引,它只是忽略where谓词中出现的列的索引。忽略索引意味着优化器在生成”最优“的计划之前,甚至不会计算索引扫描的成本,它认为这样会节省所有因此(计算索引扫描成本)花费的开销,因为它假设<>条件将导致提取表中很大一部分行。在这样的情况下,可以尝试重写查询以避免使用<>运算符。

注意:无法强制数据库执行并行索引范围扫描。但是,数据库在执行燕行嵌套循环连接时,确实执行了并行索引查找。

这里的唯一选择就是重写查询,以消除不等于子句。如果有多个谓词需要处理,就更有必要这么做。请记住,当指定not in子句时,优化器的行为与指定不等于子句是相同的。在某些情况下,另一个很好的解决方案是用case结构取代不等于谓词。请记住,如果使用case结构,那么还需要与之相匹配的基于函数的索引。

2 使用通配符查询
如果执行一个包含前导通配符搜索的查询,优化器可能会忽略索引而执行全表扫描。例如对于下面的查询:

SQL> select * from emp where last_name like '%hen';

如果匹配模式中的前导字符不是”%“或下划线(_),优化器更有可能使用索引。like运算符的初始字符使用通配符”%“或”_”,意味着数据库可能必须读取表中大部分行。如果使用索引,也需要访问每个索引块,对索引的读取完成后,可能还需要扫描大多数的表块。在这种情况下,全表扫描可能会更有效。优化器跳过last_name列的索引,因为它必须检查列中的每个值,以确定这些值是否以”hen”值结束。它最后选择了全表扫描,如下面语句的解释计划所示:

SQL> select * from emp where last_name like '%hen';


Execution Plan
----------------------------------------------------------
Plan hash value: 3956160932

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     5 |   345 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| EMP  |     5 |   345 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("LAST_NAME" LIKE '%hen')

如果把上述语句修改为如下所示的语句,优化器就选择了索引扫描。

SQL> select * from emp where last_name like 'hen%';

no rows selected


Execution Plan
----------------------------------------------------------
Plan hash value: 2522206107

-----------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |               |     1 |    69 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMP           |     1 |    69 |     1   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN                  | EMP_LAST_NAME |     1 |       |     1   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("LAST_NAME" LIKE 'hen%')
       filter("LAST_NAME" LIKE 'hen%')

请注意,第一个例子使用前导通配符搜索。事实上,为了强制使用索引,在这个例子中,只要把通配符(%)从前导位置向后移动哪怕一个字符的位置(select * from emp where last_name like ‘h%en%),都会使用优化器使用emp表中的emp_last_name索引。我们经常使用这个例子演示,在搜索字符串中推迟使用通配符不会阻止使用索引。那么,在“%”前有多少字符就将允许使用该索引呢?当额外的字符被添加到搜索字符串中通配符(%)规范前时,优化器自然会预计该数据库将读取更少的索引和表中更少的行,因此它更倾向于选择使用索引。因此,如果搜索“ABC%”,而不是“%ABC”,那么数据库将更有可能使用索引范围扫描,因为它意识到,这时采用全表扫描的成本更高。

3 在谓词中引用空值
假设有个只有两列的表,这两列都允许NULL值。我们还假设,事实上,表中有几行在两列中都是NULL。如果执行以下语句:

SQL> select * from mytable where a is null;

no rows selected


Execution Plan
----------------------------------------------------------
Plan hash value: 1015944200

-----------------------------------------------------------------------------
| Id  | Operation         | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |         |     1 |    26 |     2   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| MYTABLE |     1 |    26 |     2   (0)| 00:00:01 |
-----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("A" IS NULL)

数据库的优化器将不会使用此表上的唯一索引,因为假设有一行数据,它的某个唯一索引的所有列都是NULL值,数据库允许把这样的行添加到表中,但不会把它包括在索引中。事实上,即使表上有唯一索引,也可以向表中添加所有列都是NULL值的多少行,因为Oracle数据库认为所有列都是NULL值的两行是不同的,所以认为它们仍然符合唯一性。其结果是该表将比索引有更多的行,因为所有列都是NULL值的行不会被插入到索引中。当执行先前的查询时,数据库忽略了索引,因为该索引不包括所有的列都是NULL值的行。为了避免得出错误的答案,该数据库忽略了索引。

在这个例子中,让数据库使用索引的唯一方法是,确保在此表的两列中至少有一列被定义为

SQL> create table mytab1(a int,b int not null);

Table created.

SQL> create unique index mytab1_idx on mytab1(a,b);

Index created.

SQL> select * from mytab1 where a is null;

no rows selected


Execution Plan
----------------------------------------------------------
Plan hash value: 3315145109

-------------------------------------------------------------------------------
| Id  | Operation        | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT |            |     1 |    26 |     1   (0)| 00:00:01 |
|*  1 |  INDEX RANGE SCAN| MYTAB1_IDX |     1 |    26 |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access("A" IS NULL)

如果某行所有的索引列都是空的,Oracle数据库就不会把该行包含到索引中。然而,实际上可以简单地增加另一列到索引中,对NULL值进行索引,
如下所示:

SQL>create index with_null on employees(nullable_column,'1');

4 在查询中包含函数
如果某个查询在where子句中包含索引列上的函数,优化器也会跳过索引。请注意,无论是你在查询中显式地应用了函数,还是数据库在你不知道的情况下隐式地应用了函数,优化器都会跳过索引。下面先讨论显式应用函数。比如,执行以下查询:

SQL>select * from emp where upper(last_name)='CHEN';

在这种情况下,由于upper函数的存在,优化器跳过了last_name列的索引。(第5章介绍了如何使用基于函数的索引来解决这个问题)。如果应用程序需要频繁地把函数应用于索引列,那么最好创建基于函数的索引,以便允许数据库使用索引。

请注意,即使查询没有显式地把函数应用到某个列,在某些情况下它也可能隐式地这样做。例如,如果在表中定义了一个数值型的列,然后通过指定一个字符,而不是一个数值来查询列值,优化器就会忽略索引。也就是说,如果执行语句select * from emp where department_id=’10’,而不是select * from emp where department_id=10,优化器需要在幕后应用to_number函数才能得到答案。再次强调,使用函数意味着优化器将不使用索引。在这种情况下,即使指定了index提示,优化器也可能会执行全索引扫描,但不会执行索引唯一扫描。因为全索引扫描必须扫描整个索引,所以它比索引唯一扫描慢得多。

日期型数据经常会引起隐式转换,从而阻止使用索引。下面的表达式是非常常见的:

SQL> select * from emp where trunc(hire_date)=trunc(sysdate);

在写这样的查询时,人们往往下意识地使用trunc函数。我们把包含时间的日期截断,以消除一天中的时间,往往不考虑查询执行的后果。然而,对Oracle数据库而言,它只是注意到并没有真正对表达式trunc(hire_date)进行索引,而只索引了hire_date列。因此,数据库忽略了索引。

列trunc(hire_date)上的基于函数的索引会使优化器选择访问索引,但还有一种更简单的方法可以解决这个问题,而无需创建基于函数的索引。

只要对sysdate值使用trunc函数,并把等于运算符替换为范围比较运算符(大于或小于),就可以不必在hire_date列上应用trunc函数。也就是说,对于如下的语句:

select * from emp where trunc(hire_date)=trunc(sysdate);

可把它改写为下面这个语句:

select * from emp where hire_date>=trunc(sysdate) and hire_date

因为对索引列hire_date移除了trunc函数,所以优化器会使用该列上的索引。

5 跳过索引的前导部分
如果在两个或多个列上有一个复合索引,但没有在查询中使用索引的前导部分,那么优化器很可能会忽略表上的索引,而执行全表扫描。比如,在表mytab1的列(a,b)上有一个索引,a是前导列。如果执行select * from mytab1 where b=99这样的SQL语句,数据库会忽略列(a,b)上的索引,因为它必须在表中的每个单独索引项上检查列a所有可能的值。

请注意,如果执行select a,b from mytab1这样的查询语句,优化器更可能使用(a,b)上的索引,因为它意识到这两列都是索引的一部分。因为索引比表更紧凑,而且数据库可以从索引本身得到查询所请求的所有值,所以优化器可能会执行索引快速全扫描。

即使某个查询不含索引的前导部分,但如果一个复合索引的前导列的不同值很少,数据库仍然可以使用索引。在这种情况下,该数据库将执行索引跳跃式扫描,如在第5章中所解释的那样。

在优化器选择了跳跃式扫描时,在谓词中使用的列前可以有多个前导的索引列。我们所见过的案例中,有谓词列前多达6列的情况,优化器仍然采用了跳跃式扫描。数据库管理员往往认为只有前导列值的个数少时,跳跃扫描才是可行的,但“少”是相对的。如果优化器认为跳跃式扫描比全表扫描的成本更低,那么优化器就将选择跳跃式扫描,最终,成本估算起着决定作用并主导优化器的选择。 ]]> http://www.jydba.net/index.php/archives/3262/feed 0 Oracle优化器忽略索引的原因 http://www.jydba.net/index.php/archives/3259 http://www.jydba.net/index.php/archives/3259#respond Thu, 08 Apr 2021 08:00:42 +0000 http://www.jydba.net/?p=3259 优化器忽略索引的原因
创建索引永远不能保证优化器在评估执行计划时一定会使用索引。如果某个查询从表中选择高比例的行,优化器可能觉得使用全表扫描而不是索引扫描,能更快地得到结果。请记住,数据库使用索引时,它首先查找索引获得rowid,然后使用这些rowid来检索所请求的行。如果查询从表中选择很大比例的行,从而导致要读取表中很大比例的块,那么数据库可能执行全表扫描来避免既读取索引又读取表,因为后者的成本可能比仅仅扫描一次表更高。

优化器是否使用索引取决于多种因素,在本章以下各节将分别对它们进行解释。

1 不同的行数
选择全表扫描或索引扫描的另一关键决定因素是,表中与给定查询谓词相匹配的不同行数占表中总行数的比率。通过查询dba_tables视图的num_rows列可以得到某个表的行数。同样,也可以通过查询dba_tab_columns视图的num_distinct列,得到任意列中不同值的数量。num_rows列与num_distinct列的值越接近,优化器越有可能倾向于访问该列的索引而非执行全表扫描,换句话说,索引的选择性越高,数据库就越有可能使用它。

索引的选择性可能会对数据库是否使用索引产生最大的影响。选择性是指每个列值有多少个不同的值。如果索引是非常有选择性的,那么每个索引条目只有很少几行。另外,如果索引的选择性不强,每个索引条目就会有许多行。

请记住,优化器用列的选择性乘以页块(leaf blocks)的统计数量,来估算在访问索引期间,数据库必须读取多少个索引块。虽然事实上,大多数情况下,高选择性的列确实会使用索引,但并不总是如此,因为使用索引还是全表扫描的最终决定因素是块的选择性。

在Oracle Database 10g版本(但不是在11g版本)中,使用dbms_stats.auto_sample_size常量估计dbms_stats包使用的行数,可能会导致对不同值的数量(NDV)产生错误的估计。如果表很大,而且有相当数量的数据是偏态的,往往就会发生这种情况。因此最好对样本大小使用自己的估计,以获得更准确的NDV值。

2 索引聚簇因子
查询dba_indexes视图的clustering_factor列,可以找到索引的聚簇因子的值。聚簇因子用来衡量表中行的有序程度,这种有序程度是与索引的行相比较而言的。如果聚簇因子接近表中的行数,行就有可能是非常随机地排列的,这种情况下,一个索引块的索引条目对应的数据行不太可能位于相同的数据块中。表的选择性(通过过滤)乘以索引聚簇因子,决定了通过索引访问表的成本。这部分计算中使用的实际上是表的选择性。虽然大部分时间,索引的选择性(乘以leaf_blocks,已在上一节讨论)和表的选择性是相同的,计算它实际上是为了确定需要访问表中的多少数据块。通常情况下,我们都假定索引聚簇因子能保证随机性,但事实并非如此。例如,虽然索引中的每行只指向两个不同的块,但条目是按rowid排序为块1,块2,块1,块2……这种(交替排列的)情况会怎么样呢? 如果索引有10000个条目,聚簇因子是10000,但实际上,将仅访问2个块。因此,聚簇因子的计算不能像大多数人认为的那样,保证数据排列的随机性。

在一个具有“好”的聚簇因子的索引中,具体索引叶块中的索引值指向分布在相同数据块中的行。另一方面,在一个具有“坏”的聚簇因子,它可以用更少的I/O读取数据。而具有相同数量的数据但组织得很差的索引,将需要更大的I/O数量,从一组更多的数据块中读取数据。在这种情况下,关键是要注意,如果每个表只有一个索引,那么它的组织可能是理想的,实际上,这只有在表中的数据按特定的顺序加载时才真正成立。举例来说,或许表是按order_date列的顺序加载的。在这种情况下,order_date上索引的聚簇因子将和表中块的数量几乎相同。但是,因为该表的存储只能按一种顺序排列,所以其他所有索引的顺序都将是“欠优化”的。因此,总而言之,“好”与“坏”更是相对而不是绝对的。这可能就是为什么使用索引的成本计算,由包括表和索引选择性的多个元素组成,以使某一个组成部分不会占非常大的比重。

一条经验法则是:良好的聚簇因子接近表的块数,而糟糕的聚簇因子接近表的行数。

除了这里讨论的两个因素,多块读取数的值对索引使用也有影响。数据库文件多块读取计数(db_file_multiblock_read_count)的值越高,从优化器的角度来看,全表扫描的成本就越低。

]]> http://www.jydba.net/index.php/archives/3259/feed 0 Oracle在索引和表扫描之间选择 http://www.jydba.net/index.php/archives/3257 http://www.jydba.net/index.php/archives/3257#respond Thu, 08 Apr 2021 07:59:03 +0000 http://www.jydba.net/?p=3257 在索引和表扫描之间选择
用户常常对此感到困惑,为什么在他们认为优化器应该使用索引时,它却选择全表扫描。本章后面的一节,介绍了优化器优先选择全表扫描而不是访问索引的几种情况。不过,在深入介绍这些情况之前,首先来了解一下基于成本的优化器工作的原理。

基于成本的优化器的任务是,从一组可能的计划中选择最佳或最优的执行计划。基于成本的优化器首先利用表或索引的行数,每列的不同值的数量以及更多其他信息,来估计可供选择的执行计划的成本。然后,它采用成本最低的执行计划。

出于演示的目的,让我们集中注意力研究确定查询成本最重要的因素之一:表的总行数和优化器需要从该表中读取的行数。几乎可以肯定,如果表的体积非常小,那么优化器将把它完全读入。假定某个表包含10000000(1000万)行,而表使用了100000个表块,因为每个块平均包含约100行。现在,在此表上创建索引,大约需要20000个叶块来存储每个索引列的索引条目。索引比表需要的块更少,因为它只保存一个列的值(和相关表列的rowid)。假设该索引的高度为3,这意味着它的blevel为2,并且每个索引列有100个不同的值,这些值的分布是均匀的。因此,该索引的每个索引值将出现100000次(1000万除以100)。下面用如下测试查询来演示优化器如何在多个执行计划中做选择:

SQL>select * from test_table where test_code='ABCDE';

优化器选反的到底是索引扫描还是全表扫描?为什么?让我们先来分析索引访问的成本。由于test_code列上的索引在所有可能值中是均匀分布的,优化器需要从test_code列上索引中的100个不同值里选择一个,这相当于索引数据的百分之一。为此,数据库需要先读根块和分支块(在这个例子中,blevel=2)。因此,优化器首先记录读取这两个块的成本。下一步,数据库读取索引叶块的1%,这相当于(20000 *0.01)=200个叶块。因此,对于索引读取,就需要访问202个索引块。

因为查询请求了表中的所有列值,所以接下来数据库必须读表中的行。在这里,关键的变量是该索引的聚簇因子,即表中索引列的值的聚集情况。索引列的值聚集程序越高,读所有必要的表行需要访问的块就会越少。例如,聚簇因子是所有可能值中最差的。

这意味首它与表中的行数(10000000)几乎相同。对于表中包含100行的100000个数据块中的每一个,数据库选择1行选择10,或从每个数据块选择1%。因此,访问表中数据的总成本将是选择性乘以聚簇因子,0.01*10000000=100000。因此,以索引为基础的读取操作的近似成本是,202个索引块访问加上100000个表块访问。得到100202块的巨大总成本。

在涉及全表扫描的成本时,请记住,全表扫描使用多块读,而不像索引的读取总是使用单块I/O。在这个例子中,假定每个表块包含100行,在一次全表扫描中数据库需要扫描大约100000个数据块。假设multi_block_read_count的值被设置为10。届时数据库将必须执行共100000/10次读取,即10000次读取。如果想要更精确地计算,也可以在总数中添加段头块的读取,因此它的值是10001。

显然,在这种情况下,甚至在假定可能出现最差的索引聚簇因子后,全表扫描的成本还是要低得多(10001次块读取与索引访问的100202次块读取相比)。此外,还可以并行执行全表扫描,使它执行得更快。请注意,在前面的例子中,查询只获取了一个大表的1%的数据,但全表扫描成本要低得多。这个简单的演示表明,优化器选择索引或全表扫描,并不只是依赖于查询需要检索的行占全行数据的百分比。相反,它还依赖于其他关键因素,如数据的分布,表和叶块的数量,表块中行的平均数量,索引叶块中叶条目的平均数量,该索引的聚簇因子和多块读取计数(multi_block_read_count)的大小。在优化器决定究竟使用索引还是全表扫描时,想要完全依靠某种神奇的比率(即查询所应检索的行与总行数的百分比,如1%,5%,10%,25%或50%)来决策是根本不现实的。这个简单的例子表明,即使查询要检索的行数只占某个表总行数很小的一部分(1%)时,优化器也可能执行全表扫描。

]]>
http://www.jydba.net/index.php/archives/3257/feed 0
Oracle如何避免使用索引 http://www.jydba.net/index.php/archives/3255 http://www.jydba.net/index.php/archives/3255#respond Thu, 08 Apr 2021 07:57:16 +0000 http://www.jydba.net/?p=3255 如何避免使用索引
一般而言,人们更倾向于寻找一些方法,让成本优化器使用所创建的索引,而不是让它忽略现有的索引。不过,有些时候,你想要做的恰恰是:让优化器不使用索引。

1 在任何情况下都不使用某个索引
例如,在处理某个选择性不强的索引时,有可能希望不使用该索引。这是因为如果某个索引没有足够的选择性,扫描整个基础表有时会更有效。

如果SQL语句包含一个结构,如包括某个索引列的where子句,优化器可能会使用该列上的索引。为了阻止这种情况的发生,可以在查询语句中指定no_index提示,让优化器不得使用某个索引。例如:

SQL> select /*+ no_index(emp dept_idx) */ * from emp where department_id=10;


Execution Plan
----------------------------------------------------------
Plan hash value: 3956160932

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     1 |    69 |     3   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| EMP  |     1 |    69 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("DEPARTMENT_ID"=10)

这个例子列出了想要让优化器忽略的具体索引。如果在表上有其他索引,优化器仍然会考虑使用那些索引。

除了指定单个索引,也可以列出一组优化器必须忽略的索引。如果只是指定no_index提示,而没有列出任何索引,优化器将忽略你指定的表的所有索引。与在本章后面将会介绍的index提示一样,no_index提示适用于B树索引,基于函数的索引,聚簇索引和域索引。

2 只避免快速扫描
no_index_ffs提示可以用来指示优化器避免对某个索引执行索引快速全扫描。请注意,与index提示的情况一样,必须在指定这个提示的同时指定特定的索引名字。例如:

SQL> select /*+ no_index_ffs(test test_i1) */   c from test;

同样,也可以使用no_index_ss提示来告诉优化器排队表中具体索引的跳跃式扫描。

3 强制表扫描
另一种避免使用索引的方法是从相反的方向解决问题,即明确要求执行表扫描。使用full提示指示优化器选择全表扫描而不是索引扫描。下面是如何指定full提示的例子:

SQL> select /*+ full(emp ) */ * from emp where department_id=10;
]]>
http://www.jydba.net/index.php/archives/3255/feed 0
Oracle全索引扫描 http://www.jydba.net/index.php/archives/3253 http://www.jydba.net/index.php/archives/3253#respond Thu, 08 Apr 2021 07:55:28 +0000 http://www.jydba.net/?p=3253 全索引扫描
全索引扫描是读取给定索引中所有条目的操作。从这个意义上说,全索引扫描类似于全表扫描。与首先做全表扫描,然后再对数据排序相比,全索引扫描是一种很好的替代方法。Oracle数据库在下面任何一种情况下都可能使用全索引扫描。
.查询需要排序合并连接(sort merge join):查询所引用的所有列必须都在索引中存在,且前导索引列的顺序也必须与查询中指定的列顺序相同。
.查询包含order by子句:子句中的所有列必须都在该索引中存在。
.查询包含group by子句:索引和group by子句必须包含相同的列,但不要求它们的顺序一定相同。

下面的例子显示数据库如何利用全索引扫描操作检索数据,而无需执行排序操作。因为索引已经排序,所以使用全索引扫描可以不必执行排序操作。全索引扫描读取单个个数据块,而不执行多块读取操作。

SQL> select * from test where c<30000 order by c;

29999 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 2983339933

---------------------------------------------------------------------------------------
| Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |         | 29999 |   292K|    26   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| TEST    | 29999 |   292K|    26   (0)| 00:00:01 |
|*  2 |   INDEX FULL  SCAN          | TEST_I1 | 29999 |       |    14   (0)| 00:00:01 |
---------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("C"<30000)

在此查询中,数据库首先执行全索引扫描,然后通过索引rowid操作执行表访问。这是因为查询请求了除索引列外的其他列(select * from …)。然而,如果查询只请求了索引列并使用了order by子句,数据库将跳过表访问,只通过访问索引得到数据,无需读取表中的值。

索引快速全扫描
当索引本身包含查询中指定的所有列时,Oracle数据库执行索引快速全扫描代替全表扫描。请注意,在下面的例子中,检索数据只用了索引快速全扫描操作,且根本没有访问表本身:

SQL> select   c from test where c<10000;

9999 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 3298034341

--------------------------------------------------------------------------------
| Id  | Operation            | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |         |  9999 | 49995 |   123   (1)| 00:00:01 |
|*  1 |  INDEX FAST FULL SCAN| TEST_I1 |  9999 | 49995 |   123   (1)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter("C"<10000)

请注意,不像全索引扫描,索引快速全扫描使用多块读操作来读取索引。因此,既因为多块的I/O,又因为这种类型的扫描可以像全表扫描那样并行运行,所以这种类型的扫描往往更快。

]]>
http://www.jydba.net/index.php/archives/3253/feed 0
Oracle索引跳跃式扫描 http://www.jydba.net/index.php/archives/3248 http://www.jydba.net/index.php/archives/3248#respond Thu, 08 Apr 2021 07:51:07 +0000 http://www.jydba.net/?p=3248 索引跳跃式扫描
当一个查询未在where子句的谓词中指定复合索引的前导列,查询“跳过”该列时,就会发生索引跳跃式扫描。数据库将一个复合索引拆分成多个逻辑子索引。复合索引前导列中的不同值越少,组成复合索引的其他键的不同值越多,索引跳跃式扫描的性能就越好。例如,如果前导列有三个不同值,数据库将把复合索引拆分成三个逻辑子索引,并在其中搜索索引非前导列的值。

在下面的例子中,数据库使用了复合索引test_i1,它是在列(b,c)上创建的。查询指定的条件是”c<10″。查询的where子句没有使用复合索引的前导列(b),从而跳过该列。

SQL> select * from test where c<10;

         A B                   C
---------- ---------- ----------
         0 F                   1
         0 F                   2
         0 F                   3
         0 F                   4
         0 F                   5
         0 F                   6
         0 F                   7
         0 F                   8
         0 F                   9

9 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 650436733

-----------------------------------------------------------------------------------------------
| Id  | Operation                           | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |         |     9 |    90 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| TEST    |     9 |    90 |     1   (0)| 00:00:01 |
|*  2 |   INDEX SKIP SCAN                   | TEST_I1 |     9 |       |     1   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("C"<10)
       filter("C"<10)

数据库把复合索引拆分成多少逻辑子索引,取决于前导列的不同值数量。在这个例子中,复合索引的前导列b只有极少数不同的值:

SQL> select distinct b from test;

B
----------
M
F

正如输出结果所显示的,复合索引的前导列只有两个不同的值。数据库把复合索引(b,c)拆分成两个子索引,第一个子索引的键值是”M”,而第二个子索引的键值是”2″。数据库检索第一个子索引,然后检索第二个子索引。另外,索引的非前导列c有200000个不同的值(与表中的行数据相同)。在这样的情况下,由于复合索引前导列中的不同值很少,数据库将采用复合索引跳跃式扫描,而不是像在以前版本的数据库(也就是说,Oracle 9i以前的版本)中那样执行全表扫描。

]]>
http://www.jydba.net/index.php/archives/3248/feed 0
Oracle索引范围扫描 http://www.jydba.net/index.php/archives/3246 http://www.jydba.net/index.php/archives/3246#respond Thu, 08 Apr 2021 07:41:31 +0000 http://www.jydba.net/?p=3246 索引范围扫描
当数据库需要访问具有高度选择性的数据时,它执行索引范围扫描。数据库按升序返回索引列的值。如果所有行的索引列都是相同的,则按rowid的顺序输出。

当处理以下类型的条件时,优化器会选择索引范围扫描,其中col1是某个索引的前导列:

col1=:b1
col1<:b1 col1>:b1

此外,包含索引前导列的上述三种条件的任何”与 (and)组合,也将导致索引范围扫描。

索引数据以升序存储。如果数据库需要返回降序的数据时,比如需要首先传回最新的数据,或需要检索小于某一具体的数据时,它使用降序索引范围扫描。

SQL> select * from emp where department_id<20;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE    JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- ------------ ---------- ---------- -------------- ---------- -------------
        200 Jennifer             Whalen                    JWHALEN                   515.123.4444         17-SEP-03    AD_ASST          4400                       101            10


Execution Plan
----------------------------------------------------------
Plan hash value: 1909286381

------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |          |    11 |   759 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMP      |    11 |   759 |     1   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN                  | DEPT_IDX |    11 |       |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("DEPARTMENT_ID"<20)

从底部开始阅读,解释计划表明,优化器首先执行索引范围扫描,并使用从索引范围扫描获得的rowid执行表访问(table access by index rowid batched操作)。在指定了“大于”条件,如”department_id>100″时,数据库也可能使用索引范围扫描,如下面的例子所示:

SQL> select * from emp where department_id>100;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE    JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- ------------ ---------- ---------- -------------- ---------- -------------
        205 Shelley              Higgins                   SHIGGINS                  515.123.8080         07-JUN-02    AC_MGR          12008                       101           110
        206 William              Gietz                     WGIETZ                    515.123.8181         07-JUN-02    AC_ACCOUNT       8300                       205           110


Execution Plan
----------------------------------------------------------
Plan hash value: 1909286381

------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |          |    11 |   759 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMP      |    11 |   759 |     1   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN                  | DEPT_IDX |    11 |       |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("DEPARTMENT_ID">100)

当查询使用between操作符时,数据库也会执行索引范围扫描,如下面的例子所示:

SQL> select * from emp where department_id between 100 and 110;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE    JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- ------------ ---------- ---------- -------------- ---------- -------------
        108 Nancy                Greenberg                 NGREENBE                  515.124.4569         17-AUG-02    FI_MGR          12008                       101           100
        109 Daniel               Faviet                    DFAVIET                   515.124.4169         16-AUG-02    FI_ACCOUNT       9000                       108           100
        110 John                 Chen                      JCHEN                     515.124.4269         28-SEP-05    FI_ACCOUNT       8200                       108           100
        111 Ismael               Sciarra                   ISCIARRA                  515.124.4369         30-SEP-05    FI_ACCOUNT       7700                       108           100
        112 Jose Manuel          Urman                     JMURMAN                   515.124.4469         07-MAR-06    FI_ACCOUNT       7800                       108           100
        113 Luis                 Popp                      LPOPP                     515.124.4567         07-DEC-07    FI_ACCOUNT       6900                       108           100
        205 Shelley              Higgins                   SHIGGINS                  515.123.8080         07-JUN-02    AC_MGR          12008                       101           110
        206 William              Gietz                     WGIETZ                    515.123.8181         07-JUN-02    AC_ACCOUNT       8300                       205           110

8 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 1909286381

------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |          |    20 |  1380 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMP      |    20 |  1380 |     1   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN                  | DEPT_IDX |    20 |       |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("DEPARTMENT_ID">=100 AND "DEPARTMENT_ID"< =110)

请注意,虽然在指定条件"where department_id <20"及"where department_id>100"时,数据库使用索引范围扫描,但如果把查询谓词修改为"where department_id<1200",它就会转而执行全表扫描。原因很简单:在指定条件为"department_id<20"或"department_id>9000"的条件时,相比条件"department_id<1200",数据库需要扫描的值要少得多。很可能有大量的值都满足条件"department_id<120",因此在指定这个条件时,数据库将执行全表扫描来检索数据,如下面的示例所示:

SQL> select * from emp where department_id<1200;

Execution Plan
----------------------------------------------------------
Plan hash value: 3956160932

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |  1107 |  7383 |    13   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| EMP  |  1107 |  7383 |    13   (0)| 00:00:01 |
--------------------------------------------------------------------------

   2 - access("DEPARTMENT_ID"<1200)

以下是另一个例子,显示了当查询谓词需要搜索表中绝大部分行时,数据库为何倾向于执行全表扫描,条件”department_id>30″显示比”department_id<1200″需要扫描更多的数据。

SQL> select * from emp where department_id>30;
Execution Plan
----------------------------------------------------------
Plan hash value: 3956160932

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |  2078 |  7383 |    23   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| EMP  |  2078 |  7383 |    23   (0)| 00:00:01 |
--------------------------------------------------------------------------

  2 - access("DEPARTMENT_ID">30)

索引降序范围扫描(index range scan descending)操作与索引范围扫描非常类似,不同的是,使用索引降序范围扫描时数据库引擎以降序读取结果。优化器之所以做出这样的选择,其中一个原因可能是避免将来再排序。在指定order by desc子句而索引又能满足该子句时,基于成本的优化器将使用索引降序范围扫描操作,从而避免降序操作。索引降序范围扫描操作向后读取索引,以避免按正常次序(升序)读取,然后再执行降序排序操作。

SQL> select * from emp where department_id<20 order by department_id desc;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE    JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- ------------ ---------- ---------- -------------- ---------- -------------
        200 Jennifer             Whalen                    JWHALEN                   515.123.4444         17-SEP-03    AD_ASST          4400                       101            10


Execution Plan
----------------------------------------------------------
Plan hash value: 3507836879

-----------------------------------------------------------------------------------------
| Id  | Operation                    | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |          |    11 |   759 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID | EMP      |    11 |   759 |     1   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN DESCENDING| DEPT_IDX |    11 |       |     1   (0)| 00:00:01 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("DEPARTMENT_ID"<20)
]]>
http://www.jydba.net/index.php/archives/3246/feed 0
Oracle索引唯一扫描 http://www.jydba.net/index.php/archives/3244 http://www.jydba.net/index.php/archives/3244#respond Thu, 08 Apr 2021 07:38:58 +0000 http://www.jydba.net/?p=3244 索引唯一扫描
如果查询只需要从表中获取单个行,数据库就执行索引唯一扫描。当查询只包含某个唯一索引中的列时,数据库使用索引唯一扫描。当查询在主键约束列上指定了相等条件时,数据库也使用索引唯一扫描。

在下面的例子中,在列employee_id上有主键约束,因此查询通过谓词”where employee_id=200″保证只访问一行。

SQL> select * from emp where employee_id=200;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE    JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- ------------ ---------- ---------- -------------- ---------- -------------
        200 Jennifer             Whalen                    JWHALEN                   515.123.4444         17-SEP-03    AD_ASST          4400                       101            10


Execution Plan
----------------------------------------------------------
Plan hash value: 4024650034

--------------------------------------------------------------------------------------
| Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |        |     1 |    69 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |     1 |    69 |     1   (0)| 00:00:01 |
|*  2 |   INDEX UNIQUE SCAN         | EMP_PK |     1 |       |     1   (0)| 00:00:01 |
--------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("EMPLOYEE_ID"=200)

在这个例子中,数据库使用列employee_id上的主键(emp_pk)。注意,在指定了某个唯一索引的所有列时,数据库也很可能执行索引唯一扫描。

]]>
http://www.jydba.net/index.php/archives/3244/feed 0
Oracle报告分区索引 http://www.jydba.net/index.php/archives/3242 http://www.jydba.net/index.php/archives/3242#respond Thu, 08 Apr 2021 07:37:26 +0000 http://www.jydba.net/?p=3242 Oracle报告分区索引
从关于索引的数据字典中可以收集到很多信息,它们包括以下内容:
.分区名称
.索引类型
.索引分区的状态(需要查询相应的视图)
.索引分区的大小

在下面的例子中,你只是希望得到employees_part表的索引名,分区名和状态的列表。因为此表上既有分区索引又有非分区索引。所以你用union操作把对两种索引的查询合并在一起。

SQL> select table_name,index_name,partition_name,p.status
  2  from user_ind_partitions p join user_indexes i using(index_name)
  3  where table_name='EMPLOYEES_PART'
  4  union
  5  select table_name,index_name,null,status
  6  from user_indexes
  7  where table_name='EMPLOYEES_PART'
  8  order by 2,3;

TABLE_NAME                     INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ------------------------------ ---------------------------------------- --------
EMPLOYEES_PART                 EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             MANAGER_MAX                              USABLE
EMPLOYEES_PART                 EMPLOYEES_PART_UK1                                                      N/A
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI               PMAX                                     USABLE
EMPLOYEES_PART                 EMPLOYEE_PART_LI                                                        N/A

25 rows selected.

请注意,在查询user_indexes视图时,分区索引对应的状态(status)列中显示N/A(表示不可用)。只有(基于索引分区的)最精细的数据字典视图的状态列才会被填入数据。也就是说,对于分区索引,user_ind_partitions视图的status列将被填充。如果你查询的最子分区索引,那么只有user_ind_subpartitions视图的status列将被填充,而user_indexes和user_ind_partitions视图的status列将是N/A。

接下来,需要执行一个查询,以确定表上所有索引分区的类型.

SQL> select table_name,index_name,partitioning_type,locality,alignment from user_part_indexes;

TABLE_NAME                     INDEX_NAME                     PARTITION LOCALI ALIGNMENT
------------------------------ ------------------------------ --------- ------ ------------
EMPLOYEES_JY                   EMPLOYEES_UK1                  RANGE     GLOBAL PREFIXED
EMPLOYEES_JY                   EMPLOYEES_JY_IH1               HASH      GLOBAL PREFIXED
EMPLOYEES_PART                 EMPLOYEE_PART_LI               RANGE     LOCAL  PREFIXED
EMPLOYEES_PART                 EMPLOYEES_PART_UK1             RANGE     GLOBAL PREFIXED

在查询段信息时,需要注意区分子分区索引。对于子分区索引,为了获得子分区的信息,大多数数据字典视图中都有一个子分区列。但这有一个例外,当需要从dba_segments等视图中获得段信息时,只有实际分区或表示实际段的子分区名才会在dba_segments中表示。换句话说,对于子分区索引,子分区名称将在dba_segments的partition_name列中出现。在下面的例子中,想要获得billing_fact表中大小超过8GB的索引子分区。你对user_ind_subpartitions执行了一个子查询,这表明dba_segments视图的partition_name列实际上代表了user_ind_subpartitions视图的subpartition_name列。

select segment_name,partition_name,round(bytes/1048576) meg
from dba_segments
where (segment_name,partition_name) in
(select index_name,subpartition_name from user_ind_subpartitions
where index_name in
(select index_name from user_indexes
where table_name='BILLING_FACT'))
and bytes>1048576*8192
order by 3 desc;
]]>
http://www.jydba.net/index.php/archives/3242/feed 0
Oracle把索引分区设置为不可用后重建 http://www.jydba.net/index.php/archives/3240 http://www.jydba.net/index.php/archives/3240#respond Thu, 08 Apr 2021 07:34:32 +0000 http://www.jydba.net/?p=3240 把索引分区设置为不可用后重建
在数据仓库环境中装载大量数据时,由于索引的存在,批量dml操作的速度可能会非常慢。分区索引的关键好处之一是,可以在批量加载数据前,把索引的某些部分设置为unusable,然后在加载完成后,仅仅需要对那些受影响的部分索引分区进行重建。

从根本上说,先把索引标记为不可用,然后重建索引是相当简单的。例如:

SQL> alter table employees_part modify partition pmax unusable local indexes;

Table altered.
SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              USABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     UNUSABLE

23 rows selected.

然后,在批量加载操作完成之后,就可以执行以下命令,重建那些受批量加载操作影响的索引分区:

SQL> alter table employees_part modify partition pmax rebuild unusable local indexes;

Table altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              USABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     USABLE

23 rows selected.

使用此命令重建索引有一个明显的缺点:索引分区是顺序建立的,即一次重建一个索引分区。如果表上有许多索引,那么用这个命令会减缓重建过程,如果此操作是常规性处理任务的一部分,那么这种减缓会令人难以接受。一种缓解alter table … rebuild local indexes unusable命令的串行限制的方法是,并行重建每个受影响的分区。

实现并行重建索引操作有好几种方法。

]]>
http://www.jydba.net/index.php/archives/3240/feed 0
Oracle重建全局分区索引和非分区索引 http://www.jydba.net/index.php/archives/3238 http://www.jydba.net/index.php/archives/3238#respond Thu, 08 Apr 2021 07:31:22 +0000 http://www.jydba.net/?p=3238 重建全局分区索引和非分区索引

对表进行任何一种分区级的操作,几乎都会使用所有全局分区索引或非分区索引无法使用。从本质上讲,索引始终必须重建。Oracle11g中的一个内置功能,允许把重建索引作为分区表操作的一部分来执行。使用分区级合并操作的例子,你可以看到,可以在alter table … merge命令中添加更新索引(update indexes)子句,这指示Oracle重建被分区级操作标记为不可用的任何索引。请看下面的例子:

SQL> alter table employees_part merge partitions p2001,pmax into partition pmax update indexes;

Table altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              USABLE
EMPLOYEES_PART_UK1             MANAGER_200                              USABLE
EMPLOYEES_PART_UK1             MANAGER_300                              USABLE
EMPLOYEES_PART_UK1             MANAGER_400                              USABLE
EMPLOYEES_PART_UK1             MANAGER_500                              USABLE
EMPLOYEES_PART_UK1             MANAGER_600                              USABLE
EMPLOYEES_PART_UK1             MANAGER_700                              USABLE
EMPLOYEES_PART_UK1             MANAGER_800                              USABLE
EMPLOYEES_PART_UK1             MANAGER_900                              USABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              USABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     USABLE

23 rows selected.

使用update indexes子句重建索引的一个关键优势是,在重建操作过程中索引仍然是在线和可用的。虽然上述例子非常简单,但使用update indexes子句的缺点之一是,由于在分区级别的操作中包装了索引重建操作,在如何重建索引方面,你失去了一定的灵活性。例如,如果你有多个索引需要重建。分别发出命令来重建每个索引的速度可能会更快。要达到这种效果,就可以同时并发地运行多个alter index … rebuild命令。虽然这种方法比较复杂,但哪怕只为了加快速度,这么做可能也是有必要的。

要重建非分区索引,只需要执行alter index … rebuild命令即可。

SQL> alter index employees_part_pk rebuild;

Index altered.

此外,对于每个索引,可以选择性地决定使用并行机制,如下面的例子所示:

SQL> alter index employees_part_pk rebuild parallel(degree 4);

Index altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     USABLE

23 rows selected.

使用这种方法同样需要有足够的判断力和常识。如果需要一次性重建许多索引,同时又想使用并行机制,那么你必须注意到并发操作会有一个缺点。这需要根据具体的环境来作出决定。最初,最好用谨慎的态度开始。可以先慢慢提交少量的操作,以确保并发操作不造成IO或CPU瓶颈,也不造成临时表空间的瓶颈。如果并发操作没有造成这些瓶颈,那么就可以同时运行更多的重建命令。

重建非分区索引还有另一种选择,即简单地删除非分区不可用索引,并使用create index命令重新创建索引。

如果要重建全局分区索引,也有两种选择,既可以删除索引并使用create index命令作为一个整体重新创建索引,也可以逐个分区的重建全局分区索引。请看下面的例子:

SQL> alter index employees_part_uk1 rebuild partition manager_max;

Index altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              USABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     USABLE

23 rows selected.

你将需要对每个全局索引分区执行alter index … rebuild命令。

请注意不能把全局分区索引作为一个整体来重建。请看下面的例子:

SQL> alter index employees_part_uk1 rebuild;
alter index employees_part_uk1 rebuild
            *
ERROR at line 1:
ORA-14086: a partitioned index may not be rebuilt as a whole

正因为如此,当整个全局分区索引被标记为unusable时,删除它并使用create index命令重新创建索引,这样操作起来可能更为简单。

]]>
http://www.jydba.net/index.php/archives/3238/feed 0
Oracle 维护分区表的索引 http://www.jydba.net/index.php/archives/3235 http://www.jydba.net/index.php/archives/3235#respond Thu, 25 Mar 2021 09:17:26 +0000 http://www.jydba.net/?p=3235 维护分区表的索引
虽然分区表和分区索引提供了许多好处,但在设计应用程序时就必须考虑到,创建分区表和分区索引对维护产生的影响。根据环境的情况和具体的应用程序设计和数据库设计,维护操作也会有所不同。对于你的具体应用程序,这包括应用程序的DML模式和被插入,更新和删除的数据量。索引的存在会造成DML操作速度减慢。在某些应用程序中,特别是在数据仓库领域,执行分区一级的操作有利于加快应用程序整体处理速度。分区级的操作可能会对索引产生重大影响,这取决于应用程序使用了什么类型的索引。

下面的例子展示了分区级的操作对不同类型索引的影响。每个例子使用一个测试表,其中包含员工数据。此表上有三个索引:一个非分区索引(employees_part_i1),一个本地分区索引(employees_part_li1)和一个全局分区索引(employees_parttest_gi1)。你会看到对表执行分区级别的操作对表内每个索引的实际影响。

注意:如果在分区表任何一个空的分区上执行下列操作,所有相关索引均不受影响。这对各种索引类型都是成立的,不管它们是本地分区,全局分区还是非分区的索引。

SQL> create table employees_part
  2  (
  3  employee_id number(6) not null,
  4  first_name varchar2(20),
  5  last_name varchar2(25) not null,
  6  email varchar2(25) not null,
  7  phone_numbr varchar2(20),
  8  hire_date date not null,
  9  job_id varchar2(10) not null,
 10  salary number(8,2),
 11  commission_pct number(2,2),
 12  manager_id number(6),
 13  department_id number(4),
 14  constraint employees_part_pk primary key(employee_id,hire_date)
 15  )
 16  partition by range(hire_date)
 17  (
 18  partition p1990 values less than(to_date('1991-01-01','yyyy-mm-dd')),
 19  partition p1991 values less than(to_date('1992-01-01','yyyy-mm-dd')),
 20  partition p1992 values less than(to_date('1993-01-01','yyyy-mm-dd')),
 21  partition p1993 values less than(to_date('1994-01-01','yyyy-mm-dd')),
 22  partition p1994 values less than(to_date('1995-01-01','yyyy-mm-dd')),
 23  partition p1995 values less than(to_date('1996-01-01','yyyy-mm-dd')),
 24  partition p1996 values less than(to_date('1997-01-01','yyyy-mm-dd')),
 25  partition p1997 values less than(to_date('1998-01-01','yyyy-mm-dd')),
 26  partition p1998 values less than(to_date('1999-01-01','yyyy-mm-dd')),
 27  partition p1999 values less than(to_date('2000-01-01','yyyy-mm-dd')),
 28  partition p2000 values less than(to_date('2001-01-01','yyyy-mm-dd')),
 29  partition pmax values less than(maxvalue)
 30  );

Table created.

SQL> create index employee_part_li on employees_part(hire_date) local;

Index created.

SQL> select partition_name,status from user_ind_partitions where index_name='EMPLOYEE_PART_LI';

PARTITION_NAME                                                                                                                   STATUS
-------------------------------------------------------------------------------------------------------------------------------- --------
P1990                                                                                                                            USABLE
P1991                                                                                                                            USABLE
P1992                                                                                                                            USABLE
P1993                                                                                                                            USABLE
P1994                                                                                                                            USABLE
P1995                                                                                                                            USABLE
P1996                                                                                                                            USABLE
P1997                                                                                                                            USABLE
P1998                                                                                                                            USABLE
P1999                                                                                                                            USABLE
P2000                                                                                                                            USABLE
PMAX                                                                                                                             USABLE

12 rows selected.

1 添加分区
往表中添加分区对表上现有的索引影响最小。事实上,无论你选择使用什么索引类型(本地分区,全局分区或非分区),在添加分区操作后,任何现存的索引分区都不会受到影响,也不需要特定的索引级别的操作。下面的例子向测试员工表中添加一个分区,用于保存2001年的历史数据:

SQL> alter table employees_part add partition p2001 values less than(to_date('2002-01-01','yyyy-mm-dd'));
alter table employees_part add partition p2001 values less than(to_date('2002-01-01','yyyy-mm-dd'))
                                         *
ERROR at line 1:
ORA-14074: partition bound must collate higher than that of the last partition


SQL> alter table employees_part drop partition pmax;

Table altered.

SQL> select partition_name,status from user_ind_partitions where index_name='EMPLOYEE_PART_LI';

PARTITION_NAME                                                                                                                   STATUS
-------------------------------------------------------------------------------------------------------------------------------- --------
P1990                                                                                                                            USABLE
P1991                                                                                                                            USABLE
P1992                                                                                                                            USABLE
P1993                                                                                                                            USABLE
P1994                                                                                                                            USABLE
P1995                                                                                                                            USABLE
P1996                                                                                                                            USABLE
P1997                                                                                                                            USABLE
P1998                                                                                                                            USABLE
P1999                                                                                                                            USABLE
P2000                                                                                                                            USABLE

11 rows selected.

SQL> alter table employees_part add partition p2001 values less than(to_date('2002-01-01','yyyy-mm-dd'));

Table altered.

添加分区后,可以运行以下查询来确实添加分区(add partition)操作对表上现有索引的影响:

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE

13 rows selected.

2 截断分区
截断分区是删除一个表分区内所有数据的最简单的方法。而且,对于创建了本地分区索引的表,截断表分区不影响底层的索引分区,其中包括被截断的分区。然而,如果你的表上有非分区索引或者全局分区索引,截断分区就会使得Oracle无法知道哪些索引条目受到了截断操作的影响。因此,Oracle别无选择,只能简单地把整个索引标记为unusable。例如:

SQL> create index employees_part_uk1 on employees_part(manager_id)
  2  global
  3  partition by range(manager_id)
  4  (
  5  partition manager_100 values less than(100),
  6  partition manager_200 values less than(200),
  7  partition manager_300 values less than(300),
  8  partition manager_400 values less than(400),
  9  partition manager_500 values less than(500),
 10  partition manager_600 values less than(600),
 11  partition manager_700 values less than(700),
 12  partition manager_800 values less than(800),
 13  partition manager_900 values less than(900),
 14  partition manager_max values less than(maxvalue)
 15  );

Index created.

SQL> alter table employees_part truncate partition p1995;

Table truncated.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE

23 rows selected.

3 移动分区
移动分区有各种原因。你可能需要将一些表或分区移动到不同的表空间,也可能会决定压缩某个分区的数据,或者可能因为大量的更新操作已经导致了行迁移而需要重组表的分区。

执行移动分区操作时,你会再次看到本地分区索引受到的影响是最小的。本地分区索引的分区级移动操作与截断操作的一个关键的区别在于,被移动分区的索引已被标记为unusable。因为移动分区中的每一行后,现在每一行的rowid值都与先前的不同,所以Oracle需要这么做,因此该索引分区的条目现在是无效的,因为它们现在包含过时的rowid项。被移动的索引分区需要重建,以反映新的rowid值。

与截断分区的例子一样,Oracle不了解该表上的全局分区和非分区索引的表分区边界,因此需要把整个索引标志为unusable,且整个索引都需要重建安。对于本地分区索引,只需要重建受移动的表分区影响的索引分区。

在下面的例子中,需要把较旧的1995年的员工数据移动到它自己的表空间,这可能是为了能把它设置成只读:

SQL> alter table employees_part move partition p1995 tablespace reporting_index;

Table altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    UNUSABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE

23 rows selected.

4 拆分分区
拆分分区表的分区,通常是因为它不再符合应用程序的要求,或出于维护的原因需要拆分。最常见的原因之一是,需要简单地往表中添加一个分区,而它不是表最高端的分区,正因为如此,这需要通过拆分分区,而不是添加分区来实现。

下面的例子拆分了maxvalue分区以便为早于2003年1月的数据添加一个分区。对于本地分区索引,因为拆分操作触动了pmax分区,并创建一个新的分区(p2002),pmax分区中的行已经被拆分到两个分区中。因为一些数据可能从pmax表分区移动到新的p2002表分区,所以pmax分区的索引项是过时的。因此,在此拆分操作的情况下,这两个本地索引分区都被标记为unusable。由于新的分区以前不存在,其实没有现有的本地索引分区与它对应,所以Oracle自动创建一个索引分区,并把它标记为unusable。

与前面提到的截断和移动操作一样,拆分分区后,所有的全局分区和非分区索引全部被标记为unusable。

SQL> alter table employees_part add partition pmax values less than(maxvalue);

Table altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    UNUSABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     UNUSABLE

24 rows selected.



SQL> alter table employees_part split partition pmax at (to_date('2003-01-01','yyyy-mm-dd')) into
  2  (partition p2002 tablespace reporting_index,partition pmax tablespace reporting_index);

Table altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       VALID
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    UNUSABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE
EMPLOYEE_PART_LI               P2002                                    UNUSABLE
EMPLOYEE_PART_LI               PMAX                                     UNUSABLE

25 rows selected.
< ?pre>
要强调的重要注意事项是,如果某个实质上往表中添加分区的分区拆分操作是必要的,因为需要一个高端分区来保存某种形式的默认数据,即使只是添加一个空分区的分区拆分操作,也可能会花费相当多的时间。因为Oracle需要分析现有的分区中的每一行,以便有效地执行正确的拆分。在这种情况下,对于指定用maxvalue指定了高端值的表,在高端分区以下,添加一个未被使用且始终为空的“虚拟”分区可能是有益的。那么,如果添加历史分区到表中,你可以始使用空的“虚拟”分区来拆分分区。这提供了两个关键的好处:首先,分区拆分操作会很快,因为没有需要分析的数据;其次,也没有索引将被标记为不可用,因为被拆分的分区没有数据,而新的分区也没有数据。

查看下面的创建表的DDL语句。对于employees_part表,员工离开了公司以后,他们的记录中的hire_date列被修改为maxvalue并留在表中作为历史记录。在这种情况下,pmax分区中将永远有数据。当你在表的pmax分区上执行分区拆分以添加今后几年的分区时,这么做总是会花时间的,而底层索引分区将标记为unusable。通过把p9999分区创建为“虚拟”分区,你绝不会把任何行添加到这个分区中。那么,当你拆分p9999分区来添加2001年及以后年份的数据分区时,它始终是在一个空的分区上进行拆分。因为拆分操作发生在空的分区上面,所以拆分操作将很快完成,而所有底层的本地索引分区将继续可用。
create table employees_part
(
employee_id number(6) not null,
first_name varchar2(20),
last_name varchar2(25) not null,
email varchar2(25) not null,
phone_numbr varchar2(20),
hire_date date not null,
job_id varchar2(10) not null,
salary number(8,2),
commission_pct number(2,2),
manager_id number(6),
department_id number(4),
constraint employees_part_pk primary key(employee_id,hire_date)
)
partition by range(hire_date)
(
partition p1990 values less than(to_date('1991-01-01','yyyy-mm-dd')),
partition p1991 values less than(to_date('1992-01-01','yyyy-mm-dd')),
partition p1992 values less than(to_date('1993-01-01','yyyy-mm-dd')),
partition p1993 values less than(to_date('1994-01-01','yyyy-mm-dd')),
partition p1994 values less than(to_date('1995-01-01','yyyy-mm-dd')),
partition p1995 values less than(to_date('1996-01-01','yyyy-mm-dd')),
partition p1996 values less than(to_date('1997-01-01','yyyy-mm-dd')),
partition p1997 values less than(to_date('1998-01-01','yyyy-mm-dd')),
partition p1998 values less than(to_date('1999-01-01','yyyy-mm-dd')),
partition p1999 values less than(to_date('2000-01-01','yyyy-mm-dd')),
partition p2000 values less than(to_date('2001-01-01','yyyy-mm-dd')),
partition p9999 values less than(to_date('9999-12-31','yyyy-mm-dd')),
partition pmax values less than(maxvalue)
);

5 交换分区
在数据仓库环境中,交换分区进行大批量数据加载特别常见。因为数据被加载到一个独立的表中,所以在加载操作期间读取操作不会受到影响。然后做一个分区交换,这实质上是对数据字典的修改,把一个独立的表段重新指向一个分区表的一部分,并把相关受影响的(原)表分区指向一个独立的表段。

分区交换与分区移动是类似的,只有受影响的本地分区索引的交换分区被标记为unusable。对于全局分区和非分区索引,你可以看到整个索引都已被标记为unusable。

SQL> alter table employees_part exchange partition p1995 with table employees_part_exch;

Table altered.


SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    UNUSABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE
EMPLOYEE_PART_LI               P2002                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     USABLE

25 rows selected.

6 删除分区
删除分区,通常发生在基于日期或时间戳的分区表中,因为有些数据已经过期,数据库不再需要这些数据了。对于本地分区索引,删除某个分区对其余的本地索引分区没有任何影响。所有本地分区索引保持在可用(usable)状态。然而,对于全局范围内分区和非分区索引,将再次把整个索引标记为不可用,因为Oracle无法确定这些索引中的哪些行已通过删除分区操作被删除了。

SQL> alter table employees_part drop partition p1995;

Table altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE
EMPLOYEE_PART_LI               P2002                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     USABLE

24 rows selected.

7 合并分区
合并分区操作本质上是分区拆分的逆操作,正如分区拆分操作,执行分区合并也是为了满足某些应用程序要求或是由于维护的原因。

下面的例子将把p2002和pmax分区全并成一个pmax分区。在这种情况下,两个分区中的所有行实质上被合并到一个新的分区。对于本地分区索引,它有一个匹配pmax的索引分区。因为分区合并改变了分区中行的组成,本地分区索引的pmax分区已被标记为unusable.

因为全局分区索引和非分区索引没有表分区组成的信息,所以整个索引又被标记为unusable.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE
EMPLOYEE_PART_LI               P2001                                    USABLE
EMPLOYEE_PART_LI               P2002                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     USABLE

25 rows selected.


SQL> alter table employees_part merge partitions p2002,pmax into partition pmax;

Table altered.

SQL> select index_name,null partition_name,status from user_indexes where table_name='EMPLOYEES_PART' and partitioned='NO'
  2  union
  3  select index_name,partition_name,status from user_ind_partitions where index_name in
  4  (select index_name from user_indexes where table_name='EMPLOYEES_PART')
  5  order by 1,2,3;

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEES_PART_PK                                                       UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_100                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_200                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_300                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_400                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_500                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_600                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_700                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_800                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_900                              UNUSABLE
EMPLOYEES_PART_UK1             MANAGER_MAX                              UNUSABLE

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEE_PART_LI               P1990                                    USABLE
EMPLOYEE_PART_LI               P1991                                    USABLE
EMPLOYEE_PART_LI               P1992                                    USABLE
EMPLOYEE_PART_LI               P1993                                    USABLE
EMPLOYEE_PART_LI               P1994                                    USABLE
EMPLOYEE_PART_LI               P1995                                    USABLE
EMPLOYEE_PART_LI               P1996                                    USABLE
EMPLOYEE_PART_LI               P1997                                    USABLE
EMPLOYEE_PART_LI               P1998                                    USABLE
EMPLOYEE_PART_LI               P1999                                    USABLE
EMPLOYEE_PART_LI               P2000                                    USABLE

INDEX_NAME                     PARTITION_NAME                           STATUS
------------------------------ ---------------------------------------- --------
EMPLOYEE_PART_LI               P2001                                    USABLE
EMPLOYEE_PART_LI               PMAX                                     UNUSABLE

24 rows selected.

注意:对于表的大多数分区级操作,如果受影响的分区是空的,那么这种操作不会影响任何相关的索引。

]]>
http://www.jydba.net/index.php/archives/3235/feed 0
Oracle 全局分区索引 http://www.jydba.net/index.php/archives/3233 http://www.jydba.net/index.php/archives/3233#respond Thu, 25 Mar 2021 09:12:08 +0000 http://www.jydba.net/?p=3233 全局分区索引实质上意味着该索引与数据表有不同的分区方案,且是基于不同于数据表的一个或一组分区列进行分区的。这主要是为了提高数据库中数据查询的性能。基于用户对给定表的查询,为提高查询性能,可以在给定的查询列上创建全局分区的索引。

可以创建以下几种类型的全局分区索引:
.范围
.哈希

为了说明基于范围的全局分区索引,假定你发现有很多的查询要访问employees表中的manager_id列,那么就可以在manager_id列上创建分区索引,它的分区完全独立于表。查看如下范围分区索引的例子:

SQL> create table employees_jy as select * from employees;

Table created.

SQL> create index employees_gi1
  2  on employees_jy(manager_id)
  3  global
  4  partition by range(manager_id)
  5  (
  6  partition manager_100 values less than(100),
  7  partition manager_200 values less than(200),
  8  partition manager_300 values less than(300),
  9  partition manager_400 values less than(400),
 10  partition manager_500 values less than(500),
 11  partition manager_600 values less than(600),
 12  partition manager_700 values less than(700),
 13  partition manager_800 values less than(800),
 14  partition manager_900 values less than(900),
 15  partition manager_max values less than(maxvalue)
 16  );

Index created.

你可以在分区表或非分区表上创建全局分区索引。换句话说,创建全局分区索引并不需要对表进行分区。正如本章后面所讨论的,因为分区表的全局分区索引维护起来不太方便,全局分区索引并不常用,所以通常很少甚至不用它来提高查询性能,特别是在非分区表中。

基于范围的全局分区索引,必须始终为索引指定一个最大值,即用maxvalue作为最大值。这保证了新插入到相应表的任何数据将在分局分区索引中有地方保存。换句话说,对于全局分区索引,它永远不会有“越界”的情况。如果不在全局分区索引中指定上限分区,Oracle将不允许创建索引,若执行下列语句,就会出现以下错误提示信息:

SQL> create index employees_gi2
  2  on employees_jy(manager_id)
  3  global
  4  partition by range(manager_id)
  5  (
  6  partition manager_100 values less than(100),
  7  partition manager_200 values less than(200),
  8  partition manager_300 values less than(300),
  9  partition manager_400 values less than(400),
 10  partition manager_500 values less than(500),
 11  partition manager_600 values less than(600),
 12  partition manager_700 values less than(700),
 13  partition manager_800 values less than(800),
 14  partition manager_900 values less than(900)
 15  );
)
*
ERROR at line 15:
ORA-14021: MAXVALUE must be specified for all columns

由于每个全局分区索引吕必须包含一个上限分区,因此把分区添加到全局分区索引的唯一方式就是,使用alter index … split分区命令。例如:

SQL> alter index employees_gi1 split partition manager_max at(1000) into (partition manager_max,partition manager_1000);

Index altered.


SQL> select partition_name,status from user_ind_partitions where index_name='EMPLOYEES_GI1';

PARTITION_NAME                                                                                                                   STATUS
-------------------------------------------------------------------------------------------------------------------------------- --------
MANAGER_100                                                                                                                      USABLE
MANAGER_1000                                                                                                                     USABLE
MANAGER_200                                                                                                                      USABLE
MANAGER_300                                                                                                                      USABLE
MANAGER_400                                                                                                                      USABLE
MANAGER_500                                                                                                                      USABLE
MANAGER_600                                                                                                                      USABLE
MANAGER_700                                                                                                                      USABLE
MANAGER_800                                                                                                                      USABLE
MANAGER_900                                                                                                                      USABLE
MANAGER_MAX                                                                                                                      USABLE

11 rows selected.

SQL>

还可以删除全局分区索引的部分分区。然而,这样做时,如果被删除的分区包含索引条目,上限比它高的相邻分区就被标记为不可用。在下面的代码中,查询了删除分区manager_200前该索引各分区的状态:

SQL> select partition_name,status from user_ind_partitions where index_name='EMPLOYEES_GI1';

PARTITION_NAME                                                                                                                   STATUS
-------------------------------------------------------------------------------------------------------------------------------- --------
MANAGER_100                                                                                                                      USABLE
MANAGER_1000                                                                                                                     USABLE
MANAGER_200                                                                                                                      USABLE
MANAGER_300                                                                                                                      USABLE
MANAGER_400                                                                                                                      USABLE
MANAGER_500                                                                                                                      USABLE
MANAGER_600                                                                                                                      USABLE
MANAGER_700                                                                                                                      USABLE
MANAGER_800                                                                                                                      USABLE
MANAGER_900                                                                                                                      USABLE
MANAGER_MAX                                                                                                                      USABLE

11 rows selected.

然后删除分区manager_200

SQL> alter index employees_gi1 drop partition manager_200;

Index altered.

当再次查询user_ind_partitions时,你可以看到数据库把上限更高的相邻分区标记为unusable状态。

SQL> select partition_name,status from user_ind_partitions where index_name='EMPLOYEES_GI1';

PARTITION_NAME                                                                                                                   STATUS
-------------------------------------------------------------------------------------------------------------------------------- --------
MANAGER_100                                                                                                                      USABLE
MANAGER_1000                                                                                                                     USABLE
MANAGER_300                                                                                                                      UNUSABLE
MANAGER_400                                                                                                                      USABLE
MANAGER_500                                                                                                                      USABLE
MANAGER_600                                                                                                                      USABLE
MANAGER_700                                                                                                                      USABLE
MANAGER_800                                                                                                                      USABLE
MANAGER_900                                                                                                                      USABLE
MANAGER_MAX                                                                                                                      USABLE

10 rows selected.

一旦删除了全局索引分区,就必须执行alter index命令重建由于drop partition操作而被标记为unusable的分区。

SQL> alter index employees_gi1 rebuild partition manager_300;

Index altered.

SQL> select partition_name,status from user_ind_partitions where index_name='EMPLOYEES_GI1';

PARTITION_NAME                                                                                                                   STATUS
-------------------------------------------------------------------------------------------------------------------------------- --------
MANAGER_100                                                                                                                      USABLE
MANAGER_1000                                                                                                                     USABLE
MANAGER_300                                                                                                                      USABLE
MANAGER_400                                                                                                                      USABLE
MANAGER_500                                                                                                                      USABLE
MANAGER_600                                                                                                                      USABLE
MANAGER_700                                                                                                                      USABLE
MANAGER_800                                                                                                                      USABLE
MANAGER_900                                                                                                                      USABLE
MANAGER_MAX                                                                                                                      USABLE

10 rows selected.

因为必须在全局分区索引上用maxvalue指定的一个分区,所以永远无法删除上限最高的分区。例如:

SQL> alter index employees_gi1 drop partition manager_1000;
alter index employees_gi1 drop partition manager_1000
                                         *
ERROR at line 1:
ORA-14078: you may not drop the highest partition of a GLOBAL index

全局分区索引可以是唯一索引,也可以是非唯一索引。本章到目前为止,只创建了非唯一索引。下面列出的是在表上创建全局唯一索引分区的语句:

SQL> create unique index employees_uk1 on employees_jy(manager_id,employee_id)
  2  global
  3  partition by range(manager_id)
  4  (
  5  partition manager_100 values less than(100),
  6  partition manager_200 values less than(200),
  7  partition manager_300 values less than(300),
  8  partition manager_400 values less than(400),
  9  partition manager_500 values less than(500),
 10  partition manager_600 values less than(600),
 11  partition manager_700 values less than(700),
 12  partition manager_800 values less than(800),
 13  partition manager_900 values less than(900),
 14  partition manager_max values less than(maxvalue)
 15  );

Index created.

本地分区索引可以定义为前缀或非前缀索引,而全局分区索引必须创建为前缀索引,也就是说,分区列必须在该索引的前导端。如果你试图创建全局分区的非前缀索引,就会收到以下错误 提示信息:

SQL> create unique index employees_uk1 on employees_jy(employee_id)
  2  global
  3  partition by range(manager_id)
  4  (
  5  partition manager_100 values less than(100),
  6  partition manager_200 values less than(200),
  7  partition manager_300 values less than(300),
  8  partition manager_400 values less than(400),
  9  partition manager_500 values less than(500),
 10  partition manager_600 values less than(600),
 11  partition manager_700 values less than(700),
 12  partition manager_800 values less than(800),
 13  partition manager_900 values less than(900),
 14  partition manager_max values less than(maxvalue)
 15  );
partition by range(manager_id)
                             *
ERROR at line 3:
ORA-14038: GLOBAL partitioned index must be prefixed

另一种全局分区索引类型是哈希分区索引。使用哈希分区索引通常是出于性能原因,因为这使用索引在分区之间更均匀地分布。请看下面创建基于哈希的全局分区索引的例子:

SQL> create index employees_jy_ih1 on employees_jy(department_id) global partition by hash(department_id) partitions 4;

Index created.

注意:全局分区索引必须在堆组织表上创建。而且,不能创建全局分区位图索引。

]]>
http://www.jydba.net/index.php/archives/3233/feed 0
Oracle管理分区表的主键和唯一索引 http://www.jydba.net/index.php/archives/3231 http://www.jydba.net/index.php/archives/3231#respond Thu, 25 Mar 2021 08:45:53 +0000 http://www.jydba.net/?p=3231 管理分区表的主键和唯一索引
当需要在表上定义主键约束时,首先使用主键约束的列创建唯一索引,然后再添加约束,这通常被视为一种良好的做法。例如:

SQL> create unique index employees_part_pk on employees_part(employee_id,hire_date) local;

Index created.

SQL> alter table employees_part add constraint employees_part_pk primary key(employee_id,hire_date);

Table altered.

这样做的好处是,它允许你在必要时禁用和重新启用约束,而不必删除底层索引。当必须在一个大表上执行约束管理时,这可以节省大量的时间。在数据仓库环境中,经常有大量数据要批量加载到表中,禁用约束然后重新启用约束是很常见的操作,因为在这种情况下,在加载之前禁用约束并在加载后重新启用约束,可以节省大量的整体数据处理时间。

如果你首先创建了唯一索引,然后启用主键约束,如果禁用这个主键约束,那么你的约束和索引在数据库中仍然存在。如下面的例子所示:

SQL> alter table employees_part disable constraint employees_part_pk;

Table altered.

SQL> select i.index_name,c.constraint_type,i.partitioned from user_indexes i left join user_constraints c
  2  on (i.index_name=c.constraint_name) where i.index_name='EMPLOYEES_PART_PK';

INDEX_NAME                     CONSTRAINT_TYPE                PARTITIONED
------------------------------ ------------------------------ ----------------------------------------
EMPLOYEES_PART_PK              P                              YES

如果你用create tabel语句或单个alter table语句内联地创建主键,将同时创建底层的唯一索引。在这种情况下,如果禁用这个主键约束,你可以看到它删除了底层索引。

SQL> alter table employees_part disable constraint employees_part_pk;

Table altered.

SQL> select i.index_name,c.constraint_type,i.partitioned from user_indexes i left join user_constraints c
  2  on (i.index_name=c.constraint_name) where i.index_name='EMPLOYEES_PART_PK';
no rows selected

当对表的分区一级执行操作(如在表上执行分区拆分)时,会使用一个分区的索引变得不可用(unusable),这种情况下,本地分区索引就变得非常有用。至于主键,你可以简单地禁用主键约束(在这种情况下,底层索引保持不变),执行分区操作,再重建该分区索引,然后重新启用主键约束。这样,索引唯一需要重建的是受上述操作影响的分区。

在唯一索引最终要成为主键时,唯一索引必须包含分区列这一限制会导致另一个常见的问题,即,有时用户提出需求,不要把分区列放到表的主键列中去。如下面的例子所示,通过使用先前创建的唯一索引,就可以简单地改变员工表来创建主键约束:

SQL> alter table employees_part add constraint employees_part_pk_1 primary key(employee_id);

Table altered.

如果你的客户需求中规定,分区列(在本列是hire_date)不得作为主键的一部分,那么也可以使用相同的语法简单地创建主键约束,这同时也创建了未分区的底层索引。下面的查询显示了这个结果:

SQL> select i.index_name,c.constraint_type,i.partitioned from user_indexes i,user_constraints c
  2  where i.index_name=c.constraint_name and i.index_name='EMPLOYEES_PART_PK_1';

INDEX_NAME                     CONSTRAINT_TYPE                PARTITIONED
------------------------------ ------------------------------ ----------------------------------------
EMPLOYEES_PART_PK_1            P                              NO

你的表上确实建立了索引,但它不是分区的。这样做的好处是,解除了唯一索引必须包含分区列的限制,可以在单个employee_id列上创建“自然”的主键约束了。缺点是,现在分区表employees上有一个非分区索引。如果现在需要在该表上执行任何分区级操作,如截断分区,移动分区,或拆分分区,等等,那么整个底层非分区索引将被标记为unusable,而且必须在执行任何分区级操作后重建它。

]]>
http://www.jydba.net/index.php/archives/3231/feed 0
Oracle本地分区索引 http://www.jydba.net/index.php/archives/3229 http://www.jydba.net/index.php/archives/3229#respond Thu, 25 Mar 2021 08:43:51 +0000 http://www.jydba.net/?p=3229 1 分区索引
分区索引与非分区索引相比,具有许多好处。使用分区索引的关键好处如下:
.性能方面的优势
.通过DML操作载入数据。
.通过DDL操作载入数据。
.用select语句查询数据。

.维护方面的好处
.重建索引。
.在分区一级把索引设置为不可用或不可见。

可以创建本地分区或全局分区的分区索引。本地分区索引只能存在于分区表,而全局分区的索引既可以在分区表创建,也可以在非分区表上创建。还可以在分区表上创建非分区索引。分区索引最常见的配置是在分区表上创建本地分区索引,只是因为这种配置的整体优势一般大于分区表上的全局分区索引和非分区索引。

注意:创建分区表上的非分区索引与创建非分区表上的非分区索引是相同的。

2 创建本地分区索引
最常见的分区索引类型是本地分区索引。本地分区索引只能在分区表上创建。顾名思义,“本地”是指索引条目和相应的数据之间有直接的关系。数据分区和索引分区之间存在一对一的关系。如果有某个按日期范围分区的表,今年每个月都有一个分区,那么对于2012年1月分区的所有数据,创建的每个索引在2012年1月分区都有相应的索引项。

2.1 最简单的形式
除LOCAL关键字外,最基本的创建本地分区索引的形式与创建非分区索引相同。

create table employees_part
(
EMPLOYEE_ID   NUMBER(6),
FIRST_NAME    VARCHAR2(20),
LAST_NAME     VARCHAR2(25),
EMAIL         VARCHAR2(25),
PHONE_NUMBER  VARCHAR2(20),
HIRE_DATE     DATE,
JOB_ID        VARCHAR2(10),
SALARY        NUMBER(8,2),
COMMISSION_PCT NUMBER(2,2),
MANAGER_ID     NUMBER(6),
DEPARTMENT_ID  NUMBER(4)
)
partition by range(hire_date)
(
   partition p01 values less than(to_date('2002-01-01','yyyy-mm-dd')),
   partition p02 values less than(to_date('2003-01-01','yyyy-mm-dd')),
   partition p03 values less than(to_date('2004-01-01','yyyy-mm-dd')),
   partition p04 values less than(to_date('2005-01-01','yyyy-mm-dd')),
   partition p05 values less than(to_date('2006-01-01','yyyy-mm-dd')),
   partition p06 values less than(to_date('2007-01-01','yyyy-mm-dd')),
   partition p07 values less than(to_date('2008-01-01','yyyy-mm-dd')),
   partition p08 values less than(to_date('2009-01-01','yyyy-mm-dd')),
   partition p09 values less than(to_date('2010-01-01','yyyy-mm-dd')),
   partition p10 values less than(to_date('2011-01-01','yyyy-mm-dd')),
   partition p11 values less than(to_date('2012-01-01','yyyy-mm-dd')),
   partition p12 values less than(to_date('2013-01-01','yyyy-mm-dd'))
);
/




SQL> create table employees_part
  2  (
  3  EMPLOYEE_ID   NUMBER(6),
  4  FIRST_NAME    VARCHAR2(20),
  5  LAST_NAME     VARCHAR2(25),
  6  EMAIL         VARCHAR2(25),
  7  PHONE_NUMBER  VARCHAR2(20),
  8  HIRE_DATE     DATE,
  9  JOB_ID        VARCHAR2(10),
 10  SALARY        NUMBER(8,2),
 11  COMMISSION_PCT NUMBER(2,2),
 12  MANAGER_ID     NUMBER(6),
 13  DEPARTMENT_ID  NUMBER(4)
 14  )
 15  partition by range(hire_date)
 16  (
 17     partition p01 values less than(to_date('2002-01-01','yyyy-mm-dd')),
 18     partition p02 values less than(to_date('2003-01-01','yyyy-mm-dd')),
 19     partition p03 values less than(to_date('2004-01-01','yyyy-mm-dd')),
 20     partition p04 values less than(to_date('2005-01-01','yyyy-mm-dd')),
 21     partition p05 values less than(to_date('2006-01-01','yyyy-mm-dd')),
 22     partition p06 values less than(to_date('2007-01-01','yyyy-mm-dd')),
 23     partition p07 values less than(to_date('2008-01-01','yyyy-mm-dd')),
 24     partition p08 values less than(to_date('2009-01-01','yyyy-mm-dd')),
 25     partition p09 values less than(to_date('2010-01-01','yyyy-mm-dd')),
 26     partition p10 values less than(to_date('2011-01-01','yyyy-mm-dd')),
 27     partition p11 values less than(to_date('2012-01-01','yyyy-mm-dd')),
 28     partition p12 values less than(to_date('2013-01-01','yyyy-mm-dd'))
 29  );
/
Table created.


SQL> insert into employees_part select * from employees;

107 rows created.

SQL> commit;

Commit complete.


SQL> create index employees_part_i1 on employees_part(hire_date) local;

Index created.

对于这个例子,Oracle创建的分区名称将与数据分区的名称相同。此外,所有分区都将在USERS表空间内创建。

根据应用程序的需求,可能需要指定各个分区的具体信息,比如下列内容:
.分区名称
.表空间名称
.存储参数

2.2 分区级的需求
如果有特定的分区级的需求,就需要在create index ddl内指定每个分区的信息。例如:

SQL> create index employees_part_i2 on employees_part(hire_date) local
  2  (
  3  partition pi01,
  4  partition pi02,
  5  partition pi03,
  6  partition pi04,
  7  partition pi05,
  8  partition pi06,
  9  partition pi07,
 10  partition pi08,
 11  partition pi09,
 12  partition pi10,
 13  partition pi11,
 14  partition pi12
 15  );

Index created.

在这个例子中,对分区名称进行了修改,在表分区名中间插入一个i来表示索引分区。为了让索引具有与表不同的分区名称,必须在create indexddl中指定每个分区的名称。还可以为每个分区指定不同的表空间,因为它代表了一年的数据。把每年的数据放在自己的表空间内,就可以把往年数据的表空间设置为只读。这有助于提高查询速度和备份速度,因为你不需要在数据库的每个备份中都备份只读表空间。

再次强调,要创建本地分区索引,必须是在分区表上创建。否则,就会出现以下错误提示信息:

SQL> create index employees_i1 on employees(hire_date) tablespace users local;
create index employees_i1 on employees(hire_date) tablespace users local
                             *
ERROR at line 1:
ORA-14016: underlying table of a LOCAL partitioned index must be partitioned

2.3 前缀和非前缀选项
可以把本地分区索引创建为前缀或非前缀的。在创建本地分区的前缀索引时,这意味着表的分区列在索引的前导端。如果分区列不在索引的前导端,就被当作非前缘索引。在Oracle的早期版本中,本地前缀索引与非前缀索引相比,在性能上有一些优势。在Oracle后来的版本中,包括版本11gR2,建立本地前缀索引的优势已经减弱。不过,如果你的数据库环境是OLTP系统,本地前缀索引比非前缀索引更有利于提高查询性能,因为为了检索某个查询所需的数据,优化器需要扫描的索引分区可能会较少。

在创建本地分区的唯一索引时,索引必须包括分区列,否则就会出现以下错误提示信息:

SQL> create unique index employees_part_pk on employees_part(employee_id) local;
create unique index employees_part_pk on employees_part(employee_id) local
                                         *
ERROR at line 1:
ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index

在唯一索引的定义中添加分区列(在本例中是hire_date)后,就可以在employees_part表上创建唯一索引了。

SQL> create unique index employees_part_pk on employees_part(employee_id,hire_date) local;

Index created.
]]>
http://www.jydba.net/index.php/archives/3229/feed 0
Oracle应用程序域索引 http://www.jydba.net/index.php/archives/3227 http://www.jydba.net/index.php/archives/3227#respond Thu, 25 Mar 2021 08:40:37 +0000 http://www.jydba.net/?p=3227 应用程序域索引是最不为人所知且大多数开发人员和DBA也是最少使用的一种。应用域索引支持创建自己的索引结构,以实现目前Oracle数据库中不存在的新的索引类型。Oracle数据库本身实现的全文索引,就是应用程序域索引的一个很好的例子,全文索引常用来促进在大的文本项中的搜索。为了创建全文索引,需要在create index语句中包含indextype子句,如下所示:

SQL> create table test_tab(dsc clob);

Table created.

SQL> insert into test_tab values('hi,this is xiaoming');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test_tab;

DSC
--------------------------------------------------------------------------------
hi,this is xiaoming

SQL> create index test_idx on test_tab(dsc) indextype is ctxsys.context;

Index created.

SQL>
SQL> select * from test_tab where contains(dsc,'this is')>0;

no rows selected

就像收集普通索引的统计信息一样,可以调用dbms_stats.gather_index_stats存储过程来收集全文索引的统计信息。虽然我们这里只是简单地讨论了应用程序域索引,在大多数情况下,这些索引对第三方解决方案供应商有更多的用处,因为他们需要使用创新的索引解决方案来访问各类非传统的数据,如文本和图像。例如,在使用某些类型的数据,如视频剪辑时,Oracle提供的数据类型可能不太适用。此外,这些特殊类型的数据,可能需要特殊类型的操作,例如,图像中的颜色等级。你可以使用能把图像中的颜色分级的比较运算符,来定义这些特殊类型的操作。

]]>
http://www.jydba.net/index.php/archives/3227/feed 0
openPower服务器搭建Oracle 19c adg http://www.jydba.net/index.php/archives/3201 http://www.jydba.net/index.php/archives/3201#respond Fri, 15 Jan 2021 07:33:36 +0000 http://www.jydba.net/?p=3201 创建用户与组
创建组(在各个主机上执行)

mkgroup -'A' id='501' adms='root' oinstall
mkgroup -'A' id='502' adms='root' asmdba
mkgroup -'A' id='503' adms='root' asmoper
mkgroup -'A' id='504' adms='root' dba
mkgroup -'A' id='505' adms='root' oper
mkgroup -'A' id='506' adms='root' backdba
mkgroup -'A' id='507' adms='root' dgdba
mkgroup -'A' id='508' adms='root' racdba
mkgroup -'A' id='509' adms='root' kmdba

创建用户(在各个主机上执行)

mkuser id=601 pgrp=oinstall groups=dba,asmdba,oper,asmoper,backdba,dgdba,racdba,kmdba home=/home/oracle oracle

创建安装目录

mkdir -p /u01/app/oraInventory
mkdir -p /u01/app/oracle/product/19.3/db
mkdir -p /u01/temp

chown -R oracle:oinstall /u01
chmod -R 775 /u01

设置用户环境变量(用oracle用户来编辑.profile)

umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3/db
export ORACLE_SID=hxsy
export ORACLE_UNQNAME=hxsy
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin
export ORACLE_PATH=${PATH}:$ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/u01/tmp
export TMPDIR=/u01/tmp
export PS1=`hostname`:'$PWD'"$"

使用如下命令查看虚拟内存管理参数

vmo -L minperm%
vmo -L maxperm%
vmo -L maxclient%
vmo -L lru_file_repage
vmo -L strict_maxclient
vmo -L strict_maxperm

如果设置不合适,使用如下命令修改:

vmo -p -o minperm%=3
vmo -p -o maxperm%=90
vmo -p -o maxclient%=90
vmo -p -o lru_file_repage=0
vmo -p -o strict_maxclient=1
vmo -p -o strict_maxperm=0

检查网络参数设置
ephemeral参数:
使用命令no -a |fgrep ephemeral可以查看当前系统ephemeral参数设置,建议的参数设置如下

tcp_ephemeral_high = 65500
tcp_ephemeral_low = 9000
udp_ephemeral_high= 65500
udp_ephemeral_low = 9000

如果系统中参数设置和上述值不一样,使用命令修改:

#no -p -o tcp_ephemeral_low=9000 -o tcp_ephemeral_high=65500
#no -p -o udp_ephemeral_low=9000 -o udp_ephemeral_high=65500

使用如下命令修改网络可调整参数:

#no -p -o rfc1323=1
#no -r -o ipqmaxlen=512
#no -p -o ipqmaxlen=512
#no -p -o sb_max=4194304
#no -p -o tcp_recvspace=65536
#no -p -o tcp_sendspace=65536
#no -p -o udp_recvspace=1351680 该值是udp_sendspace的10倍,但须小于sb_max
#no -p -o udp_sendspace=135168

备注:-r表示reboot后生效,-p表示即刻生效.
检查内核参数maxuproc(建议16384)和ncargs(至少128)

#lsattr -E -l sys0 -a ncargs
#lsattr -E -l sys0 -a maxuproc

如果设置不合适使用如下命令修改:

#chdev -l sys0 -a ncargs=256
#chdev -l sys0 -a maxuproc=16384

解压数据库软件

aix1:/u01/soft$unzip -q AIX.PPC64_193000_db_home.zip -d $ORACLE_HOME

安装数据库软件
在$ORACLE_HOME/install/response目录中有一个安装rsp文件示例
配置响应文件

[oracle@ora19c ~]$ vi 19c_dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.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/19.3/db
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=true
oracle.install.db.rootconfig.configMethod=ROOT

执行安装

openaix1:/home/oracle$$ORACLE_HOME/runInstaller -silent  -force -noconfig  -ignorePrereq  -responseFile /home/oracle/19c_dbinstall.rsp

********************************************************************************

Your platform requires the root user to perform certain pre-installation
OS preparation.  The root user should run the shell script 'rootpre.sh' before
you proceed with Oracle installation. The rootpre.sh script can be found at:
/u01/app/oracle/product/19.3/db/clone/rootpre.sh

Answer 'y' if root has run 'rootpre.sh' so you can proceed with Oracle
installation.
Answer 'n' to abort installation and then ask root to run 'rootpre.sh'.

********************************************************************************

Has 'rootpre.sh' been run by root in this machine? [y/n] (n)
y
Launching Oracle Database Setup Wizard...


 Enter password for 'root' user: 
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2020-11-17_01-49-09AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: installActions2020-11-17_01-49-09AM.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/19.3/db/install/response/db_2020-11-17_01-49-09AM.rsp

You can find the log of this install session at:
 /u01/tmp/InstallActions2020-11-17_01-49-09AM/installActions2020-11-17_01-49-09AM.log
Successfully Setup Software with warning(s).
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2020-11-17_01-49-09AM

配置监听
创建配置监听的响应文件
在/u01/app/oracle/product/19.3/db/assistants/netca/目录有一个示例文件

aix1:/home/oracle$vi 19c_netca.rsp
"19c_netca.rsp" [New file] 

[GENERAL]
RESPONSEFILE_VERSION="19.0"
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"}


aix1:/home/oracle$netca /silent /responsefile /home/oracle/19c_netca.rsp
UnsatisfiedLinkError exception loading native library: njni19
java.lang.UnsatisfiedLinkError: njni19 (Not found in java.library.path)
java.lang.UnsatisfiedLinkError: oracle/net/common/NetGetEnv.jniGetOracleHome()Ljava/lang/String;
        at oracle.net.common.NetGetEnv.getOracleHome(Unknown Source)
        at oracle.net.ca.NetCALogger.getOracleHome(NetCALogger.java:230)
        at oracle.net.ca.NetCALogger.initOracleParameters(NetCALogger.java:215)
        at oracle.net.ca.NetCALogger.initLogger(NetCALogger.java:130)
        at oracle.net.ca.NetCA.main(NetCA.java:459)

Error: oracle/net/common/NetGetEnv.jniGetOracleHome()Ljava/lang/String;
Oracle Net Services configuration failed.  The exit code is 1


# lsdev | grep iocp
iocp0      Defined         I/O Completion Ports
# smitty iocp

# lsdev | grep iocp
iocp0      Available       I/O Completion Ports


aix1:/home/oracle$$ORACLE_HOME/bin/relink all 
writing relink log to: /u01/app/oracle/product/19.3/db/install/relinkActions2020-11-16_11-17-27PM.log

aix1:/home/oracle$netca /silent /responsefile /home/oracle/19c_netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/oracle/19c_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/19.3/db/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

aix1:/home/oracle$lsnrctl status

LSNRCTL for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production on 16-NOV-2020 23:24:53

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=aix1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production
Start Date                16-NOV-2020 23:23:28
Uptime                    0 days 0 hr. 1 min. 27 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/aix1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aix1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

创建数据库
创建配置数据库的响应文件
在/u01/app/oracle/product/19.3/db/assistants/dbca/目录中有一个示例文件

[oracle@ora19c install]$ cat /u01/app/oracle/product/19.3/db/assistants/dbca/dbca.rsp


aix1:/home/oracle$vi 19c_dbca.rsp
automaticMemoryManagement=TRUE
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
templateName=General_Purpose.dbc
gdbName=hxsy
sid=hxsy
databaseConfigType=SI
createAsContainerDatabase=TRUE
numberOfPDBs=1
pdbName=hxsy1
useLocalUndoForPDBs=TRUE
pdbAdminPassword=hxsy_123456
sysPassword=hxsy_123456
systemPassword=hxsy_123456
storageType=FS
characterSet=ZHS16GBK
nationalCharacterSet=AL16UTF16
listeners=LISTENER
sampleSchema=TRUE
totalMemory 2048
databaseType=MULTIPURPOSE
automaticMemoryManagement=FALSE
totalMemory=4096

创建数据库

aix1:/home/oracle$dbca -silent  -createDatabase -responseFile /home/oracle/19c_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
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/hxsy.
Database Information:
Global Database Name:hxsy
System Identifier(SID):hxsy
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/hxsy/hxsy.log" for further details.

给主库配置归档

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/product/19.3/db/dbs/arch
Oldest online log sequence     5
Current log sequence           7


SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/arch' scope=both sid='*';

System altered.

SQL> show parameter log_archive_for

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_format                   string      %t_%s_%r.dbf

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

aix1:/u01/app/oracle/product/19.3/db/dbs$sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 16 16:32:33 2020
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 3221222936 bytes
Fixed Size                  9303576 bytes
Variable Size             956301312 bytes
Database Buffers         2231369728 bytes
Redo Buffers               24248320 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 HXSY1                          MOUNTED

SQL> alter pluggable database hxsy1 open;

Pluggable database altered.

SQL> show pdbs;

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

这里主库已经启用了归档

启用force logging

SQL> alter database force logging;

Database altered.

SQL> select force_logging from v$database;

FORCE_LOGGING
---------------------------------------
YES

给备库创建密码文件
这里通过复制主库的密码文件来创建备库密码文件

openaix1:/u01/app/oracle/product/19.3/db/dbs$scp oracle@aix1:/u01/app/oracle/product/19.3/db/dbs/orapwhxsy /u01/app/oracle/product/19.3/db/dbs/
oracle@aix1's password: 
orapwhxsy                                                                                                                                                                                                 100% 2048   199.4KB/s   00:00    
openaix1:/u01/app/oracle/product/19.3/db/dbs$ls -lrt
total 16
-rw-r--r--    1 oracle   oinstall       3079 May 16 2015  init.ora
-rw-r-----    1 oracle   oinstall       2048 Nov 17 16:40 orapwhxsy

给备库创建参数文件
使用主库的参数文件进行创建

SQL> create pfile from spfile;

File created.



aix1:/u01/app/oracle/product/19.3/db/dbs$cat inithxsy.ora

*.audit_file_dest='/u01/app/oracle/admin/hxsy/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/u01/app/oracle/oradata/HXSY_DG/control01.ctl','/u01/app/oracle/oradata/HXSY_DG/control02.ctl'
*.db_block_size=8192
*.db_name='hxsy'
*.db_unique_name='hxsy_dg'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=hxsyXDB)'
*.enable_pluggable_database=true
*.local_listener='LISTENER_HXSY'
*.log_archive_dest_1='location=/u01/app/oracle/arch valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=hxsy_dg'
*.log_archive_dest_2='service=hxsy LGWR ASYNC valid_for=(online_logfiles,primary_role) db_unique_name=hxsy'
*.log_archive_config='DG_CONFIG=(hxsy,hxsy_dg)'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=1024m
*.processes=2560
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=3072m
*.undo_tablespace='UNDOTBS1'
--备库以备库角色运行时需要设置的参数
*.db_file_name_convert='/u01/app/oracle/oradata/HXSY','/u01/app/oracle/oradata/HXSY_DG'
*.fal_client='hxsy_dg'
*.fal_server='hxsy'
*.log_file_name_convert='/u01/app/oracle/oradata/HXSY','/u01/app/oracle/oradata/HXSY_DG'
*.standby_file_management='auto'

在备库主机上创建参数文件

openaix1:/u01/app/oracle/product/19.3/db/dbs$vi inithxsy.ora
"inithxsy.ora" [New file] 
*.audit_file_dest='/u01/app/oracle/admin/hxsy/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/u01/app/oracle/oradata/HXSY_DG/control01.ctl','/u01/app/oracle/oradata/HXSY_DG/control02.ctl'
*.db_block_size=8192
*.db_name='hxsy'
*.db_unique_name='hxsy_dg'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=hxsyXDB)'
*.enable_pluggable_database=true
*.local_listener='LISTENER_HXSY'
*.log_archive_dest_1='location=/u01/app/oracle/arch valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=hxsy_dg'
*.log_archive_dest_2='service=hxsy LGWR ASYNC valid_for=(online_logfiles,primary_role) db_unique_name=hxsy'
*.log_archive_config='DG_CONFIG=(hxsy,hxsy_dg)'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=1024m
*.processes=2560
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=3072m
*.undo_tablespace='UNDOTBS1'
*.db_file_name_convert='/u01/app/oracle/oradata/HXSY','/u01/app/oracle/oradata/HXSY_DG'
*.fal_client='hxsy_dg'
*.fal_server='hxsy'
*.log_file_name_convert='/u01/app/oracle/oradata/HXSY','/u01/app/oracle/oradata/HXSY_DG'
*.standby_file_management='auto'

为主库和备库配置监听
主库

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = hxsy)
      (ORACLE_HOME =/u01/app/oracle/product/19.3/db)
      (GLOBAL_DBNAME=hxsy)
    )
  )

备库

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = hxsy)
      (ORACLE_HOME =/u01/app/oracle/product/19.3/db)
      (GLOBAL_DBNAME=hxsy_dg)
    )
  )

重启主库和备库的监听
主库:

aix1:/u01/app/oracle/product/19.3/db/network/admin$lsnrctl status

LSNRCTL for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production on 16-NOV-2020 16:58:45

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=aix1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production
Start Date                16-NOV-2020 16:58:06
Uptime                    0 days 0 hr. 0 min. 39 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/aix1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aix1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "hxsy" has 1 instance(s).
  Instance "hxsy", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

备库:

openaix1:/home/oracle$lsnrctl start

LSNRCTL for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production on 17-NOV-2020 17:01:03

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

Starting /u01/app/oracle/product/19.3/db/bin/tnslsnr: please wait...

TNSLSNR for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.3/db/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/openaix1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=openaix1)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=openaix1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production
Start Date                17-NOV-2020 17:01:04
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/openaix1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=openaix1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "hxsy_dg" has 1 instance(s).
  Instance "hxsy", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

为主库和备库创建Oracle Net服务名
主库:

HXSY =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.24.117)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = hxsy)
    )
  )


HXSY_DG =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.24.116)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = hxsy_dg)
      (UR=A)
    )
  )

备库:
使用备份创建备库

openaix1:/u01/app/oracle/oradata$sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 17 17:07:09 2020
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 3221222936 bytes
Fixed Size                  9242136 bytes
Variable Size             754974720 bytes
Database Buffers         2449473536 bytes
Redo Buffers                7532544 bytes

aix1:/u01/app/oracle/product/19.3/db/dbs$rman target sys/hxsy_123456@hxsy auxiliary sys/hxsy_123456@hxsy_dg

Recovery Manager: Release 19.0.0.0.0 - Production on Mon Nov 16 17:23:03 2020
Version 19.3.0.0.0

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

connected to target database: HXSY (DBID=1728588152)
connected to auxiliary database: HXSY (not mounted)

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

Starting Duplicate Db at 2020-11-16 17:23:12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=2420 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19.3/db/dbs/orapwhxsy'   ;
}
executing Memory Script

Starting backup at 2020-11-16 17:23:14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2908 device type=DISK
Finished backup at 2020-11-16 17:23:16

contents of Memory Script:
{
   restore clone from service  'hxsy' standby controlfile;
}
executing Memory Script

Starting restore at 2020-11-16 17:23:16
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output file name=/u01/app/oracle/oradata/HXSY_DG/control01.ctl
output file name=/u01/app/oracle/oradata/HXSY_DG/control02.ctl
Finished restore at 2020-11-16 17:23: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/HXSY_DG/temp01.dbf";
   set newname for tempfile  2 to 
 "/u01/app/oracle/oradata/HXSY_DG/pdbseed/temp012020-11-17_00-11-36-085-AM.dbf";
   set newname for tempfile  3 to 
 "/u01/app/oracle/oradata/HXSY_DG/hxsy1/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/u01/app/oracle/oradata/HXSY_DG/system01.dbf";
   set newname for datafile  3 to 
 "/u01/app/oracle/oradata/HXSY_DG/sysaux01.dbf";
   set newname for datafile  4 to 
 "/u01/app/oracle/oradata/HXSY_DG/undotbs01.dbf";
   set newname for datafile  5 to 
 "/u01/app/oracle/oradata/HXSY_DG/pdbseed/system01.dbf";
   set newname for datafile  6 to 
 "/u01/app/oracle/oradata/HXSY_DG/pdbseed/sysaux01.dbf";
   set newname for datafile  7 to 
 "/u01/app/oracle/oradata/HXSY_DG/users01.dbf";
   set newname for datafile  8 to 
 "/u01/app/oracle/oradata/HXSY_DG/pdbseed/undotbs01.dbf";
   set newname for datafile  9 to 
 "/u01/app/oracle/oradata/HXSY_DG/hxsy1/system01.dbf";
   set newname for datafile  10 to 
 "/u01/app/oracle/oradata/HXSY_DG/hxsy1/sysaux01.dbf";
   set newname for datafile  11 to 
 "/u01/app/oracle/oradata/HXSY_DG/hxsy1/undotbs01.dbf";
   set newname for datafile  12 to 
 "/u01/app/oracle/oradata/HXSY_DG/hxsy1/users01.dbf";
   restore
   from  nonsparse   from service 
 'hxsy'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/HXSY_DG/temp01.dbf in control file
renamed tempfile 2 to /u01/app/oracle/oradata/HXSY_DG/pdbseed/temp012020-11-17_00-11-36-085-AM.dbf in control file
renamed tempfile 3 to /u01/app/oracle/oradata/HXSY_DG/hxsy1/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 2020-11-16 17:23:32
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/HXSY_DG/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/HXSY_DG/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/HXSY_DG/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/HXSY_DG/pdbseed/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/HXSY_DG/pdbseed/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/HXSY_DG/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/HXSY_DG/pdbseed/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/HXSY_DG/hxsy1/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/HXSY_DG/hxsy1/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/HXSY_DG/hxsy1/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service hxsy
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00012 to /u01/app/oracle/oradata/HXSY_DG/hxsy1/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 2020-11-16 17:25:31

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=4 STAMP=1056734739 file name=/u01/app/oracle/oradata/HXSY_DG/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=1056734739 file name=/u01/app/oracle/oradata/HXSY_DG/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/pdbseed/system01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=8 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/pdbseed/sysaux01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=9 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/users01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=10 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/pdbseed/undotbs01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=11 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/hxsy1/system01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=12 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/hxsy1/sysaux01.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=13 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/hxsy1/undotbs01.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=14 STAMP=1056734740 file name=/u01/app/oracle/oradata/HXSY_DG/hxsy1/users01.dbf
Finished Duplicate Db at 2020-11-16 17:25:45
openaix1:/u01/app/oracle/oradata/HXSY_DG$sqlplus / as sysdba 

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 17 17:26:54 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select instance_name,status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
hxsy             MOUNTED

SQL> show parameter db_unique_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      hxsy_dg

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/HXSY_DG/system01.dbf
/u01/app/oracle/oradata/HXSY_DG/sysaux01.dbf
/u01/app/oracle/oradata/HXSY_DG/undotbs01.dbf
/u01/app/oracle/oradata/HXSY_DG/pdbseed/system01.dbf
/u01/app/oracle/oradata/HXSY_DG/pdbseed/sysaux01.dbf
/u01/app/oracle/oradata/HXSY_DG/users01.dbf
/u01/app/oracle/oradata/HXSY_DG/pdbseed/undotbs01.dbf
/u01/app/oracle/oradata/HXSY_DG/hxsy1/system01.dbf
/u01/app/oracle/oradata/HXSY_DG/hxsy1/sysaux01.dbf
/u01/app/oracle/oradata/HXSY_DG/hxsy1/undotbs01.dbf
/u01/app/oracle/oradata/HXSY_DG/hxsy1/users01.dbf

11 rows selected.

对物理备库创建备重做日志文件
查询主库的联机重做日志文件,备重做日志文件的大小应该与主库联机重做日志文件的大小相同,备重做日志文件组的数量应该比主库联机重做日志文件组多一组,计算公式为

(maximum # of logfiles +1) * maximum # of threads 
aix1:/u01/app/oracle/product/19.3/db/dbs$sqlplus sys/hxsy_123456@hxsy as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 16 17:28:21 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL>  select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/HXSY/redo03.log
/u01/app/oracle/oradata/HXSY/redo02.log
/u01/app/oracle/oradata/HXSY/redo01.log


SQL> select group#,thread#,bytes/1024/1024 from v$log;

    GROUP#    THREAD# BYTES/1024/1024
---------- ---------- ---------------
         1          1             200
         2          1             200
         3          1             200



SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/HXSY_DG/redo03.log
/u01/app/oracle/oradata/HXSY_DG/redo02.log
/u01/app/oracle/oradata/HXSY_DG/redo01.log

SQL> select group#,thread#,bytes/1024/1024 from v$log;

    GROUP#    THREAD# BYTES/1024/1024
---------- ---------- ---------------
         1          1             200
         3          1             200
         2          1             200

备库:

SQL> alter database add standby logfile thread 1 group 4('/u01/app/oracle/oradata/HXSY_DG/redo04.log') size 200M;

Database altered.

SQL> alter database add standby logfile thread 1 group 5('/u01/app/oracle/oradata/HXSY_DG/redo05.log') size 200M;

Database altered.

SQL> alter database add standby logfile thread 1 group 6('/u01/app/oracle/oradata/HXSY_DG/redo06.log') size 200M;

Database altered.

SQL> alter database add standby logfile thread 1 group 7('/u01/app/oracle/oradata/HXSY_DG/redo07.log') size 200M;

Database altered.

主库:

SQL> alter database add standby logfile thread 1 group 4('/u01/app/oracle/oradata/HXSY/redo04.log') size 200M;

Database altered.

SQL> alter database add standby logfile thread 1 group 5('/u01/app/oracle/oradata/HXSY/redo05.log') size 200M;

Database altered.

SQL> alter database add standby logfile thread 1 group 6('/u01/app/oracle/oradata/HXSY/redo06.log') size 200M;

Database altered.

SQL> alter database add standby logfile thread 1 group 7('/u01/app/oracle/oradata/HXSY/redo07.log') size 200M;

Database altered.

设置主库相关初始化参数

log_archive_config='DG_CONFIG=(hxsy,hxsy_dg)'
log_archive_dest_1='LOCATION=/u01/app/oracle/arch valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=hxsy'
log_archive_dest_2='SERVICE=hxsy_dg LGWR ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=hxsy_dg'
log_archive_dest_state_1=enable
log_archive_dest_state_2=enable
remote_login_passwordfile=exclusive
log_archive_format= %t_%s_%r.dbf
log_archive_max_processes=30

主库以备库角色运行时需要额外设置的参数。这些参数当主库被转换为备库角色运行时生效:

fal_server='hxsy_dg'
fal_client='hxsy'
db_file_name_convert='/u01/app/oracle/oradata/HXSY_DG', '/u01/app/oracle/oradata/HXSY'
log_file_name_convert='/u01/app/oracle/oradata/HXSY_DG', '/u01/app/oracle/oradata/HXSY'
standby_file_management='auto'


SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/arch valid_for=(ALL_LOGFILES,ALL_ROLES) db_unique_name=hxsy' scope=both sid='*';

System altered.

SQL> alter system set log_archive_dest_2='SERVICE=hxsy_dg LGWR ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=hxsy_dg'scope=both sid='*';

System altered.

SQL> alter system set log_archive_dest_state_1=enable scope=both sid='*';

System altered.

SQL> alter system set log_archive_dest_state_2=enable scope=both sid='*';

System altered.


SQL> alter system set log_archive_max_processes=30 scope=both sid='*';

System altered.

SQL> alter system set fal_server='hxsy_dg' scope=both sid='*';

System altered.

SQL> alter system set fal_client='hxsy' scope=both sid='*';

System altered.

SQL> alter system set db_file_name_convert='/u01/app/oracle/oradata/HXSY_DG', '/u01/app/oracle/oradata/HXSY' scope=spfile sid='*';

System altered.

SQL> alter system set log_file_name_convert='/u01/app/oracle/oradata/HXSY_DG', '/u01/app/oracle/oradata/HXSY' scope=spfile sid='*';

System altered.

SQL> alter system set standby_file_management='auto' scope=both sid='*';

System altered.


SQL> alter system set log_archive_config='DG_CONFIG=(hxsy,hxsy_dg)' scope=both sid='*';

System altered.



SQL> select name, database_role, open_mode from gv$database;

NAME      DATABASE_ROLE    OPEN_MODE
--------- ---------------- --------------------
HXSY      PRIMARY          READ WRITE


SQL> select name, database_role, open_mode from gv$database;

NAME      DATABASE_ROLE    OPEN_MODE
--------- ---------------- --------------------
HXSY      PHYSICAL STANDBY READ ONLY

使用alter database语句来启用实时应用功能:
.对于物理备库执行alter database recover managed standby database(在Oracle 12.1中需要指定current logfile子句来启用实时应用,但在12.2中不再需要)。

在备库节点上执行实时重做应用

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

Database altered.

alert日志信息如下

# tail -f /u01/app/oracle/diag/rdbms/hxsy_dg/hxsy/trace/alert_hxsy.log
ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
ORA-01110: data file 202: '/u01/app/oracle/oradata/HXSY_DG/pdbseed/temp012020-11-17_00-11-36-085-AM.dbf'
2020-11-17T17:47:58.239174-06:00
File 202 not verified due to error ORA-01157
2020-11-17T17:47:58.390428-06:00
PDB$SEED(2):Re-creating tempfile /u01/app/oracle/oradata/HXSY_DG/pdbseed/temp012020-11-17_00-11-36-085-AM.dbf
2020-11-17T17:47:59.013123-06:00
PDB$SEED(2):Opening pdb with no Resource Manager plan active
Physical standby database opened for read only access.
Completed: alter database open
2020-11-17T17:50:46.966690-06:00
Warning: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE has been deprecated.
Warning: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE has been deprecated.
alter database recover managed standby database using current logfile disconnect from session
2020-11-17T17:50:47.069179-06:00
Attempt to start background Managed Standby Recovery process (hxsy)
Starting background process MRP0
2020-11-17T17:50:47.296690-06:00
MRP0 started with pid=67, OS id=10682718 
2020-11-17T17:50:47.329349-06:00
Background Managed Standby Recovery process started (hxsy)
2020-11-17T17:50:52.560871-06:00
 Started logmerger process
2020-11-17T17:50:52.734970-06:00

IM on ADG: Start of Empty Journal 

IM on ADG: End of Empty Journal 
PR00 (PID:12190072): Managed Standby Recovery starting Real Time Apply
max_pdb is 3
2020-11-17T17:50:54.165887-06:00
Parallel Media Recovery started with 8 slaves
2020-11-17T17:50:54.389175-06:00
stopping change tracking
2020-11-17T17:50:54.609199-06:00
PR00 (PID:12190072): Media Recovery Log /u01/app/oracle/arch/1_7_1056672314.dbf
2020-11-17T17:50:54.799176-06:00
PR00 (PID:12190072): Media Recovery Log /u01/app/oracle/arch/1_8_1056672314.dbf
2020-11-17T17:50:54.877923-06:00
TT02 (PID:12779914): Waiting for all non-current ORLs to be archived
2020-11-17T17:50:54.987923-06:00
TT02 (PID:12779914): All non-current ORLs have been archived
2020-11-17T17:50:55.311006-06:00
Completed: alter database recover managed standby database using current logfile disconnect from session
2020-11-17T17:50:55.335874-06:00
PR00 (PID:12190072): Media Recovery Waiting for T-1.S-9 (in transit)
2020-11-17T17:50:55.376975-06:00
Recovery of Online Redo Log: Thread 1 Group 4 Seq 9 Reading mem 0
2020-11-17T17:50:55.412407-06:00
  Mem# 0: /u01/app/oracle/oradata/HXSY_DG/redo04.log

在主库创建表空间test

SQL> create tablespace test datafile '/u01/app/oracle/oradata/HXSY/test01.dbf' size 50M;

Tablespace created.


SQL>  select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
TEST

6 rows selected.

SQL> select con_id,ts#,name from v$tablespace;

    CON_ID        TS# NAME
---------- ---------- ------------------------------
         1          1 SYSAUX
         1          0 SYSTEM
         1          2 UNDOTBS1
         1          4 USERS
         1          3 TEMP
         2          0 SYSTEM
         2          1 SYSAUX
         2          2 UNDOTBS1
         2          3 TEMP
         3          0 SYSTEM
         3          1 SYSAUX

    CON_ID        TS# NAME
---------- ---------- ------------------------------
         3          2 UNDOTBS1
         3          3 TEMP
         3          5 USERS
         1          6 TEST

15 rows selected.

SQL> select ts#,name from v$datafile where ts#=6 and con_id=1;

       TS# NAME
---------- --------------------------------------------------
         6 /u01/app/oracle/oradata/HXSY/test01.dbf

备库alert日志如下:

Recovery of Online Redo Log: Thread 1 Group 4 Seq 9 Reading mem 0
2020-11-17T17:50:55.412407-06:00
  Mem# 0: /u01/app/oracle/oradata/HXSY_DG/redo04.log
2020-11-17T17:52:48.412685-06:00
Recovery created file /u01/app/oracle/oradata/HXSY_DG/test01.dbf
2020-11-17T17:52:48.453155-06:00
Errors in file /u01/app/oracle/diag/rdbms/hxsy_dg/hxsy/trace/hxsy_dbw0_7602670.trc:
ORA-01157: cannot identify/lock data file 203 - see DBWR trace file
ORA-01110: data file 203: '/u01/app/oracle/oradata/HXSY_DG/hxsy1/temp01.dbf'
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 7
Successfully added datafile 13 to media recovery
Datafile #13: '/u01/app/oracle/oradata/HXSY_DG/test01.dbf'
2020-11-17T17:53:13.126690-06:00
Control autobackup written to DISK device

备库:

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
TEST

6 rows selected.

SQL> select con_id,ts#,name from v$tablespace;

    CON_ID        TS# NAME
---------- ---------- ------------------------------
         1          1 SYSAUX
         1          0 SYSTEM
         1          2 UNDOTBS1
         1          4 USERS
         1          3 TEMP
         2          0 SYSTEM
         2          1 SYSAUX
         2          2 UNDOTBS1
         2          3 TEMP
         3          0 SYSTEM
         3          1 SYSAUX

    CON_ID        TS# NAME
---------- ---------- ------------------------------
         3          2 UNDOTBS1
         3          3 TEMP
         3          5 USERS
         1          6 TEST

15 rows selected.

SQL> select ts#,name from v$datafile where ts#=6 and con_id=1;

       TS# NAME
---------- --------------------------------------------------
         6 /u01/app/oracle/oradata/HXSY_DG/test01.dbf

验证
主库:

SQL> create table t1 as select * from dba_users;

Table created.

SQL> select count(*) from t1;

  COUNT(*)
----------
        36


SQL> create table t2(id number(20),name varchar2(20));

Table created.

SQL> insert into t2 values(1,'jy');

1 row created.

SQL> commit;

Commit complete.

SQL> update t2 set name='hy' where id=1;

1 row updated.

SQL> commit;

Commit complete.

SQL> delete from t2;

1 row deleted.

SQL> commit;

Commit complete.

SQL> create table t3(id number(20),name varchar2(20)) tablespace test;

Table created.

SQL> insert into t3 values(1,'jy');

1 row created.

SQL> commit;

Commit complete.

备库

SQL> select count(*) from t1;

  COUNT(*)
----------
        36

SQL> desc t2;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                                 NUMBER(20)
 NAME                                               VARCHAR2(20)

SQL> select * from t2;

        ID NAME
---------- --------------------------------------------------
         1 jy

SQL> select * from t2;

        ID NAME
---------- --------------------------------------------------
         1 hy

SQL> select * from t2;

no rows selected

SQL> 
SQL> 
SQL> desc t3;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                                 NUMBER(20)
 NAME                                               VARCHAR2(20)

SQL> select * from t3;

        ID NAME
---------- --------------------------------------------------
         1 jy

验证物理备库是否执行正确
在创建物理备库后并且设置重做传输服务,可能想要验证主库的数据库修改是否会成功的传输到备库。对于备库可以查询v$managed_standby视图来验证重做是否被从主库传输到备库并应用。

SQL> select client_process,process,thread#,sequence#,status from v$managed_standby where client_process='LGWR' or process='MRP0';

CLIENT_P PROCESS      THREAD#  SEQUENCE# STATUS
-------- --------- ---------- ---------- ------------
LGWR     RFS                1          9 IDLE
N/A      MRP0               1          9 APPLYING_LOG

上面的查询对于使用CLIENT_PROCESS为LGWR的主库会显示一行记录,它指示重做传输工作正常并且主重做线程将会被发送到备库。 如果主库是RAC数据库,那么对于使用CLIENT_PROCESS为LGWR的当前活动的每个主库实例都会显示一行记录。

上面的查询对于MRP也行显示一行。如果MRP的状态显示为APPLYING_LOG并且SEQUENCE#等于主库当前正被发送的日志序列号,那么备库已经解决了所有的日志差异并且当前处于实时应用日志模式。

查询主库当前正被发送日志的序列号为9与上面的MRP进程所显示的sequence#(9)相同

SQL> select group#,thread#,sequence#,status from v$log;

    GROUP#    THREAD#  SEQUENCE# STATUS
---------- ---------- ---------- ----------------
         1          1          7 INACTIVE
         2          1          8 INACTIVE
         3          1          9 CURRENT

注意MRP进程可能显示的sequence#比主库当前被发送的日志序列号小,那么这就表示正在应用的归档重做日志文件与发送的日志文件之间存在差异并且它并没有赶上。一旦所有差异被解决,相同的查询将显示MRP正在应用当前sequence#。

]]>
http://www.jydba.net/index.php/archives/3201/feed 0
openPower服务器安装Oracle 19c http://www.jydba.net/index.php/archives/3199 http://www.jydba.net/index.php/archives/3199#respond Fri, 15 Jan 2021 07:17:55 +0000 http://www.jydba.net/?p=3199 在openPower服务器上安装Oracle 19C
1.创建用户与组
1.1.创建组(在各个主机上执行)

mkgroup -'A' id='501' adms='root' oinstall
mkgroup -'A' id='502' adms='root' asmdba
mkgroup -'A' id='503' adms='root' asmoper
mkgroup -'A' id='504' adms='root' dba
mkgroup -'A' id='505' adms='root' oper
mkgroup -'A' id='506' adms='root' backdba
mkgroup -'A' id='507' adms='root' dgdba
mkgroup -'A' id='508' adms='root' racdba
mkgroup -'A' id='509' adms='root' kmdba

1.2.创建用户(在各个主机上执行)

mkuser id=601 pgrp=oinstall groups=dba,asmdba,oper,asmoper,backdba,dgdba,racdba,kmdba home=/home/oracle oracle

创建安装目录

mkdir -p /u01/app/oraInventory
mkdir -p /u01/app/oracle/product/19.3/db
mkdir -p /u01/temp

chown -R oracle:oinstall /u01
chmod -R 775 /u01

2.设置用户环境变量(用oracle用户来编辑.profile)

umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3/db
export ORACLE_SID=hxsy
export ORACLE_UNQNAME=hxsy
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin
export ORACLE_PATH=${PATH}:$ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/u01/tmp
export TMPDIR=/u01/tmp
export PS1=`hostname`:'$PWD'"$"

3.使用如下命令查看虚拟内存管理参数

vmo -L minperm%
vmo -L maxperm%
vmo -L maxclient%
vmo -L lru_file_repage
vmo -L strict_maxclient
vmo -L strict_maxperm

4.如果设置不合适,使用如下命令修改:

vmo -p -o minperm%=3
vmo -p -o maxperm%=90
vmo -p -o maxclient%=90
vmo -p -o lru_file_repage=0
vmo -p -o strict_maxclient=1
vmo -p -o strict_maxperm=0

5.检查网络参数设置
ephemeral参数:
5.1 使用命令no -a |fgrep ephemeral可以查看当前系统ephemeral参数设置,建议的参数设置如下

tcp_ephemeral_high = 65500
tcp_ephemeral_low = 9000
udp_ephemeral_high= 65500
udp_ephemeral_low = 9000

如果系统中参数设置和上述值不一样,使用命令修改:

#no -p -o tcp_ephemeral_low=9000 -o tcp_ephemeral_high=65500
#no -p -o udp_ephemeral_low=9000 -o udp_ephemeral_high=65500

使用如下命令修改网络可调整参数:

#no -p -o rfc1323=1
#no -r -o ipqmaxlen=512
#no -p -o ipqmaxlen=512
#no -p -o sb_max=4194304
#no -p -o tcp_recvspace=65536
#no -p -o tcp_sendspace=65536
#no -p -o udp_recvspace=1351680 该值是udp_sendspace的10倍,但须小于sb_max
#no -p -o udp_sendspace=135168

备注:-r表示reboot后生效,-p表示即刻生效.
检查内核参数maxuproc(建议16384)和ncargs(至少128)

#lsattr -E -l sys0 -a ncargs
#lsattr -E -l sys0 -a maxuproc

如果设置不合适使用如下命令修改:

#chdev -l sys0 -a ncargs=256
#chdev -l sys0 -a maxuproc=16384

6.解压数据库软件

aix1:/u01/soft$unzip -q AIX.PPC64_193000_db_home.zip -d $ORACLE_HOME

7.安装数据库软件
在$ORACLE_HOME/install/response目录中有一个安装rsp文件示例
7.1.配置响应文件

[oracle@ora19c ~]$ vi 19c_dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.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/19.3/db
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=true
oracle.install.db.rootconfig.configMethod=ROOT

8.执行安装

openaix1:/home/oracle$$ORACLE_HOME/runInstaller -silent  -force -noconfig  -ignorePrereq  -responseFile /home/oracle/19c_dbinstall.rsp

********************************************************************************

Your platform requires the root user to perform certain pre-installation
OS preparation.  The root user should run the shell script 'rootpre.sh' before
you proceed with Oracle installation. The rootpre.sh script can be found at:
/u01/app/oracle/product/19.3/db/clone/rootpre.sh

Answer 'y' if root has run 'rootpre.sh' so you can proceed with Oracle
installation.
Answer 'n' to abort installation and then ask root to run 'rootpre.sh'.

********************************************************************************

Has 'rootpre.sh' been run by root in this machine? [y/n] (n)
y
Launching Oracle Database Setup Wizard...


 Enter password for 'root' user:
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2020-11-17_01-49-09AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: installActions2020-11-17_01-49-09AM.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/19.3/db/install/response/db_2020-11-17_01-49-09AM.rsp

You can find the log of this install session at:
 /u01/tmp/InstallActions2020-11-17_01-49-09AM/installActions2020-11-17_01-49-09AM.log
Successfully Setup Software with warning(s).
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2020-11-17_01-49-09AM

9.配置监听
创建配置监听的响应文件
在/u01/app/oracle/product/19.3/db/assistants/netca/目录有一个示例文件

aix1:/home/oracle$vi 19c_netca.rsp
"19c_netca.rsp" [New file]

[GENERAL]
RESPONSEFILE_VERSION="19.0"
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"}


aix1:/home/oracle$netca /silent /responsefile /home/oracle/19c_netca.rsp
UnsatisfiedLinkError exception loading native library: njni19
java.lang.UnsatisfiedLinkError: njni19 (Not found in java.library.path)
java.lang.UnsatisfiedLinkError: oracle/net/common/NetGetEnv.jniGetOracleHome()Ljava/lang/String;
        at oracle.net.common.NetGetEnv.getOracleHome(Unknown Source)
        at oracle.net.ca.NetCALogger.getOracleHome(NetCALogger.java:230)
        at oracle.net.ca.NetCALogger.initOracleParameters(NetCALogger.java:215)
        at oracle.net.ca.NetCALogger.initLogger(NetCALogger.java:130)
        at oracle.net.ca.NetCA.main(NetCA.java:459)

Error: oracle/net/common/NetGetEnv.jniGetOracleHome()Ljava/lang/String;
Oracle Net Services configuration failed.  The exit code is 1


# lsdev | grep iocp
iocp0      Defined         I/O Completion Ports
# smitty iocp

# lsdev | grep iocp
iocp0      Available       I/O Completion Ports


aix1:/home/oracle$$ORACLE_HOME/bin/relink all
writing relink log to: /u01/app/oracle/product/19.3/db/install/relinkActions2020-11-16_11-17-27PM.log

aix1:/home/oracle$netca /silent /responsefile /home/oracle/19c_netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/oracle/19c_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/19.3/db/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

aix1:/home/oracle$lsnrctl status

LSNRCTL for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production on 16-NOV-2020 23:24:53

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=aix1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 19.0.0.0.0 - Production
Start Date                16-NOV-2020 23:23:28
Uptime                    0 days 0 hr. 1 min. 27 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/aix1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aix1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully



10.创建数据库
10.1 创建配置数据库的响应文件
在/u01/app/oracle/product/19.3/db/assistants/dbca/目录中有一个示例文件

[oracle@ora19c install]$ cat /u01/app/oracle/product/19.3/db/assistants/dbca/dbca.rsp


aix1:/home/oracle$vi 19c_dbca.rsp
automaticMemoryManagement=TRUE
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
templateName=General_Purpose.dbc
gdbName=hxsy
sid=hxsy
databaseConfigType=SI
createAsContainerDatabase=TRUE
numberOfPDBs=1
pdbName=hxsy1
useLocalUndoForPDBs=TRUE
pdbAdminPassword=hxsy_123456
sysPassword=hxsy_123456
systemPassword=hxsy_123456
storageType=FS
characterSet=ZHS16GBK
nationalCharacterSet=AL16UTF16
listeners=LISTENER
sampleSchema=TRUE
totalMemory 2048
databaseType=MULTIPURPOSE
automaticMemoryManagement=FALSE
totalMemory=4096

11.创建数据库

aix1:/home/oracle$dbca -silent  -createDatabase -responseFile /home/oracle/19c_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
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/hxsy.
Database Information:
Global Database Name:hxsy
System Identifier(SID):hxsy
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/hxsy/hxsy.log" for further details.

12.验证是否可以登录数据库

aix1:/u01/app/oracle/product/19.3/db/dbs$sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 16 16:32:33 2020
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 3221222936 bytes
Fixed Size                  9303576 bytes
Variable Size             956301312 bytes
Database Buffers         2231369728 bytes
Redo Buffers               24248320 bytes
Database mounted.

SQL> alter database open;

Database altered.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 HXSY1                          MOUNTED

SQL> alter pluggable database hxsy1 open;

Pluggable database altered.

SQL> show pdbs;

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

]]>
http://www.jydba.net/index.php/archives/3199/feed 0
Oracle如何管理带约束的B树索引 http://www.jydba.net/index.php/archives/3154 http://www.jydba.net/index.php/archives/3154#respond Fri, 06 Nov 2020 09:13:00 +0000 http://www.jydba.net/?p=3154 管理带约束的B树索引
B树索引与主键和唯一键约束是分不开的。这是因为Oracle使用索引来强制执行主键和唯一键约束。若没有相关联的B树索引,将不能启用主键或唯一约束。

在创建主键或唯一键约束时,你可以选择让Oracle自动创建相应索引。在这种情况下,如果删除或禁用约束,Oracle也将自动删除相应的索引。

单独创建索引和约束也是可以的。当单独创建索引和约束时,允许删了或禁用约束,而不会自动删除相应的索引。如果有大量数据需要处理,你可能希望禁用约束,而不删除相应索引。

因为在定义外键约束时,Oracle不会自动创建索引,所以必须手动在与外键约束相关的列上创建索引。在大多数情况下,在外键列上创建B树索引是有益的,因为它有助于避免锁定问题,并提高通过主键和外键列连接父/子表的查询的性能。

1 在主键列上创建B树索引
主键约束保证在一列(或列的组合)中的值可用于唯一标识表内的记录。每个表只能有一个主键约束。主键约束不能包含空值。主键约束可以被看做是唯一(unique)约束和非空(NOT NULL)约束的结合。为每个表创建主键索引有如下几个很好的理由。
.强制执行了主键列在表内必须是唯一的这一业务需求。是的,在某些情况下,可能有一个不需要主键的表(比如日志表),但在大多数情况下,主键对每个表都是必需的。
.主键中的许多列,在访问应用程序的查询的where子句中被频繁使用。这些列上的索引将会改善查询的性能。
.除非已定义父表主键或唯一键约束,否则Oracle将不允许创建子表的外键约束。因此,如果需要外键约束,就必须使用主键或唯一键约束。

对任何启用的主键,Oracle都需要一个与之对应的索引。有几种技术可用来创建主键约束及其对应的索引。
.首先创建表。然后在单独的alter table语句中添加主键约束。alter table语句同时创建了主键约束和索引。
.在create table 语句中内联(与列一起)或在单独的部分中指定主键约束。
.首先创建表,然后使用create index语句创建包含主键列的索引,最后使用alter table … add constraint语句添加主键约束。

1.1.使用alter table来创建主键约束和索引
下面介绍的这种技术是创建主键约束和相关联的索引最可取的方法。这种方法允许对表的创建与约束和索引的定义分别进行管理。如果你使用的应用程序包含数千个表,约束和索引,那么将创建表与建立相应的约束和索引分开,可以使用管理和诊断安装问题变得更容易。这不是死板的规定,相反,它是从诊断问题演变而来的一种偏好。

在这个例子中,表和主键约束是分别创建的。首先,创建表时没有定义任何约束。

SQL> create table cust2
  2  (
  3  cust_id number,
  4  first_name varchar2(200),
  5  last_name varchar2(200)
  6  ) tablespace reporting_data;

Table created.

然后添加主键约束

SQL> alter table cust2 add constraint cust2_pk primary key(cust_id) using index tablespace reporting_index;

Table altered.

此代码示例使用alter table … add constraint语句同时创建主键约束和唯一索引。约束和索引都被命名为CUSTS_PK。

1.2.使用create table创建主键约束和索引
另一种常见的方法是用create table语句创建主键约束和索引。可以内联(和列一起)直接指定一个约束。这种方法的优点是简单。如果在开发或测试环境中进行试验,这种方法是快速且有效的。但这种方法也有一个缺点,它不允许在多个列上定义主键。例如:

SQL> create table cust3
  2  (
  3  cust_id number primary key,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

SQL> insert into cust3 values(1,'jing','yong');

1 row created.

SQL> commit;

Commit complete.

SQL> select a.segment_name,a.segment_type,a.extents,a.bytes from user_segments a,user_indexes b where a.segment_name=b.index_name and b.table_name in('CUST3');

SEGMENT_NAME                                                                                                                     SEGMENT_TYPE          EXTENTS      BYTES
-------------------------------------------------------------------------------------------------------------------------------- ------------------ ---------- ----------
SYS_C0023486                                                                                                                     INDEX                       1    1048576

在这段代码中,Oracle创建了主键约束和相应的唯一索引。Oracle自动生成像SYS_C0023486这样的随机名称(约束和索引也被赋予了相同的名称)。

如果想要明确地对约束和索引提供名称,就可以执行下面这样的语句:

SQL> create table cust4
  2  (
  3  cust_id number constraint cust4_pk primary key,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

SQL> insert into cust4 values(1,'jing','yong');

1 row created.

SQL> commit;

Commit complete.

SQL> select a.segment_name,a.segment_type,a.extents,a.bytes from user_segments a,user_indexes b where a.segment_name=b.index_name and b.table_name in('CUST4');

SEGMENT_NAME                                                                                                                     SEGMENT_TYPE          EXTENTS      BYTES
-------------------------------------------------------------------------------------------------------------------------------- ------------------ ---------- ----------
CUST4_PK                                                                                                                         INDEX                       1    1048576

也可以指定放置索引的表空间,如下所示:

SQL> create table cust5
  2  (
  3  cust_id number constraint cust5_pk primary key using index tablespace reporting_index,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

还可以在create table语句单独的部分中定义主键约束(不和列在一起)。下面是在单独的部分定义主键约束的例子:

SQL> create table cust6
  2  (
  3  cust_id number,
  4  first_name varchar2(30),
  5  last_name varchar2(30),
  6  constraint cust6_pk primary key(cust_id) using index tablespace reporting_index
  7  )
  8  tablespace reporting_data;

Table created.

这种技术被称为外联(out-of-line),因为约束的声明与列定义之间是用逗号隔开的。该做法与内联的方法相比,具有可以为主键指定多列的优势。

1.3.分别创建B-tree索引和主键约束
还可以首先创建索引,然后改变表以应用主键约束。为了保持这个例子的完整性,这里也显示了create table语句。

SQL> create table cust7
  2  (
  3  cust_id number,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

SQL> create unique index cust7_pk on cust7(cust_id) tablespace reporting_index;

Index created.

SQL> alter table cust7 add constraint cust7_pk primary key(cust_id);

Table altered.

这种方法的优点是,可以独立于索引删除或禁用主键约束。在大型数据库环境中,出于数据加载时性能方面的原因,有时可能想要删除或禁用约束。有时可能需要能删除约束,但不删除索引的灵活性。在大型数据库环境中,重建索引会花费很长的时间并消耗大量的系统资源。

另一种稍微有些牵强的情况是,有可能创建一个与主键约束定义的列不同的列的索引。例如:

SQL> create table cust8
  2  (
  3  cust_id number,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

SQL> create index cust8_pk on cust8(cust_id,first_name,last_name) tablespace reporting_index;

Index created.

SQL> alter table cust8 add constraint cust8_pk primary key(cust_id);

Table altered.

建议不要创建与约束列不同的列的主键索引,但这么做是可以的。你应该知道有这种情况,避免在诊断问题时感到困惑。

1.4.查看主键约束和索引的详细信息
用如下语句可以确认某个索引的详细信息:

SQL> select index_name,index_type,uniqueness from user_indexes where table_name='CUST7';

INDEX_NAME                                                                                                                       INDEX_TYPE                  UNIQUENES
-------------------------------------------------------------------------------------------------------------------------------- --------------------------- ---------
CUST7_PK                                                                                                                         NORMAL                      UNIQUE

输出如上所示,为了验证约束的信息,可执行如下查询:

SQL> select constraint_name,constraint_type from user_constraints where table_name='CUST7';

CONSTRAINT_NAME                                                                                                                  CONSTRAINT_TYPE
-------------------------------------------------------------------------------------------------------------------------------- ------------------------------
CUST7_PK                                                                                                                         P

1.5.删除主键约束和索引
创建主键约束时自动创建的索引不能直接删除。在这种情况下,如果像下面这样直接删除索引:

SQL> drop index cust4_pk;

就会收到如下错误信息:

drop index cust4_pk
           *
ERROR at line 1:
ORA-02429: cannot drop index used for enforcement of unique/primary key

要删除索引,必须首先删除或禁用主键约束。例如,下面的语句将删除创建约束时自动创建的索引:

SQL> alter table cust4 disable constraint cust4_pk;

Table altered.
SQL> alter table cust4 drop constraint cust4_pk;

Table altered.

或者

SQL> alter table cust4 drop primary key;

Table altered.

在删除或禁用主键约束时,可以选择不删除相关索引。可以使用drop/disable constraint子句的keep index子句来保留索引。例如:

SQL> alter table cust4 drop constraint cust4_pk keep index;

Table altered.

此代码指示Oracle删除约束,但保留索引。如果要处理的是很大的表,那么出于载入或操纵数据时性能方面的原因,可能要禁用或删除约束,而非索引,因为删除与一个大表相关联的索引后,可能需要相当长的时间和大量资源来重新创建它。

要注意的另一个方面是,如果主键或唯一键被已启用的外键引用,而试图删除父表上的约束,如下所示:

SQL> alter table cust1 drop primary key;

就会收到如下错误信息:

alter table cust1 drop primary key
*
ERROR at line 1:
ORA-02273: this unique/primary key is referenced by some foreign keys

在这种情况下,需要先删除或禁用引用的外键,或使用cascade子句在主键约束已经被删除或禁用时,自动删除外键约束。例如:

SQL>alter table cust1 drop constraint cust1_pk cascade;
SQL>alter table cust1 disable constraint cust1_pk cascade;
SQL>alter table cust1 drop primary key cascade;

级联删除约束只删除了所有依赖外键的约束,但不从子表中删除任何数据。

2 在唯一键列上创建B树索引
唯一键约束的主要目的是强制地不属于主键一部分的列的唯一性。如果有非主键列在一个表中是唯一的这种业务需求,那么应该使用唯一约束。例如,你可能有定义在客户表的cust_id列上的主键,但可能还需要一个last_name和first_name列的组合上的唯一键约束。

唯一键与主键有两方面的差别。首先,唯一键可以包含NULL值,其次每个表可以定义多个唯一键(而每个表只能定义一个主键)。

如果需要为某个列创建唯一约束,那么可以通过下列几种不同的方式来实现这一需求。
.使用alter table语句来创建一个唯一约束。这将自动创建一个唯一的B树索引。
.使用create table语句来创建一个唯一约束。这也将自动创建一个唯一的B树索引。
.分别创建B树索引和约束。如果想要在禁用或删除约束时分别管理索引和约束,那么可以使用这种方法。
.只创建唯一B树索引,而不费心去创建唯一键约束。如果索引中的列不能被子表的外键引用,那么可以使用这种方法。

2.1.使用alter table来创建唯一约束和索引
这种方法是我们启用唯一键约束并创建相应索引的首选方法。正如在主键约束和索引部分中提到的,将创建表的语句与创建约束和索引的语句分离,往往更容易诊断安装问题。

下面的示例演示如何创建一个表,然后在非主键列上添加一个唯一键约束。

SQL> create table cust9
  2  (
  3  cust_id number,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

接下来,使用alter table语句在cust表的last_name和first_name列的组合上创建一个名为cust9_ux1的唯一约束。

SQL> alter table cust9 add constraint cust9_uk1 unique(last_name,first_name) using index tablespace reporting_index;

Table altered.

此语句创建了该唯一约束。此外,Oracle会自动创建一个具有相同名称的相关索引。

2.2.使用create table创建唯一约束和索引
使用create table方法的优点在于,它简单且可以把索引和约束的创建封装在一个语句中。在用create table语句定义唯一约束时,它可以用内网联方式,也可以用外联方式来定义。

第一个例子显示了如何在一个列上内联地创建唯一键约束和索引。由于内联唯一键约束只可以定义在列上,所以我们添加了SSN列,它以内联内式定义了唯一键约束。

SQL> create table cust10
  2  (
  3  cust_id number constraint cust10_pk primary key using index tablespace reporting_index,
  4  first_name varchar2(30),
  5  last_name varchar2(30),
  6  ssn varchar2(15) constraint cust10_uk1 unique using index tablespace reporting_index
  7  )
  8  tablespace reporting_data;

Table created.

下一个例子使用外联技术在first_name和last_name列的组合上创建了一个唯一约束:

SQL> create table cust11
  2  (
  3  cust_id number constraint cust11_pk primary key using index tablespace reporting_index,
  4  first_name varchar2(30),
  5  last_name varchar2(30),
  6  ssn varchar2(15),
  7  constraint cust11_uk1 unique(first_name,last_name) using index tablespace reporting_index
  8  )
  9  tablespace reporting_data;

Table created.

外联方式的定义具有允许在多列上创建一个唯一键约束的优势。

2.3.分别创建B树索引和唯一键约束
如果需要分别管理索引和约束,那么可以先创建索引,然后再创建约束。例如:

SQL> create table cust12
  2  (
  3  cust_id number,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

SQL> create unique index cust12_uk1 on cust12(first_name,last_name) tablespace reporting_index;

Index created.

SQL> alter table cust12 add constraint cust12_uk1 unique(first_name,last_name);

Table altered.

分别创建索引和约束的好处是,可以在不删除底层索引的情况下删了或禁用约束。在处理大量数据时,可考虑使用这种方法。如果你有任何理由需要禁用约束,然后重新启用它,就可以这样做而不删除索引(因为重新创建大索引可能需要很长一段时间)。

2.4.只创建唯一索引
还可以只创建唯一索引而不添加唯一约束。如果你从来没有计划用外键引用一个唯一键,那么只创建一个唯一索引而不定义唯一约束也是可以的。下面是创建一个无关联约束的唯一索引的例子:

SQL> create table cust13
  2  (
  3  cust_id number,
  4  first_name varchar2(30),
  5  last_name varchar2(30)
  6  )
  7  tablespace reporting_data;

Table created.

SQL> create unique index cust13_uk1 on cust13(first_name,last_name) tablespace reporting_index;

Index created.

在用上述语句明确地创建唯一索引时,Oracle虽然创建了一个唯一索引,但却没有在dba/all/user_constraints中为约束添加条目。为什么这很重要呢?,考虑这种情况:

SQL> insert into cust13 values(1,'JAMES','STARK');

1 row created.

SQL> insert into cust13 values(2,'JAMES','STARK');

下面是被抛出的相应错误消息提示:

insert into cust13 values(2,'JAMES','STARK')
*
ERROR at line 1:
ORA-00001: unique constraint (JY.CUST13_UK1) violated

如果让你来诊断这个问题的话,你首先会检查的地方是dba_constraints,你会按错误消息中显示的名称在其中查找一个约束。然而,没有查到任何信息。

SQL> select constraint_name from dba_constraints where constraint_name='CUST13_UK1';

no rows selected

没有相关记录可能会使用人困惑:向表中插入数据时,抛出的错误消息已经表明违反了唯一约束,但在与约束相关的数据字典视图中却没有它的信息。在这种情况下,必须在dba_indexes中查看已经创建的唯一索引的详细信息。例如:

SQL> select index_name,uniqueness from dba_indexes where index_name='CUST13_UK1';

INDEX_NAME                                         UNIQUENES
-------------------------------------------------- ---------
CUST13_UK1                                         UNIQUE

如果你希望能够使用与约束相关的数据字典视图来报告唯一键约束,就应该也定义一个约束。

2.5.删除唯一键约束和索引
如果索引是创建唯一键约束时自动创建的,那么不能直接删除该索引。在这种情况下,必须删除或禁用唯一键约束,而相关的索引会自动被删除。例如:

SQL> drop index cust11_uk1;
drop index cust11_uk1
           *
ERROR at line 1:
ORA-02429: cannot drop index used for enforcement of unique/primary key

SQL>alter table cust11 drop constraint cust11_uk1;

这行语句同时删除约束和索引。如果想保留索引,那么可以指定keep index子句。

SQL>alter table cust drop constraint cust11_uk1 keep index;

如果分别创建索引和唯一键约束,或者如果没有唯一键约束与唯一索引相关联,那么可以直接删除该索引。

3 索引外键列
外键约束确保插入数据到子表时,相应的父表记录存在。这是一个保证数据符合父/子业务关系规则的机制。外键也被称为参照完整性约束。

不同于主键和唯一键约束,Oracle不会自动创建外键列上的索引。因此,必须在定义为外键约束的列的基础上手动创建一个外键索引。在大多数情况下,应该在与外键关联的列上创建索引。这里有两个原因。.Oracle经常可以利用外键列上的索引,来改善使用外键列来连接父表和子表的查询性能。.如果外键列上没有B树索引存在,在往子表插入数据或从子表删除数据时,它会锁定父表中的所有行。对于频繁修改父表和子表的应用程序,这将导致锁定和死锁问题。

首先讨论如何在一个外键列上创建B树索引,然后再介绍用来检测未被索引的外键列的一些技巧。

3.1.在外键列上实现索引
假设有这样的需求:必须为address1表的每条记录分配cust14表中存在的一个相应cust_id列。为了强制执行这种关系,在address1表上创建如下外键约束:

SQL> create table cust14(
  2  cust_id number,
  3  last_name varchar2(30),
  4  first_name varchar2(30)
  5  )
  6  tablespace reporting_data;

Table created.



SQL> create table address1(
  2  address_id number,
  3  cust_id number,
  4  street varchar2(30),
  5  city varchar2(30),
  6  state varchar2(30)
  7  )
  8  tablespace reporting_data;

Table created.


SQL> alter table address1 add constraint addr1_fk1 foreign key(cust_id) references cust14(cust_id);
alter table address1 add constraint addr1_fk1 foreign key(cust_id) references cust14(cust_id)
                                                                                     *
ERROR at line 1:
ORA-02270: no matching unique or primary key for this column-list

注意,外键列必须引用父表中定义了主键或唯一键约束的列。否则,就会收到错误提示信息”ORA-02270: 此列列表无匹配的唯一键或主键”。

因为在连接cust14表和address1表时,外键列被广泛使用,且外键列上的索引会提高性能,所以在这种情况下,必须手动创建一个索引。例如,在address1表的cust_id外键列上创建普通的B树索引。

SQL>create index addr1_fk1 on address1(cust_id);

索引名不必与外键名称相同。是否这样做,只是一种个人喜好。我们觉得约束和相应的索引具有相同的名称时,维护环境更容易。

创建索引时,如果不指定表空间名称,Oracle会在用户的默认表空间放置索引。一般情况下,最好明确指定该表的索引的存放位置。例如:

create index addr1_fk1 on address1(cust_id) tablespace reporting_index;

注意,外键列上的索引,并不一定是B树类型的。在数据仓库环境中,经常在星型模式的事实表的外键列上使用位图索引。与B树索引不同,外键列上的位图索引不能解决父/子表锁定的问题。使用星型模式的应用程序通常不从事实表删除或修改子记录,因此在数据仓库环境中,在外键列上使用位图索引,锁定不是什么问题。

3.2.确定外键列是否已经被索引
如果你从头开始创建一个应用程序,那么创建程序代码,并确保每一个外键约束都有相应的索引很容易。但是,如果你继承了一个现成的数据库,就需要审慎地检查外键列是否已经被索引。

你可以使用数据字典视图来验证,外键约束的所有列上是否有相应的索引。其基本思路是检查每个外键约束,看它是否有一个相应的索引,这个任务并不像一开始看上去那么简单。用下面的查询作为例子,它可以用来指导你按正确的途径入手:

SQL> col owner for a30
SQL> col cons_name for a30
SQL> col tab_name for a30
SQL> col cons_column for a30
SQL> col ind_column for a30
SQL> select distinct
  2  a.owner owner,
  3  a.constraint_name cons_name,
  4  a.table_name tab_name,
  5  b.column_name cons_column,
  6  nvl(c.column_name,'***Check index***') ind_column
  7  from dba_constraints a,dba_cons_columns b,dba_ind_columns c
  8  where a.constraint_type='R'
  9  and a.owner=UpPER('&&user_name')
 10  and a.owner=b.owner
 11  and a.constraint_name=b.constraint_name
 12  and b.column_name=c.column_name(+)
 13  and b.table_name=c.table_name(+)
 14  and b.position=c.column_position(+)
 15  order by tab_name,ind_column;
old   9: and a.owner=UpPER('&&user_name')
new   9: and a.owner=UpPER('JY')

OWNER                          CONS_NAME                      TAB_NAME                       CONS_COLUMN                    IND_COLUMN
------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------
JY                             ADDR_FK1                       ADDRESS                        CUST_ID                        CUST_ID

虽然此查询简单并易于理解,但它并不能在所有情况下都正确地报告出未索引的外键。例如,在多列外键的情况下,以不同于索引列的顺序定义约束也不要紧,只要索引列在该索引中位于前面即可。换句话说,如果约束被定义为col1和col2,那么定义一个先是col2,然后是col1的B树索引也没关系。

另一方面,使用B树索引有助于避免锁定的问题,但位图索引却做不到这点。在这种情况下,查询还应该检查索引类型。

在这些情况下,需要用更复杂的查询来检测与外键列相关的索引问题。下面的例子是一个更复杂的查询,它使用listagg分析函数来比较外键约束列(作为字符串返回一行)与相应的索引列:

这个查询会先提示你输入一个模式名称,然后将显示没有相应的索引的外键约束。此查询还检查了索引类型,位图索引可以在外键列上存在,但它不能防止锁定问题。

SQL> select
  2   case when ind.index_name is not null then
  3     case when ind.index_type in('BITMAP') then
  4        '** Bitmp idx **'
  5     else
  6        'indexed'
  7     end
  8   else
  9     '** Check idx **'
 10   end checker,
 11   ind.index_type,
 12   cons.owner,cons.table_name,ind.index_name,cons.constraint_name,cons.cols
 13   from( select
 14         c.owner,c.table_name,c.constraint_name,
 15         listagg(cc.column_name,',') within group (order by cc.column_name) cols
 16         from dba_constraints c,dba_cons_columns cc
 17         where c.owner=cc.owner
 18         and c.owner=UPPER('&&schema')
 19         and c.constraint_name=cc.constraint_name
 20         and c.constraint_type='R'
 21         group by c.owner,c.table_name,c.constraint_name) cons
 22  left outer join
 23  (select
 24    table_owner,table_name,index_name,index_type,cbr,listagg(column_name,',') within group (order by column_name) cols
 25    from(select
 26         ic.table_owner,ic.table_name,ic.index_name,ic.column_name,ic.column_position,i.index_type,
 27         connect_by_root(ic.column_name) cbr
 28         from dba_ind_columns ic,dba_indexes i
 29         where ic.table_owner=UPPER('&&schema')
 30         and ic.table_owner=i.table_owner
 31         and ic.table_name=i.table_name
 32         and ic.index_name=i.index_name
 33         connect by prior ic.column_position-1=ic.column_position
 34         and prior ic.index_name=ic.index_name)
 35  group by table_owner,table_name,index_name,index_type,cbr) ind
 36  on cons.cols=ind.cols
 37  and cons.table_name=ind.table_name
 38  and cons.owner=ind.table_owner
 39  order by checker,cons.owner,cons.table_name;
Enter value for schema: JY
old  18:        and c.owner=UPPER('&&schema')
new  18:        and c.owner=UPPER('JY')
old  29:        where ic.table_owner=UPPER('&&schema')
new  29:        where ic.table_owner=UPPER('JY')


CHECKER                        INDEX_TYPE                     OWNER                          TABLE_NAME                     INDEX_NAME                     CONSTRAINT_NAME                COLS
------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------
** Check idx **                                               JY                             ADDRESS                                                       ADDR_FK1                       CUST_ID

表锁和外键
下面用一个简单的例子来演示外键列没有索引时的锁定问题。

首先创建两个表(dept和emp)并用一个外键约束把它们关联起来。

SQL> create table emp(emp_id number primary key,dept_id number);

Table created.

SQL> create table dept(dept_id number primary key);

Table created.

SQL> alter table emp add constraint emp_fk1 foreign key(dept_id) references dept(dept_id);

Table altered.

插入数据

SQL> insert into dept values(10);

1 row created.

SQL> insert into dept values(20);

1 row created.

SQL> insert into dept values(30);

1 row created.

SQL> insert into emp values(1,10);

1 row created.

SQL> insert into emp values(2,20);

1 row created.

SQL> insert into emp values(3,30);

1 row created.

SQL> commit;

Commit complete.

打开两个终端会话。在一个会话中,从子表删除一条记录,但不提交。

SQL> delete from emp where dept_id=10;

1 row deleted.

现在尝试(在另一个会话里)从父表中删除一些不受子表删除操作影响的数据。

SQL> delete from dept where dept_id=30;

对父表数据的删除操作会挂起,直到子表的事务初步提交(或回滚)。如果子表中的外键列上没有常规的B树索引,那么任何时间尝试往子表插入数据或删除子表的数据时,它都会在父表上放置一个全表锁,在子表的事务完成前,该全表锁会一直阻止删除或更新父表的数据。

回滚删除子表数据的操作

SQL> rollback;

Rollback complete.

当回滚删除子表数据的操作后,删除父表数据的操作报错,因为违反完整性约束

SQL> delete from dept where dept_id=30;
delete from dept where dept_id=30
*
ERROR at line 1:
ORA-02292: integrity constraint (JY.EMP_FK1) violated - child record found

现在额外创建一个子表外键列上的索引,并再次运行前面的操作。

SQL> create index emp_fk1 on emp(dept_id);

Index created.

再次执行删除操作,删除子表的数据

SQL> delete from emp where dept_id=10;

1 row deleted.

在另一个会话中删除父表数据不会挂起会立即报违反完整性约束

SQL> delete from dept where dept_id=30;
delete from dept where dept_id=30
*
ERROR at line 1:
ORA-02292: integrity constraint (JY.EMP_FK1) violated - child record found

这样就能够独立地运行前面列出的两个delete语句。当外键列上有B树索引时,如果从子表中删除数据,Oracle将不会过分地锁定父表中的所有行数据。

]]>
http://www.jydba.net/index.php/archives/3154/feed 0
Oracle如何实现B树索引 http://www.jydba.net/index.php/archives/3151 http://www.jydba.net/index.php/archives/3151#respond Fri, 06 Nov 2020 09:00:37 +0000 http://www.jydba.net/?p=3151 实现B树索引
这里将介绍使用B树索引时会遇到的典型任务。典型的任务包括。
.创建索引
.报告索引
.显示重新创建索引需要的代码
.删除索引

1 创建B树索引
下面给出的是一个示例脚本,它创建一个表,并在单独的表空间创建与之相关的索引。表和索引从表空间继承存储属性,这是因为在create table或create index语句中没有指定存储参数。此外,你希望主键和唯一键约束自动创建B树索引。

SQL> create table cust1(
  2  cust_id number,
  3  last_name varchar2(30),
  4  first_name varchar2(30)
  5  )
  6  tablespace reporting_data;

Table created.

SQL> alter table cust1 add constraint cust_pk primary key(cust_id) using index tablespace reporting_index;

Table altered.

SQL> alter table cust1 add constraint cust_uk1 unique(last_name,first_name) using index tablespace reporting_index;

Table altered.

SQL> create table address(
  2  address_id number,
  3  cust_id number,
  4  street varchar2(30),
  5  city varchar2(30),
  6  state varchar2(30)
  7  )
  8  tablespace reporting_data;

Table created.

SQL> alter table address add constraint addr_fk1 foreign key(cust_id) references cust1(cust_id);

Table altered.

SQL> create index addr_fk1 on address(cust_id) tablespace reporting_index;

Index created.

此脚本创建了两个表。父表是cust1,它的主键是cust_id。子表是address,它的主键是address_id。在address表中,cust_id列作为外键存在,它映射到cust1表的cust_id列。

此脚本也创建了三个B树索引。其中第一个是创建主键约束时自动创建的。第二个索引是创建唯一约束时自动创建的。第三个索引是明确创建在address表中的cust_id外键列上的。所有这三个索引都是在reporting_index表空间中创建的,而表是在reporting_data表空间中创建的。

2 报告索引
上面的例子中创建的索引的详细信息可以通过查询数据字典来验证。

SQL> select index_name,index_type,table_name,tablespace_name,status from user_indexes where table_name in('CUST1','ADDRESS');

INDEX_NAME                                         INDEX_TYPE                  TABLE_NAME                                         TABLESPACE_NAME                                    STATUS
-------------------------------------------------- --------------------------- -------------------------------------------------- -------------------------------------------------- --------
ADDR_FK1                                           NORMAL                      ADDRESS                                            REPORTING_INDEX                                    VALID
CUST_PK                                            NORMAL                      CUST1                                              REPORTING_INDEX                                    VALID
CUST_UK1                                           NORMAL                      CUST1                                              REPORTING_INDEX                                    VALID

运行以下查询来验证创建了索引的列:

SQL> select index_name,column_name,column_position from user_ind_columns where table_name in('CUST1','ADDRESS') order by index_name,column_position;

INDEX_NAME                                         COLUMN_NAME                    COLUMN_POSITION
-------------------------------------------------- ------------------------------ ---------------
ADDR_FK1                                           CUST_ID                                      1
CUST_PK                                            CUST_ID                                      1
CUST_UK1                                           LAST_NAME                                    1
CUST_UK1                                           FIRST_NAME                                   2

要显示区的数目和已使用的空间,可以运行以下查询:

SQL> select a.segment_name,a.segment_type,a.extents,a.bytes from user_segments a,user_indexes b where a.segment_name=b.index_name and b.table_name in('CUST1','ADDRESS');

no rows selected

请注意,这个例子的输出结果显示,没有为索引分配段,区或空间。

从Oracle 11g第2版开始,在创建表时,如果还没有往表中插入数据,相关的段(和区)将会初步推迟创建。这意味着直到数据行被插入到相关的表之后,才会为相关的索引创建段。为了说明这一点,给CUST1表插入一行,也给ADDRESS表插入一行,如下所示:

SQL> insert into cust1 values(1,'STARK','JIM');

1 row created.

SQL> insert into address values(100,1,'Vacuum Ave','Portland','OR');

1 row created.

SQL> commit;

Commit complete.

重新运行这个查询(段的使用报告)产生的输出如下:

SQL> select a.segment_name,a.segment_type,a.extents,a.bytes from user_segments a,user_indexes b where a.segment_name=b.index_name and b.table_name in('CUST1','ADDRESS');

SEGMENT_NAME                                                                                                                     SEGMENT_TYPE          EXTENTS      BYTES
-------------------------------------------------------------------------------------------------------------------------------- ------------------ ---------- ----------
ADDR_FK1                                                                                                                         INDEX                       1     131072
CUST_PK                                                                                                                          INDEX                       1     131072
CUST_UK1                                                                                                                         INDEX                       1     131072

3 显示创建索引的代码
有时候可能需要删除一些索引。这些索引可能是由过时的应用程序建立的,也可能是你自己以前建立的,但已经用不到了。在删除索引之前,建议你首先生成重新创建索引所需的数据定义语言(DDL)。如果删除索引对性能有不利影响而需要重新创建它,就可以重新创建索引(就像没有删除它一样)。

可以使用dbms_metadata.get_ddl函数来显示对象的DDL。确保为LONG变量设置适当的值,使用返回的CLOB值能全部显示出来。例如:

SQL> set long 1000000
SQL> select dbms_metadata.get_ddl('INDEX','ADDR_FK1') from dual;

下面是输出结果:

DBMS_METADATA.GET_DDL('INDEX','ADDR_FK1')
--------------------------------------------------------------------------------

  CREATE INDEX "JY"."ADDR_FK1" ON "JY"."ADDRESS" ("CUST_ID")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING
  STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "REPORTING_INDEX"

这段代码显示了重新创建索引需要的所有内容。这些代码中的许多值反映了从索引表空间继承的默认设置或存储参数。

如果想要显示当前连接的用户的所有索引元数据,可以运行下面的代码:

SQL> select dbms_metadata.get_ddl('INDEX',index_name) from user_indexes;

DBMS_METADATA.GET_DDL('INDEX',INDEX_NAME)
--------------------------------------------------------------------------------

  CREATE INDEX "JY"."CUST_IDX1" ON "JY"."CUST" ("LAST_NAME")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS"


  CREATE INDEX "JY"."CUST_IDX2" ON "JY"."CUST" ("FIRST_NAME")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS"


  CREATE UNIQUE INDEX "JY"."CUST_PK" ON "JY"."CUST1" ("CUST_ID")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING
  STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)


  CREATE UNIQUE INDEX "JY"."CUST_UK1" ON "JY"."CUST1" ("LAST_NAME", "FIRST_NAME")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING
  STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "REPORTING_INDEX"


  CREATE INDEX "JY"."ADDR_FK1" ON "JY"."ADDRESS" ("CUST_ID")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING
  STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "REPORTING_INDEX"

如果当前连接的用户有很多索引,这个查询将会产生大量的输出。

4 删除B树索引
如果确定不再使用某个索引了,那么应该删除它。在删除索引之前,应采取必要的预防措施,以确保不会对性能产生不利影响。如果可能的话,最好的办法是在与生产环境同等条件(在硬件,数据,负载等方面)的测试环境中删除索引,确定对性能的不利影响。如果不可能进行彻底的测试,那么在删除前考虑先做以下工作。
.启用对索引的监测。
.使用索引不可见。
.使用索引不可用。

这样做是为了在实际删除之前,先确定该索引没有用于任何目的。监控索引会让你了解应用程序的select语句是否使用了它。但索引监控不会告诉你该索引是否被用于其他内部用途,如用来强制执行某个约束或防止锁定问题。

使用一个索引不可见需要Oracle 11g及以上版本。不可见索引仍然由Oracle维护,但查询优化器确定执行计划时不考虑它。请注意,不可见的索引仍然可以由Oracle在内部使用,用来避免锁定问题或强制执行约束。所以,使用索引不可见并不是用来确定该索引是否被使用的完全可靠的方法。

下面是使用索引 不可见的一个例子:

SQL> alter index addr_fk1 invisible;

Index altered.

此代码使用索引对查询优化器不可见,因此,它不能在查询中用来检索行。然而,当修改表中的记录时,该索引结构仍然由Oracle维护。如果确定该索引对性能非常关键,那么可以通过如下命令很容易地使用它再次对优化器可见。

SQL> alter index addr_fk1 visible;

Index altered.

删除索引之前的另一种选择是使其不可用。

SQL> alter index addr_fk1 unusable;

Index altered.

此代码使得索引不可用,但不会删除它。不可用表示,不但优化器不会使用索引,而且当DML语句操作它的表时,Oracle也不会维护该索引。此外,不可用的索引不能在内部使用,用于强制执行约束或避免锁定问题。

如果需要重新启用不可用的索引,那么就必须重建它。而重建一个大型的索引,会消耗大量的时间和资源。

SQL> alter index addr_fk1 rebuild;

Index altered.

当确信不需要某个索引后,就可以使用drop index语句来删除它。这个语句将永久删除该索引,找回该索引的唯一办法是重新创建它。

SQL> drop index addr_fk1;

Index dropped.
]]>
http://www.jydba.net/index.php/archives/3151/feed 0
Oracle如何创建B树索引 http://www.jydba.net/index.php/archives/3149 http://www.jydba.net/index.php/archives/3149#respond Fri, 06 Nov 2020 08:56:12 +0000 http://www.jydba.net/?p=3149 创建B树索引之前,为了慎重起起见,有必要从架构层面考虑一些将影响可维护性和可用性的问题。以下是建立索引之前,应该考虑的架构性问题。
.在创建索引之前,首先对它的大小进行估计。
.考虑指定表索引的表空间(与表分离)。这使得分开管理表和索引变得更轻松,如备份和恢复任务。
.允许对象从它闪的表空间继承存储参数。
.定义创建索引时要使用的命令标准。

1 在创建索引前估计索引的大小
一张大表上创建索引之前,可能需要估计它将会占用的空间大小。预测索引大小最好的方法是在测试环境中创建它,测试环境中有生产环境的典型数据集。如果不能建立生产数据的完整副本,那么经常可以用数据的一个子集来推断在生产中所需索引空间的大小。如果你没有使用削减的生产数据的奢侈条件,还可以使用dbms_space.create_index_cost存储过程来估算索引的大小。例如,如下代码估算了在cust表的first_name列上创建索引的大小:

SQL> set serverout on
SQL> exec dbms_stats.gather_table_stats(user,'CUST');

PL/SQL procedure successfully completed.

SQL> variable used_bytes number
SQL> variable alloc_bytes number
SQL> exec dbms_space.create_index_cost('create index cust_idx2 on cust(first_name)',:used_bytes,:alloc_bytes);

PL/SQL procedure successfully completed.

下面是这个例子的一些示例输出:

SQL> print :used_bytes

USED_BYTES
----------
      7490

SQL> print :alloc_bytes

ALLOC_BYTES
-----------
      65536

used_bytes变量给出了索引数据需要多少空间的估计。alloc_bytes变量提供了将在表空间内分配多大空间的估计。

下一步,创建索引。

SQL> create index cust_idx2 on cust(first_name);

Index created.

用如下查询显示所占用的空间的实际数额:

SQL> select bytes from user_segments where segment_name='CUST_IDX2';

     BYTES
----------
     65536

输出显示空间分配字节数的估计量等于实际使用量。

根据记录数,列数,数据类型和统计数据的准确性,输出的结果可能会有所不同。除初始大小之外,还要牢记随着记录插入到表中,该索引将增大。必须对索引占用的空间进行监控,并确保有足够的磁盘空间,以适应未来的增长需求。

2 为索引创建单独的表空间
对于关键的应用程序,必须提前考虑表和索引会消耗多少空间,以及它们增长的速度有多快。空间消耗和对象的增长对数据库可用性有直接影响。如果空间用尽了,那么数据库将变得不可用。最好的管理办法是,针对空间要求创建表空间,并在创建对象时明确指定表空间名。考虑到这一点,我们建议将表和索引分别保存到单独的表空间。考虑以下原因。
.支持采用不同的备份和恢复要求。你可能希望灵活地用与备份表不同的频率来备份索引。或者可以选择不备份索引,因为你知道可以重新创建它们。
.如果让表或索引从表空间继承它的存储特性,使用单独的表空间可以为表空间内创建的对象量身定制存储属性。表和索引往往有不同的存储要求(如区的大小,记录等)。
.运行维护报告时,如果报告针对不同的表空间具有不同的节(section),有时管理表和索引会更容易。

如果这些原因出现在你的环境中,那么可能值得付出额外的努力,对表和索引采用不同的表空间。如果你没有前面提到的任何需要,那么把表和索引保存在相同的表空间是不错的选择。

DBA经常出于性能的原因,考虑把索引放置在单独的表空间。如果你有从头开始建立存储系统的奢侈条件,可以把挂载点(mount point)设置为有自己的磁盘和控制器,那么可能会看到把表和索引存储在不同表空间的一些IO上的好处。如今,存储管理员往往会分配给你的SAN中的一大片存储,并且无法保证数据和索引将存储在单独的磁盘和控制器上。因此,把表和索引存储在不同表空间的做法,通常对提高性能没什么帮助。换句话说,性能获得提高不是通过将表和索引存储到不同的表空间实现的,而是由于在所有可用的设备上均匀地分布IO实现的。

下面的代码显示的是为表和索引单独建立表空间的例子。它使用固定大小的区和自动段空间管理(ASSM)创建了本地管理的表空间。

SQL> create tablespace reporting_data datafile '+DATA/JYCS/reporting_data01.dbf' size 1G extent management local uniform size 1M
  2  segment space management auto;

Tablespace created.


SQL> create tablespace reporting_index datafile '+DATA/JYCS/reporting_index01.dbf' size 500M extent management local uniform size 128K
  2  segment space management auto nologging;

Tablespace created.

我们更倾向于使用统一大小的区,因为这确保了表空间内存的所有区大小相同,从而减少了对象创建和删除时的碎片。ASSM的功能允许Oracle自动管理存储属性,而以前这需要手动监测和由DBA维护。

3 从表空间继承存储参数
创建表或索引时,有几个与表空间相关的技术细节需要注意。例如,如果创建表和索引时不指定存储参数,则表和索引会继承表空间的存储参数。这是在大多数情况下所需的行为。这样就可以不必手动指定这些参数。如果需要创建一个具有与表空间不同的存储参数的对象,那么用create table/index语句来实现。

此外,请记住,如果不明确指定表侬间,默认情况下,表和索引创建在用户的默认表空间中。在开发和测试环境中,这是可以接受的。对于生产环境,则应该考虑在create table/index语句中明确命令表空间。

4 命令标准
在创建和管理索引时,制定一些命名标准是非常可取的。考虑以下因素.
.当错误消息中包含表示表,索引类型等的信息时,简化了对问题的诊断。
.显示索引信息的报告更容易被分组,因此更具可读性并更容易地发现其中的规律和问题。鉴于这些需求,这里有一些示例索引命名指南。
.主键索引名称应该包含表名和一个后缀,如_UKN,其中N是一个数字。
.外键列上的索引应包含外键表和一个后缀,如_FKN,其中N是一个数字。
.对于不用于约束的索引,使用表名和一个后缀,如_IDXN,其中N是一个数字。
.基于函数的索引的名称应包含表名和一个后缀,如_FCN,其中N是一个数字。

一些厂商在命名索引时使用前缀。例如,主键索引将被命名为PK_CUST(而不是CUST_PK)。所有这些不同的命名标准都是有效的。

]]>
http://www.jydba.net/index.php/archives/3149/feed 0
Oracle中的B树索引 http://www.jydba.net/index.php/archives/3147 http://www.jydba.net/index.php/archives/3147#respond Fri, 06 Nov 2020 08:52:44 +0000 http://www.jydba.net/?p=3147 B树索引是Oracle的默认的索引类型。因为表中的行标识符(rowid)和相关的列值存储在一个平衡的树状结构的索引块中,所以该索引类型被称为B树索引。使用Oracle的B树索引有以下几个原因.
.提高SQL语句的性能
.强制执行主键和唯一键约束的唯一性
.减少通过主键和外键约束关联的父表和子表间潜在的锁定问题

Oracle如何使用B树索引
为了充分理解B树索引的内部实现,以便在建立数据库应用程序时能做出明智的索引决定。将举例说明,首先创建测试表cust

SQL> create table cust(
  2  cust_id number,
  3  last_name varchar2(30),
  4  first_name varchar2(30));

Table created.

在last_name列上创建B树索引

SQL> create index cust_idx1 on cust(last_name);

Index created.

向表cust中插入数据

SQL> insert into cust(cust_id,last_name,first_name)
  2  select rownum rn ,a.last_name,a.first_name from hr.employees a
  3  union
  4  select rownum+(107*1) rn ,a.last_name,a.first_name from hr.employees a
  5  union
  6  select rownum+(107*2) rn ,a.last_name,a.first_name from hr.employees a
  7  union
  8  select rownum+(107*4) rn ,a.last_name,a.first_name from hr.employees a
  9  union
 10  select rownum+(107*5) rn ,a.last_name,a.first_name from hr.employees a
 11  union
 12  select rownum+(107*6) rn ,a.last_name,a.first_name from hr.employees a
 13  union
 14  select rownum+(107*7) rn ,a.last_name,a.first_name from hr.employees a
 15  union
 16  select rownum+(107*8) rn ,a.last_name,a.first_name from hr.employees a
 17  union
 18  select rownum+(107*9) rn ,a.last_name,a.first_name from hr.employees a
 19  union
 20  select rownum+(107*10) rn ,a.last_name,a.first_name from hr.employees a;

1070 rows created.

SQL> commit;

Commit complete.

SQL> select distinct last_name,first_name from cust where rownum<11;

LAST_NAME                      FIRST_NAME
------------------------------ ------------------------------
Austin                         David
Banda                          Amit
Atkinson                       Mozhe
Bissot                         Laura
Ande                           Sundar
Bates                          Elizabeth
Bell                           Sarah
Bernstein                      David
Baer                           Hermann
Baida                          Shelli

10 rows selected.

插入数据后,确保该表的统计信息是最新的,以便为查询优化器提供足够的信息,从而做出如何检索数据的更好决定,执行如下命令收集表的统计信息:

SQL> exec dbms_stats.gather_table_stats(ownname=>'JY',tabname=>'CUST',cascade=>true);

PL/SQL procedure successfully completed.

不建议使用analyze语句(带compute和estimate子句)来收集统计信息。提供此功能只是为了向后兼容。

当向表中插入数据时,Oracle将分配由物理数据库块组成的区。Oracle还将为索引分配数据块。对于每个插入到表中的记录,Oracle还将创建一个包含rowid和列值的索引条目(本例中是rowid和last_name列的值)。每个索引项的rowid指向存储该表的列值的数据文件和数据块号。

当从一个表及其对应的索引选择数据时,存在三种情况。
.SQL查询所需的所有表的数据都在索引结构中。因此,只需要访问索引块。不需要从表中读取数据块。
.查询所需的所有信息没有都包含在索引块中。因此,查询优化器选择既访问索引块也要访问表块来检索需要的数据,以满足查询条件。
.查询优化器选择不访问索引。因此只访问表块。

场景1.所有的数据位于索引块中
这里将介绍两种情况。在每种情况下,执行查询需要的所有数据,包括返回给用户的数据,以及在where子句中被评估的数据,都位于该索引中。
.索引范围扫描(index range scan):如果优化器确定它使用索引结构检索查询所需的多个行时是有效的,那么就使用这种扫描。索引范围扫描被广泛用于各种各样的情况。

.索引快速全扫描(index fast full scan):如果优化器确定表中的大部分行需要进行检索,那么就使用这种扫描。但所有需要的信息都存储在索引中。由于索引结构通常比表结构小,优化器确定全索引扫描(比全表扫描)更高效。这种情况对统计(count)值的查询是很常见的。

首先演示的是索引范围扫描。在这种情况下,运行下面的查询:

select last_name from cust where last_name='Austin';

为了在该查询中返回数据,Oracle最小需要读取多少块,也就是说为了满足此查询,访问物理块最有效的方式是什么,优化器可以选择读取表结构的每个块。然而,这会导致很大的IO开销,因此,它不是检索数据的最优化方法。

对于这个例子,检索数据最有效的方法是使用索引结构。要返回包含last_name列中值为Austin的行,Oracle将需要读取3个索引块。通过使用Oracle的autotrace(自动跟踪)实用程序,可以确认。

SQL> set autotrace on
SQL> select last_name from cust where last_name='Austin';

LAST_NAME
------------------------------
Austin
Austin
Austin
Austin
Austin
Austin
Austin
Austin
Austin
Austin

10 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 3472749082

------------------------------------------------------------------------------
| Id  | Operation        | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
------------------------------------------------------------------------------
|   0 | SELECT STATEMENT |           |    10 |    80 |     1   (0)| 00:00:01 |
|*  1 |  INDEX RANGE SCAN| CUST_IDX1 |    10 |    80 |     1   (0)| 00:00:01 |
------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access("LAST_NAME"='Austin')

此输出显示,Oracle只需要使用cust_idx1索引来检索数据,以满足查询的结果集。不需要访问表中的数据块,只需要访问索引块。这对于给定的查询,这是特别高效的索引策略。当索引包含查询所需的所有列值时,它被称为覆盖索引。

下面列出为这个例子使用自动跟踪所显示的统计信息:

Statistics
----------------------------------------------------------
          1  recursive calls
          0  db block gets
          3  consistent gets
          0  physical reads
          0  redo size
        653  bytes sent via SQL*Net to client
        624  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
         10  rows processed

一致获取(consistent gets)的值表示有三个读内存操作。数据库块获取(db block gets)加一致获取等于总的内存读取操作。由于索引块已经在内存中,因此返回此查询的结果集不需要物理读取。此外,有10行进行了处理,这与cust表中last_name为Austin的记录数相符。

下面显示导致执行索引快速全扫描的一个例子。

select count(last_name) from cust;

使用set autotrace on生成执行计划。下面是相应的输出:

SQL> select count(last_name) from cust;

COUNT(LAST_NAME)
----------------
            1070


Execution Plan
----------------------------------------------------------
Plan hash value: 2246355899

-----------------------------------------------------------------------------------
| Id  | Operation             | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |           |     1 |     8 |     3   (0)| 00:00:01 |
|   1 |  SORT AGGREGATE       |           |     1 |     8 |            |          |
|   2 |   INDEX FAST FULL SCAN| CUST_IDX1 |  1070 |  8560 |     3   (0)| 00:00:01 |
-----------------------------------------------------------------------------------

此输出显示,确定表内的计数只用到了索引结构。在这种情况下,优化器确定采取索引快速全扫描比全表扫描更高效。

Statistics
----------------------------------------------------------
         48  recursive calls
          0  db block gets
         91  consistent gets
          0  physical reads
          0  redo size
        559  bytes sent via SQL*Net to client
        624  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          3  sorts (memory)
          0  sorts (disk)
          1  rows processed


场景2.索引中不包含所有信息
考虑这样一种情况:假设需要从cust表获得更多信息。首先,回顾一下前面的查询语句,并且还要在查询结果中返回first_name列。现在,要获得新增的数据元素,就需要访问表本身。下面是新的查询语句:

select last_name,first_name from cust where last_name='Austin';

使用set autotrace on,并执行前面的查询语句:

SQL> alter system flush buffer_cache;

System altered.

SQL> select last_name,first_name from cust where last_name='Austin';

LAST_NAME                      FIRST_NAME
------------------------------ ------------------------------
Austin                         David
Austin                         David
Austin                         David
Austin                         David
Austin                         David
Austin                         David
Austin                         David
Austin                         David
Austin                         David
Austin                         David

10 rows selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 2100940648

-------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |           |    10 |   150 |     1   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| CUST      |    10 |   150 |     1   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN                  | CUST_IDX1 |    10 |       |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access("LAST_NAME"='Austin')

此输出信息指示,cust_idx1索引是通过一次索引范围扫描(index range scan)访问的。索引范围扫描标识出满足此查询结果所需的索引块。此外,表是过table access by index rowid batched来读取的。通过索引的rowid访问表,表示Oracle利用存储在索引中的rowid找到表块包含的相应行。把rowid映射到相应的表块,这些块中含有last_name值为Austin的数据。由于我们清空了buffer cache了,这样查询共执行了6次物理读取,9次内存读取。

Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          9  consistent gets
          6  physical reads
          0  redo size
        896  bytes sent via SQL*Net to client
        624  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
         10  rows processed

场景3.只有表块被访问
在某些情况下,即使有索引存在,Oracle也会确定只使用表块比通过索引访问更为有效。当Oracle检查表内的每一行时,这被称为全表扫描。
例如,执行此查询:

SQL> select * from cust;

下面是相应的执行计划和统计信息:

Execution Plan
----------------------------------------------------------
Plan hash value: 260468903

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |  1070 | 19260 |     3   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| CUST |  1070 | 19260 |     3   (0)| 00:00:01 |
--------------------------------------------------------------------------


Statistics
----------------------------------------------------------
        204  recursive calls
          9  db block gets
        389  consistent gets
         20  physical reads
       1080  redo size
      38869  bytes sent via SQL*Net to client
       1405  bytes received via SQL*Net from client
         73  SQL*Net roundtrips to/from client
         33  sorts (memory)
          0  sorts (disk)
       1070  rows processed

此输出显示,需要一致读取(consistent gets)389个块以及数据库块获取(db block gets)9个块和物理读取20个块。Oracle检索表中的每一行以返回满足查询所需的结果。在这种情况下,必须读取表中已使用的所有块,Oracle无法使用索引来加快数据检索。

]]>
http://www.jydba.net/index.php/archives/3147/feed 0
Oracle DG备库发现Oracle Home目录使用空间巨增的问题处理 http://www.jydba.net/index.php/archives/3050 http://www.jydba.net/index.php/archives/3050#respond Tue, 28 Jul 2020 00:46:13 +0000 http://www.jydba.net/?p=3050 同事巡检查发现Oracle RAC DG备库的Oracle Home目录使用空间巨增,执行命令发现oracle目录占用了87G,这肯定不正常。

[root@dgdb1 app]# du -sh *
11G     11.2.0
8.0K    asmpfile.ora
3.1G    grid
87G     oracle
4.0M    oraInventory

进一步检查发现ORACLE_HOME目录下的dbs目录占用了61G。

[root@dgdb1 db_1]# du -sh *
177M    apex
303M    assistants
459M    bin
58M     ccr
8.0K    cdata
2.9M    cfgtoollogs
68K     clone
4.0K    config
5.9M    crs
24K     csmig
236K    css
296M    ctx
3.3M    cv
61G     dbs
12K     dc_ocm
396K    deinstall
1.1M    demo
16K     diagnostics
6.9M    dv
40K     emcli
8.0K    EMStage
1.9M    has
40K     hs
11M     ide
7.4M    install
1.5M    instantclient
215M    inventory
60M     j2ee
118M    javavm
26M     jdbc
520K    jdev
186M    jdk
43M     jlib
2.7M    ldap
768M    lib
64K     log
33M     md
96K     mesg
908K    mgw
8.3M    network
33M     nls
326M    oc4j
1.7M    odbc
13M     olap
5.5M    OPatch
528K    opmn
40M     oracore
4.0K    oraInst.loc
7.4M    ord
29M     oui
545M    owb
1.7M    owm
60M     perl
1.6M    plsql
5.1M    precomp
316K    racg
127M    rdbms
124K    relnotes
4.0K    root.sh
12K     scheduler
20K     slax
82M     sqldeveloper
4.8M    sqlj
484K    sqlplus
9.6M    srvm
21M     suptools
220M    sysman
112K    timingframework
512K    ucp
3.7M    uix
800K    usm
8.0K    utl
556K    wwg
19M     xdk

检查dbs目录发现多了很多broken*这样的文件,并且在是三月2号8:36分到9:49分之间生成的

[root@dgdb1 dbs]# ls -lrt
total 63341528
-rw-r--r-- 1 oracle oinstall       2851 May 15  2009 init.ora
-rw-rw---- 1 oracle asmadmin       1544 Nov  9  2016 hc_rlzy1.dat
-rw-r----- 1 oracle oinstall       1536 Nov 11  2016 orapwRLZY1
-rw-r--r-- 1 oracle oinstall         60 Nov 20  2016 initRLZY1.ora
-rw-r--r-- 1 oracle oinstall         60 Nov 24  2016 initRLZY1.ora.bk
-rw-r--r-- 1 oracle oinstall       1922 Nov 24  2016 initCAIWU1.ora.bk
-rw-r--r-- 1 oracle oinstall         60 Nov 24  2016 initCAIWU1.ora
-rw-r----- 1 oracle oinstall       1536 Nov 24  2016 orapwCAIWU1
-rw-rw---- 1 oracle asmadmin       1544 Nov 24  2016 hc_chdyldg.dat
-rw-r--r-- 1 oracle oinstall       1979 Nov 24  2016 initchdyl1.ora.bk
-rw-r--r-- 1 oracle oinstall         61 Nov 24  2016 initchdyl1.ora
-rw-r----- 1 oracle oinstall       1536 Nov 24  2016 orapwchdyl1
-rw-r--r-- 1 oracle oinstall       2019 Nov 28  2016 initsjjh1.ora.bk
-rw-r--r-- 1 oracle oinstall         60 Nov 28  2016 initsjjh1.ora.bak.dgdb1
-rw-r----- 1 oracle oinstall       1536 Nov 28  2016 orapwsjjh1.bk
-rw-r--r-- 1 oracle oinstall         83 Nov 29  2016 initsjjh1.ora
-rw-rw---- 1 oracle asmadmin       1544 Apr  1  2017 hc_dbdb1.dat
-rw-r--r-- 1 oracle oinstall       1783 Apr  1  2017 initdadb1.ora.bk
-rw-r--r-- 1 oracle oinstall         53 Apr  1  2017 initdadb1.ora.bak.dgdb1
-rw-r----- 1 oracle oinstall       1536 Apr  1  2017 orapwdadb1
-rw-r--r-- 1 oracle oinstall         76 Apr  5  2017 initdadb1.ora
-rw-rw---- 1 oracle asmadmin       1544 Apr 22  2019 hc_chdyl1.dat
-rw-rw---- 1 oracle asmadmin       1544 Apr 22  2019 hc_dadb1.dat
-rw-rw---- 1 oracle asmadmin       1544 Apr 22  2019 hc_CAIWU1.dat
-rw-rw---- 1 oracle asmadmin       1544 Jul 29  2019 hc_RLZY1.dat
-rw-r----- 1 oracle oinstall       1536 Aug  6  2019 orapwsjjh
-rw-rw---- 1 oracle asmadmin       1544 Aug  6  2019 hc_sjjh.dat
-rw-r----- 1 oracle asmadmin   10797056 Oct 14  2019 snapcf_sjjh1.f
-rw-r----- 1 oracle oinstall       1536 Mar  1 18:31 orapwsjjh1
-rw-r----- 1 oracle asmadmin 1262486016 Mar  2 08:36 broken0
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:36 broken1
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:36 broken2
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:36 broken3
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:36 broken4
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:36 broken5
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:37 broken6
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:37 broken7
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:37 broken8
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:37 broken9
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:37 broken10
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:37 broken11
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:38 broken12
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:38 broken13
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:38 broken14
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:38 broken15
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:38 broken16
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:38 broken17
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:38 broken18
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:39 broken19
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:39 broken20
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:39 broken21
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:39 broken22
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:39 broken23
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:39 broken24
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:40 broken25
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:40 broken26
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:40 broken27
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:40 broken28
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:40 broken29
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:48 broken59
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:48 broken33
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:48 broken35
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:48 broken34
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:48 broken36
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:49 broken37
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:49 broken39
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:49 broken38
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:49 broken40
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:49 broken41
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:49 broken42
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:49 broken43
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:50 broken44
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:50 broken45
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:50 broken46
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:50 broken47
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:50 broken48
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:50 broken49
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:51 broken51
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:51 broken50
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:51 broken52
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:51 broken53
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:51 broken54
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:51 broken55
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:52 broken57
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:52 broken56
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 08:52 broken58
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 09:17 broken32
-rw-r----- 1 oracle asmadmin 1073742336 Mar  2 09:33 broken31
-rw-r----- 1 oracle asmadmin 1262486016 Mar  2 09:49 broken30
-rw-rw---- 1 oracle asmadmin       1544 Mar  2 10:02 hc_sjjh1.dat
-rw-r----- 1 oracle asmadmin   48316416 Jul 21 03:00 snapcf_RLZY1.f

查看文件broken0发现是sjjh数据库与日志文件相关的错误

查看实例的alert.log文件的内容,果然是在写日志文件时出现了错误:

Successful mount of redo thread 1, with mount id 4246975374
Physical Standby Database mounted.
Lost write protection disabled
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken0'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken0'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken1'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken1'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken2'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken2'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 4 of thread 1
ORA-00312: online log 4 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken3'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 4 of thread 1
ORA-00312: online log 4 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken3'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken4'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken4'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 6 of thread 1
ORA-00312: online log 6 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken5'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 6 of thread 1
ORA-00312: online log 6 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken5'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 7 of thread 1
ORA-00312: online log 7 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken6'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 7 of thread 1
ORA-00312: online log 7 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken6'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 8 of thread 1
ORA-00312: online log 8 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken7'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 8 of thread 1
ORA-00312: online log 8 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken7'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 9 of thread 1
ORA-00312: online log 9 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken8'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 9 of thread 1
ORA-00312: online log 9 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken8'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 10 of thread 1
ORA-00312: online log 10 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken9'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 10 of thread 1
ORA-00312: online log 10 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken9'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 11 of thread 1
ORA-00312: online log 11 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken10'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 11 of thread 1
ORA-00312: online log 11 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken10'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 12 of thread 1
ORA-00312: online log 12 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken11'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 12 of thread 1
ORA-00312: online log 12 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken11'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 13 of thread 1
ORA-00312: online log 13 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken12'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 13 of thread 1
ORA-00312: online log 13 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken12'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 14 of thread 1
ORA-00312: online log 14 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken13'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 14 of thread 1
ORA-00312: online log 14 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken13'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 15 of thread 1
ORA-00312: online log 15 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken14'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 15 of thread 1
ORA-00312: online log 15 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken14'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 16 of thread 1
ORA-00312: online log 16 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken15'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 16 of thread 1
ORA-00312: online log 16 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken15'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 17 of thread 1
ORA-00312: online log 17 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken16'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 17 of thread 1
ORA-00312: online log 17 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken16'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 18 of thread 1
ORA-00312: online log 18 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken17'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 18 of thread 1
ORA-00312: online log 18 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken17'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 19 of thread 1
ORA-00312: online log 19 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken18'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 19 of thread 1
ORA-00312: online log 19 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken18'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 20 of thread 1
ORA-00312: online log 20 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken19'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 20 of thread 1
ORA-00312: online log 20 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken19'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 21 of thread 1
ORA-00312: online log 21 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken20'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 21 of thread 1
ORA-00312: online log 21 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken20'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 22 of thread 1
ORA-00312: online log 22 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken21'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 22 of thread 1
ORA-00312: online log 22 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken21'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 23 of thread 1
ORA-00312: online log 23 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken22'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 23 of thread 1
ORA-00312: online log 23 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken22'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 24 of thread 1
ORA-00312: online log 24 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken23'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 24 of thread 1
ORA-00312: online log 24 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken23'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 25 of thread 1
ORA-00312: online log 25 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken24'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 25 of thread 1
ORA-00312: online log 25 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken24'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 26 of thread 1
ORA-00312: online log 26 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken25'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 26 of thread 1
ORA-00312: online log 26 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken25'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 27 of thread 1
ORA-00312: online log 27 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken26'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 27 of thread 1
ORA-00312: online log 27 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken26'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 28 of thread 1
ORA-00312: online log 28 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken27'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 28 of thread 1
ORA-00312: online log 28 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken27'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 29 of thread 1
ORA-00312: online log 29 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken28'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 29 of thread 1
ORA-00312: online log 29 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken28'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 30 of thread 1
ORA-00312: online log 30 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken29'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 30 of thread 1
ORA-00312: online log 30 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken29'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 31 of thread 1
ORA-00312: online log 31 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken30'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 31 of thread 1
ORA-00312: online log 31 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken30'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 32 of thread 1
ORA-00312: online log 32 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken31'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 32 of thread 1
ORA-00312: online log 32 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken31'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 33 of thread 1
ORA-00312: online log 33 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken32'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 33 of thread 1
ORA-00312: online log 33 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken32'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 34 of thread 1
ORA-00312: online log 34 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken33'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 34 of thread 1
ORA-00312: online log 34 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken33'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 35 of thread 1
ORA-00312: online log 35 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken34'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 35 of thread 1
ORA-00312: online log 35 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken34'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 36 of thread 1
ORA-00312: online log 36 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken35'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 36 of thread 1
ORA-00312: online log 36 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken35'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 37 of thread 1
ORA-00312: online log 37 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken36'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 37 of thread 1
ORA-00312: online log 37 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken36'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 38 of thread 1
ORA-00312: online log 38 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken37'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 38 of thread 1
ORA-00312: online log 38 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken37'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 39 of thread 1
ORA-00312: online log 39 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken38'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 39 of thread 1
ORA-00312: online log 39 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken38'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 40 of thread 1
ORA-00312: online log 40 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken39'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 40 of thread 1
ORA-00312: online log 40 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken39'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 41 of thread 1
ORA-00312: online log 41 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken40'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 41 of thread 1
ORA-00312: online log 41 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken40'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 42 of thread 1
ORA-00312: online log 42 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken41'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 42 of thread 1
ORA-00312: online log 42 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken41'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 43 of thread 1
ORA-00312: online log 43 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken42'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 43 of thread 1
ORA-00312: online log 43 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken42'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 44 of thread 1
ORA-00312: online log 44 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken43'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 44 of thread 1
ORA-00312: online log 44 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken43'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 45 of thread 1
ORA-00312: online log 45 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken44'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 45 of thread 1
ORA-00312: online log 45 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken44'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 46 of thread 1
ORA-00312: online log 46 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken45'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 46 of thread 1
ORA-00312: online log 46 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken45'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 47 of thread 1
ORA-00312: online log 47 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken46'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 47 of thread 1
ORA-00312: online log 47 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken46'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 48 of thread 1
ORA-00312: online log 48 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken47'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 48 of thread 1
ORA-00312: online log 48 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken47'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 49 of thread 1
ORA-00312: online log 49 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken48'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 49 of thread 1
ORA-00312: online log 49 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken48'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 50 of thread 1
ORA-00312: online log 50 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken49'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 50 of thread 1
ORA-00312: online log 50 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken49'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 51 of thread 1
ORA-00312: online log 51 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken50'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 51 of thread 1
ORA-00312: online log 51 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken50'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 52 of thread 1
ORA-00312: online log 52 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken51'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 52 of thread 1
ORA-00312: online log 52 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken51'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 53 of thread 1
ORA-00312: online log 53 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken52'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 53 of thread 1
ORA-00312: online log 53 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken52'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 54 of thread 1
ORA-00312: online log 54 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken53'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 54 of thread 1
ORA-00312: online log 54 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken53'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 55 of thread 1
ORA-00312: online log 55 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken54'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 55 of thread 1
ORA-00312: online log 55 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken54'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 56 of thread 1
ORA-00312: online log 56 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken55'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 56 of thread 1
ORA-00312: online log 56 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken55'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 57 of thread 1
ORA-00312: online log 57 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken56'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 57 of thread 1
ORA-00312: online log 57 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken56'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 58 of thread 1
ORA-00312: online log 58 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken57'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 58 of thread 1
ORA-00312: online log 58 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken57'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 59 of thread 1
ORA-00312: online log 59 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken58'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 59 of thread 1
ORA-00312: online log 59 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken58'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 60 of thread 1
ORA-00312: online log 60 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken59'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /u01/app/oracle/diag/rdbms/sjjhdg/sjjh1/trace/sjjh1_lgwr_54343.trc:
ORA-00313: open failed for members of log group 60 of thread 1
ORA-00312: online log 60 thread 1: '/u01/app/oracle/product/11.2.0/db_1/dbs/broken59'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Completed: ALTER DATABASE MOUNT
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Mon Mar 02 08:35:50 2020
alter database open
AUDIT_TRAIL initialization parameter is changed to OS, as DB is NOT compatible for database opened with read-only access
查看主库的alert.log文件发现主库不能将日志同步到备库,原因是因为主备库之间网络故障
Mon Mar 02 01:17:22 2020
Thread 1 cannot allocate new log, sequence 3357
Private strand flush not complete
Current log# 11 seq# 3356 mem# 0: /oradata/sjjh/redo11.log
LGWR: Standby redo logfile selected for thread 1 sequence 3357 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3357 (LGWR switch)
Current log# 12 seq# 3357 mem# 0: /oradata/sjjh/redo12.log
Mon Mar 02 01:17:29 2020
Archived Log entry 6342 added for thread 1 sequence 3356 ID 0xfc687662 dest 1:
Mon Mar 02 02:00:00 2020
Closing scheduler window
Closing Resource Manager plan via scheduler window
Clearing Resource Manager plan via parameter
Mon Mar 02 02:33:30 2020
Thread 1 cannot allocate new log, sequence 3358
Private strand flush not complete
Current log# 12 seq# 3357 mem# 0: /oradata/sjjh/redo12.log
LGWR: Standby redo logfile selected for thread 1 sequence 3358 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3358 (LGWR switch)
Current log# 13 seq# 3358 mem# 0: /oradata/sjjh/redo13.log
Mon Mar 02 02:33:38 2020
Archived Log entry 6344 added for thread 1 sequence 3357 ID 0xfc687662 dest 1:
Mon Mar 02 03:45:12 2020
Thread 1 cannot allocate new log, sequence 3359
Private strand flush not complete
Current log# 13 seq# 3358 mem# 0: /oradata/sjjh/redo13.log
LGWR: Standby redo logfile selected for thread 1 sequence 3359 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3359 (LGWR switch)
Current log# 14 seq# 3359 mem# 0: /oradata/sjjh/redo14.log
Mon Mar 02 03:45:19 2020
Archived Log entry 6346 added for thread 1 sequence 3358 ID 0xfc687662 dest 1:
Mon Mar 02 08:24:54 2020
LGWR: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (3113)
LGWR: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
Error 3113 for archive log file 14 to 'jhk_st'
LGWR: Error 1041 disconnecting from destination LOG_ARCHIVE_DEST_2 standby host 'jhk_st'
Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED
Thread 1 cannot allocate new log, sequence 3360
Private strand flush not complete
Current log# 14 seq# 3359 mem# 0: /oradata/sjjh/redo14.log
LGWR: Failed to archive log 14 thread 1 sequence 3359 (3113)
Thread 1 advanced to log sequence 3360 (LGWR switch)
Current log# 15 seq# 3360 mem# 0: /oradata/sjjh/redo15.log
Mon Mar 02 08:25:01 2020
Archived Log entry 6347 added for thread 1 sequence 3359 ID 0xfc687662 dest 1:
Mon Mar 02 08:30:31 2020
Thread 1 cannot allocate new log, sequence 3361
Private strand flush not complete
Current log# 15 seq# 3360 mem# 0: /oradata/sjjh/redo15.log
Mon Mar 02 08:30:52 2020
LGWR: Standby redo logfile selected for thread 1 sequence 3361 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3361 (LGWR switch)
Current log# 16 seq# 3361 mem# 0: /oradata/sjjh/redo16.log
Mon Mar 02 08:30:52 2020
Archived Log entry 6349 added for thread 1 sequence 3360 ID 0xfc687662 dest 1:
Mon Mar 02 08:30:52 2020
ARC0: Standby redo logfile selected for thread 1 sequence 3360 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 08:54:23 2020
LGWR: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (272)
LGWR: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
Error 272 for archive log file 16 to 'jhk_st'
Mon Mar 02 08:55:04 2020
Thread 1 cannot allocate new log, sequence 3362
Private strand flush not complete
Current log# 16 seq# 3361 mem# 0: /oradata/sjjh/redo16.log
LGWR: Failed to archive log 16 thread 1 sequence 3361 (272)
Thread 1 advanced to log sequence 3362 (LGWR switch)
Current log# 17 seq# 3362 mem# 0: /oradata/sjjh/redo17.log
Mon Mar 02 08:55:07 2020
Archived Log entry 6351 added for thread 1 sequence 3361 ID 0xfc687662 dest 1:
Mon Mar 02 09:00:04 2020
ARC3: Standby redo logfile selected for thread 1 sequence 3361 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:00:04 2020
Thread 1 cannot allocate new log, sequence 3363
Private strand flush not complete
Current log# 17 seq# 3362 mem# 0: /oradata/sjjh/redo17.log
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected for thread 1 sequence 3363 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3363 (LGWR switch)
Current log# 18 seq# 3363 mem# 0: /oradata/sjjh/redo18.log
Mon Mar 02 09:00:08 2020
Archived Log entry 6353 added for thread 1 sequence 3362 ID 0xfc687662 dest 1:
ARC3: Standby redo logfile selected for thread 1 sequence 3362 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:13:31 2020
LGWR: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (3113)
LGWR: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
Error 3113 for archive log file 18 to 'jhk_st'
LGWR: Error 1041 disconnecting from destination LOG_ARCHIVE_DEST_2 standby host 'jhk_st'
Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED
Thread 1 cannot allocate new log, sequence 3364
Private strand flush not complete
Current log# 18 seq# 3363 mem# 0: /oradata/sjjh/redo18.log
LGWR: Failed to archive log 18 thread 1 sequence 3363 (3113)
Thread 1 advanced to log sequence 3364 (LGWR switch)
Current log# 19 seq# 3364 mem# 0: /oradata/sjjh/redo19.log
Mon Mar 02 09:13:36 2020
Archived Log entry 6355 added for thread 1 sequence 3363 ID 0xfc687662 dest 1:
Mon Mar 02 09:14:42 2020
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=MEMORY SID='*';
Mon Mar 02 09:14:43 2020
ARC3: Standby redo logfile selected for thread 1 sequence 3363 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:14:45 2020
Thread 1 cannot allocate new log, sequence 3365
Private strand flush not complete
Current log# 19 seq# 3364 mem# 0: /oradata/sjjh/redo19.log
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected for thread 1 sequence 3365 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3365 (LGWR switch)
Current log# 20 seq# 3365 mem# 0: /oradata/sjjh/redo20.log
Mon Mar 02 09:14:48 2020
Archived Log entry 6357 added for thread 1 sequence 3364 ID 0xfc687662 dest 1:
Mon Mar 02 09:16:14 2020
LGWR: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (272)
LGWR: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
Error 272 for archive log file 20 to 'jhk_st'
Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED
Thread 1 cannot allocate new log, sequence 3366
Private strand flush not complete
Current log# 20 seq# 3365 mem# 0: /oradata/sjjh/redo20.log
LGWR: Failed to archive log 20 thread 1 sequence 3365 (272)
Thread 1 advanced to log sequence 3366 (LGWR switch)
Current log# 21 seq# 3366 mem# 0: /oradata/sjjh/redo21.log
Mon Mar 02 09:16:19 2020
Archived Log entry 6359 added for thread 1 sequence 3365 ID 0xfc687662 dest 1:
Mon Mar 02 09:22:07 2020
Thread 1 cannot allocate new log, sequence 3367
Private strand flush not complete
Current log# 21 seq# 3366 mem# 0: /oradata/sjjh/redo21.log
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected for thread 1 sequence 3367 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3367 (LGWR switch)
Current log# 22 seq# 3367 mem# 0: /oradata/sjjh/redo22.log
Mon Mar 02 09:22:10 2020
Archived Log entry 6361 added for thread 1 sequence 3366 ID 0xfc687662 dest 1:
Mon Mar 02 09:29:22 2020
LGWR: Attempting destination LOG_ARCHIVE_DEST_2 network reconnect (3113)
LGWR: Destination LOG_ARCHIVE_DEST_2 network reconnect abandoned
Error 3113 for archive log file 22 to 'jhk_st'
LGWR: Error 1041 disconnecting from destination LOG_ARCHIVE_DEST_2 standby host 'jhk_st'
Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED
Thread 1 cannot allocate new log, sequence 3368
Private strand flush not complete
Current log# 22 seq# 3367 mem# 0: /oradata/sjjh/redo22.log
LGWR: Failed to archive log 22 thread 1 sequence 3367 (3113)
Thread 1 advanced to log sequence 3368 (LGWR switch)
Current log# 23 seq# 3368 mem# 0: /oradata/sjjh/redo23.log
Mon Mar 02 09:29:26 2020
Archived Log entry 6363 added for thread 1 sequence 3367 ID 0xfc687662 dest 1:
Mon Mar 02 09:30:04 2020
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=MEMORY SID='*';
Mon Mar 02 09:30:05 2020
ARC3: Standby redo logfile selected for thread 1 sequence 3367 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:30:05 2020
Thread 1 cannot allocate new log, sequence 3369
Private strand flush not complete
Current log# 23 seq# 3368 mem# 0: /oradata/sjjh/redo23.log
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
FAL[server, ARC3]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
ORACLE Instance sjjh - Archival Error. Archiver continuing.
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected for thread 1 sequence 3369 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3369 (LGWR switch)
Current log# 24 seq# 3369 mem# 0: /oradata/sjjh/redo24.log
Mon Mar 02 09:30:08 2020
Archived Log entry 6365 added for thread 1 sequence 3368 ID 0xfc687662 dest 1:
ARC3: Standby redo logfile selected for thread 1 sequence 3368 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:31:27 2020
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED
Thread 1 cannot allocate new log, sequence 3370
Private strand flush not complete
Current log# 24 seq# 3369 mem# 0: /oradata/sjjh/redo24.log
LGWR: Failed to archive log 24 thread 1 sequence 3369 (272)
Thread 1 advanced to log sequence 3370 (LGWR switch)
Current log# 25 seq# 3370 mem# 0: /oradata/sjjh/redo25.log
Mon Mar 02 09:31:33 2020
Archived Log entry 6367 added for thread 1 sequence 3369 ID 0xfc687662 dest 1:
Mon Mar 02 09:37:09 2020
Thread 1 cannot allocate new log, sequence 3371
Private strand flush not complete
Current log# 25 seq# 3370 mem# 0: /oradata/sjjh/redo25.log
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected for thread 1 sequence 3371 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3371 (LGWR switch)
Current log# 26 seq# 3371 mem# 0: /oradata/sjjh/redo26.log
Mon Mar 02 09:37:12 2020
Archived Log entry 6369 added for thread 1 sequence 3370 ID 0xfc687662 dest 1:
Mon Mar 02 09:37:12 2020
ARC3: Standby redo logfile selected for thread 1 sequence 3370 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:42:26 2020
Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED
Thread 1 cannot allocate new log, sequence 3372
Private strand flush not complete
Current log# 26 seq# 3371 mem# 0: /oradata/sjjh/redo26.log
LGWR: Failed to archive log 26 thread 1 sequence 3371 (3113)
Thread 1 advanced to log sequence 3372 (LGWR switch)
Current log# 27 seq# 3372 mem# 0: /oradata/sjjh/redo27.log
Mon Mar 02 09:42:31 2020
Archived Log entry 6371 added for thread 1 sequence 3371 ID 0xfc687662 dest 1:
Mon Mar 02 09:44:23 2020
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=MEMORY SID='*';
Mon Mar 02 09:44:23 2020
ARC0: Standby redo logfile selected for thread 1 sequence 3371 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:44:25 2020
Thread 1 cannot allocate new log, sequence 3373
Private strand flush not complete
Current log# 27 seq# 3372 mem# 0: /oradata/sjjh/redo27.log
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected for thread 1 sequence 3373 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3373 (LGWR switch)
Current log# 28 seq# 3373 mem# 0: /oradata/sjjh/redo28.log
Mon Mar 02 09:44:28 2020
Archived Log entry 6373 added for thread 1 sequence 3372 ID 0xfc687662 dest 1:
Mon Mar 02 09:44:28 2020
ARC3: Standby redo logfile selected for thread 1 sequence 3372 for destination LOG_ARCHIVE_DEST_2
Mon Mar 02 09:45:34 2020
Thread 1 cannot allocate new log, sequence 3374
Private strand flush not complete
Current log# 28 seq# 3373 mem# 0: /oradata/sjjh/redo28.log
LGWR: Standby redo logfile selected for thread 1 sequence 3374 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3374 (LGWR switch)
Current log# 29 seq# 3374 mem# 0: /oradata/sjjh/redo29.log
Mon Mar 02 09:45:35 2020
Archived Log entry 6376 added for thread 1 sequence 3373 ID 0xfc687662 dest 1:
Mon Mar 02 13:45:51 2020
LGWR: Standby redo logfile selected for thread 1 sequence 3375 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3375 (LGWR switch)
Current log# 30 seq# 3375 mem# 0: /oradata/sjjh/redo30.log
Mon Mar 02 13:45:55 2020
Archived Log entry 6378 added for thread 1 sequence 3374 ID 0xfc687662 dest 1:
Mon Mar 02 13:47:12 2020
Thread 1 cannot allocate new log, sequence 3376
Private strand flush not complete
Current log# 30 seq# 3375 mem# 0: /oradata/sjjh/redo30.log
Destination LOG_ARCHIVE_DEST_2 no longer supports SYNCHRONIZATION
Thread 1 advanced to log sequence 3376 (LGWR switch)
Current log# 1 seq# 3376 mem# 0: /oradata/sjjh/redo01.log
Mon Mar 02 13:47:19 2020
Archived Log entry 6380 added for thread 1 sequence 3375 ID 0xfc687662 dest 1:
Mon Mar 02 22:00:00 2020
Setting Resource Manager plan SCHEDULER[0x32D9]:DEFAULT_MAINTENANCE_PLAN via scheduler window
Setting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter
Mon Mar 02 22:00:00 2020
Starting background process VKRM
Mon Mar 02 22:00:00 2020
VKRM started with pid=47, OS id=81983
Mon Mar 02 22:00:02 2020
Begin automatic SQL Tuning Advisor run for special tuning task "SYS_AUTO_SQL_TUNING_TASK"
Mon Mar 02 22:01:00 2020
End automatic SQL Tuning Advisor run for special tuning task "SYS_AUTO_SQL_TUNING_TASK"
Tue Mar 03 00:38:04 2020
Thread 1 cannot allocate new log, sequence 3377
Private strand flush not complete
Current log# 1 seq# 3376 mem# 0: /oradata/sjjh/redo01.log
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected for thread 1 sequence 3377 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3377 (LGWR switch)
Current log# 2 seq# 3377 mem# 0: /oradata/sjjh/redo02.log
Tue Mar 03 00:38:12 2020
Archived Log entry 6382 added for thread 1 sequence 3376 ID 0xfc687662 dest 1:
Tue Mar 03 00:40:10 2020
LGWR: Standby redo logfile selected for thread 1 sequence 3378 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 3378 (LGWR switch)
Current log# 3 seq# 3378 mem# 0: /oradata/sjjh/redo03.log

明白原因之后现在可以删除dbs目录中的broker*文件来释放空间

]]>
http://www.jydba.net/index.php/archives/3050/feed 0
Oracle Linux 7.1 silent install 19C RAC http://www.jydba.net/index.php/archives/2991 http://www.jydba.net/index.php/archives/2991#respond Tue, 19 May 2020 00:58:29 +0000 http://www.jydba.net/?p=2991 一·系统环境规则
1.1网络架构

                                    节点1                    节点2
主机名                               19c1                     19c2 
Private IP                          10.10.10.141             10.10.10.142 
Public IP                           10.13.13.141             10.13.13.142
VIP                                 10.13.13.143             10.13.13.144
SCANIP                              10.13.13.145/146/147 
SCAN_NAME                           scan-19c

1.2 存储

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

1.3 软件版本

操作系统:Oracle Linux 7.1
集群软件: Oracle Clusterware 19.3.0
数据库软件:Oracle Database Enterprise 19.3.0

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

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

2.2修改Private IP地址

[root@19c1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192
HWADDR=00:50:56:A3:10:82
TYPE=Ethernet
BOOTPROTO=none
IPADDR=10.10.10.141
PREFIX=24
GATEWAY=10.10.10.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens192
UUID=7d9faf7c-d74c-41da-b02e-8703dfb8ef20
DEVICE=ens192
ONBOOT=no

[root@19c2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens192
UUID=752d38b2-aa25-4f94-9232-df2edb36ed79
ONBOOT=yes
DEVICE=ens192
IPADDR=10.10.10.142
PREFIX=24
GATEWAY=10.10.10.1
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

2.3 修改Public IP地址

[root@19c1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=073349c5-40bc-4a0d-b1e6-44a935689d41
DEVICE=ens160
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
IPADDR=10.13.13.141
PREFIX=24
GATEWAY=10.13.13.254

[root@19c2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=073349c5-40bc-4a0d-b1e6-44a935689d41
DEVICE=ens160
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
IPADDR=10.13.13.142
PREFIX=24
GATEWAY=10.13.13.254

2.4 关闭时间同步服务

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

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

2.5关闭防火墙和SELinux

[root@19c1 ~]# systemctl stop firewalld
[root@19c1 ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@19c1 ~]# setenforce 0
[root@19c1 ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@19c1 ~]# 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@19c2 ~]# systemctl stop chronyd
[root@19c2 ~]# systemctl disable chronyd
rm '/etc/systemd/system/multi-user.target.wants/chronyd.service'
[root@19c2 ~]# mv /etc/chrony.conf /etc/chrony.conf.bak
[root@19c2 ~]# setenforce 0
[root@19c2 ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@19c2 ~]# 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@19c1 ~]# ls -lrt /etc/yum.repos.d/
total 4
-rw-r--r--. 1 root root 2323 Feb 16 2015 public-yum-ol7.repo

[root@19c1 ~]# mv /etc/yum.repos.d/public-yum-ol7.repo /etc/yum.repos.d/public-yum-ol7.repo.bak
[root@19c1 ~]# mount /dev/sr0 /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@19c1 ~]# cat >> /etc/yum.repos.d/jy.repo < [base]
> name=jy
> baseurl=file:///mnt
> enabled=1
> gpgcheck=0
> multilib_policy=all
> EOF
[root@19c1 ~]# cat /etc/yum.repos.d/jy.repo
[base]
name=jy
baseurl=file:///mnt
enabled=1
gpgcheck=0
multilib_policy=all
[root@19c1 ~]# yum clean all
Loaded plugins: langpacks
Cleaning repos: base ol7_UEKR3 ol7_latest
Cleaning up everything
[root@19c1 ~]# 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@19c2 ~]# ls -lrt /etc/yum.repos.d/
total 4
-rw-r--r--. 1 root root 2323 Feb 16 2015 public-yum-ol7.repo
[root@19c2 ~]# mv /etc/yum.repos.d/public-yum-ol7.repo /etc/yum.repos.d/public-yum-ol7.repo.bak
[root@19c2 ~]# mount /dev/sr0 /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@19c2 ~]# cat >> /etc/yum.repos.d/jy.repo < [base]
> name=jy
> baseurl=file:///mnt
> enabled=1
> gpgcheck=0
> multilib_policy=all
> EOF
[root@19c2 ~]# cat /etc/yum.repos.d/jy.repo
[base]
name=jy
baseurl=file:///mnt
enabled=1
gpgcheck=0
multilib_policy=all
[root@19c2 ~]# yum clean all
Loaded plugins: langpacks
Cleaning repos: base
Cleaning up everything

[root@19c2 ~]# 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@19c1 ~]# systemctl stop ntpd.service
[root@19c1 ~]# systemctl disable ntpd.service

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

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

[root@19c1 ~]# systemctl stop ntpd.service
[root@19c1 ~]# systemctl disable ntpd.service
[root@19c1 ~]# groupadd -g 54321 oinstall
[root@19c1 ~]# groupadd -g 54322 dba
[root@19c1 ~]# groupadd -g 54323 oper
[root@19c1 ~]# groupadd -g 54324 backupdba
[root@19c1 ~]# groupadd -g 54325 dgdba
[root@19c1 ~]# groupadd -g 54326 kmdba
[root@19c1 ~]# groupadd -g 54327 asmdba
[root@19c1 ~]# groupadd -g 54328 asmoper
[root@19c1 ~]# groupadd -g 54329 asmadmin
[root@19c1 ~]# groupadd -g 54330 racdba

[root@19c1 ~]# grep 543 /etc/group
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:
oinstall:x:54321:

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

[root@19c2 ~]# grep 543 /etc/group
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:
oinstall:x:54321:

创建用户

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

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

2.9创建相关目录

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

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

2.10 安装软件包

[root@19c1 ~]# 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 13 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@19c1 ~]# 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 26 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@19c2 ~]# 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 8.1 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@19c2 ~]# 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 74 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@19c1 ~]# 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@19c2 ~]# 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@19c1 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

#public-ip
10.13.13.141 19c1
10.13.13.142 19c2

#public-vip
10.13.13.143 19c1-vip
10.13.13.144 19c2-vip

#prive-ip
10.10.10.141 19c1-priv
10.10.10.142 19c2-priv

#scan-ip
10.13.13.145 scan-19c
10.13.13.146 scan-19c
10.13.13.147 scan-19c


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

#public-ip
10.13.13.141 19c1
10.13.13.142 19c2

#public-vip
10.13.13.143 19c1-vip
10.13.13.144 19c2-vip

#prive-ip
10.10.10.141 19c1-priv
10.10.10.142 19c2-priv

#scan-ip
10.13.13.145 scan-19c
10.13.13.146 scan-19c
10.13.13.147 scan-19c

2.12 修改系统内核参数

[root@19c1 ~]# cat /etc/sysconfig/network
# Created by anaconda
[root@19c1 ~]# 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@19c2 ~]# cat /etc/sysconfig/network
# Created by anaconda
[root@19c2 ~]# 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@19c1 ~]# 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@19c2 ~]# 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@19c1 ~]# 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@19c2 ~]# 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@19c1 ~]# cat >> /etc/pam.d/login < session required /lib64/security/pam_limits.so 
> EOF

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

2.15 配置系统环境变量

[root@19c1 ~]# 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@19c2 ~]# 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
> 
> 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@19c1 ~]$ 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/19.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@19c2 ~]$ 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/19.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@19c1 ~]$ 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/19.3/db
export ORACLE_SID=ora19c1
export ORACLE_UNQNAME=ora19c
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@19c2 ~]$ 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/19.3/db
export ORACLE_SID=ora19c2
export ORACLE_UNQNAME=ora19c
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@19c1 ~]# fdisk -l

Disk /dev/sdc: 64.4 GB, 64424509440 bytes, 125829120 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: 85.9 GB, 85899345920 bytes, 167772160 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: 0x0001fbac

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 167649279 83311616 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: 76.8 GB, 76843843584 bytes, 150085632 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@19c1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
36000c299fe61de641fb3c6a854adf1f7
[root@19c1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
36000c29ad3aa426c31327dac0a2b2a01

[root@19c1 ~]# 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==”36000c299fe61de641fb3c6a854adf1f7″, 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==”36000c29ad3aa426c31327dac0a2b2a01″, RUN+=”/bin/sh -c ‘mknod /dev/asmdisk02 b $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02′”

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

[root@19c2 ~]# fdisk -l

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: 85.9 GB, 85899345920 bytes, 167772160 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: 0x0001fbac

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

Disk /dev/sdc: 64.4 GB, 64424509440 bytes, 125829120 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: 76.8 GB, 76843843584 bytes, 150085632 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@19c2 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
36000c299fe61de641fb3c6a854adf1f7
[root@19c2 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
36000c29ad3aa426c31327dac0a2b2a01

[root@19c2 ~]# 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==”36000c299fe61de641fb3c6a854adf1f7″, 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==”36000c29ad3aa426c31327dac0a2b2a01″, RUN+=”/bin/sh -c ‘mknod /dev/asmdisk02 b $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02′”

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

2.19 禁用avahi
[root@19c1 /]# systemctl stop avahi-dnsconfd
Failed to issue method call: Unit avahi-dnsconfd.service not loaded.
[root@19c1 /]# systemctl stop avahi-daemon
Warning: Stopping avahi-daemon, but it can still be activated by:
avahi-daemon.socket
[root@19c1 /]# systemctl disable avahi-dnsconfd
[root@19c1 /]# systemctl disable avahi-daemon

[root@19c2 /]# systemctl stop avahi-dnsconfd
Failed to issue method call: Unit avahi-dnsconfd.service not loaded.
[root@19c2 /]# systemctl stop avahi-daemon
Warning: Stopping avahi-daemon, but it can still be activated by:
avahi-daemon.socket
[root@19c2 /]# systemctl disable avahi-dnsconfd
[root@19c2 /]# systemctl disable avahi-daemon

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

[root@19c1 /]# su - grid
Last login: Mon May 18 18:15:15 CST 2020 on pts/0
[grid@19c1 ~]$ cd /soft
[grid@19c1 soft]$ ls -lrt
total 5809468
-rw-r--r--. 1 grid oinstall 2889184573 May 16 22:08 LINUX.X64_193000_grid_home.zip
-rwxr-xr-x. 1 oracle oinstall 3059705302 May 18 18:44 LINUX.X64_193000_db_home.zip
[grid@19c1 soft]$ unzip -q LINUX.X64_193000_grid_home.zip -d $ORACLE_HOME

3.2 安装CVU

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

把安装包复件到节点2

[root@19c1 /]# scp /u01/app/19.3/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm 19c2:~ 
The authenticity of host '19c2 (10.13.13.142)' can't be established.
ECDSA key fingerprint is 7f:1f:9a:0f:8b:d1:e0:17:32:08:12:73:d8:1d:9c:da.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '19c2,10.13.13.142' (ECDSA) to the list of known hosts.
root@19c2's password: 
cvuqdisk-1.0.10-1.rpm

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

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

[root@19c1 /]# /u01/app/19.3/grid/oui/prov/resources/scripts/sshUserSetup.sh -user grid -hosts "19c1 19c2" -advanced exverify -confirm

[root@19c1 /]# /u01/app/19.3/grid/oui/prov/resources/scripts/sshUserSetup.sh -user oracle -hosts "19c1 19c2" -advanced exverify -confirm

[root@19c1 /]# su - grid
Last login: Mon May 18 19:03:39 CST 2020 on pts/0
[grid@19c1 ~]$ ssh 19c2 date
Mon May 18 19:07:27 CST 2020
[grid@19c1 ~]$ ssh 19c1 date
Mon May 18 19:07:36 CST 2020
[grid@19c1 ~]$ exit
logout
[root@19c1 /]# su - oracle
Last login: Mon May 18 18:17:25 CST 2020 on pts/0
[oracle@19c1 ~]$ ssh 19c2 date
Mon May 18 19:07:45 CST 2020
[oracle@19c1 ~]$ ssh 19c1 date
Mon May 18 19:07:51 CST 2020

[root@19c2 ~]# su - grid
Last login: Mon May 18 18:16:12 CST 2020 on pts/0
[grid@19c2 ~]$ ssh 19c1 date
Mon May 18 19:04:05 CST 2020
[grid@19c2 ~]$ ssh 19c2 date
Mon May 18 19:08:17 CST 2020
[grid@19c2 ~]$ exit
logout
[root@19c2 ~]# su - oracle
Last login: Mon May 18 18:19:20 CST 2020 on pts/0
[oracle@19c2 ~]$ ssh 19c1 date
Mon May 18 19:08:27 CST 2020
[oracle@19c2 ~]$ ssh 19c2 date
Mon May 18 19:08:31 CST 2020

3.4 安装前环境检查GI

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

根据提示修复检查的问题
[root@19c1 /]# /u01/tmp/CVU_19.0.0.0.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

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

3.5开始安装Grid软件

[grid@19c1 ~]$ vi grid.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.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-19c
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.clusterName=ora19c-cluster
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.clusterNodes=19c1:19c1-vip,19c2:19c2-vip
oracle.install.crs.config.networkInterfaceList=ens192:10.10.10.0:5,ens160:10.13.13.0:1
oracle.install.crs.configureGIMR=false
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@19c1 ~]$ $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-32047] The location (/u01/app/oraInventory) specified for the central inventory is not empty.
ACTION: It is recommended to provide an empty location for the inventory.
[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/GridSetupActions2020-05-18_09-17-17PM/gridSetupActions2020-05-18_09-17-17PM.log
ACTION: Identify the list of failed prerequisite checks from the log: /u01/tmp/GridSetupActions2020-05-18_09-17-17PM/gridSetupActions2020-05-18_09-17-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/19.3/grid/install/response/grid_2020-05-18_09-17-17PM.rsp

You can find the log of this install session at:
/u01/tmp/GridSetupActions2020-05-18_09-17-17PM/gridSetupActions2020-05-18_09-17-17PM.log

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

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

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/19.3/grid/gridSetup.sh -executeConfigTools -responseFile /home/grid/grid.rsp [-silent]


Moved the install session logs to:
/u01/app/oraInventory/logs/GridSetupActions2020-05-18_09-17-17PM

节点一 执行root脚本

[root@19c1 ~]# /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@19c1 ~]# /u01/app/19.3/grid/root.sh
Check /u01/app/19.3/grid/install/root_19c1_2020-05-18_21-35-58-622023345.log for the output of root script

节点二 执行root脚本

[root@19c2 /]# /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@19c2 /]# /u01/app/19.3/grid/root.sh
Check /u01/app/19.3/grid/install/root_19c2_2020-05-18_21-58-15-384301417.log for the output of root script

[grid@19c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details 
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.chad
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.net1.network
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.ons
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.19c1.vip
1 ONLINE ONLINE 19c1 STABLE
ora.19c2.vip
1 ONLINE ONLINE 19c2 STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE 19c2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.OCR.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE 19c1 Started,STABLE
2 ONLINE ONLINE 19c2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE 19c1 STABLE
ora.qosmserver
1 ONLINE ONLINE 19c1 STABLE
ora.scan1.vip
1 ONLINE ONLINE 19c2 STABLE
ora.scan2.vip
1 ONLINE ONLINE 19c1 STABLE
ora.scan3.vip
1 ONLINE ONLINE 19c1 STABLE
--------------------------------------------------------------------------------

3.6创建ASM磁盘组

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

SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 18 22:10:54 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

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

Diskgroup created.

节点二执行挂载

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

SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 18 22:13:07 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> alter diskgroup data mount;

Diskgroup altered.

[grid@19c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details 
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.chad
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.net1.network
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.ons
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.19c1.vip
1 ONLINE ONLINE 19c1 STABLE
ora.19c2.vip
1 ONLINE ONLINE 19c2 STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE 19c2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.OCR.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE 19c1 Started,STABLE
2 ONLINE ONLINE 19c2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE 19c1 STABLE
ora.qosmserver
1 ONLINE ONLINE 19c1 STABLE
ora.scan1.vip
1 ONLINE ONLINE 19c2 STABLE
ora.scan2.vip
1 ONLINE ONLINE 19c1 STABLE
ora.scan3.vip
1 ONLINE ONLINE 19c1 STABLE
--------------------------------------------------------------------------------

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

[oracle@19c1 ~]$ cd /soft
[oracle@19c1 soft]$ ls -lrt
total 5809468
-rw-r--r--. 1 grid oinstall 2889184573 May 16 22:08 LINUX.X64_193000_grid_home.zip
-rwxr-xr-x. 1 oracle oinstall 3059705302 May 18 18:44 LINUX.X64_193000_db_home.zip
[oracle@19c1 soft]$ unzip -q LINUX.X64_193000_db_home.zip -d $ORACLE_HOME



4.2安装前检查
[grid@19c1 ~]$ $ORACLE_HOME/runcluvfy.sh stage -pre dbinst -n "19c1,19c2" -fixup -verbose

4.3编写响应文件

[oracle@19c1 ~]$ vi dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.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/19.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=19c1,19c2
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

4.4执行安装

[oracle@19c1 ~]$ $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/InstallActions2020-05-18_10-55-24PM/installActions2020-05-18_10-55-24PM.log
ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2020-05-18_10-55-24PM/installActions2020-05-18_10-55-24PM.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/19.3/db/install/response/db_2020-05-18_10-55-24PM.rsp

You can find the log of this install session at:
/u01/app/oraInventory/logs/InstallActions2020-05-18_10-55-24PM/installActions2020-05-18_10-55-24PM.log

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

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


Successfully Setup Software with warning(s).

4.5执行root.sh脚本

[root@19c1 ~]# /u01/app/oracle/product/19.3/db/root.sh
Check /u01/app/oracle/product/19.3/db/install/root_19c1_2020-05-18_23-18-15-064687854.log for the output of root script
[root@19c1 ~]# cat /u01/app/oracle/product/19.3/db/install/root_19c1_2020-05-18_23-18-15-064687854.log
Performing root user operation.

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/19.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@19c2 /]# /u01/app/19.3/grid/root.sh
Check /u01/app/19.3/grid/install/root_19c2_2020-05-18_21-58-15-384301417.log for the output of root script
[root@19c2 /]# /u01/app/oracle/product/19.3/db/root.sh
Check /u01/app/oracle/product/19.3/db/install/root_19c2_2020-05-18_23-18-22-213501815.log for the output of root script
[root@19c2 /]# cat /u01/app/oracle/product/19.3/db/install/root_19c2_2020-05-18_23-18-22-213501815.log
Performing root user operation.

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/19.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@19c1 ~]$ vi dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
templateName=General_Purpose.dbc
gdbName=ora19c
sid=ora19c
databaseConfigType=RAC
responseFile=NO_VALUE
characterSet=ZHS16GBK
nationalCharacterSet=AL16UTF16
sysPassword=xxzx7817600
systemPassword=xxzx7817600
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=ora19cpdb
useLocalUndoForPDBs=TRUE
pdbAdminPassword=xxzx7817600
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=3072
redoLogFileSize=50
emConfiguration=NONE
nodelist=19c1,19c2
storageType=ASM
diskGroupName=+DATA
datafileDestination=+DATA
asmsnmpPassword=xxzx7817600
sampleSchema=TRUE

oracle@19c1 ~]$ dbca -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.
[FATAL] [DBT-09101] Target environment does not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/app/oracle/cfgtoollogs/dbca/trace.log_2020-05-19_12-01-31AM
ACTION: Find the appropriate configuration from the log file or from the installation guide to meet the prerequisites and fix this manually.

查看错误日志可以看到因为操作系统内核版本过低等原因检查没有通过

INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OS Kernel Version: This is a prerequisite condition to test whether the system kernel version is at least "4.1.12".


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:CRITICAL


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Package: kmod-20-21 (x86_64): This is a prerequisite condition to test whether the package "kmod-20-21 (x86_64)" is available on the system.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:IGNORABLE


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Package: kmod-libs-20-21 (x86_64): This is a prerequisite condition to test whether the package "kmod-libs-20-21 (x86_64)" is available on the system.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:IGNORABLE


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Single Client Access Name (SCAN): This test verifies the Single Client Access Name configuration.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:CRITICAL


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: DNS/NIS name service 'scan-19c': This test verifies that the Name Service lookups for the Distributed Name Server (DNS) and the Network Information Service (NIS) match for the SCAN name entries.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:CRITICAL


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED

使用-ignorePreReqs忽略警告和错误再次执行

[oracle@19c1 ~]$ 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/ora19c.
Database Information:
Global Database Name:ora19c
System Identifier(SID) Prefix:ora19c
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora19c/ora19c0.log" for further details.

[grid@19c2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details 
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.chad
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.net1.network
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.ons
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.19c1.vip
1 ONLINE ONLINE 19c1 STABLE
ora.19c2.vip
1 ONLINE ONLINE 19c2 STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE 19c2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.OCR.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE 19c1 Started,STABLE
2 ONLINE ONLINE 19c2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE 19c1 STABLE
ora.ora19c.db
1 ONLINE ONLINE 19c1 Open,HOME=/u01/app/o
racle/product/19.3/d
b,STABLE
2 ONLINE ONLINE 19c2 Open,HOME=/u01/app/o
racle/product/19.3/d
b,STABLE
ora.qosmserver
1 ONLINE ONLINE 19c1 STABLE
ora.scan1.vip
1 ONLINE ONLINE 19c2 STABLE
ora.scan2.vip
1 ONLINE ONLINE 19c1 STABLE
ora.scan3.vip
1 ONLINE ONLINE 19c1 STABLE
--------------------------------------------------------------------------------

测试连接

[oracle@19c2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue May 19 02:12:46 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0


SQL> select * from v$version;

BANNER BANNER_FULL BANNER_LEGACY CON_ID
------------------------------------------------------------ ------------------------------------------------------------ -------------------------------------------------- ----------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Oracle Database 19c Enterprise Edition Release 19. 0
Production Production 0.0.0.0 - Production

SQL> show pdbs;

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

到此安装就完了.

]]>
http://www.jydba.net/index.php/archives/2991/feed 0
Oracle Linux 7.1 silent install 19c http://www.jydba.net/index.php/archives/2988 http://www.jydba.net/index.php/archives/2988#respond Tue, 19 May 2020 00:36:35 +0000 http://www.jydba.net/?p=2988 Oracle Linux 7.1 单机静默安装19C
一·操作环境
操作系统 Oracle Linux 7.1
数据库版本 Oracle Database 19.3
主机名 ora19c
IP:10.10.10.140
安装目录 /u01/app/oracle/product/19.3/db1
数据库名称 cs

二·操作环境准备
2.1 关闭防火墙

[root@ora19c ~]# systemctl stop firewalld
[root@ora19c ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'

2.2禁用NetworkManager服务

[root@ora19c ~]# systemctl stop NetworkManager
[root@ora19c ~]# systemctl disable NetworkManager
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'

2.3禁用SELINUX

[root@ora19c ~]# setenforce 0
[root@ora19c ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@ora19c ~]# 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.4配置hosts解析

[root@ora19c ~]# echo " 
> 10.138.130.140 ora19c " >> /etc/hosts
[root@ora19c ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
 
10.138.130.140 ora19c 

2.6创建组和用户

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

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

2.7创建安装目录

[root@ora19c ~]# mkdir -p /u01/app/oraInventory
[root@ora19c ~]# mkdir -p /u01/app/oracle/product/19.3/db1
[root@ora19c ~]# mkdir -p /u01/temp

[root@ora19c ~]# chown -R oracle:oinstall /u01
[root@ora19c ~]# chmod -R 775 /u01

2.8配置用户环境变量

[oracle@ora19c ~]$ cat .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/temp
TMPDIR=/u01/temp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/oracle
DB_HOME=/u01/app/oracle/product/19.3/db1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=ora19c
export ORACLE_UNQNAME=ora19c
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.9配置系统环境变量

[root@ora19c ~]# 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.10修改系统内核参数

[root@ora19c ~]# cat >> /etc/sysctl.conf <  fs.aio-max-nr = 1048576
> fs.file-max = 6815744
> kernel.shmall = 2097152
> kernel.shmmax = 42949672950
> kernel.shmmni = 4096
> kernel.sem = 250 32000 100 128
> net.ipv4.ip_local_port_range = 9000 65500
> net.core.rmem_default = 262144
> net.core.rmem_max = 4194304
> net.core.wmem_default = 262144
> net.core.wmem_max = 1048576
> EOF


[root@ora19c ~]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 42949672950
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

2.11 配置LIMITS限制

[root@ora19c ~]# cat >> /etc/security/limits.conf <  oracle          soft    nproc           16384
> oracle          hard    nproc           16384
> oracle          soft    nofile          65536
> oracle          hard    nofile          65536
> oracle          soft    memlock         3145728
> oracle          hard    memlock         3145728
> EOF

2.12配置PAM
[root@ora19c ~]# cat >> /etc/pam.d/login < session required /lib64/security/pam_limits.so
> EOF

2.13安装依赖包
配置YUM源

[root@ora19c ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   72G   11G   61G  16% /
devtmpfs             3.8G     0  3.8G   0% /dev
tmpfs                3.8G   84K  3.8G   1% /dev/shm
tmpfs                3.8G  8.9M  3.8G   1% /run
tmpfs                3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/sda1            497M  152M  346M  31% /boot
/dev/sr0             4.0G  4.0G     0 100% /run/media/root/OL-7.1 Server.x86_64
[root@ora19c ~]# mount /dev/sr0 /mnt/
mount: /dev/sr0 is write-protected, mounting read-only

[root@ora19c ~]# cd /etc/yum.repos.d/
[root@ora19c yum.repos.d]# ls -lrt
total 4
-rw-r--r--. 1 root root 2323 Feb 16  2015 public-yum-ol7.repo

[root@ora19c yum.repos.d]# cat >> /etc/yum.repos.d/local.repo <  [base]
> name=local
> baseurl=file:///mnt 
> gpgcheck=0
> enabled=1
> EOF

[root@ora19c yum.repos.d]# yum clean all
Loaded plugins: langpacks
Cleaning repos: base
Cleaning up everything
[root@ora19c yum.repos.d]# 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@ora19c yum.repos.d]# 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
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
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                                                                                                                                                                                                       9.3 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@ora19c yum.repos.d]# 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                                                                                                                                                                                                        44 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@ora19c yum.repos.d]# 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)

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

[root@ora19c soft]# chown -R oracle:oinstall /soft
[root@ora19c soft]# chmod -R 775 /soft
[root@ora19c soft]# su - oracle
Last login: Sun May 17 08:09:29 CST 2020 on pts/0

[oracle@ora19c soft]$ unzip -q LINUX.X64_193000_db_home.zip  -d $ORACLE_HOME
replace /u01/app/oracle/product/19.3/db1/.patch_storage/29517242_Apr_17_2019_23_27_10/original_patch/README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
[oracle@ora19c soft]$ du -sh $ORACLE_HOME
6.5G    /u01/app/oracle/product/19.3/db1

3.2安装数据库软件
配置响应文件

[oracle@ora19c ~]$ vi 19c_dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.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/19.3/db1
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.rootconfig.executeRootScript=true
oracle.install.db.rootconfig.configMethod=ROOT

执行安装

[oracle@ora19c ~]$ $ORACLE_HOME/runInstaller -silent  -force -noconfig  -ignorePrereq  -responseFile /home/oracle/19c_dbinstall.rsp
Launching Oracle Database Setup Wizard...


 Enter password for 'root' user:  --输入root用户密码用于自动执行root.sh脚本
[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/temp/InstallActions2020-05-17_09-19-02AM/installActions2020-05-17_09-19-02AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/temp/InstallActions2020-05-17_09-19-02AM/installActions2020-05-17_09-19-02AM.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/19.3/db1/install/response/db_2020-05-17_09-19-02AM.rsp

You can find the log of this install session at:
 /u01/temp/InstallActions2020-05-17_09-19-02AM/installActions2020-05-17_09-19-02AM.log
Successfully Setup Software with warning(s).
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2020-05-17_09-19-02AM

四·配置监听
创建配置监听的响应文件

[oracle@ora19c ~]$ vi 19c_netca.rsp
[GENERAL]
RESPONSEFILE_VERSION="19.3"
CREATE_TYPE="CUSTOM"
[Session]
TOPLEVEL_COMPONENT={"oracle.net.ca","19.3"}
[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@ora19c ~]$ netca /silent /responsefile /home/oracle/19c_netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/oracle/19c_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/19.3/db1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

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

[oracle@ora19c ~]$ vi 19c_dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
templateName=General_Purpose.dbc
gdbName=ora19c
sid=ora19c
databaseConfigType=SI
createAsContainerDatabase=TRUE
numberOfPDBs=1
pdbName=ora19c1
useLocalUndoForPDBs=TRUE
pdbAdminPassword=xxzx7817600
sysPassword=xxzx7817600
systemPassword=xxzx7817600
datafileDestination='/u01/app/oracle/oradata'
recoveryAreaDestination='/u01/app/oracle/flash_recovery_area'
storageType=FS
characterSet=ZHS16GBK
nationalCharacterSet=AL16UTF16
listeners="LISTENER"
sampleSchema=TRUE
totalMemory 2048
databaseType=MULTIPURPOSE
automaticMemoryManagement=TRUE
totalMemory=4096

创建数据库

[oracle@ora19c ~]$ dbca -silent  -createDatabase -responseFile /home/oracle/19c_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
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ora19c.
Database Information:
Global Database Name:ora19c
System Identifier(SID):ora19c
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora19c/ora19c.log" for further details.

六·检查监听状态验证数据库是否被自动注册

[oracle@ora19c ORA19C]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 18-MAY-2020 08:21:51

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19c)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                17-MAY-2020 20:21:29
Uptime                    0 days 12 hr. 0 min. 23 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3/db1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ora19c/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora19c)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "a5d933ae541261b5e0538c828a0a1480" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "ora19c" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "ora19c1" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "ora19cXDB" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@ora19c ORA19C]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 18 08:22:30 2020
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> show pdbs

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

到此,19c静默安装已经完成。

]]>
http://www.jydba.net/index.php/archives/2988/feed 0
Linux Use ODBC Connect Oracle http://www.jydba.net/index.php/archives/2950 http://www.jydba.net/index.php/archives/2950#respond Thu, 26 Mar 2020 09:34:19 +0000 http://www.jydba.net/?p=2950 因为工作需要,需要使用ODBC访问Oracle,下面是ODBC访问Oracle的具体配置
1.下载unixODBC和Oracle简易客户端软件包
1.1下载地址:

http://www.unixodbc.org/

1.1.1下载文件:

unixODBC-2.3.0.tar.gz

2 Oracle ODBC Driver
2.1下载地址:

http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

2.1.1下载文件:

instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
instantclient-basic-linux.x64-12.2.0.1.0.zip
instantclient-sdk-linux.x64-12.2.0.1.0.zip
instantclient-jdbc-linux.x64-12.2.0.1.0.zip
instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
instantclient-basiclite-linux.x64-12.2.0.1.0.zip
instantclient-tools-linux.x64-12.2.0.1.0.zip

将这些软件包上传到/soft目录

3.安装unixODBC(root用户)

#cd /soft
#tar xvf unixODBC-2.3.0.tar.gz
#cd /soft/unixODBC-2.3.0
#./configure
#make
#make install

(默认是被安装到/usr/local)

4.安装Oracle ODBC(root用户)

#cd /soft/
#unzip instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
#unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
#unzip instantclient-sdk-linux.x64-12.2.0.1.0.zip
#unzip instantclient-jdbc-linux.x64-12.2.0.1.0.zip
#unzip instantclient-odbc-linux.x64-12.2.0.1.0-2.zip
#unzip instantclient-basiclite-linux.x64-12.2.0.1.0.zip
#unzip instantclient-tools-linux.x64-12.2.0.1.0.zip
[root@dmks instantclient_12_2]# ./odbc_update_ini.sh /usr/local
 *** ODBCINI environment variable not set,defaulting it to HOME directory!

更新操作完成后,会在/usr/local/etc/odbcinst.ini增加Oracle12C的驱动描述信息。

[root@dmks etc]# cat odbcinst.ini
[DM7 ODBC DRIVER]
Description = ODBC DRIVER FOR DM7
Driver = /dm_home/dmdbms/bin/libdodbc.so


[Oracle 12c ODBC driver]
Description     = Oracle ODBC driver for Oracle 12c
Driver          = /soft/instantclient_12_2/libsqora.so.12.1
Setup           =
FileUsage       =
CPTimeout       =
CPReuse         =

并且会在HOME目录下也就是/root,生成.odbc.ini文件,修改.odbc.ini文件

[root@dmks ~]# cat .odbc.ini
[OracleODBC-12c]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle 12c ODBC driver
DSN = OracleODBC-12c
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MaxLargeData = 0
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = shardcat 与tnsnames.ora文件中的服务器一致
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T
UserID =
StatementCache=F
CacheBufferSize=20
UseOCIDescribeAny=F
SQLTranslateErrors=F
MaxTokenSize=8192
AggregateSQLType=FLOAT
5.测试ODBC连接Oracle
[root@dmks ~]# isql  OracleODBC-12c system xxzx7817600 -v
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select * from v$version;
+---------------------------------------------------------------------------------+-----------------------------------------+
| BANNER                                                                          | CON_ID                                  |
+---------------------------------------------------------------------------------+-----------------------------------------+
| Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production    | 0                                       |
| PL/SQL Release 12.2.0.1.0 - Production                                          | 0                                       |
| CORE  12.2.0.1.0      Production                                                      | 0                                       
| TNS for Linux: Version 12.2.0.1.0 - Production                                  | 0                                       |
| NLSRTL Version 12.2.0.1.0 - Production                                          | 0                                       |
+---------------------------------------------------------------------------------+-----------------------------------------+

到此使用odbc连接Oracle的操作完成,还是很简单的。

]]>
http://www.jydba.net/index.php/archives/2950/feed 0
18C RAC DBCA建库时找不到ASM磁盘 http://www.jydba.net/index.php/archives/2945 http://www.jydba.net/index.php/archives/2945#respond Wed, 18 Mar 2020 09:19:38 +0000 http://www.jydba.net/?p=2945 在Oracle Linux 7.1中使用dbca为Oracle 18C RAC创建数据库时,找不到ASM磁盘组;而grid用户使用asmca却又能看到ASM磁盘组。

解决方法
1. 检查创建ASM磁盘设备的权限,正确的权限为grid:asmadmin,通过下面输出可知权限正确

[root@18c1 ~]# ls -lrt /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Mar 16 22:28 /dev/asmdisk01
brw-rw---- 1 grid asmadmin 8, 32 Mar 17 08:40 /dev/asmdisk02

[root@18c2 ~]# ls -lrt /dev/asm*
brw-rw---- 1 grid asmadmin 8, 32 Mar 17 08:41 /dev/asmdisk02
brw-rw---- 1 grid asmadmin 8, 16 Mar 17 08:41 /dev/asmdisk01

2.检查ASM实例是否启动

[grid@18c1 ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     61440    35868                0           35868              0             Y  CRS/
MOUNTED  EXTERN  N         512             512   4096  4194304     40960    36036                0           36036              0             N  DATA/

[grid@18c2 ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     61440    35868                0           35868              0             Y  CRS/
MOUNTED  EXTERN  N         512             512   4096  4194304     40960    36036                0           36036              0             N  DATA/

3. 检查GRID_HOME/bin下oracle是否有s权限,如果没有需要添加s权限,通过下面的输出可知GRID_HOME/bin目录下的oracle是没有s权限的,这里需要添加

[root@18c1 ~]# ls -lrt /u01/app/oracle/18.0.0/db/bin/oracle
-rwsr-s--x 1 oracle asmadmin 437038067 Mar 16 23:00 /u01/app/oracle/18.0.0/db/bin/oracle
[root@18c1 ~]# ls -lrt /u01/app/18.0.0/grid/bin/oracle
-rwxr-x--x. 1 grid oinstall 413877125 Mar 16 19:10 /u01/app/18.0.0/grid/bin/oracle
[root@18c2 /]# ls -lrt /u01/app/oracle/18.0.0/db/bin/oracle
-rwsr-s--x 1 oracle oinstall 437038067 Mar 16 23:07 /u01/app/oracle/18.0.0/db/bin/oracle
[root@18c2 /]# ls -lrt /u01/app/18.0.0/grid/bin/oracle
-rwxr-x--x. 1 grid oinstall 413877125 Mar 16 19:30 /u01/app/18.0.0/grid/bin/oracle

[root@18c1 ~]# chmod +s /u01/app/18.0.0/grid/bin/oracle
[root@18c1 ~]# ls -lrt /u01/app/18.0.0/grid/bin/oracle
-rwsr-s--x. 1 grid oinstall 413877125 Mar 16 19:10 /u01/app/18.0.0/grid/bin/oracle

[root@18c2 /]# chmod +s /u01/app/18.0.0/grid/bin/oracle
[root@18c2 /]# ls -lrt /u01/app/18.0.0/grid/bin/oracle
-rwsr-s--x. 1 grid oinstall 413877125 Mar 16 19:30 /u01/app/18.0.0/grid/bin/oracle

4.检查用户所有组

[root@18c1 ~]# id oracle
uid=1001(oracle) gid=1011(oinstall) groups=1007(asmdba),1009(dba),1010(oper),1012(backupdba),1013(dgdba),1014(kmdba),1015(racdba),1011(oinstall)
[root@18c1 ~]# id grid
uid=1002(grid) gid=1011(oinstall) groups=1006(asmadmin),1007(asmdba),1008(asmoper),1009(dba),1011(oinstall)
[root@18c1 ~]# gpasswd -a oracle asmadmin
Adding user oracle to group asmadmin
[root@18c1 ~]# id oracle
uid=1001(oracle) gid=1011(oinstall) groups=1006(asmadmin),1007(asmdba),1009(dba),1010(oper),1012(backupdba),1013(dgdba),1014(kmdba),1015(racdba),1011(oinstall)

[root@18c2 /]# id oracle
uid=1001(oracle) gid=1011(oinstall) groups=1007(asmdba),1009(dba),1010(oper),1012(backupdba),1013(dgdba),1014(kmdba),1015(racdba),1011(oinstall)
[root@18c2 /]# id grid
uid=1002(grid) gid=1011(oinstall) groups=1006(asmadmin),1007(asmdba),1008(asmoper),1009(dba),1011(oinstall)
[root@18c2 /]# gpasswd -a oracle asmadmin
Adding user oracle to group asmadmin
[root@18c2 /]# id oracle
uid=1001(oracle) gid=1011(oinstall) groups=1006(asmadmin),1007(asmdba),1009(dba),1010(oper),1012(backupdba),1013(dgdba),1014(kmdba),1015(racdba),1011(oinstall)

再执行dbca创建数据库时能正确找到磁盘组

]]>
http://www.jydba.net/index.php/archives/2945/feed 0
Oracle Linux 7.1 Install Oracle 19C RAC http://www.jydba.net/index.php/archives/2881 http://www.jydba.net/index.php/archives/2881#respond Tue, 17 Mar 2020 05:21:08 +0000 http://www.jydba.net/?p=2881 安装环境为Oracle Linux 7.1,Oracle版本为19C,下面是RAC环境的IP配置

ip地址          主机名                   类型     解析方式 
10.10.10.190  19c1                    public   DNS或etc/hosts 
10.10.10.191  19c2                    public   DNS或etc/hosts 
88.88.88.1    19c1-priv               private  DNS或etc/hosts 
88.88.88.2    19c2-priv               private  DNS或etc/hosts 
10.10.10.192  19c1-vip                virtual  DNS或etc/hosts 
10.10.10.193  19c2-vip                virtual  DNS或etc/hosts
10.10.10.194  hy-scan                 scan     DNS或etc/hosts
10.10.10.195  hy-scan                 scan     DNS或etc/hosts
10.10.10.196  hy-scan                 scan     DNS或etc/hosts

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

10.10.10.190 19c1
10.10.10.191 19c2
88.88.88.1 19c1-priv
88.88.88.2 19c2-priv
10.10.10.192 19c1-vip
10.10.10.193 19c2-vip

10.10.10.194 hy-scan
10.10.10.195 hy-scan
10.10.10.196 hy-scan


[root@19c2 /]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.190 19c1
10.10.10.191 19c2
88.88.88.1 19c1-priv
88.88.88.2 19c2-priv
10.10.10.192 19c1-vip
10.10.10.193 19c2-vip

10.10.10.194 hy-scan
10.10.10.195 hy-scan
10.10.10.196 hy-scan

创建用户组

[root@19c1 /]# groupadd -g 1006 asmadmin
[root@19c1 /]# groupadd -g 1007 asmdba
[root@19c1 /]# groupadd -g 1008 asmoper
[root@19c1 /]# groupadd -g 1009 dba
[root@19c1 /]# groupadd -g 1010 oper
[root@19c1 /]# groupadd -g 1011 oinstall
[root@19c1 /]# groupadd -g 1012 backupdba
[root@19c1 /]# groupadd -g 1013 dgdba
[root@19c1 /]# groupadd -g 1014 kmdba
[root@19c1 /]# groupadd -g 1015 racdba

[root@19c2 /]# groupadd -g 1006 asmadmin
[root@19c2 /]# groupadd -g 1007 asmdba
[root@19c2 /]# groupadd -g 1008 asmoper
[root@19c2 /]# groupadd -g 1009 dba
[root@19c2 /]# groupadd -g 1010 oper
[root@19c2 /]# groupadd -g 1011 oinstall
[root@19c2 /]# groupadd -g 1012 backupdba
[root@19c2 /]# groupadd -g 1013 dgdba
[root@19c2 /]# groupadd -g 1014 kmdba
[root@19c2 /]# groupadd -g 1015 racdba

创建用户

[root@19c1 /]# useradd  -u 1001 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper,asmadmin oracle
[root@19c1 /]# useradd  -u 1002 -g oinstall -G asmadmin,asmdba,asmoper,dba grid


[root@19c2 /]# useradd  -u 1001 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper,asmadmin oracle
[root@19c2 /]# useradd  -u 1002 -g oinstall -G asmadmin,asmdba,asmoper,dba grid

[root@19c1 /]# passwd grid
Changing password for user grid.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

[root@19c1 /]# passwd oracle
Changing password for user grid.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

[root@19c2 /]# passwd grid
Changing password for user grid.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

[root@19c2 /]# passwd oracle
Changing password for user grid.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

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

[root@19c1 /]# cd /etc/udev/rules.d/
[root@19c1 rules.d]# ls -lrt
总用量 4
-rw-r--r--. 1 root root 709 3月   6 2015 70-persistent-ipoib.rules
[root@19c1 rules.d]# vi 99-my-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c29e40b943ae6772ffb254910685", 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=="36000c29a2bcbd0e7f1843df54da0baa6", RUN+="/bin/sh -c 'mknod /dev/asmdisk02 b  $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02'"


[root@19c2 rules.d]# vi 99-my-asmdevices.rules
KERNEL=="sd*[!0-9]", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block",  PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",  RESULT=="36000c29e40b943ae6772ffb254910685", 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=="36000c29a2bcbd0e7f1843df54da0baa6", RUN+="/bin/sh -c 'mknod /dev/asmdisk02 b  $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02'" 

[root@19c1 rules.d]# /sbin/udevadm trigger --type=devices --action=change 
[root@19c2 rules.d]# /sbin/udevadm trigger --type=devices --action=change

[root@19c1 rules.d]#  ls -lrt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 32 3月  16 19:16 /dev/asmdisk02
brw-rw----. 1 grid asmadmin 8, 16 3月  16 19:16 /dev/asmdisk01


[root@19c2 rules.d]#  ls -lrt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 32 Mar 16 19:15 /dev/asmdisk02
brw-rw----. 1 grid asmadmin 8, 16 Mar 16 19:15 /dev/asmdisk01


以root用户创建“Oracle inventory 目录”

[root@19c1 /]# mkdir -p /u01/app/oraInventory
[root@19c2 /]# mkdir -p /u01/app/oraInventory

以root用户创建“Grid Infrastructure BASE 目录”

[root@19c1 /]#  mkdir -p /u01/app/grid
[root@19c2 /]#  mkdir -p /u01/app/grid

以root用户创建“Grid Infrastructure Home 目录”

[root@19c1 /]# mkdir -p /u01/app/19.0.0/grid
[root@19c2 /]# mkdir -p /u01/app/19.0.0/grid
[root@19c1 /]# chown -R grid:oinstall /u01
[root@19c1 /]# chmod -R 775 /u01
[root@19c2 /]# chown -R grid:oinstall /u01
[root@19c2 /]# chmod -R 775 /u01

以root用户创建“Oracle Base 目录”

[root@19c1 /]#  mkdir -p /u01/app/oracle
[root@19c2 /]#  mkdir -p /u01/app/oracle

以root用户创建“Oracle RDBMS Home 目录”

[root@19c1 /]# mkdir -p /u01/app/oracle/19.0.0/db
[root@19c2 /]# mkdir -p /u01/app/oracle/19.0.0/db
[root@19c1 /]# chown -R oracle:oinstall /u01/app/oracle
[root@19c1 /]# chmod -R 775 /u01/app/oracle
[root@19c2 /]# chown -R oracle:oinstall /u01/app/oracle
[root@19c2 /]# chmod -R 775 /u01/app/oracle

创建一个tmp目录

[root@19c1 /]#  mkdir /u01/tmp
[root@19c1 /]# chmod a+wr /u01/tmp

[root@19c2 /]#  mkdir /u01/tmp
[root@19c2 /]# chmod a+wr /u01/tmp

设置环境变量

[grid@19c1 ~]$ 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/19.0.0/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 

[grid@19c2 ~]$ 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/19.0.0/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


[root@19c1 /]# su - oracle
[oracle@19c1 ~]$ 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/19.0.0/db
export ORACLE_SID=hy1
export ORACLE_UNQNAME=hy
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

[root@19c2 /]# su - oracle
-bash: /home/oracle: 是一个目录
[oracle@19c2 ~]$ 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/19.0.0/db
export ORACLE_SID=hy2
export ORACLE_UNQNAME=hy
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

修改内核参数编辑/etc/sysctl.conf文件

[root@19c1 /]# vi /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304

[root@19c1 /]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304

[root@19c2 /]# vi /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304

[root@19c2 /]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304

修改oarcle参数的shell限制,在所有节点的/etc/security/limits.conf文件中添加以下参数

grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
grid soft memlock 3145728
grid hard memlock 3145728

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 3145728
oracle hard memlock 3145728

修改shell的默认参数文件,在所有节点的/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


if [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

对C shell(csh or tcsh) 在所有节点的/etc/csh.login文件中增加以下代码

if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif

if ( $USER == "grid" ) then
limit maxproc 16384
limit descriptors 65536
endif

解压GI安装压缩包:

[grid@jytest1 soft]cd /soft/
[grid@19c1 soft]$ unzip Oracle_Database_Grid_Infrastructure_19_2_0_0_0_for_Linux_x86-64.zip -d /u01/app/19.0.0/grid/

这里使用xshell与xmanager来执行安装

[root@19c1 ~]# xhost +
access control disabled, clients can connect from any host
[root@19c1 ~]# su - grid
??′ε??£o? 3? 16 19:55:59 CST 2020pts/0 ?
[grid@19c1 ~]$ cd $ORACLE_HOME
[grid@19c1 grid]$ export DISPLAY=10.138.130.242:0.0
[grid@19c1 grid]$ ./gridSetup.sh
 




















以root用户分别在两个节点上执行以下脚本,先在主节点执行。

[[root@19c1 /]# ./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@19c2 /]# ./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@19c1 /]# ./u01/app/19.0.0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/19.0.0/grid

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


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/19.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/19c1/crsconfig/rootcrs_19c1_2020-03-16_10-18-52PM.log
2020/03/16 22:19:07 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2020/03/16 22:19:08 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2020/03/16 22:19:08 CLSRSC-363: User ignored prerequisites during installation
2020/03/16 22:19:08 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2020/03/16 22:19:11 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2020/03/16 22:19:13 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2020/03/16 22:19:13 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2020/03/16 22:19:13 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2020/03/16 22:19:44 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2020/03/16 22:19:45 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2020/03/16 22:19:51 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2020/03/16 22:20:06 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2020/03/16 22:20:06 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2020/03/16 22:20:15 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2020/03/16 22:20:16 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2020/03/16 22:20:46 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2020/03/16 22:20:56 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2020/03/16 22:21:06 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2020/03/16 22:21:16 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.

ASM has been created and started successfully.

[DBT-30001] Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-200316PM102150.log for details.

2020/03/16 22:22:41 CLSRSC-482: Running command: '/u01/app/19.0.0/grid/bin/ocrconfig -upgrade grid oinstall'
CRS-4256: Updating the profile
Successful addition of voting disk dda88fad4f094f1cbf686f6a903d8f9c.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   dda88fad4f094f1cbf686f6a903d8f9c (/dev/asmdisk01) [CRS]
Located 1 voting disk(s).
2020/03/16 22:24:13 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2020/03/16 22:25:23 CLSRSC-343: Successfully started Oracle Clusterware stack
2020/03/16 22:25:23 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2020/03/16 22:27:29 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2020/03/16 22:28:06 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

[root@19c2 /]# ./u01/app/19.0.0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/19.0.0/grid

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


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/19.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/19c2/crsconfig/rootcrs_19c2_2020-03-16_10-28-54PM.log
2020/03/16 22:29:03 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2020/03/16 22:29:03 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2020/03/16 22:29:03 CLSRSC-363: User ignored prerequisites during installation
2020/03/16 22:29:03 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2020/03/16 22:29:05 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2020/03/16 22:29:05 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2020/03/16 22:29:05 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2020/03/16 22:29:06 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2020/03/16 22:29:08 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2020/03/16 22:29:09 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2020/03/16 22:29:13 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2020/03/16 22:29:13 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2020/03/16 22:29:17 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2020/03/16 22:29:17 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2020/03/16 22:29:36 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2020/03/16 22:29:44 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2020/03/16 22:29:47 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2020/03/16 22:29:50 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2020/03/16 22:29:52 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
2020/03/16 22:30:02 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2020/03/16 22:31:34 CLSRSC-343: Successfully started Oracle Clusterware stack
2020/03/16 22:31:34 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2020/03/16 22:31:57 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2020/03/16 22:32:06 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded



检查集群信息

[grid@19c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       19c1                     STABLE
               ONLINE  ONLINE       19c2                     STABLE
ora.chad
               ONLINE  ONLINE       19c1                     STABLE
               ONLINE  ONLINE       19c2                     STABLE
ora.net1.network
               ONLINE  ONLINE       19c1                     STABLE
               ONLINE  ONLINE       19c2                     STABLE
ora.ons
               ONLINE  ONLINE       19c1                     STABLE
               ONLINE  ONLINE       19c2                     STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.19c1.vip
      1        ONLINE  ONLINE       19c1                     STABLE
ora.19c2.vip
      1        ONLINE  ONLINE       19c2                     STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       19c1                     STABLE
      2        ONLINE  ONLINE       19c2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.CRS.dg(ora.asmgroup)
      1        ONLINE  ONLINE       19c1                     STABLE
      2        ONLINE  ONLINE       19c2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       19c2                     STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       19c1                     STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       19c1                     STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       19c1                     Started,STABLE
      2        ONLINE  ONLINE       19c2                     Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       19c1                     STABLE
      2        ONLINE  ONLINE       19c2                     STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       19c1                     STABLE
ora.qosmserver
      1        ONLINE  ONLINE       19c1                     STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       19c2                     STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       19c1                     STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       19c1                     STABLE
--------------------------------------------------------------------------------




[oracle@19c1 db]$ cd /soft
[oracle@19c1 soft]$ unzip -q Oracle_Database_19_2_0_0_0_for_Linux_x86-64.zip -d /u01/app/oracle/19.0.0/db

[root@19c1 ~]# xhost +
access control disabled, clients can connect from any host
[root@19c1 ~]# su – oracle
Last login: Mon Mar 16 22:51:15 CST 2020 on pts/3
[oracle@19c1 ~]$ cd $ORACLE_HOME
[oracle@19c1 db]$ export DISPLAY=10.138.130.242:0.0
[oracle@19c1 db]$ ./runInstaller











以 root用户在所有节点上执行以下脚本,先在主节点执行

[root@19c1 /]# ./u01/app/oracle/19.0.0/db/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/19.0.0/db

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

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

[root@19c2 /]# ./u01/app/oracle/19.0.0/db/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/19.0.0/db

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

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.


创建磁盘组

[root@19c1 ~]# su - grid
Last login: Tue Mar 17 10:30:57 CST 2020
[grid@19c1 ~]$ export DISPLAY=10.138.130.242:0.0
[grid@19c1 ~]$ asmca



创建数据库hy

[root@19c1 ~]# xhost +
access control disabled, clients can connect from any host
[root@19c1 ~]# su - oracle
Last login: Mon Mar 16 23:09:23 CST 2020
[oracle@19c1 ~]$ export DISPLAY=10.138.130.242:0.0
[oracle@19c1 ~]$ dbca
 
















检查集群信息

[grid@jytest1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.CRS.dg
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.DATA.dg
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.TEST.dg
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.chad
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.net1.network
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.ons
               ONLINE  ONLINE       jytest1                  STABLE
               ONLINE  ONLINE       jytest2                  STABLE
ora.proxy_advm
               OFFLINE OFFLINE      jytest1                  STABLE
               OFFLINE OFFLINE      jytest2                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       jytest2                  STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       jytest1                  STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       jytest1                  STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       jytest1                  169.254.123.145 88.8
                                                             8.88.1,STABLE
ora.asm
      1        ONLINE  ONLINE       jytest1                  Started,STABLE
      2        ONLINE  ONLINE       jytest2                  Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       jytest1                  STABLE
ora.jy.db
      1        ONLINE  ONLINE       jytest1                  Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db,STABLE
      2        ONLINE  ONLINE       jytest2                  Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db,STABLE
ora.jytest1.vip
      1        ONLINE  ONLINE       jytest1                  STABLE
ora.jytest2.vip
      1        ONLINE  ONLINE       jytest2                  STABLE
ora.mgmtdb
      1        ONLINE  ONLINE       jytest1                  Open,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       jytest1                  STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       jytest2                  STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       jytest1                  STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       jytest1                  STABLE
--------------------------------------------------------------------------------

到此19C RAC for Oracle Linux 7.1的安装完成!

]]>
http://www.jydba.net/index.php/archives/2881/feed 0
Oracle Linux Install Oracle 18C RAC http://www.jydba.net/index.php/archives/2826 http://www.jydba.net/index.php/archives/2826#respond Tue, 17 Mar 2020 04:32:32 +0000 http://www.jydba.net/?p=2826 安装环境为Oracle Linux 7.1,Oracle版本为18C,下面是RAC环境的IP配置

ip地址          主机名                   类型     解析方式 
10.10.10.171  18c1                    public   DNS或etc/hosts 
10.10.10.172  18c2                    public   DNS或etc/hosts 
88.88.87.1    18c1-priv               private  DNS或etc/hosts 
88.88.87.2    18c2-priv               private  DNS或etc/hosts 
10.10.10.175  18c1-vip                virtual  DNS或etc/hosts 
10.10.10.176  18c2-vip                virtual  DNS或etc/hosts
10.10.10.177  jycs-scan               scan     DNS或etc/hosts
10.10.10.178  jycs-scan               scan     DNS或etc/hosts
10.10.10.179  jycs-scan               scan     DNS或etc/hosts

[root@localhost soft]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.171 18c1
10.10.10.172 18c2
88.88.87.1 18c1-priv
88.88.87.2 18c2-priv
10.10.10.175 18c1-vip
10.10.10.176 18c2-vip

10.10.10.177 jycs-scan
10.10.10.178 jycs-scan
10.10.10.179 jycs-scan

[root@localhost ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.10.10.171 18c1
10.10.10.172 18c2
88.88.87.1 18c1-priv
88.88.87.2 18c2-priv
10.10.10.175 18c1-vip
10.10.10.176 18c2-vip

10.10.10.177 jycs-scan
10.10.10.178 jycs-scan
10.10.10.179 jycs-scan

创建用户组

[root@jytest1 ~]# groupadd -g 1006 asmadmin
[root@jytest1 ~]# groupadd -g 1007 asmdba
[root@jytest1 ~]# groupadd -g 1008 asmoper
[root@jytest1 ~]# groupadd -g 1009 dba
[root@jytest1 ~]# groupadd -g 1010 oper
[root@jytest1 ~]# groupadd -g 1011 oinstall
[root@jytest1 ~]# groupadd -g 1012 backupdba
[root@jytest1 ~]# groupadd -g 1013 dgdba
[root@jytest1 ~]# groupadd -g 1014 kmdba
[root@jytest1 ~]# groupadd -g 1015 racdba


[root@jytest2 ~]# groupadd -g 1006 asmadmin
[root@jytest2 ~]# groupadd -g 1007 asmdba
[root@jytest2 ~]# groupadd -g 1008 asmoper
[root@jytest2 ~]# groupadd -g 1009 dba
[root@jytest2 ~]# groupadd -g 1010 oper
[root@jytest2 ~]# groupadd -g 1011 oinstall
[root@jytest2 ~]# groupadd -g 1012 backupdba
[root@jytest2 ~]# groupadd -g 1013 dgdba
[root@jytest2 ~]# groupadd -g 1014 kmdba
[root@jytest2 ~]# groupadd -g 1015 racdba

创建用户
[root@jytest1 ~]#useradd -u 1001 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper,asmadmin oracle
[root@jytest1 ~]#useradd -u 1002 -g oinstall -G asmadmin,asmdba,asmoper,dba grid

[root@jytest2 ~]#useradd -u 1001 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper,asmadmin oracle
[root@jytest2 ~]#useradd -u 1002 -g oinstall -G asmadmin,asmdba,asmoper,dba grid

[root@jytest1 /]# 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.
You have new mail in /var/spool/mail/root
[root@jytest1 /]# 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@jytest2 /]# 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@jytest2 /]# 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.

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

[root@18c1 rules.d]# 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=="36000c29b61b89a10988ac7ee8d332517", 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=="36000c29dfb622388fc0d35385109c4e9", RUN+="/bin/sh -c 'mknod /dev/asmdisk02 b  $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02'"

[root@18c2 rules.d]# 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=="36000c29b61b89a10988ac7ee8d332517", 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=="36000c29dfb622388fc0d35385109c4e9", RUN+="/bin/sh -c 'mknod /dev/asmdisk02 b  $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02'"
[root@18c1 rules.d]#  /sbin/udevadm trigger --type=devices --action=change
[root@18c2 ~]#  /sbin/udevadm trigger --type=devices --action=change

[root@18c1 rules.d]#  ls -lrt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 32 Mar 16 17:00 /dev/asmdisk01
brw-rw----. 1 grid asmadmin 8, 32 Mar 16 17:01 /dev/asmdisk02

[root@18c2 ~]#  ls -lrt /dev/asm*
brw-rw----. 1 grid asmadmin 8, 16 Mar 16 17:00 /dev/asmdisk01
brw-rw----. 1 grid asmadmin 8, 32 Mar 16 17:02 /dev/asmdisk02

以root用户创建“Oracle inventory 目录”

[root@18c1 rules.d]# mkdir -p /u01/app/oraInventory
[root@18c1 rules.d]# chown -R grid:oinstall /u01/app/oraInventory
[root@18c1 rules.d]# chmod -R 775 /u01/app/oraInventory

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

以root用户创建“Grid Infrastructure BASE 目录”

[root@18c1 rules.d]# mkdir -p /u01/app/grid
[root@18c1 rules.d]# chown -R grid:oinstall /u01/app/grid
[root@18c1 rules.d]# chmod -R 775 /u01/app/grid

[root@18c2 ~]# mkdir -p /u01/app/grid
[root@18c2 ~]# chown -R grid:oinstall /u01/app/grid
[root@18c2 ~]# chmod -R 775 /u01/app/grid

以root用户创建“Grid Infrastructure Home 目录”

[root@18c1 rules.d]# mkdir -p /u01/app/18.0.0/grid
[root@18c1 rules.d]# chown -R grid:oinstall /u01/app/18.0.0/grid
[root@18c1 rules.d]# chmod -R 775 /u01/app/18.0.0/grid

[root@18c2 ~]# mkdir -p /u01/app/18.0.0/grid
[root@18c2 ~]# chown -R grid:oinstall /u01/app/18.0.0/grid
[root@18c2 ~]# chmod -R 775 /u01/app/18.0.0/grid

以root用户创建“Oracle Base 目录”

[root@18c1 rules.d]#  mkdir -p /u01/app/oracle
[root@18c1 rules.d]#  chown -R oracle:oinstall /u01/app/oracle
[root@18c1 rules.d]# chmod -R 775 /u01/app/oracle

[root@18c2 ~]#  mkdir -p /u01/app/oracle
[root@18c2 ~]#  chown -R oracle:oinstall /u01/app/oracle
[root@18c2 ~]# chmod -R 775 /u01/app/oracle

以root用户创建“Oracle RDBMS Home 目录”

[root@18c1 rules.d]# mkdir -p /u01/app/oracle/18.0.0/db
[root@18c1 rules.d]# chown -R oracle:oinstall /u01/app/oracle/18.0.0/db
[root@18c1 rules.d]# chmod -R 775 /u01/app/oracle/18.0.0/db

[root@18c2 ~]# mkdir -p /u01/app/oracle/18.0.0/db
[root@18c2 ~]# chown -R oracle:oinstall /u01/app/oracle/18.0.0/db
[root@18c2 ~]# chmod -R 775 /u01/app/oracle/18.0.0/db

创建一个tmp目录

[root@18c1 /]# mkdir /u01/tmp
[root@18c1 /]# chmod a+wr /u01/tmp

[root@18c2 ~]# mkdir /u01/tmp
[root@18c2 ~]# chmod a+wr /u01/tmp

设置环境变量

[root@jytest1 ~]# su - 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.0.0/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
[root@jytest2 ~]# su - grid
[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.0.0/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

[root@18c1 /]# su - 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/18.0.0/db
export ORACLE_SID=jycs1
export ORACLE_UNQNAME=jycs
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

[root@18c2 ~]# su - oracle
[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/18.0.0/db
export ORACLE_SID=jycs2
export ORACLE_UNQNAME=jycs
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

修改内核参数编辑/etc/sysctl.conf文件

[root@18c1 /]# vi /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304



[root@18c1 /]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304

[root@18c2 ~]# vi /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304

~
[root@18c2 ~]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304

修改oarcle参数的shell限制,在所有节点的/etc/security/limits.conf文件中添加以下参数

grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
grid soft memlock 3145728
grid hard memlock 3145728

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 3145728
oracle hard memlock 3145728

修改shell的默认参数文件,在所有节点的/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


if [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

对C shell(csh or tcsh) 在所有节点的/etc/csh.login文件中增加以下代码

if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif

if ( $USER == "grid" ) then
limit maxproc 16384
limit descriptors 65536
endif

解压GI安装压缩包:

[grid@jytest1 soft]cd /soft/
[grid@18c1 soft]$ unzip LINUX.X64_180000_grid_home.zip -d /u01/app/18.0.0/grid

这里使用xshell与xmanager来执行安装

[root@18c1 ~]# xhost +
access control disabled, clients can connect from any host
[root@18c1 ~]# su - grid
Last login: Mon Mar 16 17:36:02 CST 2020 on pts/1
[grid@18c1 ~]$ cd /u01/app/18.0.0/grid
[grid@18c1 grid]$ export DISPLAY=10.138.130.242:0.0
[grid@18c1 grid]$ ./gridSetup.sh























以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@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@18c1 /]# ./u01/app/18.0.0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/18.0.0/grid

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


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/18.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/18c1/crsconfig/rootcrs_18c1_2020-03-16_07-10-52PM.log
2020/03/16 19:11:26 CLSRSC-594: Executing installation step 1 of 20: 'SetupTFA'.
2020/03/16 19:11:26 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.
2020/03/16 19:12:15 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2020/03/16 19:12:15 CLSRSC-594: Executing installation step 2 of 20: 'ValidateEnv'.
2020/03/16 19:12:15 CLSRSC-363: User ignored prerequisites during installation
2020/03/16 19:12:15 CLSRSC-594: Executing installation step 3 of 20: 'CheckFirstNode'.
2020/03/16 19:12:19 CLSRSC-594: Executing installation step 4 of 20: 'GenSiteGUIDs'.
2020/03/16 19:12:24 CLSRSC-594: Executing installation step 5 of 20: 'SaveParamFile'.
2020/03/16 19:12:41 CLSRSC-594: Executing installation step 6 of 20: 'SetupOSD'.
2020/03/16 19:12:41 CLSRSC-594: Executing installation step 7 of 20: 'CheckCRSConfig'.
2020/03/16 19:12:41 CLSRSC-594: Executing installation step 8 of 20: 'SetupLocalGPNP'.
2020/03/16 19:13:25 CLSRSC-594: Executing installation step 9 of 20: 'CreateRootCert'.
2020/03/16 19:13:35 CLSRSC-594: Executing installation step 10 of 20: 'ConfigOLR'.
2020/03/16 19:13:58 CLSRSC-594: Executing installation step 11 of 20: 'ConfigCHMOS'.
2020/03/16 19:13:58 CLSRSC-594: Executing installation step 12 of 20: 'CreateOHASD'.
2020/03/16 19:14:13 CLSRSC-594: Executing installation step 13 of 20: 'ConfigOHASD'.
2020/03/16 19:14:14 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2020/03/16 19:15:02 CLSRSC-594: Executing installation step 14 of 20: 'InstallAFD'.
2020/03/16 19:16:10 CLSRSC-594: Executing installation step 15 of 20: 'InstallACFS'.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '18c1'
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on '18c1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2020/03/16 19:16:55 CLSRSC-594: Executing installation step 16 of 20: 'InstallKA'.
2020/03/16 19:17:10 CLSRSC-594: Executing installation step 17 of 20: 'InitConfig'.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '18c1'
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on '18c1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
CRS-2672: Attempting to start 'ora.driver.afd' on '18c1'
CRS-2672: Attempting to start 'ora.evmd' on '18c1'
CRS-2672: Attempting to start 'ora.mdnsd' on '18c1'
CRS-2676: Start of 'ora.driver.afd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on '18c1'
CRS-2676: Start of 'ora.cssdmonitor' on '18c1' succeeded
CRS-2676: Start of 'ora.mdnsd' on '18c1' succeeded
CRS-2676: Start of 'ora.evmd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on '18c1'
CRS-2676: Start of 'ora.gpnpd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on '18c1'
CRS-2676: Start of 'ora.gipcd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on '18c1'
CRS-2672: Attempting to start 'ora.diskmon' on '18c1'
CRS-2676: Start of 'ora.diskmon' on '18c1' succeeded
CRS-2676: Start of 'ora.cssd' on '18c1' succeeded

[INFO] [DBT-30161] Disk label(s) created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-200316PM071759.log for details.
[INFO] [DBT-30001] Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-200316PM071759.log for details.


2020/03/16 19:19:59 CLSRSC-482: Running command: '/u01/app/18.0.0/grid/bin/ocrconfig -upgrade grid oinstall'
CRS-2672: Attempting to start 'ora.crf' on '18c1'
CRS-2672: Attempting to start 'ora.storage' on '18c1'
CRS-2676: Start of 'ora.storage' on '18c1' succeeded
CRS-2676: Start of 'ora.crf' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on '18c1'
CRS-2676: Start of 'ora.crsd' on '18c1' succeeded
CRS-4256: Updating the profile
Successful addition of voting disk b1f6f23bbaef4ff2bf3cdfdec8a72881.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   b1f6f23bbaef4ff2bf3cdfdec8a72881 (AFD:CRS1) [CRS]
Located 1 voting disk(s).
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '18c1'
CRS-2673: Attempting to stop 'ora.crsd' on '18c1'
CRS-2677: Stop of 'ora.crsd' on '18c1' succeeded
CRS-2673: Attempting to stop 'ora.storage' on '18c1'
CRS-2673: Attempting to stop 'ora.crf' on '18c1'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on '18c1'
CRS-2673: Attempting to stop 'ora.mdnsd' on '18c1'
CRS-2677: Stop of 'ora.crf' on '18c1' succeeded
CRS-2677: Stop of 'ora.storage' on '18c1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on '18c1'
CRS-2677: Stop of 'ora.drivers.acfs' on '18c1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on '18c1' succeeded
CRS-2677: Stop of 'ora.asm' on '18c1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on '18c1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on '18c1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on '18c1'
CRS-2673: Attempting to stop 'ora.evmd' on '18c1'
CRS-2677: Stop of 'ora.ctssd' on '18c1' succeeded
CRS-2677: Stop of 'ora.evmd' on '18c1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on '18c1'
CRS-2677: Stop of 'ora.cssd' on '18c1' succeeded
CRS-2673: Attempting to stop 'ora.driver.afd' on '18c1'
CRS-2673: Attempting to stop 'ora.gipcd' on '18c1'
CRS-2673: Attempting to stop 'ora.gpnpd' on '18c1'
CRS-2677: Stop of 'ora.driver.afd' on '18c1' succeeded
CRS-2677: Stop of 'ora.gpnpd' on '18c1' succeeded
CRS-2677: Stop of 'ora.gipcd' on '18c1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on '18c1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
2020/03/16 19:22:35 CLSRSC-594: Executing installation step 18 of 20: 'StartCluster'.
CRS-4123: Starting Oracle High Availability Services-managed resources
CRS-2672: Attempting to start 'ora.evmd' on '18c1'
CRS-2672: Attempting to start 'ora.mdnsd' on '18c1'
CRS-2676: Start of 'ora.mdnsd' on '18c1' succeeded
CRS-2676: Start of 'ora.evmd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on '18c1'
CRS-2676: Start of 'ora.gpnpd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on '18c1'
CRS-2676: Start of 'ora.gipcd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on '18c1'
CRS-2676: Start of 'ora.cssdmonitor' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.crf' on '18c1'
CRS-2672: Attempting to start 'ora.cssd' on '18c1'
CRS-2672: Attempting to start 'ora.diskmon' on '18c1'
CRS-2676: Start of 'ora.diskmon' on '18c1' succeeded
CRS-2676: Start of 'ora.crf' on '18c1' succeeded
CRS-2676: Start of 'ora.cssd' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on '18c1'
CRS-2672: Attempting to start 'ora.ctssd' on '18c1'
CRS-2676: Start of 'ora.ctssd' on '18c1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.asm' on '18c1'
CRS-2676: Start of 'ora.asm' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.storage' on '18c1'
CRS-2676: Start of 'ora.storage' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on '18c1'
CRS-2676: Start of 'ora.crsd' on '18c1' succeeded
CRS-6023: Starting Oracle Cluster Ready Services-managed resources
CRS-6017: Processing resource auto-start for servers: 18c1
CRS-6016: Resource auto-start has completed for server 18c1
CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources
CRS-4123: Oracle High Availability Services has been started.
2020/03/16 19:24:23 CLSRSC-343: Successfully started Oracle Clusterware stack
2020/03/16 19:24:23 CLSRSC-594: Executing installation step 19 of 20: 'ConfigNode'.
CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on '18c1'
CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.asm' on '18c1'
CRS-2676: Start of 'ora.asm' on '18c1' succeeded
CRS-2672: Attempting to start 'ora.CRS.dg' on '18c1'
CRS-2676: Start of 'ora.CRS.dg' on '18c1' succeeded
2020/03/16 19:27:00 CLSRSC-594: Executing installation step 20 of 20: 'PostConfig'.
2020/03/16 19:29:03 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded 

[root@18c2 /]# ./u01/app/18.0.0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/18.0.0/grid

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


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

检查集群信息

[root@18c1 /]# su - grid
Last login: Mon Mar 16 19:40:16 CST 2020
[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.CRS.GHCHKPT.advm
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.CRS.dg
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.crs.ghchkpt.acfs
               OFFLINE OFFLINE      18c1                     volume /opt/oracle/r
                                                             hp_images/chkbase is
                                                             unmounted,STABLE
               OFFLINE OFFLINE      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.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
--------------------------------------------------------------------------------


安装数据库软件

[oracle@18c1 soft]$ unzip LINUX.X64_180000_db_home.zip -d /u01/app/oracle/18.0.0/db 

[root@18c1 ~]# xhost +
access control disabled, clients can connect from any host
[root@18c1 ~]# su - oracle
Last login: Mon Mar 16 17:20:14 CST 2020 on pts/0
[oracle@18c1 ~]$ cd  $ORACLE_HOME
[oracle@18c1  db]$ export DISPLAY=10.138.130.242:0.0
[oracle@18c1 db]$ ./runInstaller 











以 root用户在所有节点上执行以下脚本,先在主节点执行

[root@18c1 /]# ./u01/app/oracle/18.0.0/db/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/18.0.0/db

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

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

[root@18c2 /]# ./u01/app/oracle/18.0.0/db/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/18.0.0/db

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

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

创建数据库jycs

[oracle@jytest1 database]$ dbca
















检查数据库配置信息

[grid@18c2 18.0.0]$ 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.CRS.GHCHKPT.advm
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.CRS.dg
               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.chad
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       18c2                     STABLE
ora.crs.ghchkpt.acfs
               OFFLINE OFFLINE      18c1                     STABLE
               OFFLINE OFFLINE      18c2                     STABLE
ora.helper
               OFFLINE OFFLINE      18c1                     IDLE,STABLE
               OFFLINE OFFLINE      18c2                     IDLE,STABLE
ora.net1.network
               ONLINE  ONLINE       18c1                     STABLE
               ONLINE  ONLINE       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        ONLINE  ONLINE       18c1                     169.254.11.99 88.88.
                                                             87.1,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.jycs.db
      1        ONLINE  ONLINE       18c1                     Open,HOME=/u01/app/o
                                                             racle/18.0.0/db,STAB
                                                             LE
      2        ONLINE  ONLINE       18c2                     Open,HOME=/u01/app/o
                                                             racle/18.0.0/db,STAB
                                                             LE
ora.mgmtdb
      1        ONLINE  ONLINE       18c1                     Open,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
--------------------------------------------------------------------------------

到此18C RAC for Oracle Linux 7.1的安装完成!

]]>
http://www.jydba.net/index.php/archives/2826/feed 0
私有IP丢失造成Oracle 12C RAC集群节点不能启动 http://www.jydba.net/index.php/archives/2806 http://www.jydba.net/index.php/archives/2806#respond Thu, 20 Feb 2020 11:30:43 +0000 http://www.jydba.net/?p=2806 某生产环境Oracle Linux 7.1,Oracle 12C RAC显示节点1的集群资源没有启动,信息如下:

[grid@cs2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       cs2                      STABLE
ora.CRS.dg
               ONLINE  ONLINE       cs2                      STABLE
ora.DATA.dg
               ONLINE  ONLINE       cs2                      STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       cs2                      STABLE
ora.chad
               ONLINE  OFFLINE      cs2                      STABLE
ora.net1.network
               ONLINE  ONLINE       cs2                      STABLE
ora.ons
               ONLINE  OFFLINE      cs2                      STABLE
ora.proxy_advm
               OFFLINE OFFLINE      cs2                      STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       cs2                      STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       cs2                      STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       cs2                      STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       cs2                      169.254.255.92 88.88
                                                             .88.191,STABLE
ora.asm
      1        ONLINE  OFFLINE                               STABLE
      2        ONLINE  ONLINE       cs2                      Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cs.db
      1        ONLINE  OFFLINE                               STABLE
      2        ONLINE  OFFLINE                               Instance Shutdown,ST
                                                             ABLE
ora.cs1.vip
      1        ONLINE  INTERMEDIATE cs2                      FAILED OVER,STABLE
ora.cs2.vip
      1        ONLINE  ONLINE       cs2                      STABLE
ora.cvu
      1        ONLINE  ONLINE       cs2                      STABLE
ora.gns
      1        ONLINE  OFFLINE                               STABLE
ora.gns.vip
      1        ONLINE  OFFLINE                               STABLE
ora.mgmtdb
      1        ONLINE  OFFLINE                               Instance Shutdown,ST
                                                             ABLE
ora.qosmserver
      1        ONLINE  ONLINE       cs2                      STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       cs2                      STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       cs2                      STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       cs2                      STABLE
--------------------------------------------------------------------------------

如果查看节点1上的alert.log文件,信息如下:

[root@cs1 soft]# tail -100 /u01/app/grid/diag/crs/cs1/crs/trace/alert.log

2020-01-14 20:45:50.226 [CVUD(2366CRS-10051: CVU found following errors with Clusterware setup : PRVE-3191 :
(DESCRIPTION = (LOAD_BALANCE=on)  (ADDRESS = (PROTOCOL = TCP)(HOST = cs-cluster-scan.cs-cluster.jy.net)(PORT = 1521)) (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = cs)))
Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
 

2020-02-17 14:49:28.563 [ORAROOTAGENT(15500)]CRS-5822: Agent '/u01/app/product/12.2.0/crs/bin/orarootagent_root' disconnected from server. Details at (:CRSAGF00117:) {0:5:63832} in /u01/app/grid/diag/crs/cs1/crs/trace/crsd_orarootagent_root.trc.
2020-02-17 14:49:28.584 [ORAAGENT(15466)]CRS-5822: Agent '/u01/app/product/12.2.0/crs/bin/oraagent_grid' disconnected from server. Details at (:CRSAGF00117:) {0:1:36} in /u01/app/grid/diag/crs/cs1/crs/trace/crsd_oraagent_grid.trc.
2020-02-17 14:49:29.607 [GPNPD(3293)]CRS-2329: GPNPD on node cs1 shut down. 
2020-02-17 14:49:30.123 [OSYSMOND(6077)]CRS-8504: Oracle Clusterware OSYSMOND process with operating system process ID 6077 is exiting
2020-02-17 14:49:31.377 [MDNSD(3254)]CRS-5602: mDNS service stopping by request.
2020-02-17 14:49:31.747 [MDNSD(3254)]CRS-8504: Oracle Clusterware MDNSD process with operating system process ID 3254 is exiting
2020-02-17 14:49:46.650 [OCTSSD(5883)]CRS-2405: The Cluster Time Synchronization Service on host cs1 is shutdown by user
2020-02-17 14:49:46.651 [OCTSSD(5883)]CRS-8504: Oracle Clusterware OCTSSD process with operating system process ID 5883 is exiting
2020-02-17 14:49:47.651 [OCSSD(3616)]CRS-1603: CSSD on node cs1 has been shut down.
2020-02-17 14:49:47.958 [OCSSD(3616)]CRS-1660: The CSS daemon shutdown has completed
2020-02-17 14:49:47.959 [OCSSD(3616)]CRS-8504: Oracle Clusterware OCSSD process with operating system process ID 3616 is exiting
2020-02-17 14:49:49.726 [ORAAGENT(3235)]CRS-5822: Agent '/u01/app/product/12.2.0/crs/bin/oraagent_grid' disconnected from server. Details at (:CRSAGF00117:) {0:9:818} in /u01/app/grid/diag/crs/cs1/crs/trace/ohasd_oraagent_grid.trc.
2020-02-17 14:49:49.727 [ORAROOTAGENT(3029)]CRS-5822: Agent '/u01/app/product/12.2.0/crs/bin/orarootagent_root' disconnected from server. Details at (:CRSAGF00117:) {0:1:21} in /u01/app/grid/diag/crs/cs1/crs/trace/ohasd_orarootagent_root.trc.

根据上面的错误信息提示查看crsd_oraagent_grid.trc跟踪文件:

[root@cs1 ~]# more /u01/app/grid/diag/crs/cs1/crs/trace/crsd_oraagent_grid.trc
Trace file /u01/app/grid/diag/crs/cs1/crs/trace/crsd_oraagent_grid.trc
Oracle Database 12c Clusterware Release 12.2.0.1.0 - Production Copyright 1996, 2016 Oracle. All rights reserved.

*** TRACE CONTINUED FROM FILE /u01/app/grid/diag/crs/cs1/crs/trace/crsd_oraagent_grid_910.trc ***

2020-02-17 14:39:22.129 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] LsnrAgent::regEndpoint 110 reset regEndPointDone:0
2020-02-17 14:39:22.129 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] generateEndPointStrings:generate endpoints
2020-02-17 14:39:22.129 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.129 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.129 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.129 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.129 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] generateEndPointStrings:No IP matching the subnet 88.88.88.0
2020-02-17 14:39:22.130 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] Ocr Context init default level 1814629536
2020-02-17 14:39:22.133 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] Agent::getDeploymentPlatformId return 
2020-02-17 14:39:22.133 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] LsnrAgent::generateEndPoints 000 entry {nonPriv
2020-02-17 14:39:22.133 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] LsnrAgent::generateEndPoints 000 entry { lsnrResName: endpAttr:TCP:1526 type:4
2020-02-17 14:39:22.133 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] LsnrAgent::generateEndPoints 040 Listener ResName:
2020-02-17 14:39:22.133 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] LsnrAgent::removeDuplicates 
2020-02-17 14:39:22.133 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] LsnrAgent::generateEndPoints 999 exit nonPriv}
2020-02-17 14:39:22.133 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] LsnrAgent::regEndpoint 200 endpStrings empty
2020-02-17 14:39:22.134 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] AsmLsnrAgent::init
2020-02-17 14:39:22.154 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.154 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.154 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.154 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] VendorType=0
2020-02-17 14:39:22.154 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] Cannot find an IP address matching the subnet 88.88.88.0
2020-02-17 14:39:22.154 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] Ocr Context init default level 1814629536
2020-02-17 14:39:22.157 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] Agent::getDeploymentPlatformId return 
2020-02-17 14:39:22.158 : CLSCEVT:2462013184: (:CLSCE0028:)clsce_unsubscribe 0x7f725c004510 successfully unsubscribed : 974833
2020-02-17 14:39:22.158 : USRTHRD:2462013184: {0:1:18} WorkerThread::removeWorker total workers: 2
2020-02-17 14:39:22.158 : USRTHRD:2462013184: {0:1:18} Worker::schedule adding worker 'ReconnSub-LsnrAgentSub-ASMNET1LSNR_ASM' to thread 'ReconnectingSubscribers'
2020-02-17 14:39:22.158 : USRTHRD:2462013184: {0:1:18} WorkerThread::addWorker total workers: 3
2020-02-17 14:39:22.158 :CLSDYNAM:2462013184: [ora.ASMNET1LSNR_ASM.lsnr]{0:1:18} [check] Skipping CSS Initialization for rebootless recovery
2020-02-17 14:39:22.159 : CLSCEVT:2478823168: clsce_subscribe 0x7f72600d06b0 filter='(^CRS_RESOURCE_PROFILE_CHANGE.*RESOURCE_CLASS='(scan_vip|vip)')|(^CRS_RESOURCE_PROFILE_CHANGE.*TYPE='ora\.network\.type')', flags=1, handler=0xc6ad0c, 
arg=0x7f726016de10

从上面的错误信息中可以找到Cannot find an IP address matching the subnet 88.88.88.0,这说明私有IP丢失了。

如是查看网络IP地址
节点2私有IP正常

[grid@cs2 ~]$ ifconfig -a
ens160: flags=4163  mtu 1500
        inet 10.13.13.191  netmask 255.255.255.0  broadcast 10.13.13.255
        inet6 fe80::250:56ff:fea0:92af  prefixlen 64  scopeid 0x20
        ether 00:50:56:a0:92:af  txqueuelen 1000  (Ethernet)
        RX packets 127560233  bytes 10186683662 (9.4 GiB)
        RX errors 0  dropped 353  overruns 0  frame 0
        TX packets 18954431  bytes 1554204413 (1.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens160:1: flags=4163  mtu 1500
        inet 10.13.13.130  netmask 255.255.255.0  broadcast 10.13.13.255
        ether 00:50:56:a0:92:af  txqueuelen 1000  (Ethernet)

ens160:2: flags=4163  mtu 1500
        inet 10.13.13.147  netmask 255.255.255.0  broadcast 10.13.13.255
        ether 00:50:56:a0:92:af  txqueuelen 1000  (Ethernet)

ens160:3: flags=4163  mtu 1500
        inet 10.13.13.141  netmask 255.255.255.0  broadcast 10.13.13.255
        ether 00:50:56:a0:92:af  txqueuelen 1000  (Ethernet)

ens160:4: flags=4163  mtu 1500
        inet 10.13.13.138  netmask 255.255.255.0  broadcast 10.13.13.255
        ether 00:50:56:a0:92:af  txqueuelen 1000  (Ethernet)

ens160:5: flags=4163  mtu 1500
        inet 10.13.13.137  netmask 255.255.255.0  broadcast 10.13.13.255
        ether 00:50:56:a0:92:af  txqueuelen 1000  (Ethernet)

ens160:6: flags=4163  mtu 1500
        inet 10.13.13.136  netmask 255.255.255.0  broadcast 10.13.13.255
        ether 00:50:56:a0:92:af  txqueuelen 1000  (Ethernet)

ens192: flags=4163  mtu 1500
        inet 88.88.88.191  netmask 255.255.255.0  broadcast 88.88.88.255
        inet6 fe80::250:56ff:fea0:a05c  prefixlen 64  scopeid 0x20
        ether 00:50:56:a0:a0:5c  txqueuelen 1000  (Ethernet)
        RX packets 294716840  bytes 215309349272 (200.5 GiB)
        RX errors 0  dropped 355  overruns 0  frame 0
        TX packets 63703465  bytes 363393728693 (338.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens192:1: flags=4163  mtu 1500
        inet 169.254.255.92  netmask 255.255.0.0  broadcast 169.254.255.255
        ether 00:50:56:a0:a0:5c  txqueuelen 1000  (Ethernet)

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 90029207  bytes 223833448058 (208.4 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 90029207  bytes 223833448058 (208.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:d0:6e:0b  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098  mtu 1500
        ether 52:54:00:d0:6e:0b  txqueuelen 500  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


[grid@cs2 ~]$ cat /etc/hosts

127.0.0.1      localhost
10.13.13.190  cs1
10.13.13.191  cs2

#10.13.13.192 cs1-vip.jy.net cs1-vip
#10.13.13.193 cs2-vip.jy.net cs2-vip

88.88.88.190   cs1-priv.jy.net cs1-priv
88.88.88.191   cs2-priv.jy.net cs2-priv


10.13.13.141 cs-cluster-scan 
10.13.13.142 cs-cluster-scan 
10.13.13.143 cs-cluster-scan 

节点1的私有IP丢失

[root@cs1 ~]# ifconfig -a
ens160: flags=4163  mtu 1500
        inet 10.13.13.190  netmask 255.255.255.0  broadcast 10.13.13.255
        inet6 fe80::250:56ff:fea0:4e69  prefixlen 64  scopeid 0x20
        inet6 2018::2  prefixlen 64  scopeid 0x0
        ether 00:50:56:a0:4e:69  txqueuelen 1000  (Ethernet)
        RX packets 53266410  bytes 3937179306 (3.6 GiB)
        RX errors 0  dropped 143  overruns 0  frame 0
        TX packets 2988621  bytes 284679938 (271.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens192: flags=4163  mtu 1500
        inet6 fe80::250:56ff:fea0:17dc  prefixlen 64  scopeid 0x20
        ether 00:50:56:a0:17:dc  txqueuelen 1000  (Ethernet)
        RX packets 70361859  bytes 5602168856 (5.2 GiB)
        RX errors 0  dropped 141  overruns 0  frame 0
        TX packets 24902418  bytes 195063342601 (181.6 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 30235303  bytes 10958756943 (10.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30235303  bytes 10958756943 (10.2 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:d0:6e:0b  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098  mtu 1500
        ether 52:54:00:d0:6e:0b  txqueuelen 500  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



设置私有IP

[root@cs1 network-scripts]# cat ifcfg-Ethernet_connection_ens192
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=ens192
UUID=8ec45d90-c1fb-4924-84a0-72f58fc9b82f
DEVICE=ens192
ONBOOT=yes
IPADDR=88.88.88.190
PREFIX=24
NETMASK=255.255.255.0

[root@cs1 network-scripts]# ifconfig -a
ens160: flags=4163  mtu 1500
        inet 10.138.130.190  netmask 255.255.255.0  broadcast 10.138.130.255
        inet6 fe80::250:56ff:fea0:4e69  prefixlen 64  scopeid 0x20
        inet6 2018::2  prefixlen 64  scopeid 0x0
        ether 00:50:56:a0:4e:69  txqueuelen 1000  (Ethernet)
        RX packets 53277081  bytes 3937945677 (3.6 GiB)
        RX errors 0  dropped 143  overruns 0  frame 0
        TX packets 2989099  bytes 284806540 (271.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens192: flags=4163  mtu 1500
        inet 88.88.88.190  netmask 255.255.255.0  broadcast 88.88.88.255
        inet6 fe80::250:56ff:fea0:17dc  prefixlen 64  scopeid 0x20
        ether 00:50:56:a0:17:dc  txqueuelen 1000  (Ethernet)
        RX packets 70371906  bytes 5602881459 (5.2 GiB)
        RX errors 0  dropped 141  overruns 0  frame 0
        TX packets 24902428  bytes 195063343317 (181.6 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 30236949  bytes 10959017396 (10.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30236949  bytes 10959017396 (10.2 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:d0:6e:0b  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098  mtu 1500
        ether 52:54:00:d0:6e:0b  txqueuelen 500  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@cs1 ~]# crsctl stop crs -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘cs2’
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘cs2’
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘cs2’
CRS-2673: Attempting to stop ‘ora.crf’ on ‘cs2’
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘cs2’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘cs2’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘cs2’
CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘cs2’
CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘cs2’ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘cs2’ succeeded
CRS-2677: Stop of ‘ora.crf’ on ‘cs2’ succeeded
CRS-2677: Stop of ‘ora.gpnpd’ on ‘cs2’ succeeded
CRS-2677: Stop of ‘ora.evmd’ on ‘cs2’ succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ‘cs2’ succeeded
CRS-2677: Stop of ‘ora.asm’ on ‘cs2’ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘cs2’
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘cs2’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘cs2’
CRS-2677: Stop of ‘ora.cssd’ on ‘cs2’ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘cs2’
CRS-2673: Attempting to stop ‘ora.driver.afd’ on ‘cs2’
CRS-2677: Stop of ‘ora.driver.afd’ on ‘cs2’ succeeded
CRS-2677: Stop of ‘ora.gipcd’ on ‘cs2’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘cs2’ has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@cs1 ~]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

手动启动节点1的集群软件

[root@cs1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       cs1                      STABLE
               ONLINE  ONLINE       cs2                      STABLE
ora.CRS.dg
               ONLINE  ONLINE       cs1                      STABLE
               ONLINE  ONLINE       cs2                      STABLE
ora.DATA.dg
               ONLINE  ONLINE       cs1                      STABLE
               ONLINE  ONLINE       cs2                      STABLE
ora.DN.dg
               OFFLINE OFFLINE      cs1                      STABLE
               OFFLINE OFFLINE      cs2                      STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       cs1                      STABLE
               ONLINE  ONLINE       cs2                      STABLE
ora.chad
               ONLINE  ONLINE       cs1                      STABLE
               ONLINE  ONLINE       cs2                      STABLE
ora.net1.network
               ONLINE  ONLINE       cs1                      STABLE
               ONLINE  ONLINE       cs2                      STABLE
ora.ons
               ONLINE  ONLINE       cs1                      STABLE
               ONLINE  ONLINE       cs2                      STABLE
ora.proxy_advm
               OFFLINE OFFLINE      cs1                      STABLE
               OFFLINE OFFLINE      cs2                      STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       cs1                      STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       cs2                      STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       cs1                      STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       cs1                      169.254.207.24 88.88
                                                             .88.190,STABLE
ora.asm
      1        ONLINE  ONLINE       cs1                      Started,STABLE
      2        ONLINE  ONLINE       cs2                      Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cs.db
      1        ONLINE  ONLINE       cs1                      Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db,STABLE
      2        ONLINE  ONLINE       cs2                      Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db,STABLE
ora.cs1.vip
      1        ONLINE  ONLINE       cs1                      STABLE
ora.cs2.vip
      1        ONLINE  ONLINE       cs2                      STABLE
ora.cvu
      1        ONLINE  ONLINE       cs1                      STABLE
ora.gns
      1        ONLINE  ONLINE       cs2                      STABLE
ora.gns.vip
      1        ONLINE  ONLINE       cs2                      STABLE
ora.mgmtdb
      1        ONLINE  OFFLINE      cs1                      Open,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       cs1                      STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       cs1                      STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       cs2                      STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       cs1                      STABLE
--------------------------------------------------------------------------------

到此恢复正常状态。

]]>
http://www.jydba.net/index.php/archives/2806/feed 0
PLSQL通过Oracle 11g客户端连接Oracle 12c服务器错误 ORA-28040 http://www.jydba.net/index.php/archives/2797 http://www.jydba.net/index.php/archives/2797#comments Mon, 17 Feb 2020 02:32:22 +0000 http://www.jydba.net/?p=2797 PLSQL通过Oracle 11g客户端连接Oracle 12c服务器错误 ORA-28040
环境描述:
oracle服务器端版本:oracle 12.2.0.1.0
oracle客户端版本:oracle 11.2.0.1.0
PLSQL是11.4

因为PLSQL连接数据库也是要通过Oracle客户端,那么使用11g客户端访问oracle 12c应该也会得到如下错误:

C:\Users\Administrator>sqlplus sys/abcd@shardcat as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 20 22:22:07 2014

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

ERROR:
ORA-28040: No matching authentication protocol

查看关于错误的详细描述:

[oracle@shard1 admin]$ oerr ora 28040
28040, 0000, "No matching authentication protocol"
// *Cause:  There was no acceptable authentication protocol for
//          either client or server.
// *Action: The administrator should set the values of the
//          SQLNET.ALLOWED_LOGON_VERSION_SERVER and
//          SQLNET.ALLOWED_LOGON_VERSION_CLIENT parameters, on both the
//          client and on the server, to values that match the minimum
//          version software supported in the system.
//          This error is also raised when the client is authenticating to
//          a user account which was created without a verifier suitable for
//          the client software version. In this situation, that account's
//          password must be reset, in order for the required verifier to
//          be generated and allow authentication to proceed successfully.

在服务器端查看表:dba_users,PASSWORD_VERSIONS 列是:11G 12C

SQL> select username, account_status,password_versions from dba_users where account_status='OPEN';

USERNAME                       ACCOUNT_STATUS                                                   PASSWORD_VERSIONS
------------------------------ ---------------------------------------------------------------- ----------------------------------
SYS                            OPEN                                                             11G 12C
SYSTEM                         OPEN                                                             11G 12C
GSMCATUSER                     OPEN                                                             11G 12C
JY                             OPEN                                                             11G 12C
MYGDSADMIN                     OPEN                                                             11G 12C
APP_SCHEMA                     OPEN                                                             11G 12C

6 rows selected.

服务器端:修改 sqlnet.ora 配置:(配置修改后,不需要重启oracle服务器)我这里是新创建的sqlnet.ora,因为原来没有创建

[oracle@shard1 admin]$ ls -lrt
总用量 12
-rw-r--r--. 1 oracle oinstall 1441 8月  28 2015 shrept.lst
drwxr-xr-x. 2 oracle oinstall   61 10月 12 2017 samples
-rw-r-----. 1 oracle oinstall  960 1月  18 2018 tnsnames.ora
-rw-r--r--  1 oracle oinstall  504 2月  17 12:58 listener.ora
[oracle@shard1 admin]$ vi sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=11

客户端:再次尝试连接,提示用户名密码错误:

C:\Users\Administrator>sqlplus sys/abcd@shardcat as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 20 22:16:06 2014

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

ERROR:
ORA-01017: invalid username/password; logon denied

修改服务器端 sqlnet.ora 后,需要重新登录sqlplus,再修改用户密码,否则修改用户密码后,标记的密码版本仍然为11G 12C;重新登录sqlplus,修改scott用户密码,并查看 PASSWORD_VERSIONS,多了一个 10G

[oracle@shard1 ~]$ sqlplus sys/abcd@shardcat as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Feb 17 13:07:28 2020

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> alter user sys identified by "abcd";

User altered.


SQL> select username, account_status,password_versions from dba_users where account_status='OPEN';

USERNAME                       ACCOUNT_STATUS                                                   PASSWORD_VERSIONS
------------------------------ ---------------------------------------------------------------- ----------------------------------
SYS                            OPEN                                                             10G 11G 12C
SYSTEM                         OPEN                                                             11G 12C
GSMCATUSER                     OPEN                                                             11G 12C
JY                             OPEN                                                             11G 12C
MYGDSADMIN                     OPEN                                                             11G 12C
APP_SCHEMA                     OPEN                                                             11G 12C

6 rows selected.

客户端:再次尝试登录oracle 12c,成功:

C:\Users\Administrator>sqlplus sys/abcd@shardcat as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 20 22:22:39 2014

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>

总结:oracle11g 客户端连接 oracle 12c服务器,需要在服务器端配置 sqlnet.ora,并重新修改用户密码。

]]>
http://www.jydba.net/index.php/archives/2797/feed 1
Oracle 12C Formatted Block Dump http://www.jydba.net/index.php/archives/2782 http://www.jydba.net/index.php/archives/2782#respond Fri, 07 Feb 2020 08:06:38 +0000 http://www.jydba.net/?p=2782 Oracle 12C Formatted Block Dump
.可以从RDBMS中dump数据块
.在用户dump目录中会生成一个跟踪文件包含dump信息

对7号文件中的135号数据块执行dump

SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/shardcat/shardcat/trace/shardcat_ora_13182.trc
SQL> alter system dump datafile 7 block 135;

System altered.

对于任何数据块dump都有一个数据块头信息。它决定了剩余dump的格式。在任何Oracle块dump的头部应该可以看到块头信息:
Rdba:数据块的相对DBA
Scn:SCN序列号
Seq:序列号:
SEQ->0 /* non-logged changes – do not advance seq# */
SEQ->(UB1MAXVAL-1) /* maximum possible sequence number */
SEQ->(UB1MAXVAL) /* seq# to indicate a block is corrupt, equal to FF */

Flg: Flag(在kcbh.h中定义)
Tail:一致性数据用来验证数据块的开始与结束是否是相同版本(它由SCNBase的低阶两字节加上数据块类型加上SCN的序列号)
Frmt:数据块格式:在Oracle 12c中是2
Chkval数据块的选项检查值:如果db_block_checksum=true
Type:数据块类型(在kcb.h中定义)
Rdba:相对数据块地址
Seg/Obj:Seg/Obj ID dump输出的Seg/Obj为0x1af27

SQL> select to_number('1af27','xxxxxx') from dual;

TO_NUMBER('1AF27','XXXXXX')
---------------------------
                     110375

SQL> select object_id,object_name from dba_objects where owner='JY' and object_name='T1';

 OBJECT_ID OBJECT_NAME
---------- ------------------------------
    110375 T1

Csc:最近数据块清除
itc: itl插槽数量
Flg: E
Typ: 1=DATA;2=INDEX
Itl:相关事务列表索引(ITLs由initrans和maxtrans来决定)
Xid:事务ID(UndoSeg.Slot.Wrap)
Uba:Undo段地址(UndoDBA.SeqNo.RecordNo)
Flg:C=Committed;U=Commit Upper Bound;T=Active at CSC;B=Rollback of this UBA gives before image of the ITL.
Lck:这个事务所影响的行数
Scn/Fsc:Scn=提交事务的SCN号;Fsc=Free space credit(bytes)
例如:

*** 2020-02-07T14:35:53.082746+08:00
Start dump data blocks tsn: 4 file#:7 minblk 135 maxblk 135
Block dump from cache:
Dump of buffer cache at level 4 for pdb=0 tsn=4 rdba=29360263
Block dump from disk:
buffer tsn: 4 rdba: 0x01c00087 (7/135)
scn: 0x1e1174a seq: 0x09 flg: 0x06 tail: 0x174a0609
frmt: 0x02 chkval: 0xba74 type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
......省略......

Block header dump:  0x01c00087
 Object id on Block? Y
 seg/obj: 0x1af27  csc:  0x0000000001e11748  itc: 2  flg: E  typ: 1 - DATA
     brn: 0  bdba: 0x1c00080 ver: 0x01 opc: 0
     inc: 0  exflg: 0

 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x0008.003.00006d30  0x010001c2.2499.09  --U-    8  fsc 0x0000.01e1174a
0x02   0x0008.01b.00003a9a  0x010002b5.114f.20  C---    0  scn  0x0000000001286184
bdba: 0x01c00087

Tsiz:总的数据区域大小

SQL> select to_number('1f98','xxxxxx') from dual;

TO_NUMBER('1F98','XXXXXX')
--------------------------
                      8088

Hsiz:数据块头大小

SQL> select to_number('22','xxxxxx') from dual;

TO_NUMBER('22','XXXXXX')
------------------------
                      34

Pbl:持有数据块的缓存指针
Flag:N=pctfree hit(clusters);F=do not put on free list;K=flushable cluster keys
Ntab:表的数量(在clusters中大于1)
Nrow:行记录数
Frre:第一个可用行索引项;-1=没有添加
Fsbo:可用空间开始偏移量
Fseo:可用空间结束偏移量
Avsp:数据块中可用空间
Tosp:当所有事务提交后总的可用空间
Nrow:第一个表的行数
例如:

data_block_dump,data header at 0x7f799676f064
===============
tsiz: 0x1f98
hsiz: 0x22
pbl: 0x7f799676f064
     76543210
flag=--------
ntab=1
nrow=8
frre=-1
fsbo=0x22
fseo=0x1efa
avsp=0x1f29
tosp=0x1f2b
0xe:pti[0]      nrow=8  offs=0
0x12:pri[0]     offs=0x1f47
0x14:pri[1]     offs=0x1f3d
0x16:pri[2]     offs=0x1f33
0x18:pri[3]     offs=0x1f29
0x1a:pri[4]     offs=0x1f1f
0x1c:pri[5]     offs=0x1f15
0x1e:pri[6]     offs=0x1f08
0x20:pri[7]     offs=0x1efa

Oracle Formatted Block Dump: Data Layer
Tab: tab 0,row 0,offset
Cc:在这个行片段中的列数
Lb:锁字节:这个行被锁定的ITL条目
Fb:Flag字节
H=行片段头;K=集簇键;C=集簇表成员;D=删除的行记录;F=第一个数据片;L=最后数据片;P=紧接前一个数据片的第一个列
N=紧接下一个数据片的最后一个列
Tl:行大小(字节数加上数据)
Col:列数据
例如:

block_row_dump:
tab 0, row 0, @0x1f47
tl: 10 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 02
col  1: [ 3]  6d 5f 41
tab 0, row 1, @0x1f3d
tl: 10 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 03
col  1: [ 3]  6d 5f 42
tab 0, row 2, @0x1f33
tl: 10 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 04
col  1: [ 3]  6d 5f 43
tab 0, row 3, @0x1f29
tl: 10 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 05
col  1: [ 3]  6d 5f 44
tab 0, row 4, @0x1f1f
tl: 10 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 06
col  1: [ 3]  6d 5f 45
tab 0, row 5, @0x1f15
tl: 10 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 07
col  1: [ 3]  6d 5f 46
tab 0, row 6, @0x1f08
tl: 13 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 08
col  1: [ 6]  6d 5f 4a 59 48 59
tab 0, row 7, @0x1efa
tl: 14 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 09
col  1: [ 7]  6d 5f 4a 59 59 59 4c
end_of_block_dump
End dump data blocks tsn: 4 file#: 7 minblk 135 maxblk 135
]]>
http://www.jydba.net/index.php/archives/2782/feed 0
Oracle数据块格式 http://www.jydba.net/index.php/archives/2777 http://www.jydba.net/index.php/archives/2777#respond Fri, 17 Jan 2020 07:52:08 +0000 http://www.jydba.net/?p=2777 数据块结构
Oracle 数据块有三部分:
Cache layer
Transaction layer
Data layer

Oracle Data Block的结构简图如下,其中从Data header到Row Data部分合称Data Layer:

———————
– Cache Layer –
———————
– Transaction Layer –
———————
– Data Header –
———————
– Table Directory –
———————
– Row Directory –
———————
– Free Space –
———————
– Row Data –
———————
– Tailchk –
———————
下面将使用bbed工具来显示相关结构信息

BBED> map
 File: /u01/app/oracle/oradata/shardcat/users01.dbf (7)
 Block: 135                                   Dba:0x01c00087
------------------------------------------------------------
 KTB Data Block (Table/Cluster)

 struct kcbh, 20 bytes                      @0

 struct ktbbh, 72 bytes                     @20

 struct kdbh, 14 bytes                      @100

 struct kdbt[1], 4 bytes                    @114

 sb2 kdbr[8]                                @118

 ub1 freespace[7983]                        @134

 ub1 rowdata[71]                            @8117

 ub4 tailchk                                @8188

数据块组件
Oracle数据块三层C结构,它被映射到SGA kcbh(内核缓存数据块头)中的数据块。Cache Layer包含关于块格式,类型(数据,索引,头等)信息和序列数据。

BBED> p kcbh
struct kcbh, 20 bytes                       @0
   ub1 type_kcbh                            @0        0x06
   ub1 frmt_kcbh                            @1        0xa2
   ub2 wrp2_kcbh                            @2        0x0000
   ub4 rdba_kcbh                            @4        0x01c00087
   ub4 bas_kcbh                             @8        0x01286184
   ub2 wrp_kcbh                             @12       0x0000
   ub1 seq_kcbh                             @14       0x01
   ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)
   ub2 chkval_kcbh                          @16       0x0137
   ub2 spare3_kcbh                          @18       0x0000

Cache Layer:Block的第一部分,长度为20字节,内部数据结构名为kcbh,包括
type_kcbh:块类型(table/index,rollback segment,temporary segment等)
frmt_kcbh:块格式(v6,v7,v8)
rdba_kcbh:块地址DBA
bas_kcbh/wrp_kcbh:SCN
seq_kcbh:块的序列号
flg_kcbh:块的标志

事务层存储了关于数据块的事务信息
Transaction Layer:内部结构名ktbbh。分成两部分,第一部分为固定长度,长度为24字节,包含事务相关的一些基本信息。第二部分为可变长度,包含itl,长度根据itl条目的个数变化,每个itl长度为24字节,内部结构名ktbbhitl

BBED> p ktbbh
struct ktbbh, 72 bytes                      @20
   ub1 ktbbhtyp                             @20       0x01 (KDDBTDATA)
   union ktbbhsid, 4 bytes                  @24
      ub4 ktbbhsg1                          @24       0x0001af27
      ub4 ktbbhod1                          @24       0x0001af27
   struct ktbbhcsc, 8 bytes                 @28
      ub4 kscnbas                           @28       0x01286182
      ub2 kscnwrp                           @32       0x8000
      ub2 kscnwrp2                          @34       0x0000
   sb2 ktbbhict                             @36       7938
   ub1 ktbbhflg                             @38       0x32 (NONE)
   ub1 ktbbhfsl                             @39       0x00
   ub4 ktbbhfnx                             @40       0x01c00080
   struct ktbbhitl[0], 24 bytes             @44
      struct ktbitxid, 8 bytes              @44
         ub2 kxidusn                        @44       0x0006
         ub2 kxidslt                        @46       0x0012
         ub4 kxidsqn                        @48       0x000038f6
      struct ktbituba, 8 bytes              @52
         ub4 kubadba                        @52       0x010002d9
         ub2 kubaseq                        @56       0x10c9
         ub1 kubarec                        @58       0x09
      ub2 ktbitflg                          @60       0x8000 (KTBFCOM)
      union _ktbitun, 2 bytes               @62
         sb2 _ktbitfsc                      @62      -32768
         ub2 _ktbitwrp                      @62       0x8000
      ub4 ktbitbas                          @64       0x01228dbb
   struct ktbbhitl[1], 24 bytes             @68
      struct ktbitxid, 8 bytes              @68
         ub2 kxidusn                        @68       0x0008
         ub2 kxidslt                        @70       0x001b
         ub4 kxidsqn                        @72       0x00003a9a
      struct ktbituba, 8 bytes              @76
         ub4 kubadba                        @76       0x010002b5
         ub2 kubaseq                        @80       0x114f
         ub1 kubarec                        @82       0x20
      ub2 ktbitflg                          @84       0x2001 (KTBFUPB)
      union _ktbitun, 2 bytes               @86
         sb2 _ktbitfsc                      @86       10
         ub2 _ktbitwrp                      @86       0x000a
      ub4 ktbitbas                          @88       0x01286184

这种结构出现在数据库每个数据块的开头部分。它甚至出现在不由redo改变的排序块中。它也会出现在数据文件头块和控制文件头块的开头部分。缓存层提供了对坏数据的规模。它也用来确保正确的数据块被读取并且数据块没有破裂或损坏。所谓破裂的数据块就是只有一部分被写入磁盘,数据块的一部分保留了之前的版本。

Data Layer:包括Data Header,Table Directory,Row Directory,Free Space和Row Data。

Data Header:长度14字节,内部数据结构名kdbh

BBED> p kdbh
struct kdbh, 14 bytes                       @100
   ub1 kdbhflag                             @100      0x00 (NONE)
   sb1 kdbhntab                             @101      1
   sb2 kdbhnrow                             @102      8
   sb2 kdbhfrre                             @104     -1
   sb2 kdbhfsbo                             @106      34
   sb2 kdbhfseo                             @108      8017
   sb2 kdbhavsp                             @110      7977
   sb2 kdbhtosp                             @112      7989

其中kdbhnrow是存储在数据块中的记录数为8,而表中确实有8条记录。(从ROWID可以判断出来)

SQL> select dbms_rowid.rowid_block_number(rowid),t1.t_id,t1.t_name from jy.t1;

DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)       T_ID T_NAME
------------------------------------ ---------- ----------------------------------------
                                 134          9 YYL
                                 135          1 A
                                 135          2 B
                                 135          3 C
                                 135          4 D
                                 135          5 E
                                 135          6 F
                                 135          7 JYHY
                                 135          8 JYYYL

9 rows selected.

Table Directory: 一般table只有一个条目,cluster则有一个或多个条目。每个条目长4字节,内部数据结构名kdbt

BBED> p kdbt
struct kdbt[0], 4 bytes                     @114
   sb2 kdbtoffs                             @114      0
   sb2 kdbtnrow                             @116      8

Row Directory:数目由块中数据的行数决定,每个条目长2字节,内部数据结构名kdbr

BBED> p kdbr
sb2 kdbr[0]                                 @118      8080
sb2 kdbr[1]                                 @120      8072
sb2 kdbr[2]                                 @122      8064
sb2 kdbr[3]                                 @124      8056
sb2 kdbr[4]                                 @126      8048
sb2 kdbr[5]                                 @128      8040
sb2 kdbr[6]                                 @130      8029
sb2 kdbr[7]                                 @132      8017

查看表中的记录数据,一个重复计数也可以被指定用来重复执行examine命令来检查后续的行记录。下面的例子显示了先使用print命令来设置最后一行记录的偏移量,然后检查后面的8行记录的操作.

BBED> p *kdbr[7]
rowdata[0]
----------
ub1 rowdata[0]                              @8117     0x2c

BBED> x /8rnc
rowdata[0]                                  @8117
----------
flag@8117: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8118: 0x02
cols@8119:    2

col    0[2] @8120: 8
col    1[5] @8123: JYYYL

rowdata[12]                                 @8129
-----------
flag@8129: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8130: 0x00
cols@8131:    2

col    0[2] @8132: 7
col    1[4] @8135: JYHY

rowdata[23]                                 @8140
-----------
flag@8140: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8141: 0x00
cols@8142:    2

col    0[2] @8143: 6
col    1[1] @8146: F

rowdata[31]                                 @8148
-----------
flag@8148: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8149: 0x00
cols@8150:    2

col    0[2] @8151: 5
col    1[1] @8154: E

rowdata[39]                                 @8156
-----------
flag@8156: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8157: 0x00
cols@8158:    2

col    0[2] @8159: 4
col    1[1] @8162: D

rowdata[47]                                 @8164
-----------
flag@8164: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8165: 0x00
cols@8166:    2

col    0[2] @8167: 3
col    1[1] @8170: C

rowdata[55]                                 @8172
-----------
flag@8172: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8173: 0x00
cols@8174:    2

col    0[2] @8175: 2
col    1[1] @8178: B

rowdata[63]                                 @8180
-----------
flag@8180: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8181: 0x00
cols@8182:    2

col    0[2] @8183: 1
col    1[1] @8186: A

Free Space:表示数据块中可用空间,内部数据结构名freespace

Row Data:表示实际的数据,内部数据结构名rowdata

BBED> p rowdata[0]
ub1 rowdata[0]                              @8117     0x2c

BBED> d /v offset 8117
 File: /u01/app/oracle/oradata/shardcat/users01.dbf (7)
 Block: 135     Offsets: 8117 to 8191  Dba:0x01c00087
-------------------------------------------------------
 2c020202 c109054a 5959594c 2c000202 l ,......JYYYL,...
 c108044a 5948592c 000202c1 0701462c l ...JYHY,......F,
 000202c1 0601452c 000202c1 0501442c l ......E,......D,
 000202c1 0401432c 000202c1 0301422c l ......C,......B,
 000202c1 02014101 068461            l ......A...a

 <16 bytes per line>

Tailchk:保存在块结尾用于校验的数据,长度4个字节,内部结构名tailchk。所有Oracle块的最后四个字节都是tail check(结尾检查)。
对于一个Oracle 8以上版本的数据块的tail它是由SCN base的低位两字节的内容,数据块的类型与SCN序列号组成的。例如,如果SCN base为 0x01286184,数据块类型为0x06,SCN序列号为0x01,那么tail check将是0x61840601

BBED> p tailchk
ub4 tailchk                                 @8188     0x61840601

BBED> p kcbh
struct kcbh, 20 bytes                       @0
   ub1 type_kcbh                            @0        0x06
   ub1 frmt_kcbh                            @1        0xa2
   ub2 wrp2_kcbh                            @2        0x0000
   ub4 rdba_kcbh                            @4        0x01c00087
   ub4 bas_kcbh                             @8        0x01286184
   ub2 wrp_kcbh                             @12       0x0000
   ub1 seq_kcbh                             @14       0x01
   ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)
   ub2 chkval_kcbh                          @16       0x0137
   ub2 spare3_kcbh                          @18       0x0000

虽然tail check的值通常是由这三个组件级成,Oracle会对最终的值作为一个值(4字节)以单无符号整数来存储。在小字节序编码(little-endian)的构架机器中,比如Intel,这个值将以低位字节优先的方式来存储。因此如果使用标准块编辑器或dump命令来检查数据块的tail check时,字节顺序可能不一样。一个tail check为0x61840601,在Intel机器上它将以”01068461″的形式存储在磁盘。

BBED> dump /v offset 8188
 File: /u01/app/oracle/oradata/shardcat/users01.dbf (7)
 Block: 135     Offsets: 8188 to 8191  Dba:0x01c00087
-------------------------------------------------------
 01068461                            l ...a

 <16 bytes per line>
]]>
http://www.jydba.net/index.php/archives/2777/feed 0
Oracle Linux 6.7中 Oracle 11.2.0.4 RAC集群CRS异常处理 http://www.jydba.net/index.php/archives/2768 http://www.jydba.net/index.php/archives/2768#respond Sat, 04 Jan 2020 02:56:08 +0000 http://www.jydba.net/?p=2768 最近一个月单位上的Oracle RAC集群CRS异常导致集群命令无法使用,执行crsctl stat res -t命令出现如下错误:

[grid@db1 ~]$ crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.

[grid@db2 ~]$ crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.

但是数据库可以正常访问,业务系统也运行正常

[root@db1 ~]# ps -ef | grep pmon
root       8024 204594  0 21:11 pts/0    00:00:00 grep pmon
grid      77120      1  0 Dec21 ?        00:04:21 asm_pmon_+ASM1
oracle    77790      1  0 Dec21 ?        00:05:18 ora_pmon_CAIWU1
oracle    77794      1  0 Dec21 ?        00:05:08 ora_pmon_dadb1
oracle    77848      1  0 Dec21 ?        00:05:39 ora_pmon_chdyl1
oracle    77910      1  0 Dec21 ?        00:07:47 ora_pmon_RLZY1

[root@db2 ~]# ps -ef | grep pmon
grid      27745      1  0 Dec21 ?        00:04:21 asm_pmon_+ASM2
oracle    28393      1  0 Dec21 ?        00:05:21 ora_pmon_dadb2
oracle    28569      1  0 Dec21 ?        00:04:58 ora_pmon_CAIWU2
oracle    28573      1  0 Dec21 ?        00:05:36 ora_pmon_chdyl2
oracle    28583      1  0 Dec21 ?        00:07:49 ora_pmon_RLZY2

查看ASM磁盘组的状态,发现OCR磁盘组确实offline了

[grid@db1 ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576   3072000  2679522                0         2679522              0             N  ARCH/
MOUNTED  EXTERN  N         512   4096  1048576    204800   151138                0          151138              0             N  CWDATA/
MOUNTED  EXTERN  N         512   4096  1048576    512000   472546                0          472546              0             N  DADATA/
MOUNTED  EXTERN  N         512   4096  1048576   3072000   595334                0          595334              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576   1843200   609953                0          609953              0             N  SBDATA/

[grid@db2 ~]$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512   4096  1048576   3072000  2679522                0         2679522              0             N  ARCH/
MOUNTED  EXTERN  N         512   4096  1048576    204800   151138                0          151138              0             N  CWDATA/
MOUNTED  EXTERN  N         512   4096  1048576    512000   472546                0          472546              0             N  DADATA/
MOUNTED  EXTERN  N         512   4096  1048576   3072000   595334                0          595334              0             N  DATA/
MOUNTED  EXTERN  N         512   4096  1048576   1843200   609953                0          609953              0             N  SBDATA/

手工将crsdg上线,命令能够执行成功,但执行crsctl stat res -t命令仍然报错。

[grid@db1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 30 21:15:33 2019

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 Real Application Clusters and Automatic Storage Management options

SQL> alter diskgroup ocr mount;

Diskgroup altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

[grid@db1 ~]$ crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.

[grid@db2 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 30 21:15:05 2019

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 Real Application Clusters and Automatic Storage Management options

SQL> alter diskgroup ocr mount;

Diskgroup altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

[grid@db2 ~]$ crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.

检查节点db1的alert_+ASM1.log有如下报错,说是不能访问OCR磁盘组的相关磁盘而强制dismount了OCR磁盘,但使用dd命令测试是能够访问的

Errors in file /u01/app/grid/diag/asm/+asm/+ASM1/trace/+ASM1_ora_77212.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
WARNING: requested mirror side 1 of virtual extent 0 logical extent 0 offset 102400 is not allocated; I/O request failed
WARNING: requested mirror side 2 of virtual extent 0 logical extent 1 offset 102400 is not allocated; I/O request failed
Errors in file /u01/app/grid/diag/asm/+asm/+ASM1/trace/+ASM1_ora_77212.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
ORA-15078: ASM diskgroup was forcibly dismounted
Sat Dec 28 05:30:48 2019
SQL> alter diskgroup OCR check /* proxy */ 
ORA-15032: not all alterations performed
ORA-15001: diskgroup "OCR" does not exist or is not mounted
ERROR: alter diskgroup OCR check /* proxy */
NOTE: client exited [77184]
Sat Dec 28 05:30:49 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35285] opening OCR file
Sat Dec 28 05:30:51 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35305] opening OCR file
Sat Dec 28 05:30:53 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35322] opening OCR file
Sat Dec 28 05:30:55 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35346] opening OCR file
Sat Dec 28 05:30:57 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35363] opening OCR file
Sat Dec 28 05:31:00 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35459] opening OCR file
Sat Dec 28 05:31:02 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35481] opening OCR file
Sat Dec 28 05:31:04 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35520] opening OCR file
Sat Dec 28 05:31:06 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35539] opening OCR file
Sat Dec 28 05:31:08 2019
NOTE: [crsd.bin@db1 (TNS V1-V3) 35557] opening OCR file
Sat Dec 28 21:00:10 2019
Warning: VKTM detected a time drift.
Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.

检查错误日志

[root@db1 ~]# more /u01/app/grid/diag/asm/+asm/+ASM1/trace/+ASM1_ora_77212.trc
Trace file /u01/app/grid/diag/asm/+asm/+ASM1/trace/+ASM1_ora_77212.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
ORACLE_HOME = /u01/app/11.2.0/grid
System name:    Linux
Node name:      db1
Release:        3.8.13-68.3.4.el6uek.x86_64
Version:        #2 SMP Tue Jul 14 15:03:36 PDT 2015
Machine:        x86_64
Instance name: +ASM1
Redo thread mounted by this instance: 0 
Oracle process number: 24
Unix process pid: 77212, image: oracle@db1 (TNS V1-V3)


*** 2019-12-28 05:30:44.894
*** SESSION ID:(2929.3) 2019-12-28 05:30:44.894
*** CLIENT ID:() 2019-12-28 05:30:44.894
*** SERVICE NAME:() 2019-12-28 05:30:44.894
*** MODULE NAME:(crsd.bin@db1 (TNS V1-V3)) 2019-12-28 05:30:44.894
*** ACTION NAME:() 2019-12-28 05:30:44.894
 
Received ORADEBUG command (#1) 'CLEANUP_KFK_FD' from process 'Unix process pid: 35253, image: '

*** 2019-12-28 05:30:44.895
Finished processing ORADEBUG command (#1) 'CLEANUP_KFK_FD'

*** 2019-12-28 05:30:48.235
WARNING:failed xlate 1 
ORA-15078: ASM diskgroup was forcibly dismounted
ksfdrfms:Mirror Read file=+OCR.255.4294967295 fob=0x9b00e5d8 bufp=0x7f5dd012ba00 blkno=25 nbytes=4096
WARNING:failed xlate 1 
WARNING: requested mirror side 1 of virtual extent 0 logical extent 0 offset 102400 is not allocated; I/O request failed
ksfdrfms:Read failed from mirror side=1 logical extent number=0 dskno=65535
WARNING:failed xlate 1 
WARNING: requested mirror side 2 of virtual extent 0 logical extent 1 offset 102400 is not allocated; I/O request failed
ksfdrfms:Read failed from mirror side=2 logical extent number=1 dskno=65535
ORA-15078: ASM diskgroup was forcibly dismounted
ORA-15078: ASM diskgroup was forcibly dismounted

检查节点db1的alertdb1.log有如下报错,也是说不能访问OCR磁盘组的相关磁盘

2019-12-28 05:30:48.468: 
[/u01/app/11.2.0/grid/bin/oraagent.bin(77466)]CRS-5822:Agent '/u01/app/11.2.0/grid/bin/oraagent_grid' disconnected from server. Details at (:CRSAGF00117:) {0:1:4} in /u01/app/11.2.0/grid/log/db1/agent/crsd/oraagent_grid/oraagent_grid.lo
g.
2019-12-28 05:30:48.468: 
[/u01/app/11.2.0/grid/bin/oraagent.bin(77684)]CRS-5822:Agent '/u01/app/11.2.0/grid/bin/oraagent_oracle' disconnected from server. Details at (:CRSAGF00117:) {0:7:332} in /u01/app/11.2.0/grid/log/db1/agent/crsd/oraagent_oracle/oraagent_o
racle.log.
2019-12-28 05:30:48.471: 
[/u01/app/11.2.0/grid/bin/orarootagent.bin(77482)]CRS-5822:Agent '/u01/app/11.2.0/grid/bin/orarootagent_root' disconnected from server. Details at (:CRSAGF00117:) {0:5:11497} in /u01/app/11.2.0/grid/log/db1/agent/crsd/orarootagent_root/
orarootagent_root.log.
2019-12-28 05:30:48.480: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:30:50.003: 
[crsd(35285)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:50.021: 
[crsd(35285)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:50.520: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:30:51.918: 
[crsd(35305)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:51.929: 
[crsd(35305)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:52.557: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:30:53.945: 
[crsd(35322)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:53.956: 
[crsd(35322)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:54.595: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:30:55.976: 
[crsd(35346)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:55.988: 
[crsd(35346)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:56.633: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:30:58.010: 
[crsd(35363)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:58.020: 
[crsd(35363)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:30:58.669: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:31:00.043: 
[crsd(35459)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:00.054: 
[crsd(35459)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:00.706: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:31:02.093: 
[crsd(35481)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:02.103: 
[crsd(35481)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:02.742: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:31:04.109: 
[crsd(35520)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:04.119: 
[crsd(35520)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:04.777: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:31:06.141: 
[crsd(35539)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:06.151: 
[crsd(35539)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:06.810: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:31:08.181: 
[crsd(35557)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:08.191: 
[crsd(35557)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db1/crsd/crsd.log.
2019-12-28 05:31:08.846: 
[ohasd(33022)]CRS-2765:Resource 'ora.crsd' has failed on server 'db1'.
2019-12-28 05:31:08.847: 
[ohasd(33022)]CRS-2771:Maximum restart attempts reached for resource 'ora.crsd'; will not restart.
2019-12-28 05:31:08.848: 
[ohasd(33022)]CRS-2769:Unable to failover resource 'ora.crsd'.

检查节点db1的oraagent_grid.log文件有如下报错,显示OCR磁盘组的状态被改变为offline了。

2019-12-28 05:30:16.531: [    AGFW][511039232]{1:30746:2} Agent received the message: AGENT_HB[Engine] ID 12293:113720
2019-12-28 05:30:37.808: [    AGFW][511039232]{1:30746:9373} Agent received the message: RESOURCE_STOP[ora.OCR.dg db1 1] ID 4099:113730
2019-12-28 05:30:37.808: [    AGFW][511039232]{1:30746:9373} Preparing STOP command for: ora.OCR.dg db1 1
2019-12-28 05:30:37.808: [    AGFW][511039232]{1:30746:9373} ora.OCR.dg db1 1 state changed from: ONLINE to: STOPPING
2019-12-28 05:30:37.809: [ora.OCR.dg][513140480]{1:30746:9373} [stop] (:CLSN00108:) clsn_agent::stop {
2019-12-28 05:30:37.810: [ora.OCR.dg][513140480]{1:30746:9373} [stop] DgpAgent::stop: enter { 
2019-12-28 05:30:37.810: [ora.OCR.dg][513140480]{1:30746:9373} [stop] getResAttrib: attrib name USR_ORA_OPI value true len 4
2019-12-28 05:30:37.810: [ora.OCR.dg][513140480]{1:30746:9373} [stop] Agent::flagUsrOraOpiIsSet(true) reason not dependency
2019-12-28 05:30:37.810: [ora.OCR.dg][513140480]{1:30746:9373} [stop] DgpAgent::stop: tha exit }
2019-12-28 05:30:37.810: [ora.OCR.dg][513140480]{1:30746:9373} [stop] DgpAgent::stopSingle status:2 }
2019-12-28 05:30:37.810: [ora.OCR.dg][513140480]{1:30746:9373} [stop] (:CLSN00108:) clsn_agent::stop }
2019-12-28 05:30:37.810: [    AGFW][513140480]{1:30746:9373} Command: stop for resource: ora.OCR.dg db1 1 completed with status: SUCCESS
2019-12-28 05:30:37.810: [ora.OCR.dg][513140480]{1:30746:9373} [check] CrsCmd::ClscrsCmdData::stat entity 1 statflag 33 useFilter 0
2019-12-28 05:30:37.811: [    AGFW][511039232]{1:30746:9373} Agent sending reply for: RESOURCE_STOP[ora.OCR.dg db1 1] ID 4099:113730
2019-12-28 05:30:37.838: [ora.OCR.dg][513140480]{1:30746:9373} [check] DgpAgent::runCheck: asm stat asmRet 0
2019-12-28 05:30:37.839: [ora.OCR.dg][513140480]{1:30746:9373} [check] DgpAgent::getConnxn connected
2019-12-28 05:30:37.844: [ora.OCR.dg][513140480]{1:30746:9373} [check] DgpAgent::queryDgStatus excp no data found
2019-12-28 05:30:37.844: [ora.OCR.dg][513140480]{1:30746:9373} [check] DgpAgent::queryDgStatus no data found in v$asm_diskgroup_stat
2019-12-28 05:30:37.844: [ora.OCR.dg][513140480]{1:30746:9373} [check] DgpAgent::queryDgStatus dgName OCR ret 1
2019-12-28 05:30:37.845: [    AGFW][511039232]{1:30746:9373} ora.OCR.dg db1 1 state changed from: STOPPING to: OFFLINE
2019-12-28 05:30:37.845: [    AGFW][511039232]{1:30746:9373} Agent sending last reply for: RESOURCE_STOP[ora.OCR.dg db1 1] ID 4099:113730
2019-12-28 05:30:43.889: [ora.asm][503641856]{1:30746:2} [check] CrsCmd::ClscrsCmdData::stat entity 1 statflag 33 useFilter 0
2019-12-28 05:30:43.920: [ora.asm][503641856]{1:30746:2} [check] AsmProxyAgent::check clsagfw_res_status 0
2019-12-28 05:30:48.465: [ CRSCOMM][521545472] IpcC: IPC client connection 6c to member 0 has been removed
2019-12-28 05:30:48.465: [CLSFRAME][521545472] Removing IPC Member:{Relative|Node:0|Process:0|Type:1}
2019-12-28 05:30:48.465: [CLSFRAME][521545472] Disconnected from CRSD:db1 process: {Relative|Node:0|Process:0|Type:1}
2019-12-28 05:30:48.474: [   AGENT][511039232]{0:1:4} {0:1:4} Created alert : (:CRSAGF00117:) :  Disconnected from server, Agent is shutting down.
2019-12-28 05:30:48.474: [    AGFW][511039232]{0:1:4} Agent is exiting with exit code: 1

检查节点db2的alert_+ASM2.log有如下报错,出现了类似的”Waited 15 secs for write IO to PST disk 0 in group 1″信息,这说明对OCR磁盘组执行写操作时超时了15秒.

Sat Dec 28 03:02:51 2019
WARNING: Waited 15 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 3.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 3.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 5.
WARNING: Waited 15 secs for write IO to PST disk 1 in group 5.
WARNING: Waited 15 secs for write IO to PST disk 2 in group 5.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 5.
WARNING: Waited 15 secs for write IO to PST disk 1 in group 5.
WARNING: Waited 15 secs for write IO to PST disk 2 in group 5.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 6.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 6.
Sat Dec 28 03:02:51 2019
NOTE: process _b000_+asm2 (45488) initiating offline of disk 0.3916160907 (OCR1) with mask 0x7e in group 5
NOTE: process _b000_+asm2 (45488) initiating offline of disk 1.3916160906 (OCR2) with mask 0x7e in group 5
NOTE: process _b000_+asm2 (45488) initiating offline of disk 2.3916160905 (OCR3) with mask 0x7e in group 5
NOTE: checking PST: grp = 5
GMON checking disk modes for group 5 at 19 for pid 27, osid 45488
ERROR: no read quorum in group: required 2, found 0 disks
NOTE: checking PST for grp 5 done.
NOTE: initiating PST update: grp = 5, dsk = 0/0xe96bdf8b, mask = 0x6a, op = clear
NOTE: initiating PST update: grp = 5, dsk = 1/0xe96bdf8a, mask = 0x6a, op = clear
NOTE: initiating PST update: grp = 5, dsk = 2/0xe96bdf89, mask = 0x6a, op = clear
GMON updating disk modes for group 5 at 20 for pid 27, osid 45488
ERROR: no read quorum in group: required 2, found 0 disks
Sat Dec 28 03:02:51 2019
NOTE: cache dismounting (not clean) group 5/0x8F5B2F9F (OCR) 
NOTE: messaging CKPT to quiesce pins Unix process pid: 45490, image: oracle@db2 (B001)
Sat Dec 28 03:02:51 2019
NOTE: halting all I/Os to diskgroup 5 (OCR)
Sat Dec 28 03:02:52 2019
NOTE: LGWR doing non-clean dismount of group 5 (OCR)
NOTE: LGWR sync ABA=23.100 last written ABA 23.100
WARNING: Offline for disk OCR1 in mode 0x7f failed.
WARNING: Offline for disk OCR2 in mode 0x7f failed.
WARNING: Offline for disk OCR3 in mode 0x7f failed.
Sat Dec 28 03:02:52 2019
kjbdomdet send to inst 1
detach from dom 5, sending detach message to inst 1
Sat Dec 28 03:02:52 2019
List of instances:
 1 2
Dirty detach reconfiguration started (new ddet inc 1, cluster inc 36)
 Global Resource Directory partially frozen for dirty detach
* dirty detach - domain 5 invalid = TRUE 
 0 GCS resources traversed, 0 cancelled
Dirty Detach Reconfiguration complete
Sat Dec 28 03:02:52 2019
WARNING: dirty detached from domain 5
NOTE: cache dismounted group 5/0x8F5B2F9F (OCR) 
SQL> alter diskgroup OCR dismount force /* ASM SERVER:2405117855 */ 
Sat Dec 28 03:02:52 2019
NOTE: cache deleting context for group OCR 5/0x8f5b2f9f
GMON dismounting group 5 at 21 for pid 28, osid 45490
NOTE: Disk OCR1 in mode 0x7f marked for de-assignment
NOTE: Disk OCR2 in mode 0x7f marked for de-assignment
NOTE: Disk OCR3 in mode 0x7f marked for de-assignment
NOTE:Waiting for all pending writes to complete before de-registering: grpnum 5
Sat Dec 28 03:03:03 2019
WARNING: Waited 27 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 27 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 24 secs for write IO to PST disk 0 in group 2.
WARNING: Waited 24 secs for write IO to PST disk 0 in group 2.
WARNING: Waited 27 secs for write IO to PST disk 0 in group 3.
WARNING: Waited 27 secs for write IO to PST disk 0 in group 3.
WARNING: Waited 21 secs for write IO to PST disk 0 in group 4.
WARNING: Waited 21 secs for write IO to PST disk 0 in group 4.
WARNING: Waited 27 secs for write IO to PST disk 0 in group 6.
WARNING: Waited 27 secs for write IO to PST disk 0 in group 6.
Sat Dec 28 03:03:03 2019
ASM Health Checker found 1 new failures
Sat Dec 28 03:03:22 2019
SUCCESS: diskgroup OCR was dismounted
SUCCESS: alter diskgroup OCR dismount force /* ASM SERVER:2405117855 */
SUCCESS: ASM-initiated MANDATORY DISMOUNT of group OCR
Sat Dec 28 03:03:22 2019
NOTE: diskgroup resource ora.OCR.dg is offline
Sat Dec 28 03:03:22 2019
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Sat Dec 28 05:30:34 2019
WARNING: Waited 15 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 6.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 6.
Sat Dec 28 05:30:37 2019
 Received dirty detach msg from inst 1 for dom 5
Sat Dec 28 05:30:37 2019
List of instances:
 1 2
Dirty detach reconfiguration started (new ddet inc 2, cluster inc 36)
 Global Resource Directory partially frozen for dirty detach
* dirty detach - domain 5 invalid = TRUE 
 0 GCS resources traversed, 0 cancelled
freeing rdom 5
Dirty Detach Reconfiguration complete
Sat Dec 28 05:30:37 2019
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
WARNING: requested mirror side 1 of virtual extent 5 logical extent 0 offset 704512 is not allocated; I/O request failed
WARNING: requested mirror side 2 of virtual extent 5 logical extent 1 offset 704512 is not allocated; I/O request failed
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_ora_27831.trc:
ORA-15078: ASM diskgroup was forcibly dismounted
ORA-15078: ASM diskgroup was forcibly dismounted
Sat Dec 28 05:30:37 2019
SQL> alter diskgroup OCR check /* proxy */ 
ORA-15032: not all alterations performed
ORA-15001: diskgroup "OCR" does not exist or is not mounted
ERROR: alter diskgroup OCR check /* proxy */
Sat Dec 28 05:30:44 2019
WARNING: Waited 20 secs for write IO to PST disk 0 in group 2.
WARNING: Waited 20 secs for write IO to PST disk 0 in group 2.
Sat Dec 28 05:30:48 2019
NOTE: client exited [27819]
Sat Dec 28 05:30:49 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142641] opening OCR file
Sat Dec 28 05:30:51 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142660] opening OCR file
Sat Dec 28 05:30:53 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142678] opening OCR file
Sat Dec 28 05:30:55 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142696] opening OCR file
Sat Dec 28 05:30:57 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142723] opening OCR file
Sat Dec 28 05:30:59 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142744] opening OCR file
Sat Dec 28 05:31:01 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142773] opening OCR file
Sat Dec 28 05:31:03 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142792] opening OCR file
Sat Dec 28 05:31:05 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142806] opening OCR file
Sat Dec 28 05:31:07 2019
NOTE: [crsd.bin@db2 (TNS V1-V3) 142821] opening OCR file
Sat Dec 28 06:18:42 2019
WARNING: Waited 15 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 1.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 2.
WARNING: Waited 15 secs for write IO to PST disk 0 in group 2.

检查节点db2的alertdb2.log有如下报错,也是说不能访问OCR磁盘组的相关磁盘,但使用dd命令测试是可以访问的。

2019-12-28 05:30:48.019: 
[/u01/app/11.2.0/grid/bin/oraagent.bin(28268)]CRS-5822:Agent '/u01/app/11.2.0/grid/bin/oraagent_oracle' disconnected from server. Details at (:CRSAGF00117:) {0:7:73} in /u01/app/11.2.0/grid/log/db2/agent/crsd/oraagent_oracle/oraagent_oracle.log.
2019-12-28 05:30:48.019: 
[/u01/app/11.2.0/grid/bin/scriptagent.bin(37953)]CRS-5822:Agent '/u01/app/11.2.0/grid/bin/scriptagent_grid' disconnected from server. Details at (:CRSAGF00117:) {0:9:8} in /u01/app/11.2.0/grid/log/db2/agent/crsd/scriptagent_grid/scriptagent_grid.log.
2019-12-28 05:30:48.020: 
[/u01/app/11.2.0/grid/bin/oraagent.bin(28009)]CRS-5822:Agent '/u01/app/11.2.0/grid/bin/oraagent_grid' disconnected from server. Details at (:CRSAGF00117:) {0:1:10} in /u01/app/11.2.0/grid/log/db2/agent/crsd/oraagent_grid/oraagent_grid.log.
2019-12-28 05:30:48.021: 
[/u01/app/11.2.0/grid/bin/orarootagent.bin(28025)]CRS-5822:Agent '/u01/app/11.2.0/grid/bin/orarootagent_root' disconnected from server. Details at (:CRSAGF00117:) {0:5:373} in /u01/app/11.2.0/grid/log/db2/agent/crsd/orarootagent_root/orarootagent_root.log.
2019-12-28 05:30:48.024: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:30:49.410: 
[crsd(142641)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:49.420: 
[crsd(142641)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:50.063: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:30:51.442: 
[crsd(142660)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:51.451: 
[crsd(142660)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:52.100: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:30:53.471: 
[crsd(142678)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:53.480: 
[crsd(142678)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:54.138: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:30:55.507: 
[crsd(142696)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:55.517: 
[crsd(142696)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:56.176: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:30:57.551: 
[crsd(142723)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:57.560: 
[crsd(142723)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:58.216: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:30:59.592: 
[crsd(142744)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:30:59.602: 
[crsd(142744)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:00.253: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:31:01.627: 
[crsd(142773)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:01.636: 
[crsd(142773)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:02.290: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:31:03.658: 
[crsd(142792)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:03.668: 
[crsd(142792)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:04.327: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:31:05.701: 
[crsd(142806)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:05.711: 
[crsd(142806)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:06.365: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:31:07.726: 
[crsd(142821)]CRS-1013:The OCR location in an ASM disk group is inaccessible. Details in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:07.735: 
[crsd(142821)]CRS-0804:Cluster Ready Service aborted due to Oracle Cluster Registry error [PROC-26: Error while accessing the physical storage
]. Details at (:CRSD00111:) in /u01/app/11.2.0/grid/log/db2/crsd/crsd.log.
2019-12-28 05:31:08.402: 
[ohasd(13034)]CRS-2765:Resource 'ora.crsd' has failed on server 'db2'.
2019-12-28 05:31:08.402: 
[ohasd(13034)]CRS-2771:Maximum restart attempts reached for resource 'ora.crsd'; will not restart.
2019-12-28 05:31:08.403: 
[ohasd(13034)]CRS-2769:Unable to failover resource 'ora.crsd'.

检查节点db2的oraagent_grid.log文件有如下报错:

2019-12-28 05:29:59.329: [    AGFW][3601811200]{2:6928:2} Agent received the message: AGENT_HB[Engine] ID 12293:273304
2019-12-28 05:30:17.162: [ora.LISTENER_SCAN2.lsnr][3592312576]{1:34166:403} [check] Utils:execCmd action = 3 flags = 38 ohome = (null) cmdname = lsnrctl. 
2019-12-28 05:30:17.267: [ora.LISTENER_SCAN2.lsnr][3592312576]{1:34166:403} [check] execCmd ret = 0
2019-12-28 05:30:17.267: [ora.LISTENER_SCAN2.lsnr][3592312576]{1:34166:403} [check] CrsCmd::ClscrsCmdData::stat entity 5 statflag 32 useFilter 1
2019-12-28 05:30:17.298: [ora.LISTENER_SCAN2.lsnr][3592312576]{1:34166:403} [check] ScanLsnrAgent::checkDependentVipResource: scanVipResource = ora.scan2.vip, statRet = 0
2019-12-28 05:30:17.881: [ora.LISTENER_SCAN3.lsnr][2950686464]{1:34166:403} [check] Utils:execCmd action = 3 flags = 38 ohome = (null) cmdname = lsnrctl. 
2019-12-28 05:30:17.986: [ora.LISTENER_SCAN3.lsnr][2950686464]{1:34166:403} [check] execCmd ret = 0
2019-12-28 05:30:17.987: [ora.LISTENER_SCAN3.lsnr][2950686464]{1:34166:403} [check] CrsCmd::ClscrsCmdData::stat entity 5 statflag 32 useFilter 1
2019-12-28 05:30:18.019: [ora.LISTENER_SCAN3.lsnr][2950686464]{1:34166:403} [check] ScanLsnrAgent::checkDependentVipResource: scanVipResource = ora.scan3.vip, statRet = 0
2019-12-28 05:30:27.292: [ora.asm][2950686464]{2:6928:2} [check] CrsCmd::ClscrsCmdData::stat entity 1 statflag 33 useFilter 0
2019-12-28 05:30:27.319: [ora.asm][2950686464]{2:6928:2} [check] AsmProxyAgent::check clsagfw_res_status 0
2019-12-28 05:30:34.522: [ora.ons][2950686464]{2:6928:2} [check] getOracleHomeAttrib: oracle_home = /u01/app/11.2.0/grid
2019-12-28 05:30:34.522: [ora.ons][2950686464]{2:6928:2} [check] Utils:execCmd action = 3 flags = 6 ohome = /u01/app/11.2.0/grid/opmn/ cmdname = onsctli. 
2019-12-28 05:30:34.627: [ora.ons][2950686464]{2:6928:2} [check] (:CLSN00010:)ons is running ...
2019-12-28 05:30:34.627: [ora.ons][2950686464]{2:6928:2} [check] (:CLSN00010:)
2019-12-28 05:30:34.628: [ora.ons][2950686464]{2:6928:2} [check] execCmd ret = 0
2019-12-28 05:30:37.858: [ USRTHRD][3575973632]{1:30748:9373} Processing the event CRS_RESOURCE_STATE_CHANGE
2019-12-28 05:30:38.652: [ora.LISTENER.lsnr][3594413824]{2:6928:2} [check] Utils:execCmd action = 3 flags = 38 ohome = (null) cmdname = lsnrctl. 
2019-12-28 05:30:38.757: [ora.LISTENER.lsnr][3594413824]{2:6928:2} [check] execCmd ret = 0
2019-12-28 05:30:48.017: [ CRSCOMM][3612317440] IpcC: IPC client connection 6c to member 0 has been removed
2019-12-28 05:30:48.017: [CLSFRAME][3612317440] Removing IPC Member:{Relative|Node:0|Process:0|Type:1}
2019-12-28 05:30:48.017: [CLSFRAME][3612317440] Disconnected from CRSD:db2 process: {Relative|Node:0|Process:0|Type:1}
2019-12-28 05:30:48.020: [   AGENT][3601811200]{0:1:10} {0:1:10} Created alert : (:CRSAGF00117:) :  Disconnected from server, Agent is shutting down.
2019-12-28 05:30:48.020: [    AGFW][3601811200]{0:1:10} Agent is exiting with exit code: 1

检查2个节点的/var/log/messages日志,发现2个节点均有多路径相关的错误信息,但相关的磁盘是用于备份的,不是用于生产数据库所使用的

Dec 30 05:25:31 db1 multipathd: backup2: sdcr - emc_clariion_checker: query command indicates error
Dec 30 05:25:31 db1 multipathd: checker failed path 69:240 in map backup2
Dec 30 05:25:31 db1 kernel: device-mapper: multipath: Failing path 69:240.
Dec 30 05:25:31 db1 multipathd: backup2: remaining active paths: 3
Dec 30 05:25:37 db1 multipathd: backup2: sdcr - emc_clariion_checker: Active path is healthy.
Dec 30 05:25:37 db1 multipathd: 69:240: reinstated
Dec 30 05:25:37 db1 multipathd: backup2: remaining active paths: 4
Dec 30 05:25:37 db1 kernel: sd 5:0:3:2: emc: ALUA failover mode detected
Dec 30 05:25:37 db1 kernel: sd 5:0:3:2: emc: at SP A Port 5 (owned, default SP A)
Dec 30 05:26:03 db1 kernel: qla2xxx [0000:05:00.1]-801c:5: Abort command issued nexus=5:3:4 --  1 2002.
Dec 30 06:03:35 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 06:15:23 db1 multipathd: backup3: sdcq - emc_clariion_checker: Read error for WWN 600601608b203300d563752524c1e611.  Sense data are 0x0/0x0/0x0.
Dec 30 06:15:23 db1 kernel: qla2xxx [0000:05:00.1]-801c:5: Abort command issued nexus=5:3:1 --  1 2002.
Dec 30 06:15:23 db1 kernel: device-mapper: multipath: Failing path 69:224.
Dec 30 06:15:23 db1 multipathd: checker failed path 69:224 in map backup3
Dec 30 06:15:23 db1 multipathd: backup3: remaining active paths: 3
Dec 30 06:15:28 db1 multipathd: backup3: sdcq - emc_clariion_checker: Active path is healthy.
Dec 30 06:15:28 db1 multipathd: 69:224: reinstated
Dec 30 06:15:28 db1 multipathd: backup3: remaining active paths: 4
Dec 30 06:15:28 db1 kernel: sd 5:0:3:1: emc: ALUA failover mode detected
Dec 30 06:15:28 db1 kernel: sd 5:0:3:1: emc: at SP A Port 5 (owned, default SP A)
Dec 30 06:59:29 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 07:53:22 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 07:55:11 db1 multipathd: sdct: couldn't get asymmetric access state
Dec 30 07:55:11 db1 multipathd: backup4: load table [0 2147483648 multipath 2 queue_if_no_path retain_attached_hw_handler 1 emc 2 1 round-robin 0 2 1 70:16 1 66:240 1 round-robin 0 2 1 8:64 1 67:80 1]
Dec 30 07:55:11 db1 kernel: sd 5:0:3:4: emc: ALUA failover mode detected
Dec 30 07:55:11 db1 kernel: sd 5:0:3:4: emc: at SP A Port 5 (owned, default SP A)
Dec 30 07:55:11 db1 kernel: sd 4:0:3:4: emc: ALUA failover mode detected
Dec 30 07:55:11 db1 kernel: sd 4:0:3:4: emc: at SP A Port 4 (owned, default SP A)
Dec 30 07:55:35 db1 multipathd: backup2: sdcr - emc_clariion_checker: Read error for WWN 600601608b203300d663752524c1e611.  Sense data are 0x0/0x0/0x0.
Dec 30 07:55:35 db1 multipathd: checker failed path 69:240 in map backup2
Dec 30 07:55:35 db1 multipathd: backup2: remaining active paths: 3
Dec 30 07:55:35 db1 kernel: device-mapper: multipath: Failing path 69:240.
Dec 30 07:55:40 db1 multipathd: backup2: sdcr - emc_clariion_checker: Active path is healthy.
Dec 30 07:55:40 db1 multipathd: 69:240: reinstated
Dec 30 07:55:40 db1 multipathd: backup2: remaining active paths: 4
Dec 30 07:55:40 db1 kernel: sd 5:0:3:2: emc: ALUA failover mode detected
Dec 30 07:55:40 db1 kernel: sd 5:0:3:2: emc: at SP A Port 5 (owned, default SP A)
Dec 30 08:39:47 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 08:43:36 db1 multipathd: mpathb: load table [0 20971520 multipath 2 queue_if_no_path retain_attached_hw_handler 1 emc 2 1 round-robin 0 2 1 69:208 1 66:176 1 round-robin 0 2 1 8:0 1 67:16 1]
Dec 30 08:43:36 db1 kernel: sd 5:0:3:0: emc: ALUA failover mode detected
Dec 30 08:43:36 db1 kernel: sd 5:0:3:0: emc: at SP A Port 5 (owned, default SP A)
Dec 30 08:43:36 db1 kernel: sd 4:0:3:0: emc: ALUA failover mode detected
Dec 30 08:43:36 db1 kernel: sd 4:0:3:0: emc: at SP A Port 4 (owned, default SP A)
Dec 30 09:24:04 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 10:13:09 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 11:06:07 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 12:07:36 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 13:08:58 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 14:00:19 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 14:52:20 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 15:40:45 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 16:34:38 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 17:09:56 db1 auditd[15975]: Audit daemon rotating log files
Dec 30 17:38:16 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 18:59:38 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.
Dec 30 19:54:43 db1 CLSD: The clock on host db1 has been updated by the Cluster Time Synchronization Service to be synchronous with the mean cluster time.

经查看集群相关日志可以确定,由于存储磁盘出现IO问题(或光线闪断、或IO延迟),导致集群CRS异常宕机。但是,比较奇怪的是,虽然CSR掉线了,ASM实例和DB实例却好好的,还可以正常使用。查询oracle support发现一篇文章1581864.1?提到ASM CRS仲裁盘访问超时与隐藏参数_asm_hbeatiowait有关系,而ASM的隐藏参数_asm_hbeatiowait由于操作系统多路径Multipath配置的polling_interval有关,具体的故障原因是操作系统盘的判断访问超时远大于数据库ASM仲裁盘访问超时,导致ORACLE RAC判定ASM中仲裁盘无法访问从而将仲裁盘强制Offline。解决的思路是:首先,确定操作系统polling_interval参数与数据库ASM隐藏参数值_asm_hbeatiowait,将_asm_hbeatiowait的值调整到比polling_interval值大即可。
下面是具体的解决操作:
1、查看数据库RAC ASM的_asm_hbeatiowait值(默认是15秒):

SQL> col ksppinm for a20
SQL> col ksppstvl for a40
SQL> col ksppdesc for a80
SQL> SELECT   ksppinm, ksppstvl, ksppdesc
  2     FROM   x$ksppi x, x$ksppcv y
  3    WHERE   x.indx = y.indx AND  ksppinm = '_asm_hbeatiowait';

KSPPINM              KSPPSTVL                                 KSPPDESC
-------------------- ---------------------------------------- --------------------------------------------------------------------------------
_asm_hbeatiowait     15                                       number of secs to wait for PST Async Hbeat IO return

2、查看操作存储盘访问超时时间(Oracle Linux 6.7默认是30秒)

[root@db1 ~]# cat /sys/block/sdb/device/timeout 
30

[root@db2 ~]# cat /sys/block/sdb/device/timeout 
30

3、将_asm_hbeatiowait 的值调整为45秒(该参数是静态参数,需要重启集群)

SQL>  alter system set "_asm_hbeatiowait"=45 scope=spfile sid='*';

System altered.

4.重启集群

5.检查集群状态

[grid@db1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.CWDATA.dg
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.DADATA.dg
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.DATA.dg
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.LISTENER.lsnr
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.OCR.dg
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.SBKDATA.dg
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.asm
               ONLINE  ONLINE       db1                      Started             
               ONLINE  ONLINE       db2                      Started             
ora.gsd
               OFFLINE OFFLINE      db1                                          
               OFFLINE OFFLINE      db2                                          
ora.net1.network
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
ora.ons
               ONLINE  ONLINE       db1                                          
               ONLINE  ONLINE       db2                                          
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       db2                                          
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       db1                                          
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       db1                                          
ora.caiwu.db
      1        ONLINE  ONLINE       db1                      Open                
      2        ONLINE  ONLINE       db2                      Open                
ora.chdyl.db
      1        ONLINE  ONLINE       db1                      Open                
      2        ONLINE  ONLINE       db2                      Open                
ora.cvu
      1        ONLINE  ONLINE       db1                                          
ora.dadb.db
      1        ONLINE  ONLINE       db1                      Open                
      2        ONLINE  ONLINE       db2                      Open                
ora.db1.vip
      1        ONLINE  ONLINE       db1                                          
ora.db2.vip
      1        ONLINE  ONLINE       db2                                          
ora.oc4j
      1        ONLINE  ONLINE       db1                                          
ora.rlzy.db
      1        ONLINE  ONLINE       db1                      Open                
      2        ONLINE  ONLINE       db2                      Open                
ora.scan1.vip
      1        ONLINE  ONLINE       db2                                          
ora.scan2.vip
      1        ONLINE  ONLINE       db1                                          
ora.scan3.vip
      1        ONLINE  ONLINE       db1                                          


到此处理完成。

]]>
http://www.jydba.net/index.php/archives/2768/feed 0
RMAN删除归档日志出现RMAN-0813错误的处理 http://www.jydba.net/index.php/archives/2766 http://www.jydba.net/index.php/archives/2766#respond Sat, 04 Jan 2020 02:39:22 +0000 http://www.jydba.net/?p=2766 数据库备份日志报错:RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process,DB版本为11.2.0.4,根据备策略,每天备份归档,并且自动删除档,保留一个星期的归档,手功执如下命令:

delete noprompt archivelog until time 'sysdate-7';

依然报错,信息如下:

archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_24/thread_1_seq_2328.1241.1027887401 thread=1 sequence=2328
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_24/thread_1_seq_2329.1242.1027887719 thread=1 sequence=2329
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_24/thread_1_seq_2330.1243.1027887813 thread=1 sequence=2330
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_24/thread_1_seq_2331.1244.1027887873 thread=1 sequence=2331
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2332.1245.1027902623 thread=1 sequence=2332
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2333.1246.1027902719 thread=1 sequence=2333
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2334.1247.1027908493 thread=1 sequence=2334
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2335.1248.1027911721 thread=1 sequence=2335
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2336.1249.1027989005 thread=1 sequence=2336
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2337.1250.1027989067 thread=1 sequence=2337
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2338.1251.1027990617 thread=1 sequence=2338
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2339.1252.1028041713 thread=1 sequence=2339
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_27/thread_1_seq_2340.1253.1028075413 thread=1 sequence=2340
...............

在MOS搜索发现这是11g中的一个bug,描述的原因是在11g中,RMAN查看的是v$database中的MIN_REQUIRED_CAPTURE_CHANGE#,而不是DBA_CAPTURE。默认情况下,该值每6小时更新一次。因此,在默认情况下,v$database中的值将比当前值晚6个小时。
给出的解决方法是需要在delete 后面加上force。
手动执行delete noprompt force archivelog until time ‘sysdate-7’, 成功将归档删除。

deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_24/thread_1_seq_2330.1243.1027887813 RECID=18420 STAMP=1027887814
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_24/thread_1_seq_2331.1244.1027887873 RECID=18421 STAMP=1027887875
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2332.1245.1027902623 RECID=18422 STAMP=1027902628
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2333.1246.1027902719 RECID=18423 STAMP=1027902721
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2334.1247.1027908493 RECID=18424 STAMP=1027908500
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_25/thread_1_seq_2335.1248.1027911721 RECID=18425 STAMP=1027911722
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2336.1249.1027989005 RECID=18426 STAMP=1027989010
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2337.1250.1027989067 RECID=18427 STAMP=1027989069
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2338.1251.1027990617 RECID=18428 STAMP=1027990618
deleted archived log
archived log file name=+CWDATA/sjjhdg/archivelog/2019_12_26/thread_1_seq_2339.1252.1028041713 RECID=18429 STAMP=1028041715
...........
Deleted 800 objects
]]>
http://www.jydba.net/index.php/archives/2766/feed 0
Oracle 11G RAC One Node’s Instance Arise ORA-01105 ORA-01606 http://www.jydba.net/index.php/archives/2748 http://www.jydba.net/index.php/archives/2748#respond Thu, 12 Dec 2019 14:01:31 +0000 http://www.jydba.net/?p=2748 生产环境,Oracle Linux 6.4 RAC 11.2.4.0,今天出现了grid集群因为OCR磁盘组不能访问而不能通过命令来显示集群状态信息,在手动mount OCR磁盘组后,准备重启节点2时出现了ORA-01105,ORA-01606错误,具体信息如下:

SQL> startup
ORACLE instance started.

Total System Global Area 5.3447E+10 bytes
Fixed Size                  2265864 bytes
Variable Size            1.3019E+10 bytes
Database Buffers         4.0265E+10 bytes
Redo Buffers              160698368 bytes
ORA-01105: mount is incompatible with mounts by other instances
ORA-01606: parameter not identical to that of another mounted instance

查看错误详细说明,根据错误描述可知是由于2号实例与1号实例由于某些参数设置一样所导致的

[oracle@db2 dbs]$ oerr ora 1105
01105, 00000, "mount is incompatible with mounts by other instances"
// *Cause:  An attempt to mount the database discovered that another instance
//         mounted a database by the same name, but the mount is not
//         compatible. Additional errors are reported explaining why.
// *Action: See accompanying errors.
[oracle@db2 dbs]$ oerr ora 1606
01606, 00000, "parameter not identical to that of another mounted instance"
// *Cause:  A parameter was different on two instances.
// *Action: Modify the initialization parameter and restart.

使用spfile文件来创建文本格式的pfile文件

SQL> create pfile='rlcs.ora' from spfile;

File created.

[oracle@db2 dbs]$ cat rlcs.ora

*._serial_direct_read='AUTO'
*._swrf_mmon_flush=TRUE
*._use_adaptive_log_file_sync='FALSE'
*.audit_file_dest='/u01/app/oracle/admin/RL/adump'
*.audit_trail='NONE'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATA/rl/controlfile/current.260.926786537','+ARCH/rl/controlfile/current.256.926786537'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_name_convert='+data/rl/','+data/rldg/'
*.db_name='RL'
*.db_recovery_file_dest='+ARCH'
*.db_recovery_file_dest_size=10737418240
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=RLZYXDB)'
*.fal_server='yb_st'
RL1.instance_number=1
RL2.instance_number=2
*.listener_networks=''
*.log_archive_config='dg_config=(rl,rldg)'
*.log_archive_dest_1='location=+ARCH  valid_for=(all_logfiles,all_roles) db_unique_name=rl'
*.log_archive_dest_2='service=yb_st valid_for=(online_logfiles,primary_role) db_unique_name=rldg'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%t_%s_%r.arch'
*.log_file_name_convert='+data/rl/','+data/rldg/','+arch/rl/','+arch/rldg/'
*.open_cursors=300
*.parallel_adaptive_multi_user=TRUE
*.parallel_degree_policy='AUTO'
*.parallel_force_local=FALSE
*.pga_aggregate_target=21474836480
*.processes=2000
*.remote_listener='scan-ip:1521'
*.remote_login_passwordfile='exclusive'
*.service_names='rl'
*.sessions=2205
*.sga_max_size=53687091200
*.sga_target=53687091200
*.standby_file_management='manual'
RLZY2.thread=2
RLZY1.thread=1
*.undo_retention=7200
RLZY2.undo_tablespace='UNDOTBS2'
RLZY1.undo_tablespace='UNDOTBS1'
*.utl_file_dir='/rmanbak/utl'
从文本参数文件看不出来有什么参数是两个实例不一致的。

通过执行下面的语句来查看2号实例与gc相关的参数
SQL> set linesize 333
SQL> col name for a35
SQL> col description for a66
SQL> col value for a30
SQL> SELECT   i.ksppinm name,  
  2     i.ksppdesc description,  
  3     CV.ksppstvl VALUE
  4  FROM   sys.x$ksppi i, sys.x$ksppcv CV  
  5     WHERE   i.inst_id = USERENV ('Instance')  
  6     AND CV.inst_id = USERENV ('Instance')  
  7     AND i.indx = CV.indx  
  8     AND i.ksppinm LIKE '/_gc%' ESCAPE '/'  
  9  ORDER BY   REPLACE (i.ksppinm, '_', '');  

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_affinity_locking                if TRUE, enable object affinity                                    TRUE
_gc_affinity_locks                  if TRUE, get affinity locks                                        TRUE
_gc_affinity_ratio                  dynamic object affinity ratio                                      50
_gc_async_memcpy                    if TRUE, use async memcpy                                          FALSE
_gc_bypass_readers                  if TRUE, modifications bypass readers                              TRUE
_gc_check_bscn                      if TRUE, check for stale blocks                                    TRUE
_gc_coalesce_recovery_reads         if TRUE, coalesce recovery reads                                   TRUE
_gc_cpu_time                        if TRUE, record the gc cpu time                                    FALSE
_gc_cr_server_read_wait             if TRUE, cr server waits for a read to complete                    TRUE
_gc_defer_ping_index_only           if TRUE, restrict deferred ping to index blocks only               TRUE
_gc_defer_time                      how long to defer pings for hot buffers in milliseconds            0

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_delta_push_compression          if delta >= K bytes, compress before push                          3072
_gc_delta_push_max_level            max delta level for delta push                                     100
_gc_delta_push_objects              objects which use delta push                                       0
_gc_disable_s_lock_brr_ping_check   if TRUE, disable S lock BRR ping check for lost write protect      TRUE
_gc_down_convert_after_keep         if TRUE, down-convert lock after recovery                          TRUE
_gc_element_percent                 global cache element percent                                       110
_gc_escalate_bid                    if TRUE, escalates create a bid                                    TRUE
_gc_fg_merge                        if TRUE, merge pi buffers in the foreground                        TRUE
_gc_flush_during_affinity           if TRUE, flush during affinity                                     TRUE
_gc_fusion_compression              compress fusion blocks if there is free space                      1024
_gc_global_checkpoint_scn           if TRUE, enable global checkpoint scn                              TRUE

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_global_cpu                      global cpu checks                                                  TRUE
_gc_global_lru                      turn global lru off, make it automatic, or turn it on              AUTO
_gc_global_lru_touch_count          global lru touch count                                             5
_gc_global_lru_touch_time           global lru touch time in seconds                                   60
_gc_integrity_checks                set the integrity check level                                      1
_gc_keep_recovery_buffers           if TRUE, make single instance crash recovery buffers current       TRUE
_gc_latches                         number of latches per LMS process                                  8
_gc_log_flush                       if TRUE, flush redo log before a current block transfer            TRUE
_gc_long_query_threshold            threshold for long running query                                   0
_gc_max_downcvt                     maximum downconverts to process at one time                        256
_gc_maximum_bids                    maximum number of bids which can be prepared                       0

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_no_fairness_for_clones          if TRUE, no fairness if we serve a clone                           TRUE
_gc_object_queue_max_length         maximum length for an object queue                                 0
_gc_override_force_cr               if TRUE, try to override force-cr requests                         TRUE
_gc_persistent_read_mostly          if TRUE, enable persistent read-mostly locking                     TRUE
_gc_policy_minimum                  dynamic object policy minimum activity per minute                  1500
_gc_policy_time                     how often to make object policy decisions in minutes               10
_gc_read_mostly_flush_check         if TRUE, optimize flushes for read mostly objects                  FALSE
_gc_read_mostly_locking             if TRUE, enable read-mostly locking                                FALSE
_gcr_enable_high_cpu_kill           if TRUE, GCR may kill foregrounds under high load                  FALSE
_gcr_enable_high_cpu_rm             if TRUE, GCR may enable a RM plan under high load                  FALSE
_gcr_enable_high_cpu_rt             if TRUE, GCR may boost bg priority under high load                 FALSE

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gcr_high_cpu_threshold             minimum amount of CPU process must consume to be kill target       10
_gcr_use_css                        if FALSE, GCR wont register with CSS nor use any CSS feature       TRUE
_gc_sanity_check_cr_buffers         if TRUE, sanity check CR buffers                                   FALSE
_gcs_disable_remote_handles         disable remote client/shadow handles                               FALSE
_gcs_disable_skip_close_remastering if TRUE, disable skip close optimization in remastering            FALSE
_gc_serve_high_pi_as_current        if TRUE, use a higher clone scn when serving a pi                  TRUE
_gcs_fast_reconfig                  if TRUE, enable fast reconfiguration for gcs locks                 TRUE
_gcs_latches                        number of gcs resource hash latches to be allocated per LMS proces 64
                                    s

_gcs_pkey_history                   number of pkey remastering history                                 4000

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gcs_process_in_recovery            if TRUE, process gcs requests during instance recovery             TRUE
_gcs_resources                      number of gcs resources to be allocated
_gcs_res_per_bucket                 number of gcs resource per hash bucket                             4
_gcs_shadow_locks                   number of pcm shadow locks to be allocated
_gc_statistics                      if TRUE, kcl statistics are maintained                             TRUE
_gcs_testing                        GCS testing parameter                                              0
_gc_transfer_ratio                  dynamic object read-mostly transfer ratio                          2
_gc_undo_affinity                   if TRUE, enable dynamic undo affinity                              TRUE
_gc_undo_block_disk_reads           if TRUE, enable undo block disk reads                              TRUE
_gc_use_cr                          if TRUE, allow CR pins on PI and WRITING buffers                   TRUE
_gc_vector_read                     if TRUE, vector read current buffers                               TRUE

64 rows selected.

查看1号实例与gc相关的参数

SQL> set linesize 333
SQL> col name for a35
SQL> col description for a66
SQL> col value for a30
SQL> SELECT   i.ksppinm name,  
  2     i.ksppdesc description,  
  3     CV.ksppstvl VALUE
  4  FROM   sys.x$ksppi i, sys.x$ksppcv CV  
  5     WHERE   i.inst_id = USERENV ('Instance')  
  6     AND CV.inst_id = USERENV ('Instance')  
  7     AND i.indx = CV.indx  
  8     AND i.ksppinm LIKE '/_gc%' ESCAPE '/'  
  9  ORDER BY   REPLACE (i.ksppinm, '_', '');  

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_affinity_locking                if TRUE, enable object affinity                                    TRUE
_gc_affinity_locks                  if TRUE, get affinity locks                                        TRUE
_gc_affinity_ratio                  dynamic object affinity ratio                                      50
_gc_async_memcpy                    if TRUE, use async memcpy                                          FALSE
_gc_bypass_readers                  if TRUE, modifications bypass readers                              TRUE
_gc_check_bscn                      if TRUE, check for stale blocks                                    TRUE
_gc_coalesce_recovery_reads         if TRUE, coalesce recovery reads                                   TRUE
_gc_cpu_time                        if TRUE, record the gc cpu time                                    FALSE
_gc_cr_server_read_wait             if TRUE, cr server waits for a read to complete                    TRUE
_gc_defer_ping_index_only           if TRUE, restrict deferred ping to index blocks only               TRUE
_gc_defer_time                      how long to defer pings for hot buffers in milliseconds            0

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_delta_push_compression          if delta >= K bytes, compress before push                          3072
_gc_delta_push_max_level            max delta level for delta push                                     100
_gc_delta_push_objects              objects which use delta push                                       0
_gc_disable_s_lock_brr_ping_check   if TRUE, disable S lock BRR ping check for lost write protect      TRUE
_gc_down_convert_after_keep         if TRUE, down-convert lock after recovery                          TRUE
_gc_element_percent                 global cache element percent                                       110
_gc_escalate_bid                    if TRUE, escalates create a bid                                    TRUE
_gc_fg_merge                        if TRUE, merge pi buffers in the foreground                        TRUE
_gc_flush_during_affinity           if TRUE, flush during affinity                                     TRUE
_gc_fusion_compression              compress fusion blocks if there is free space                      1024
_gc_global_checkpoint_scn           if TRUE, enable global checkpoint scn                              TRUE

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_global_cpu                      global cpu checks                                                  TRUE
_gc_global_lru                      turn global lru off, make it automatic, or turn it on              AUTO
_gc_global_lru_touch_count          global lru touch count                                             5
_gc_global_lru_touch_time           global lru touch time in seconds                                   60
_gc_integrity_checks                set the integrity check level                                      1
_gc_keep_recovery_buffers           if TRUE, make single instance crash recovery buffers current       TRUE
_gc_latches                         number of latches per LMS process                                  8
_gc_log_flush                       if TRUE, flush redo log before a current block transfer            TRUE
_gc_long_query_threshold            threshold for long running query                                   0
_gc_max_downcvt                     maximum downconverts to process at one time                        256
_gc_maximum_bids                    maximum number of bids which can be prepared                       0

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gc_no_fairness_for_clones          if TRUE, no fairness if we serve a clone                           TRUE
_gc_object_queue_max_length         maximum length for an object queue                                 0
_gc_override_force_cr               if TRUE, try to override force-cr requests                         TRUE
_gc_persistent_read_mostly          if TRUE, enable persistent read-mostly locking                     TRUE
_gc_policy_minimum                  dynamic object policy minimum activity per minute                  1500
_gc_policy_time                     how often to make object policy decisions in minutes               10
_gc_read_mostly_flush_check         if TRUE, optimize flushes for read mostly objects                  FALSE
_gc_read_mostly_locking             if TRUE, enable read-mostly locking                                TRUE
_gcr_enable_high_cpu_kill           if TRUE, GCR may kill foregrounds under high load                  FALSE
_gcr_enable_high_cpu_rm             if TRUE, GCR may enable a RM plan under high load                  FALSE
_gcr_enable_high_cpu_rt             if TRUE, GCR may boost bg priority under high load                 FALSE

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gcr_high_cpu_threshold             minimum amount of CPU process must consume to be kill target       10
_gcr_use_css                        if FALSE, GCR wont register with CSS nor use any CSS feature       TRUE
_gc_sanity_check_cr_buffers         if TRUE, sanity check CR buffers                                   FALSE
_gcs_disable_remote_handles         disable remote client/shadow handles                               FALSE
_gcs_disable_skip_close_remastering if TRUE, disable skip close optimization in remastering            FALSE
_gc_serve_high_pi_as_current        if TRUE, use a higher clone scn when serving a pi                  TRUE
_gcs_fast_reconfig                  if TRUE, enable fast reconfiguration for gcs locks                 TRUE
_gcs_latches                        number of gcs resource hash latches to be allocated per LMS proces 64
                                    s

_gcs_pkey_history                   number of pkey remastering history                                 4000

NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_gcs_process_in_recovery            if TRUE, process gcs requests during instance recovery             TRUE
_gcs_resources                      number of gcs resources to be allocated
_gcs_res_per_bucket                 number of gcs resource per hash bucket                             4
_gcs_shadow_locks                   number of pcm shadow locks to be allocated
_gc_statistics                      if TRUE, kcl statistics are maintained                             TRUE
_gcs_testing                        GCS testing parameter                                              0
_gc_transfer_ratio                  dynamic object read-mostly transfer ratio                          2
_gc_undo_affinity                   if TRUE, enable dynamic undo affinity                              TRUE
_gc_undo_block_disk_reads           if TRUE, enable undo block disk reads                              TRUE
_gc_use_cr                          if TRUE, allow CR pins on PI and WRITING buffers                   TRUE
_gc_vector_read                     if TRUE, vector read current buffers                               TRUE

64 rows selected.

通过对比发现_gc_read_mostly_locking参数在1号实例中为true,2号实例为false

将所有实例中的_gc_read_mostly_locking参数设置为true

SQL> alter system set "_gc_read_mostly_locking"=true scope=spfile sid='*';

System altered.

重启2号实例成功

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 5.3447E+10 bytes
Fixed Size                  2265864 bytes
Variable Size            1.3019E+10 bytes
Database Buffers         4.0265E+10 bytes
Redo Buffers              160698368 bytes
Database mounted.
Database opened.

原因是因为之前有人修改过_gc_read_mostly_locking隐藏参数,只是只修改了1号实例。

]]>
http://www.jydba.net/index.php/archives/2748/feed 0
ORA-00600 qosdExpStatRead expcnt mismatch http://www.jydba.net/index.php/archives/2719 http://www.jydba.net/index.php/archives/2719#respond Mon, 21 Oct 2019 08:02:44 +0000 http://www.jydba.net/?p=2719 Oracle 12.2.0.1最近出现了ORA–0600错误,其详细信息如下:

ORA-00600: 内部错误代码, 参数: [qosdExpStatRead: expcnt mismatch], [], [], [], [], [], [], [], [], [], [], []
ORA-06512: 在 "SYS.DBMS_STATS", line 1976
ORA-06512: 在 "SYS.DBMS_STATS", line 46935
ORA-06512: 在 "SYS.DBMS_STATS", line 47168
ORA-00600: 内部错误代码, 参数: [qosdExpStatRead: expcnt mismatch], [], [], [], [], [], [], [], [], [], [], []
ORA-06512: 在 "SYS.DBMS_STATS", line 1976
ORA-06512: 在 "SYS.DBMS_STATS", line 46935
ORA-06512: 在 "SYS.DBMS_STATS", line 47168

根据Oracle官方给出的检查SQL语句,其执行结果如下:

引起访问题的原因是由于sys.exp_obj$.exp_cnt与sys.exp_stat$的行数据不匹配所造成的

解决方案
1.备份数据库涉及到修改数据字典

2. 修复问题

SQL>update sys.exp_obj$ a set exp_cnt=(select count(*) from sys.exp_stat$ b where
a.objn=b.objn and a.snapshot_id=b.snapshot_id ) where a.objn=124789;

SQL>commit;

3. 修改后,执行如下SQL确认是否还有记录,如果没有记录,说明已经修改成功,提交。

SQL>With b as (
select count(*) cnt,objn,snapshot_id from sys.exp_stat$ es group by objn,snapshot_id)
select * from sys.exp_obj$ a, b where a.objn=b.objn and a.snapshot_id=b.snapshot_id
and a.EXP_CNT<>b.CNT;

修复后,通过一天的观察没有出现该问题了。

]]>
http://www.jydba.net/index.php/archives/2719/feed 0
oracle rac 单个实例不能生成awr报告的问题 http://www.jydba.net/index.php/archives/2688 http://www.jydba.net/index.php/archives/2688#respond Mon, 19 Aug 2019 02:30:41 +0000 http://www.jydba.net/?p=2688 同事对rac集群生成性能报告时发现rac集群有一个实例没有生成awr快照,另一个实例快照正常。下面是具体处理步骤。
1号实例没有生成awr快照

SQL> select SNAP_ID,END_INTERVAL_TIME,instance_number from dba_hist_snapshot where instance_number=1;

no rows selected

2号实快照正常

SQL> set long 200   
SQL> set linesize 200
SQL> select * from ( select SNAP_ID,END_INTERVAL_TIME,instance_number from dba_hist_snapshot where instance_number=2 order by SNAP_ID desc) where rownum < =10;

   SNAP_ID END_INTERVAL_TIME                                                           INSTANCE_NUMBER
---------- --------------------------------------------------------------------------- ---------------
     24405 17-AUG-19 07.00.47.595 PM                                                                 2
     24404 17-AUG-19 06.00.42.150 PM                                                                 2
     24403 17-AUG-19 05.00.37.041 PM                                                                 2
     24402 17-AUG-19 04.00.31.774 PM                                                                 2
     24401 17-AUG-19 03.00.26.414 PM                                                                 2
     24400 17-AUG-19 02.00.21.176 PM                                                                 2
     24399 17-AUG-19 01.00.16.316 PM                                                                 2
     24398 17-AUG-19 12.00.10.997 PM                                                                 2
     24397 17-AUG-19 11.00.05.446 AM                                                                 2
     24396 17-AUG-19 10.00.59.801 AM                                                                 2

10 rows selected.

mmon进程与awr快照相关,mmnl与ash相关,如是查看两个实例的mmon与mmnl进程
2号实例

[root@db2 ~]# ps -ef | grep mmon
root     128329 127956  0 18:11 pts/2    00:00:00 grep mmon
oracle   201527      1  0  2018 ?        17:17:11 ora_mmon_RLZY2
[root@db2 ~]# ps -ef | grep mmnl
root     131772 127956  0 18:17 pts/2    00:00:00 grep mmnl
oracle   201531      1  0  2018 ?        1-06:06:24 ora_mmnl_RLZY2

1号实例

[root@db1 ~]# ps -ef | grep mmon
root     239020 238963  0 18:52 pts/2    00:00:00 grep mmon
[root@db1 ~]# ps -ef | grep mmnl
root     239052 238963  0 18:52 pts/2    00:00:00 grep mmnl

可以看到1号实例没有mmon与mmnl进程了。

如是查看1号实例的mmon进程的跟踪文件

[root@db1 trace]# ls -lrt *mmon*.trc
-rw-r----- 1 oracle asmadmin 1351052 Jan 19  2018 RLZY1_mmon_20073.trc
-rw-r----- 1 oracle asmadmin  173031 Jan 22  2018 RLZY1_mmon_49119.trc
[root@db1 trace]# more RLZY1_mmon_49119.trc
Trace file /u01/app/oracle/diag/rdbms/rlzy/RLZY1/trace/RLZY1_mmon_49119.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1
System name:    Linux
Node name:      db1
Release:        3.8.13-68.3.4.el6uek.x86_64
Version:        #2 SMP Tue Jul 14 15:03:36 PDT 2015
Machine:        x86_64
Instance name: RLZY1
Redo thread mounted by this instance: 1
Oracle process number: 36
Unix process pid: 49119, image: oracle@db1 (MMON)


*** 2018-01-19 13:55:20.030
*** SESSION ID:(1369.1) 2018-01-19 13:55:20.030
*** CLIENT ID:() 2018-01-19 13:55:20.030
*** SERVICE NAME:() 2018-01-19 13:55:20.030
*** MODULE NAME:() 2018-01-19 13:55:20.030
*** ACTION NAME:() 2018-01-19 13:55:20.030
 
minact-scn slave-status: grec-scn:0x0000.00000000 gmin-scn:0x0000.00000000 gcalc-scn:0x0000.00000000

*** 2018-01-19 14:00:20.643
minact-scn master-status: grec-scn:0x0e0e.55ad96ef gmin-scn:0x0e0e.55abf256 gcalc-scn:0x0e0e.55ac2a0a

..........
KEBM: MMON action policy violation. 'Block Cleanout Optim, Undo Segment Scan' viol=1; err=12751
minact-scn master-status: grec-scn:0x0e0e.5f0ebf8c gmin-scn:0x0e0e.5f0eac2e gcalc-scn:0x0e0e.5f0ead91
DDE rules only execution for: ORA 12751

*** 2018-01-22 07:06:04.060
----- START Event Driven Actions Dump ----
---- END Event Driven Actions Dump ----
----- START DDE Actions Dump -----
Executing SYNC actions
Executing ASYNC actions
----- START DDE Action: 'ORA_12751_DUMP' (Sync) -----
Runtime exceeded 300 seconds
Time limit violation detected at:
ksedsts()+465< -kspol_12751_dump()+145<-dbgdaExecuteAction()+1065<-dbgerRunAction()+109<-dbgerRunActions()+4134<-dbgexPhaseII()+1873<-dbgexProcessError()+2680<-dbgeExecuteForError()+88<-dbgePostErrorKGE()+2136<-dbkePostKGE_kgsf()+71<-kge
selv()+276<-ksesecl0()+162
<-ksucin()+147<-kcbzwb()+2727<-kcbgtcr()+31325<-ktucloUsMinScn()+539<-ktucloUsegScan()+992<-ksb_run_managed_action()+384<-ksbcti()+2490<-ksbabs()+1735<-kebm_mmon_main()+209<-ksbrdp()+1045<-opirip()+623<-opidrv()+603<-sou2o()+103<-opimai
_real()+250<-ssthrdmain()+265
<-main()+201<-__libc_start_main()+253Current Wait Stack:
 0: waiting for 'gc buffer busy acquire'
    file#=0x5, block#=0x278, class#=0x49
    wait_id=255378 seq_num=59358 snap_id=1
    wait times: snap=5 min 5 sec, exc=5 min 5 sec, total=5 min 5 sec
    wait times: max=infinite, heur=5 min 5 sec
    wait counts: calls=358 os=358
    in_wait=1 iflags=0x15a2
There is at least one session blocking this session.
  Dumping 1 direct blocker(s):
    inst: 1, sid: 990, ser: 1
  Dumping final blocker:
    inst: 1, sid: 990, ser: 1
Wait State:
  fixed_waits=0 flags=0x22 boundary=(nil)/-1
Session Wait History:
    elapsed time of 0.000061 sec since current wait
 0: waited for 'gc cr block 2-way'
    =0x5, =0x258, =0x47
    wait_id=255377 seq_num=59357 snap_id=1
    wait times: snap=0.000478 sec, exc=0.000478 sec, total=0.000478 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000122 sec of elapsed time
 1: waited for 'gc cr block 2-way'
    =0x5, =0x228, =0x45
    wait_id=255376 seq_num=59356 snap_id=1
    wait times: snap=0.000741 sec, exc=0.000741 sec, total=0.000741 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000120 sec of elapsed time
 2: waited for 'gc cr block 2-way'
    =0x5, =0x138, =0x43
    wait_id=255375 seq_num=59355 snap_id=1
    wait times: snap=0.000528 sec, exc=0.000528 sec, total=0.000528 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000111 sec of elapsed time
 3: waited for 'gc cr block 2-way'
    =0x5, =0xb8, =0x41
    wait_id=255374 seq_num=59354 snap_id=1
    wait times: snap=0.000583 sec, exc=0.000583 sec, total=0.000583 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000139 sec of elapsed time
 4: waited for 'gc cr block 2-way'
    =0x5, =0x110, =0x37
    wait_id=255373 seq_num=59353 snap_id=1
    wait times: snap=0.000541 sec, exc=0.000541 sec, total=0.000541 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000110 sec of elapsed time
 5: waited for 'gc cr block 2-way'
    =0x5, =0x100, =0x35
    wait_id=255372 seq_num=59352 snap_id=1
    wait times: snap=0.000629 sec, exc=0.000629 sec, total=0.000629 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000158 sec of elapsed time
 6: waited for 'gc cr block 2-way'
    =0x5, =0xf0, =0x33
    wait_id=255371 seq_num=59351 snap_id=1
    wait times: snap=0.000617 sec, exc=0.000617 sec, total=0.000617 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000128 sec of elapsed time
 7: waited for 'gc cr block 2-way'
    =0x5, =0xe0, =0x31
    wait_id=255370 seq_num=59350 snap_id=1
    wait times: snap=0.000561 sec, exc=0.000561 sec, total=0.000561 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000124 sec of elapsed time
 8: waited for 'gc cr block 2-way'
    =0x5, =0xd0, =0x2f
    wait_id=255369 seq_num=59349 snap_id=1
    wait times: snap=0.000565 sec, exc=0.000565 sec, total=0.000565 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000128 sec of elapsed time
 9: waited for 'gc cr block 2-way'
    =0x5, =0xc0, =0x2d
    wait_id=255368 seq_num=59348 snap_id=1
    wait times: snap=0.000555 sec, exc=0.000555 sec, total=0.000555 sec
    wait times: max=infinite
    wait counts: calls=1 os=1
    occurred after 0.000125 sec of elapsed time
Sampled Session History of session 1369 serial 1
---------------------------------------------------
The sampled session history is constructed by sampling
the target session every 1 second. The sampling process
captures at each sample if the session is in a non-idle wait,
an idle wait, or not in a wait. If the session is in a
non-idle wait then one interval is shown for all the samples
the session was in the same non-idle wait. If the
session is in an idle wait or not in a wait for
consecutive samples then one interval is shown for all
the consecutive samples. Though we display these consecutive
samples  in a single interval the session may NOT be continuously
idle or not in a wait (the sampling process does not know).
 
The history is displayed in reverse chronological order.
 
sample interval: 1 sec, max history 120 sec
---------------------------------------------------
  [121 samples,                                            07:04:03 - 07:06:03]
    waited for 'gc buffer busy acquire', seq_num: 59358
      p1: 'file#'=0x5
      p2: 'block#'=0x278
      p3: 'class#'=0x49
      time_waited: >= 120 sec (still in wait)
---------------------------------------------------
Sampled Session History Summary:
  longest_non_idle_wait: 'gc buffer busy acquire'
  [121 samples, 07:04:03 - 07:06:03]
      time_waited: >= 120 sec (still in wait)
---------------------------------------------------
----- END DDE Action: 'ORA_12751_DUMP' (SUCCESS, 1 csec) -----
----- END DDE Actions Dump (total 1 csec) -----
KEBM: MMON action policy violation. 'Block Cleanout Optim, Undo Segment Scan' viol=1; err=12751
minact-scn master-status: grec-scn:0x0e0e.5f0ec4ce gmin-scn:0x0e0e.5f0eac2e gcalc-scn:0x0e0e.5f0ead91

*** 2018-01-22 07:11:11.071
DDE rules only execution for: ORA 12751
----- START Event Driven Actions Dump ----
---- END Event Driven Actions Dump ----

ORA12751的错误原因是陈旧的SYS对象统计数据会导致生成次优执行计划,从而使AWR自动刷新从操作的语句运行更长时间和超时。

解决方法就是收集新的SYS对象统计信息,为优化器提供更好的统计信息,并生成更高效的执行计划

SQL> EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

PL/SQL procedure successfully completed.

SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS ('SYS');

PL/SQL procedure successfully completed.

下面就是重启mmon和mmnl进程

SQL> alter system enable restricted session;

System altered.

SQL> alter system disable restricted session;

System altered.

查看alert日志可以看到mmon和mmnl进程已经重启了

Sat Aug 17 19:18:22 2019
Starting background process MMON
Sat Aug 17 19:18:22 2019
Starting background process MMNL
MMON started with pid=399, OS id=10373 
Sat Aug 17 19:18:22 2019
MMNL started with pid=405, OS id=10375 
ALTER SYSTEM enable restricted session;
Sat Aug 17 19:18:25 2019
Some DDE async actions failed or were cancelled
Sat Aug 17 19:18:25 2019
Sweep [inc][48021]: completed
Sweep [inc][48011]: completed
Sweep [inc][48002]: completed
Sweep [inc][35010]: completed
Sweep [inc][34706]: completed
Sweep [inc][34242]: completed
Sweep [inc][33546]: completed
Sweep [inc][33394]: completed
Sweep [inc2][48021]: completed
Sweep [inc2][48011]: completed
Sweep [inc2][48002]: completed
Sweep [inc2][35010]: completed
Sweep [inc2][34706]: completed
Sweep [inc2][34242]: completed
Sweep [inc2][33546]: completed
Sweep [inc2][33394]: completed
minact-scn: Inst 1 is a slave inc#:30 mmon proc-id:10373 status:0x2
minact-scn status: grec-scn:0x0e0e.61cb2e9c gmin-scn:0x0e0e.5f0eac2e gcalc-scn:0x0e0e.5f0ead91
Sat Aug 17 19:18:29 2019
db_recovery_file_dest_size of 10240 MB is 20.87% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Sat Aug 17 19:18:42 2019
ALTER SYSTEM disable restricted session;

再查看1号实例的mmon与mmnl进程状态

[root@db1 ~]# ps -ef | grep mmnl
oracle    10375      1  0 19:18 ?        00:00:00 ora_mmnl_RLZY1
root      10611 238963  0 19:18 pts/2    00:00:00 grep mmnl

[root@db1 ~]# ps -ef | grep mmon
oracle    10373      1  7 19:18 ?        00:00:02 ora_mmon_RLZY1
root      10630 238963  0 19:18 pts/2    00:00:00 grep mmon
过了两个小时去查看1号实例已经生成了两条快照信息
SQL> set long 200
SQL> set linesize 200
SQL> select * from ( select SNAP_ID,END_INTERVAL_TIME,instance_number from dba_hist_snapshot where instance_number=1 order by SNAP_ID desc) where rownum < =10;

   SNAP_ID END_INTERVAL_TIME                                                           INSTANCE_NUMBER
---------- --------------------------------------------------------------------------- ---------------
     24407 17-AUG-19 09.00.58.595 PM                                                                 1
     24406 17-AUG-19 08.00.40.244 PM                                                                 1

到此问题解决了。

]]>
http://www.jydba.net/index.php/archives/2688/feed 0
当用户无限制使用表空间配额且表空间有足够空间时在执行DML操作时出现超出表空间的空间限额 http://www.jydba.net/index.php/archives/2666 http://www.jydba.net/index.php/archives/2666#respond Mon, 03 Jun 2019 00:34:07 +0000 http://www.jydba.net/?p=2666 朋友生产数据库在向特定的一张表插入数据时报超出表空间data的空间限额如是执行下查看用户所用的表空间配额信息,查看用户所使用表空间的配额发现没有限制,因为max_bytes为 -1

SQL>  select * from dba_ts_quotas where username='data';

TABLESPACE_NAME                USERNAME                            BYTES  MAX_BYTES     BLOCKS MAX_BLOCKS DROPPED
------------------------------ ------------------------------ ---------- ---------- ---------- ---------- -------
data                           data                           8825732464         -1  107735992         -1 NO

 1 rows selected

SQL>
SQL> select
  2    fs.tablespace_name            "Tablespace",
  3    (df.totalspace-fs.freespace)  "Used MB",
  4    fs.freespace                  "Free MB",
  5    df.totalspace                 "Total MB",
  6    round(100*(fs.freespace/df.totalspace)) "Pct. Free"
  7  from
  8    (select tablespace_name,round(sum(bytes)/1024/1024) TotalSpace
  9    from dba_data_files group by  tablespace_name) df,
 10    (select tablespace_name,round(sum(bytes)/1024/1024) FreeSpace
 11    from dba_free_space group by tablespace_name) fs
 12  where df.tablespace_name=fs.tablespace_name;

Tablespace                        Used MB    Free MB   Total MB  Pct. Free
------------------------------ ---------- ---------- ---------- ----------
SYSTEM                               7207       3033      10240         30
TEST                                 6790      34170      40960         83
USERS                                 173      25427      25600         99
UNDOTBS2                              227      24013      24240         99
DATA                               990119     176281    1166400         15
SYSAUX                               3925       1195       5120         23
UNDOTBS1                            12898      28062      40960         69

7 rows selected

查看表lv_data的依赖对象

SQL> select NAME,TYPE from dba_dependencies where REFERENCED_NAME='LV_DATA';

NAME                           TYPE
------------------------------ ------------------
LV_DATA                        VIEW
FC_UPDATE_CORPFUND             PROCEDURE
FC_UPDATE_MY                   PROCEDURE
FC_UPDATE_KY                   PROCEDURE
FC_UPDATE_FACTPAY              PROCEDURE
FC_UPDATE_CALCPAY              PROCEDURE
FC_UPDATE_KY                   PROCEDURE
......
LV_DATA                        SYNONYM
LV_DATA                        VIEW
LV_DATA                        SYNONYM
LV_DATA                        SYNONYM

139 rows selected

查看所有依赖对象的所有者

SQL> select  distinct owner from dba_objects where OBJECT_NAME in(select NAME from dba_dependencies where REFERENCED_NAME='LV_DATA');

OWNER
------------------------------
SY
SY_BK
WEB
CX
DATA
OLD
TEST
XC
CZ
OSY
BACKUP
TJ

12 rows selected

对所有依赖对象所有者授权可以无限制使用表空间

SQL> grant unlimited tablespace to OSY;

Grant succeeded

SQL> grant unlimited tablespace to SBK;

Grant succeeded

SQL> grant unlimited tablespace to WEB;

Grant succeeded

SQL> grant unlimited tablespace to CX;

Grant succeeded

SQL> grant unlimited tablespace to DATA;

Grant succeeded

SQL> grant unlimited tablespace to OLD;

Grant succeeded

SQL> grant unlimited tablespace to TEST;

Grant succeeded

SQL> grant unlimited tablespace to XC;

Grant succeeded

SQL> grant unlimited tablespace to CZ;

Grant succeeded

SQL> grant unlimited tablespace to SY;

Grant succeeded

SQL> grant unlimited tablespace to BACKUP;

Grant succeeded

SQL> grant unlimited tablespace to TJ;

Grant succeeded

再向表lv_data插入数据时恢复正常

]]>
http://www.jydba.net/index.php/archives/2666/feed 0