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

来源:互联网 发布:身份证相片制作软件 编辑:程序博客网 时间:2024/06/10 02:51
三、修改 oracle 用户的初始化参数文件,建路径
 
在OCM环境中,我们也只需要在查看:cat /home/oracle/.bash_profile

官方参考:http://docs.oracle.com/cd/B19306_01/install.102/b14203/prelinux.htm


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_SID, ORACLE_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

解决方法连接:http://blog.csdn.net/rlhua/article/details/21858001


建路径,改权限-两个节点都要执行,这个在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
0 0
原创粉丝点击