--Oracle--RAC--2

---------

三、创建账号

在三个主机【两个群集节点和客户端】上创建下面的组和oracle用户

# groupadd -g 500 oinstall
# groupadd -g 400 dba

# useradd -u 400 -g 500 -G dba -c "Oracle Owner" -d /home/oracle -s /bin/bash oracle
# passwd oracle

# vi $HOME/.bash_profile

#!/bin/bash

# Akadia AG, Fichtenweg 10, CH-3672 Oberdiessbach
# --------------------------------------------------------------------------
# File:        .bash_profile
#
# Autor:       Martin Zahn, Akadia AG, 20.09.2007
#
# Purpose:     Configuration file for BASH Shell
#
# Location:    $HOME
#
# Certified:   Oracle Enterprise Linux 5
# --------------------------------------------------------------------------

# User specific environment and startup programs

TZ=MET; export TZ
PATH=${PATH}:$HOME/bin
ENV=$HOME/.bashrc
BASH_ENV=$HOME/.bashrc
USERNAME=`whoami`
POSTFIX=/usr/local/postfix
# LANG=en_US.UTF-8
LANG=en_US
COLUMNS=130
LINES=45
DISPLAY=192.168.138.11:0.0
export USERNAME ENV COLUMNS LINES TERM PS1 PS2 PATH POSTFIX BASH_ENV LANG DISPLAY

# Setup the correct Terminal-Type【设置恰当的终端类型】

if [ `tty` != "/dev/tty1" ]
then
# TERM=linux
TERM=vt100
else
# TERM=linux
TERM=vt100
fi

# Setup Terminal (test on [ -t 0 ] is used to avoid problems with Oracle Installer)
# -t fd  True if file descriptor fd is open and refers to a terminal.

if [ -t 0 ]
then
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty cs8 -parenb -istrip hupcl ixon ixoff tabs
fi

# Set up shell environment【设置shell环境】

# set -u                                # error if undefined variable.
trap "echo -e 'logout $LOGNAME'" 0      # what to do on exit.

# Setup ORACLE 11 environment【设置Oracle 11环境】

if [ `uname -n` = "gentic" ]
then
ORACLE_SID=AKA1; export ORACLE_SID
fi
if [ `uname -n` = "cellar" ]
then
ORACLE_SID=AKA2; export ORACLE_SID
fi
ORACLE_HOSTNAME=`uname -n`; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=${ORACLE_BASE}/product/11.1.0; export ORACLE_HOME
ORA_CRS_HOME=${ORACLE_BASE}/crs; export ORA_CRS_HOME
TNS_ADMIN=${ORACLE_HOME}/network/admin; export TNS_ADMIN
ORA_NLS11=${ORACLE_HOME}/nls/data; export ORA_NLS10
CLASSPATH=${ORACLE_HOME}/JRE:${ORACLE_HOME}/jlib:${ORACLE_HOME}/rdbms/jlib
export CLASSPATH
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_OWNER=oracle; export ORACLE_OWNER
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1; export NLS_LANG
LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

# Set up the search paths:【设置搜索路径】

PATH=${POSTFIX}/bin:${POSTFIX}/sbin:${POSTFIX}/sendmail:${ORACLE_HOME}/bin
PATH=${PATH}:${ORA_CRS_HOME}/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
PATH=${PATH}:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin
PATH=${PATH}:.
export PATH

# Set date in European-Form【设置日期为欧洲形式】

echo -e " "
date '+Date: %d.%m.%y Time: %H:%M:%S'
echo -e " "
uname -a

# Clean shell-history file .sh_history【清除shell历史文件.sh_history】

: > $HOME/.bash_history

# Show last login【显示最后一次登陆】

cat .lastlogin
term=`tty`
echo -e "Last login at `date '+%H:%M, %h %d'` on $term" >.lastlogin
echo -e " "

if [ $LOGNAME = "root" ]
then
echo -e "WARNING: YOU ARE SUPERUSER !!!"
echo -e " "
fi

# Get the aliases and functions

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# Set Shell Limits for user oracle【设置oracle用户限制】

if [ $USER = "oracle" ]
then
ulimit -u 16384 -n 65536
fi

# Umask new files to rw-r--r--

umask 022

$HOME/.bashrc

alias more=less
alias up='cd ..'
alias kk='ls -la | less'
alias ll='ls -la'
alias ls='ls -F'
alias ps='ps -ef'
alias home='cd $HOME'
alias which='type -path'
alias h='history'
#
# Do not produce core dumps
#
# ulimit -c 0

PS1="`whoami`@\h:\w> "
export PS1

PS2="> "
export PS2


posted @ 2009-06-16 15:45  mop  阅读(268)  评论(0)    收藏  举报