oracle 10gr2 环境变量配置脚本
2012-11-01 20:48:50 来源:WEB开发网核心提示:cp /etc/selinux/config /etc/selinux/sugon.bak.config &&if [ $? != 0 ];thenecho "backup selinux.config failed"exit -1fiecho -n "SELINUX=disabled&
cp /etc/selinux/config /etc/selinux/sugon.bak.config &&
if [ $? != 0 ];then
echo "backup selinux.config failed"
exit -1
fi
echo -n "SELINUX=disabled" > /etc/selinux/config &&
if [ $? != 0 ];then
echo "modify selinux failed"
exit -1
fi
##Create the new groups and users:
echo -e '\n'
echo -en '\e[31m Create the user and group for install ! \e[0m \n'
groupadd oinstall &&
groupadd dba &&
groupadd oper &&
useradd -g oinstall -G dba oracle &&
echo 11111 | passwd oracle --stdin
##Create the directories in which the Oracle software will be installed:
echo -e '\n'
echo -en '\e[31m Create the DIR for ORACLE_BASE and chown the privilege! \e[0m \n'
mkdir -p $ORACLE_BASE/product/10.2.0/db_1 &&
chown -R oracle.oinstall /u01 &&
##Login as the oracle user and add the following lines at the end of the .bash_profile file:
echo -e '\n'
echo -en '\e[31m Modify the bash_profile of oracle ! \e[0m \n'
cat << EOF >> /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=/u01/crs/oracle/10gr2/crs
export ORACLE_SID=orcl
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$ORACLE_HOME/bin:$HOME/bin:$ORA_CRS_HOME/bin:/sbin:$ORA_ASM_HOME:$PATH
EOF
if [ $? != 0 ];then
echo "backup selinux.config failed"
exit -1
fi
echo -n "SELINUX=disabled" > /etc/selinux/config &&
if [ $? != 0 ];then
echo "modify selinux failed"
exit -1
fi
##Create the new groups and users:
echo -e '\n'
echo -en '\e[31m Create the user and group for install ! \e[0m \n'
groupadd oinstall &&
groupadd dba &&
groupadd oper &&
useradd -g oinstall -G dba oracle &&
echo 11111 | passwd oracle --stdin
##Create the directories in which the Oracle software will be installed:
echo -e '\n'
echo -en '\e[31m Create the DIR for ORACLE_BASE and chown the privilege! \e[0m \n'
mkdir -p $ORACLE_BASE/product/10.2.0/db_1 &&
chown -R oracle.oinstall /u01 &&
##Login as the oracle user and add the following lines at the end of the .bash_profile file:
echo -e '\n'
echo -en '\e[31m Modify the bash_profile of oracle ! \e[0m \n'
cat << EOF >> /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=/u01/crs/oracle/10gr2/crs
export ORACLE_SID=orcl
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$ORACLE_HOME/bin:$HOME/bin:$ORA_CRS_HOME/bin:/sbin:$ORA_ASM_HOME:$PATH
EOF
- ››oracle 中 UPDATE nowait 的使用方法
- ››Oracle ORA-12560解决方法
- ››Oracle 10g RAC 常用维护命令
- ››Oracle如何在ASM中定位文件的分布
- ››Oracle的DBMS_RANDOM.STRING 的用法
- ››oracle 外部表导入时间日期类型数据,多字段导入
- ››Oracle中查找重复记录
- ››oracle修改用户登录密码
- ››Oracle创建删除用户、角色、表空间、导入导出等命...
- ››Oracle中登陆时报ORA-28000: the account is lock...
- ››Oracle数据库在配置文件中更改最大连接数
- ››Oracle中在pl/sql developer修改表的两种方式
更多精彩
赞助商链接