ORACLE 安装脚本用户及环境
2015-01-21 10:48
274 查看
#!/bin/bash
echo "Now create 3 groups named 'oinstall','dba','oper'"
echo "Plus 1 users named 'oracle',Also setting the Environment"
groupadd -g 1100 oinstall
groupadd -g 1200 dba
groupadd -g 1300 oper
useradd -u 1000 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle
echo 'export PS1="`/bin/hostname -s`-> "' >> /home/oracle/.bash_profile
echo "export TMP=/tmp" >> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=db1">> /home/oracle/.bash_profile
echo "export ORACLE_SID=orcl">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=primary">> /home/oracle/.bash_profile
echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib' >> /home/oracle/.bash_profile
echo "export EDITOR=vi" >> /home/oracle/.bash_profile
#echo "export LANG=en_US" >> /home/oracle/.bash_profile
echo "export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK" >> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/oracle/.bash_profile
echo "umask 022">> /home/oracle/.bash_profile
echo "The Groups and users has been created"
echo "The Environment for oracle also has been set successfully"
echo "Now create 3 groups named 'oinstall','dba','oper'"
echo "Plus 1 users named 'oracle',Also setting the Environment"
groupadd -g 1100 oinstall
groupadd -g 1200 dba
groupadd -g 1300 oper
useradd -u 1000 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle
echo 'export PS1="`/bin/hostname -s`-> "' >> /home/oracle/.bash_profile
echo "export TMP=/tmp" >> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=db1">> /home/oracle/.bash_profile
echo "export ORACLE_SID=orcl">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=primary">> /home/oracle/.bash_profile
echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib' >> /home/oracle/.bash_profile
echo "export EDITOR=vi" >> /home/oracle/.bash_profile
#echo "export LANG=en_US" >> /home/oracle/.bash_profile
echo "export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK" >> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/oracle/.bash_profile
echo "umask 022">> /home/oracle/.bash_profile
echo "The Groups and users has been created"
echo "The Environment for oracle also has been set successfully"
相关文章推荐
- Oracle安装前的环境配置脚本
- crontab 中 python(cx_Oracle)脚本执行时需要用户环境变量,怎么办??
- linux安装oracle 11g环境搭配自动安装脚本
- oracle默认的hr用户使用脚本安装
- 【Linux】Solaris10下安装后Oracle11g的环境变量配置,实现oracle用户下支持sqlplus,lsnrctl等命令
- 红帽安装oracle 10g系统环境配置脚本
- Oracle 11g 安装环境配置脚本
- oracle安装环境一键部署脚本
- Oracle安装部署之RAC安装环境配置脚本
- Linux环境一键自动化安装oracle软件的构想(附shell脚本)
- Oracle管理监控之测试环境清理用户脚本
- Oracle 10g 安装环境配置脚本
- RedHat安装oracle 10g系统环境配置脚本
- linux 下 安装oracle配置用户环境变量参数
- 【安装oracle——准备工作】配置内核参数+添加用户组及用户+为oracle用户配置shell限制+创建目录结构+设置oracle环境
- oracle安装用户环境变量配置
- MOSS环境下安装配置RMS时的用户权限
- oracle 安装脚本
- Oracle批量创建用户和导入导出的脚本
- Windows下Perl开发环境的安装与配置---方便于M$用户