0
点赞
收藏
分享

微信扫一扫

asm单点安装(库神支持)

感谢库神支持

1、unzip LINUX.X64_19300_grid_home.zip -d $ORACLE_HOME(grid)

chown -R grid:oinstall /app/soft

chown -R grid:asmadmin /dev/asm1  
vi /app/soft/install/response/gridsetup.rsp


2、编辑grid_install.rsp配置文件

oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0

INVENTORY_LOCATION=/u01/app/oraInventory


oracle.install.option=HA_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.ClusterConfiguration=STANDALONE


oracle.install.crs.config.autoConfigureClusterNodeVIP=false


oracle.install.asm.diskGroup.name=DATA


oracle.install.asm.diskGroup.redundancy=EXTERNAL


oracle.install.asm.diskGroup.AUSize=4


oracle.install.asm.diskGroup.disks=/dev/asm4


oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*


oracle.install.crs.configureRHPS=false


oracle.install.crs.config.ignoreDownNodes=false


oracle.install.config.managementOption=NONE


oracle.install.crs.rootconfig.executeRootScript=false


oracle.install.asm.SYSASMPassword=asm


oracle.install.asm.monitorPassword=asm



3、进行安装(/u01/app/soft)(重装的话,删除/etc/ora两个文件,以及/etc/oracle/下的东西,以及清空orainventory)

./gridSetup.sh -silent -force -ignorePrereq -responseFile /u01/app/soft/install/response/gridsetup.rsp


..................................................   19% Done.

..................................................   24% Done.

..................................................   29% Done.

..................................................   34% Done.

..................................................   39% Done.

..................................................   44% Done.

..............................

Copy files successful.

..................................................   57% Done.


Link binaries in progress.


Link binaries successful.

..................................................   73% Done.


Setup files in progress.

..................................................   89% Done.


Setup files successful.

The installation of Oracle Grid Infrastructure 11g was successful.

Please check '/app/oraInventory/logs/silentInstall2021-09-11_01-05-01PM.log' for more details.

..................................................   94% Done.


Execute Root Scripts in progress.


As a root user, execute the following script(s):

       1. /app/oraInventory/orainstRoot.sh

       2. /app/product/11.2.0/grid/root.sh



..................................................   100% Done.


Execute Root Scripts successful.

As install user, execute the following script to complete the configuration.

       1. /u01/app/soft/gridsetup.sh -executeConfigTools -responseFile /u01/app/soft/install/response/gridsetup.rsp -silent

       


Successfully Setup Software.


zbsjkora:[+ASM]/app/soft/grid$  


4、安装完成后,用ROOT用户执行上述所需脚本

zbsjkora:/$/app/oraInventory/orainstRoot.sh

Changing permissions of /app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.


Changing groupname of /app/oraInventory to oinstall.

The execution of the script is complete.


zbsjkora:/$/app/product/11.2.0/grid/root.sh

Check /app/product/11.2.0/grid/install/root_zbsjkora_2021-09-12_02-15-26.log for the output of root script

zbsjkora:/$

zbsjkora:/$cat /app/product/11.2.0/grid/install/root_zbsjkora_2021-09-12_02-15-26.log

Performing root user operation for Oracle 11g  


The following environment variables are set as:

   ORACLE_OWNER= grid

   ORACLE_HOME=  /app/product/11.2.0/grid

Creating /usr/local/bin directory...

  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.

Using configuration parameter file: /app/product/11.2.0/grid/crs/install/crsconfig_params

Creating trace directory

LOCAL ADD MODE  

Creating OCR keys for user 'grid', privgrp 'oinstall'..

Operation successful.

LOCAL ONLY MODE  

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'root', privgrp 'system'..

Operation successful.

CRS-4664: Node zbsjkora successfully pinned.

Adding Clusterware entries to inittab


zbsjkora     2021/09/11 13:16:08     /app/product/11.2.0/grid/cdata/zbsjkora/backup_20210911_131608.olr

Successfully configured Oracle Grid Infrastructure for a Standalone Server



you can find the log of this instal session at: ....

Successfully Configgured Software


5、编辑(新建)response_file文件并执行(grid)


zbsjkora:[+ASM]/home/grid$vi $ORACLE_HOME/cfgtoollogs/cfgrsp.properties

oracle.assistants.asm|S_ASMPASSWORD=asm

oracle.assistants.asm|S_ASMMONITORPASSWORD=asm


执行命令:(grid)

zbsjkora:[+ASM]/app/soft/grid$ $ORACLE_HOME/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties

Setting the invPtrLoc to /app/product/11.2.0/grid/oraInst.loc


perform - mode is starting for action: configure


Sep 11, 2021 1:19:03 PM oracle.install.driver.oui.config.GenericInternalPlugIn invoke

INFO: Executing ASMCA

Sep 11, 2021 1:19:03 PM oracle.install.driver.oui.config.GenericInternalPlugIn invoke

INFO: Command /app/product/11.2.0/grid/bin/asmca -silent -oui_internal -configureASM -diskString '/dev/rhdisk*' -diskGroupName data -diskList /dev/rhdisk2 -redundancy EXTERNAL -au_size 1  

Sep 11, 2021 1:19:03 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn.handleProcess() entered.

Sep 11, 2021 1:19:03 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn: getting configAssistantParmas.

Sep 11, 2021 1:19:03 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn: checking secretArguments.

Sep 11, 2021 1:19:03 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: ... GenericInternalPlugIn: starting read loop.

Sep 11, 2021 1:19:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read: SYS_PASSWORD_PROMPT

Sep 11, 2021 1:19:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Processing: SYS_PASSWORD_PROMPT for argument tag -sysAsmPassword

Sep 11, 2021 1:19:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read: ASMSNMP_PASSWORD_PROMPT

Sep 11, 2021 1:19:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Processing: ASMSNMP_PASSWORD_PROMPT for argument tag -asmMonitorPassword

Sep 11, 2021 1:19:07 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: End of argument passing to stdin

Sep 11, 2021 1:19:45 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read:  

Sep 11, 2021 1:19:45 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read: ASM created and started successfully.

Sep 11, 2021 1:19:45 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read:  

Sep 11, 2021 1:19:45 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read: Disk Group data created successfully.

Sep 11, 2021 1:19:45 PM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess

INFO: Read:  


perform - mode finished for action: configure


You can see the log file: /app/product/11.2.0/grid/cfgtoollogs/oui/configActions2021-09-11_01-18-28-PM.log


5、查看ASM状态

zbsjkora:[+ASM]/app/soft/grid$  

zbsjkora:[+ASM]/app/soft/grid$ crsctl status res

TYPE=ora.diskgroup.type

TARGET=ONLINE

STATE=ONLINE on zbsjkora


NAME=ora.LISTENER.lsnr

TYPE=ora.listener.type

TARGET=ONLINE

STATE=ONLINE on zbsjkora


NAME=ora.asm

TYPE=ora.asm.type

TARGET=ONLINE

STATE=ONLINE on zbsjkora


NAME=ora.cssd

TYPE=ora.cssd.type

TARGET=ONLINE

STATE=ONLINE on zbsjkora


NAME=ora.diskmon

TYPE=ora.diskmon.type

TARGET=OFFLINE

STATE=OFFLINE


NAME=ora.evmd

TYPE=ora.evm.type

TARGET=ONLINE

STATE=ONLINE on zbsjkora


NAME=ora.ons

TYPE=ora.ons.type

TARGET=OFFLINE

STATE=OFFLINE


zbsjkora:[+ASM]/app/soft/grid$  

zbsjkora:[+ASM]/app/soft/grid$ crsctl stat res -t

--------------------------------------------------------------------------------

NAME           TARGET  STATE        SERVER                   STATE_DETAILS        

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.DATA.dg

              ONLINE  ONLINE       zbsjkora                                      

ora.LISTENER.lsnr

              ONLINE  ONLINE       zbsjkora                                      

ora.asm

              ONLINE  ONLINE       zbsjkora                 Started              

ora.ons

              OFFLINE OFFLINE      zbsjkora                                      

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.cssd

     1        ONLINE  ONLINE       zbsjkora                                      

ora.diskmon

     1        OFFLINE OFFLINE                                                    

ora.evmd

     1        ONLINE  ONLINE       zbsjkora      


6、检查监听状态    

zbsjkora:[+ASM]/app/soft/grid$  

zbsjkora:[+ASM]/app/soft/grid$ lsnrctl status


LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production on 11-SEP-2021 13:21:45


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 IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production

Start Date                11-SEP-2021 13:19:02

Uptime                    0 days 0 hr. 2 min. 43 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      ON

Listener Parameter File   /app/product/11.2.0/grid/network/admin/listener.ora

Listener Log File         /app/grid/diag/tnslsnr/zbsjkora/listener/alert/log.xml

Listening Endpoints Summary...

 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zbsjkora)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

 Instance "+ASM", status READY, has 1 handler(s) for this service...

The command completed successfully

zbsjkora:[+ASM]/app/soft/grid$  



7、添加磁盘组


zbsjkora:[+ASM]/app/soft/grid$ sqlplus / as sysasm


SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 11 13:25:58 2021


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 Automatic Storage Management option


SQL>  
SQL> alter diskgroup DATA add disk '/dev/rhdisk1','/dev/rhdisk3','/dev/rhdisk4','/dev/rhdisk5';


Diskgroup altered.


SQL> alter diskgroup DATA REBALANCE POWER 10;


Diskgroup altered.


SQL> set lines 150 pages 200  
col path for a40  
col HEADER_STATUS for a9  
col disk_name for a12  
col type for a16  
col bytes for 999,999,999,999  
col name for a52  

col name2 for a15  

col group_number heading 'Group|_NO' format 99  

col file_number heading 'FILE|NO' format 9999    
col redundancy format a6 noprint  

col striped format a6 noprint  

col FAILGROUP for a10    
col disk_number heading 'Disk|_NO' format 9999  

col MOUNT_STATUS heading 'Mount|_Status'    
col FAILGROUP heading 'FAIL|_GROUP'  

col TOTAL_MB heading 'Total|_MB' format 99,999,999  

select name name2,state,type,free_mb/1024,total_mb/1024,usable_file_mb/1024 from v$asm_diskgroup;


NAME2           STATE                  TYPE             FREE_MB/1024 TOTAL_MB/1024 USABLE_FILE_MB/1024

--------------- ---------------------- ---------------- ------------ ------------- -------------------

DATA            MOUNTED                EXTERN             4595.89551          4596          4595.89551


SQL> col name2 for a30  
col path for a30  
select GROUP_NUMBER,disk_number,MOUNT_STATUS,name name2,OS_MB,PATH from v$asm_disk;


Group  Disk Mount

  _NO   _NO _Status        NAME2                               OS_MB PATH

----- ----- -------------- ------------------------------ ---------- ------------------------------

    1     1 CACHED         DATA_0001                         1048576 /dev/rhdisk1

    1     0 CACHED         DATA_0000                          512000 /dev/rhdisk2

    1     2 CACHED         DATA_0002                         1048576 /dev/rhdisk3

    1     3 CACHED         DATA_0003                         1048576 /dev/rhdisk4

    1     4 CACHED         DATA_0004                         1048576 /dev/rhdisk5


SQL>  
SQL> alter diskgroup DATA drop disk 'DATA_0000';


Diskgroup altered.


SQL> alter diskgroup DATA REBALANCE POWER 10;


Diskgroup altered.


SQL> set lines 150 pages 200  
col path for a40  
col HEADER_STATUS for a9  
col disk_name for a12  
col type for a16  
col bytes for 999,999,999,999  
col name for a52  

col name2 for a15  

col group_number heading 'Group|_NO' format 99  

col file_number heading 'FILE|NO' format 9999    
col redundancy format a6 noprint  

col striped format a6 noprint  

col FAILGROUP for a10    
col disk_number heading 'Disk|_NO' format 9999  

col MOUNT_STATUS heading 'Mount|_Status'    
col FAILGROUP heading 'FAIL|_GROUP'  

col TOTAL_MB heading 'Total|_MB' format 99,999,999  

select name name2,state,type,free_mb/1024,total_mb/1024,usable_file_mb/1024 from v$asm_diskgroup;SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL>  

NAME2           STATE                  TYPE             FREE_MB/1024 TOTAL_MB/1024 USABLE_FILE_MB/1024

--------------- ---------------------- ---------------- ------------ ------------- -------------------

DATA            MOUNTED                EXTERN             4095.89551          4096          4095.89551


8、配置安装DB软件db_install.rsp

#oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0

oracle.install.option=INSTALL_DB_SWONLY

#ORACLE_HOSTNAME=zbsjkora

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/app/oracle/orainventory

#SELECTED_LANGUAGES=en,zh_CN

ORACLE_HOME=/app/oracle/product/11.2.0/db

ORACLE_BASE=/app/oracle

oracle.install.db.InstallEdition=EE

#oracle.install.db.EEOptionsSelection=false

oracle.install.db.OSDBA_GROUP=dba

oracle.install.db.OSOPER_GROUP=dba

oracle.install.db.OSBACKUPDBA_GROUP=dba

oracle.install.db.OSDGDBA_GROUP=dba

oracle.install.db.OSKMDBA_GROUP=dba

oracle.install.db.OSRACDBA_GROUP=dba

#DECLINE_SECURITY_UPDATES=true


./runInstaller -silent -ignorePrereq  -responseFile $ORACLE_HOME/install/response/db_install.rsp


9、创建数据库

dbca -silent \

   -createDatabase \

   -asmsnmpPassword asm \

   -characterSet ZHS16GBK     \

   -continueOnNonFatalErrors false \

   -diskGroupName DATA \

   -emConfiguration NONE \

   -gdbName orclgbk \

   -listeners LISTENER \

   -memoryPercentage 25 \

   -sid orclgbk\

  -sysPassword sys \

   -systemPassword sys \

  -storageType ASM \

   -sampleSchema true \

   -templateName General_Purpose.dbc

卸载
dbca -silent -deleteDatabase -sourceDB Globle_Name


10、安装补丁

10.1创建ocm.rsp响应文件

grid:

$ORACLE_HOME/OPatch/ocm/bin/emocmrsp  -no_banner -output /oracle/app/product/11.2.0/grid/OPatch/ocm/ocm.rsp

oracle:

$ORACLE_HOME/OPatch/ocm/bin/emocmrsp  -no_banner -output /oracle/app/product/11.2.0/db/OPatch/ocm/ocm.rsp

若没有emocmrsp可执行文件,手动touch 文件ocm.rsp


emocmrsp新建文件成功显示:

Provide your email address to be informed of security issues, install and

initiate Oracle Configuration Manager. Easier for you if you use your My

Oracle Support Email address/User Name.

Visit http://www.oracle.com/support/policies.html for details.

Email address/User Name:  
You have not provided an email address for notification of security issues.

Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y

The OCM configuration response file (/oracle/app/product/11.2.0/db/OPatch/ocm/ocm.rsp) was successfully created.



补丁包:

p34130714_190000_Linux-x86-64.zip

解压

unzip p34130714_190000_Linux-x86-64.zip

chown -R grid:oninstall 34130714

cat readme.html 查看需要的opatch版本12.2.0.1.30

ORACLE_HOME/OPatch#./opatch version 查看当前opatch版本12.2.0.1.17

适用高版本Opatch:p6880880_122010_Linux_x86-64.zip(scp上)

unzip p6880880_122010_Linux_x86-64.zip

grid:mv $ORACLE_HOME/Opatch $ORACLE_HOME/OPatchbak

/u01/app/soft#:mv Opatch /u01/app/19.0.0.0/grid

chown -R grid:oninstall OPatch

10.2使用响应文件打补丁:

打grid补丁:($ORACLE_HOME/OPatch)

./opatchauto apply /oracle/soft/29698727  -oh /oracle/app/product/11.2.0/grid  

打oracle补丁:($ORACLE_HOME/OPatch)

./opatchauto apply /oracle/soft/29698727 -oh /oracle/app/product/11.2.0/db



10.3查看补丁应用情况:

select * from dba_registry_history;


./opatch auto /oracle/soft/29698727 -oh /oracle/app/product/11.2.0/grid -ocmrf /app/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp

./opatch auto /oracle/soft/29698727 -oh /app/oracle/product/11.2.0/db ocmrf /app/oracle/product/11.2.0/db/OPatch/ocm/bin/ocm.rsp



































举报

相关推荐

0 条评论