OCM_Session7_3_修改 oracle 用户的初始化参数文件,建路径

本文档指导如何配置Oracle用户环境,包括设置umask为022,设定DISPLAY、ORACLE_BASE和ORACLE_HOME变量,确保PATH包含指定路径,并在安装Oracle Clusterware前创建临时目录。此外,还说明了在不同shell环境下编辑用户启动文件,设置DISPLAY变量以在本地系统显示应用程序,以及检查和调整TEMP和TMPDIR环境变量的方法。
摘要由CSDN通过智能技术生成
三、修改 oracle 用户的初始化参数文件,建路径
 
在OCM环境中,我们也只需要在查看:cat /home/oracle/.bash_profile



2.5 Configuring the oracle User's Environment

You run Oracle Universal Installer from the oracle account. However, before you start Oracle Universal Installer you must configure the environment of the oracle user.

To configure the environment, you must:

  • Set the default file mode creation mask (umask) to 022 in the shell startup file

  • Set the DISPLAY, ORACLE_BASE, and ORACLE_HOME environment variables in preparation for the Oracle Clusterware installation

You should also ensure that the PATH variable contains $ORACLE_HOME/bin before /usr/X11R6/bin

To set the oracle user's environment, follow these steps:

  1. Start a new terminal session; for example, start an X terminal (xterm).

  2. Enter the following command to ensure that X Window applications can display on this system:

    $ xhost +   hostname

    The hostname is the name of the local host.

  3. If you are not already logged in to the system where you want to install the software, then log in to that system as the oracle user.

  4. If you are not logged in as the oracle user, then switch user to oracle:

    $ su - oracle
  5. To determine the default shell for the oracle user, enter the following command:

    $ echo $SHELL
  6. Open the oracle user's shell startup file in any text editor:

    Note:

    On Red Hat Linux,   .bash_profile  is the user startup file for the Bash shell.
    • Bourne shell (sh), Bash shell (bash) or Korn shell (ksh):

      % vi .bash_profile
    • C shell (csh or tcsh):

      % vi .login
  7. Enter or edit the following line, specifying a value of 022 for the default file mode creation mask:

    umask 022
  8. If the ORACLE_SIDORACLE_HOME, or ORACLE_BASE environment variable is set in the file, then remove the appropriate lines from the file.

  9. Save the file, and exit from the text editor.

  10. To run the shell startup script, enter one of the following commands:

    • Bash shell on Red Hat Enterprise Linux:

      $ . ./.bash_profile
    • Bourne, Bash, or Korn shell:

      $ . ./.profile
    • C shell:

      % source ./.login
  11. If you are not installing the software on the local system, then enter a command similar to the following to direct X applications to display on the local system:

    • Bourne, Bash, or Korn shell:

      $ DISPLAY= local_host:0.0 ; export DISPLAY
    • C shell:

      % setenv DISPLAY   local_host:0.0

    In this example, local_host is the host name or IP address of the system that you want to use to display Oracle Universal Installer (your workstation or PC).

  12. If you determined that the /tmp directory has less than 400 MB of free disk space, then identify a file system with at least 400 MB of free space and set the TEMP and TMPDIR environment variables to specify a temporary directory on this file system:

    Note:

    You cannot use a shared file system as the location of the temporary file directory (typically   /tmp) for Oracle RAC installation. If you place   /tmp  on a shared file system, then the installation fails.
    1. Use the df -h command to identify a suitable file system with sufficient free space.

    2. If necessary, enter commands similar to the following to create a temporary directory on the file system that you identified, and set the appropriate permissions on the directory:

      $ su - root
       
      # mkdir /
      mount_point
      /tmp
       
      # chmod 775 /
      mount_point
      /tmp
       
      # exit
    3. Enter commands similar to the following to set the TEMP and TMPDIR environment variables:

      • Bourne, Bash, or Korn shell:

        $ TEMP=/ mount_point
        /tmp
         
        $ TMPDIR=/
        mount_point
        /tmp
         
        $ export TEMP TMPDIR
      • C shell:

        % setenv TEMP / mount_point
        /tmp
         
        % setenv TMPDIR /
        mount_point/tmp

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

我的修改如下:
--------------------------------------------------------------------------------------------
rac1节点

[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ vi .bash_profile
# .bash_profile

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

# User specific environment and startup programs

export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
export ORACLE_SID=racdb1
export ORACLE_TERM=xterm
export PATH= $ORA_CRS_HOME/bin: $ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin/:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022

PATH=$PATH:$HOME/bin
".bash_profile" 24L, 633C written                             
[oracle@rac1 ~]$ . .bash_profile
[oracle@rac1 ~]$ 

---------------------------------------------------------------------------------------
rac2节点

[root@rac2 ~]# su - oracle
[oracle@rac2 ~]$ vi .bash_profile
# .bash_profile

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

# User specific environment and startup programs

export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
export ORACLE_SID=racdb2
export ORACLE_TERM=xterm
export PATH= $ORA_CRS_HOME/bin: $ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin/:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022


".bash_profile" 25L, 634C written                             
[oracle@rac2 ~]$ . .bash_profile
[oracle@rac2 ~]

这里需要注意 $ORA_CRS_HOME/bin: $ORACLE_HOME/bin:这两个的位置,确保使用的srvctl命令使用的是 $ORA_CRS_HOME/bin的。

[oracle@rac1 ~]$ srvctl
/u01/app/oracle/product/10.2.0/db_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
/u01/app/oracle/product/10.2.0/db_1/bin/srvctl



建路径,改权限-两个节点都要执行,这个在OCM环境已经配置好
-----------------------------------------------------------------------------------
rac1节点:
[oracle@rac1 ~]$ su -
Password: 
[root@rac1 ~]# mkdir -p /u01/app/oracle
[root@rac1 ~]# chown -R oracle:oinstall /u01/app/oracle

------------------------------------------------------------------------------------
rac2节点
[oracle@rac2 ~]$ su -
Password: 
[root@rac2 ~]# mkdir -p /u01/app/oracle
[root@rac2 ~]# chown -R oracle:oinstall /u01/app/oracle
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值