2019独角兽企业重金招聘Python工程师标准>>>
工作需求,经常用阿里云centos6.8安装oracle11g。都是本地的文本文件复制粘贴,写到博客方便复制些。
安装epel源,阿里云机器默认已经安装不需要,我这里把命令也发来。
yum install epel-release -y
语音环境的改变:
把/etc/sysconfig/i18n的内容,其中的LANG="C"(en_US.UTF-8)改成了LANG=zh_CN.UTF-8以后,推出重新登陆(重启),然后运行locale -a 。这个根据需求来,如果只安装oracle 还是改成en_US.UTF-8吧。
一些报的常见包的安装:
yum install gcc -y
yum install libgcc gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-util glibc-static libcurl libcurl-devel libconfig libconfig-devel -y
yum install ncurses-devel ncurses -y
yum install zip unzip -y
yum install lrzsz -y
yum install glibc-headers kernel-headers libevent-headers -y
yum install xdm
yum groupinstall "Desktop"
yum groupinstall 'X Window System'
yum groupinstall "chinese support"
安装nginx还可以直接:
yum install pcre pcre-devel pcre-static zlib zlib-devel zlib-static openssl openssl-devel openssl-static -y
阿里云相关的,这样才能正常使用阿里云的桌面系统:
chkconfig --level 35 haldaemon on
chkconfig --level 35 messagebus on
nameserver 223.5.5.5
nameserver 223.6.6.6
vim /etc/inittab,把3修改成5,利用图像界面进入系统。
swap不够时的操作:
dd if=/dev/zero of=/u01/swapfile bs=1M count=32800
mkswap /u01/swapfile
mkswapon /u01/swapfile
如果需要系统启动则在 /etc/rc.local下添加
mount -a
swapon /u01/swapfile
也可以在/etc/fstab里添加如下代码(实现启动时加载):
/dev/vdb1 /u01 ext4 defaults 0 0
/u01/swapfile swap swap defaults 0 0
二、 数据库安装环境准备
1,oracle的一些包的安装(后面安装时按需求做也可以):
yum install -y compat-libstdc*
yum install -y elfutils-libelf*
yum install -y gcc*
yum install -y glibc*
yum install -y ksh*
yum install -y libaio*
yum install -y libgcc*
yum install -y libstdc*
yum install -y make*
yum install -y sysstat*
yum install libXp* -y
yum install -y glibc-kernheaders
yum install unixODBC unixODBC-devel unixODBC.i686 unixODBC-devel.i686 -y
unixODBC
kernel-headers
libevent-headers
glibc-headers
compat-glibc-headers
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh? \
libaio \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh? libaio libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat
2,
1)编辑/etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
Enter the following command to change the current values of the kernel parameters:
# /sbin/sysctl -p
2)编辑/etc/security/limits.conf
oracle soft nproc 2047
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft stack 10240
3)创建oracle用户,组
groupadd oinstall;
groupadd oper;
groupadd dba;
useradd oracle -g oinstall -G dba,oper oracle
passwd oracle
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -m oracle
passwd oracle
chown -R oracle:oinstall /u01
4) oracle相关 环境变量设置
.bash_profile文件中加入如下内容:
export ORACLE_SID=orcl
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
保存后使环境变量生效。
. .bash_profile
5)创建安装目录
# mkdir /opt/app
#chown -R oracle:oinstall /opt/app
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=nbb
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/oracm/lib:$ORACLE_HOME/lib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/jlib:$ORACLE_HOME/network/lib
export LANG=en_US.UTF-8
#export NLS_LANG=american_america.ZHS16GBK
#export NLS_LANG=american_america.AL32UTF8
export NLS_LANG=american_america.UTF8
export EDITOR=vi
3,后续
dbca
netca
oracleroot
sqlplus "/as sysdba"
sqlplus /nolog
conn as sysdba
select * from v$version;
lsnrctl start
startup
lsnrctl status
后来添加 ,安装是没有oracle oinstall等这些用户,只有oracle用户的话
usermod -g oinstall -G dba,oracle -m oracle