1. the following error is reported:
[Oracle @ rac1 ~] $ Srvctl add service-d rac-s test-r "rac1"
/U01/app/oracle/product/dbhome_1/jdk/jre/bin/java: error while loading shared libraries: libpthread. so.0: cannot open shared object file: No such file or directory
[Oracle @ rac1 ~] $
Which srvctl -- view this command, which is under ORACLE_HOME and should normally be under CRS_HOME.
/U01/app/oracle/product/dbhome_1/bin/srvctl
2. Solution: Modify the environment variable and put CRS_HOME in front of the PATH.
[Oracle @ rac1 ~] $ Vi. bash_profile
Set
$ ORA_CRS_HOME/bin: Put it in front of $ ORACLE_HOME/bin. ---- it was originally behind
PATH = $ ORA_CRS_HOME/bin: $ ORACLE_HOME/bin:$ ORACLE_HOME/OPatch: $ PATH: $ HOME/bin: $ ASM_HOME/bin
[Oracle @ rac1 ~] $ Which srvctl
/U01/app/oracle/product/dbhome_1/bin/srvctl
[Oracle @ rac1 ~] $ Source. bash_profile
[Oracle @ rac1 ~] $
Which srvctl --- this is the SRVCTL found under CRS_HOME.
/U01/app/oracle/product/crs/bin/srvctl
[Oracle @ rac1 ~] $
Srvctl add service-d rac-s test-r "rac1" -- can be used normally.