您的位置:首页 > 数据库 > Oracle

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"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: