LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 16-JAN-2018 05:25:28
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/洞改app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date16-JAN-2018 05:25:28
Uptime0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))
The listener supports no services
The command completed successfully
至此,所有工作已完成
若有疑问,亮尘请加QQ844357411进行咨询
这里介绍redhat下安装oracle的准备内容和步骤。
安装redhat *** 作系统,配置yum本地源,本地yum源的配置文件为/etc/yum.conf下面是一个/etc/yum.conf样例文件的内容:
[main]
cachedir=/home/installed
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
这里可将
cachedir=/home/installed
#cachedir=/home/installed这是自己定义的yum安装缓存目录
#keepcache=1表示安装后败清世,不删除包
#keepcache=0表示安装后,不保留包
安察肢装“X Window System”“Desk”“gnome”图形界面,安装必须的rpm包。
2
运行脚本,检查安装oracle需要的包是否都已经安装。如果系统已经配置了本地yum源,可使用最后输出的yum脚本直接安装需要补充的安装包。
####下面的代码没有问题,能执行,想法很好
####如果没有安装则使用awk 中的yum命令安装
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n" binutils \
compat-libstdc++-33 compat-db control-center elfutils-libelf elfutils-libelf-devel gcc \
gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ \
libstdc++-devel make sysstat unixODBC glibc-headers unixODBC-devel \
oracleasm oracleasmlib oracleasm-support \
pdksh sysstat xscreensaver | grep not | grep -v grep | awk '{print "yum install -y " $2 }'
####上面的程序可以改善成以下内容,这样方便查看rpm包关键字
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n" \
binutils \
compat-libstdc++-33 \
compat-db \
control-center \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
glibc-headers \
unixODBC-devel \
oracleasm \
oracleasmlib \
oracleasm-support \
pdksh \
sysstat \
xscreensaver \
| grep not | grep -v grep | awk '{print "正兆yum install -y " $2 }'
3
编辑/etc/sysconfig/network-scripts/ifcfg-eth0文件,配置IP地址:
下面是一个样例的/etc/syscofig/network-scripts/ifcfg-eth0文件内容:
DEVICE=eth0
BOOTPROTO=none
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="a4f7ad2e-219c-4eb7-bb60-ab83c3b9d651"
IPADDR=192.168.100.18
PREFIX=24
GATEWAY=192.168.100.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
DNS1=192.168.100.1
DOMAIN=192.168.100.1
HWADDR=00:0c:29:14:ba:74
USERCTL=no
4
修改/etc/sysconfig/network文件,将里面hostname改成机器名
后面是一个/etc/sysconfig/network文件内容的样例:
1. 修改/etc/sysconfig/network 文件
[root@localhost~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=dave
###配置网络映射/etc/sysconfig/network文件
我的network文件内容
####
#vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=guolong
#add the HOSTNAME lines ONLY
#the after step is vi /etc/hosts to add the IP and HOSTNAME
####
5
修改/etc/hosts文件,将IP地址和hostname添加到这个文件
我的hosts文件内容
# vi /etc/hosts
######
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#add the IP address and the HOSTNAME ONLY
#the next step is to run hostname in the command line
122.122.100.10 guolong
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
######
6
创建oracle用户所属的组oinstall 所属组dba 用户oracle,修改oracle用户密码,设置权限:
添加oracle用户和oinstall,dba组
[root@guolong oradisk]# /usr/sbin/groupadd oinstall
[root@guolong oradisk]# /usr/sbin/groupadd dba
[root@guolong oradisk]# /usr/sbin/useradd -g oinstall -G dba oracle
[root@guolong oradisk]# passwd oracle
[root@guolong network-scripts]# chown -R oracle:oinstall /opt/app
[root@guolong network-scripts]# chmod -R 775 /opt/app
[root@guolong network-scripts]#
7
配置Linux的内核参数,也就是修改/etc/sysconfig/sysctl.conf文件,并使用/etc/sysctl -p使配置生效。
可运行下面的命令查询内核参数值。
/sbin/sysctl -a | grep sem &&\
/sbin/sysctl -a | grep shm &&\
/sbin/sysctl -a | grep file-max &&\
/sbin/sysctl -a | grep ip_local_port_range &&\
/sbin/sysctl -a | grep rmem_default &&\
/sbin/sysctl -a | grep rmem_max &&\
/sbin/sysctl -a | grep wmem_default &&\
/sbin/sysctl -a | grep wmem_max &&\
/sbin/sysctl -a | grep aio-max-nr
内核参数不能低于下面的参考值:
####参考值
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
#kernel.shmmax = Minimum 536870912
kernel.shmmax = 68719476736
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
#net.ipv4.ip_local_port_range = Minimum 32768 Maxmum65500
net.ipv4.ip_local_port_range = 32768 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
下面是一个样例sysctl.conf文件的内容:
####用oracle用户修改并使得/etc/security/limits.conf配置文件生效
使用一个oracle安装者进行下面的配置,这里推荐使用oracle用户进行下面的配置
#编辑 /etc/sysctl.conf
/etc/sysctl.conf文件内容:
#vim /etc/sysctl.conf
io-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 = 1048576
#使sysctl.conf配置文件生效
运行下面的命令/etc/sysctl -p
如果要检查配置是否正确,可使用下面的命令
#检查sysctl.conf配置文件是否正确
#/sbin/sysctl -a
#运行结果如下
[root@guolong home]# /sbin/sysctl -p
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 = 1048576
[root@guolong home]#
8
修改oracle用户的资源限制文件,
编辑/etc/security/limits.conf
内容如下
以下是一个limits.conf文件的内容
样例/etc/security/limits.conf内容
#######
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
#######
9
修改oracle用户的~/.bash_profile文件,运行 source .bash_profile使配置生效。
内容如下:
10
运行xhost命令
[root@guolong network-scripts]# xhost 122.122.100.10
122.122.100.10 being added to access control list
11
配置本地显示
#配置本地显示
echo $DISPLAY
[root@guolong network-scripts]# echo $DISPLAY
:0.0
[root@guolong network-scripts]#
12
设置oracle环境变量,配置DISPLAY 和xhost,如有必要修改/etc/init.d文件,将id:3改为id:5默认使用图形界面启动。
13
mount oracle安装盘,如果是用光驱或者虚拟光驱,
mkdir /home/oradisk
mkdir /mnt/cdrom
mount -t iso9660 -o loop /dev/sr0 /mnt/cdrom
cp -Rv /mnt/cdrom/* /home/oradisk
然后cd /home/oradisk
命令行运行 ./runInstaller即可
14
注销系统,或者重启系统,悬着用户oracle,使用oracle用户登录系统。
##开始安装oracle
$ /mount_point/db/runInstaller
1. 检查系统包rpm -q compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh5.2.14
这里需要注意,rhel6里面没有pdk5.2.14这个包,橘衡戚需要单独下载,5版本的在光盘下面都可以找到。
ftp://ftp.pbone.net/mirror/archive.download.redhat.com/pub/redhat/linux/6.1/en/os/i386/RedHat/RPMS/pdksh-5.2.14-1.i386.rpm
附上下载地址
2. 修改内核参数
先备份
cp /拦败etc/sysctl.conf /etc/sysctl.conf.bk
修改,加入如下内容
vi /etc/sysctl.conf
(这里和从前安装10g时候的参数是不一样的)
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
sysctl -p
3. 添加用户和组圆陵。
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
passwd oracle
4. 修改环境变量
linux
vi /home/oracle/.bash_profile
export EDITOR=vi
export ORACLE_SID=dex
export ORACLE_BASE=/u01/apps/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11gr2/db_1
export nls_date_format="yyyy-mm-dd hh24:mi:ss"
export PATH=/u01/apps/oracle/product/11gr2/db_1/bin:$PATH
5. 修改用户限制
vi /etc/security/limits.conf
末尾加入
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login
末尾加入
session required /lib/security/pam_limits.so
6.编辑/etc/profile
vi /etc/profile
末尾加入
if [ $USER = "oracle" ]then
if [ $SHELL = "/bin/ksh" ]then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
7. 建立目录并且授权
mkdir -p /u01/apps/oracle
chown -R oracle:oinstall /u01
8. 最后验证一下
su - oracle
9. reboot,解压,./runInstall
10. 祝你好运。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)