`
1enny
  • 浏览: 69971 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

oracle的安装

 
阅读更多
Oracle001
[root@localhost /]# cd media
[root@localhost media]# ls
RHEL_5.5 x86_64 DVD RHEL_5.5 x86_64 DVD_
[root@localhost media]#cd RHEL_5.5 x86_64 DVD
-bash: cd: RHEL_5.5: No such file or directory
[root@localhost media]# ls
RHEL_5.5 x86_64 DVD_
[root@localhost media]#cd RHEL_5.5\ x86_64\ DVD_/
[root@localhost RHEL_5.5 x86_64 DVD_]# LS

//上面的红色标注的意思:在linux中假如文件路径中存在空格那么就需要使用\进行转义。因为在linux中空格默认是结束命令符



yum源的超级简单配置


1.先挂载光盘。

使用命令“mount -o loop /dev/sr0 /mnt/cdrom”。如果使用命令“mount -o loop /dev/cdrom /mnt/cdrom”也行,不过有时会出现错误,原因是/dev/cdrom是/dev/sr0的软链接文件,如果没有进行此设置的话,会让你检查文件系统的。/mnt下可以新建一个cdrom目录。

2.设置yum源的配置定义文件,该文件必须存放在/etc/yum.repos.d目录下,并且要以“.repo”结尾。本文以dvd.repo为例,编辑此配置定义文件:

[dvd] --------------->必须写的,中括号的内容可以随便写,但一定要有中括号
name = yum server ----------->可写可不写,内容随便,主要是个提示作用
baseurl=file:///mnt/cdrom --------------->一定要写的,定义yum源的仓库所在
enabled=1 --------------------->数字1为启用当前yum源,0为禁用,默认为1。
gpgcheck=0 ----------------------->是否检查rpm包的数字签名,数字1为检查,0为不检查,可以不写。

具体步骤如下:

1. 新建/mnt/cdrom目录 :mkdir /mnt/cdrom

2.挂载光盘:“mount -o loop /dev/sr0 /mnt/cdrom”,然后进入挂载目录,可以查看光盘的内容。参数“-o loop”是挂载特殊设备的。

3.新建yum源配置文件:vim /etc/yum.repos.d/dvd.repo .然后输入内容。注意:baseurl后面跟的是挂载光盘所在的目录。当然也可以使用其他的yum源,比如ftp,http.

[dvd]
name=yum server
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0

4. 安装软件进行测试,“yum -y install mysql”,成功安装后会在结尾出现“Complete!”.

yum故障排除

1.确认光盘是否成功挂载。

2.检查yum源定义文件是否存在错误,此文件要求非常严格,任何一个单词或字母出错均会导致yum出现问题。

3.检查是否还有其他的yum源定义文件。系统中可能会存在一些默认的yum源,最好将这些yum源设置为禁用或者删除。

4.用命令“yum clear all”清除缓存。

5.执行命令“yum list”能否正确列出yum源中的软件包。

6.若出现NOKEY的情况,需要导入密钥。

rpm --import /etc/pki/rpm-gpg/R[Tab键] -release

7.如果首次安装软件包之后,再次安装别的软件包的时候,很可能会发现报错了,错误信息如下:

Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia.Please verify its path and try again

解决方法:rhel6在首次读取改软件仓库之后,会把原本光盘根目录下,也就是一同被你拷贝到软件仓库目录的media.repo复制一份到/etc/yum.repos.d/,而该文件也就是导致本地yum源失效的罪魁祸首。

第一步:先卸载一个软件:yum remove PackageKit.

第二步:进入/etc/yum.repos.d/目录,删除系统复制的那份配置文件。

我这是用的系统是RHEL6.0的,故要删除的文件为packagekit-media.repo。保留自己建立的配置文件dvd.repo.



使用RedHat系统在线安装时提示This system is not registered with RHN.如下:

[root@localhost ~]# yum install httpd
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package httpd available.
Nothing to do
解决方案:

1.卸载redhat自带的yum组件

[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps

2.安装CentOS的yum包

[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm
[root@localhost ~]# rpm -ivh *.rpm
warning: yum-3.2.22-37.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [ 33%]
2:yum-fastestmirror ########################################### [ 67%]
3:yum ########################################### [100%]

3. 下载更新源,并存放在系统目录中
[root@localhost ~]# wget http://www.linuxidc.com/files/2011/05/06/CentOS-Base.repo

[root@localhost ~]#mv CentOS_Base.repo /etc/yum.repos.d/CentOS-Base.repo

4.生成缓存并进行安装

[root@localhost ~]# yum makecache
[root@localhost ~]# yum install httpd




oracle11g 安装时经常会提示缺少系统包,最好用yum安装一下。

yum可以使用网络在线安装,也可以使用本地光盘或者iso文件,两者均可。

一) 网络在线安装

首先要下载自己版本对应的repo文件,然后再配置,再安装,如下:

1. 下载repo文件

Oracle Linux 4, Update 6 or Newer

# cd /etc/yum.repos.d

# mv Oracle-Base.repo Oracle-Base.repo.disabled

# wget http://public-yum.oracle.com/public-yum-el4.repo


Oracle Linux 5

# cd /etc/yum.repos.d

# wget http://public-yum.oracle.com/public-yum-el5.repo


Oracle Linux 6

# cd /etc/yum.repos.d

# wget http://public-yum.oracle.com/public-yum-ol6.repo

Oracle VM 2

# cd /etc/yum.repos.d

# wget http://public-yum.oracle.com/public-yum-ovm2.repo

2. 最后修改下载的文件,把Change enabled=0 改为 enabled=1

3. 现在就可以使用yum 安装和更新补丁了

4) yum install libaio-devel
yum install unixODBC-devel

yum installsysstat

二)本地iso文件安装

但是还是不能更新,来招狠的吧,直接用本地iso文件作为yum源,如下:

在使用yum安装之前是必须配置yum源的, 在不能联网的情况下, 可使用DVD光盘或ISO文件做本地yum源. 下面以RHEL5.4为例, 其它版本类似.

1. 建立ISO文件存放目录(/u01/software/iso)和ISO文件的挂载目录(/u01/software/rhel5)
# mkdir /u01/software/iso
# mkdir /u01/software/rhel5
如果有现成的ISO文件可以直接上传至/u01/software/iso目录下.

2. 如果是DVD光盘(插入服务器后自动映射在/dev/cdrom下), 则先制作ISO文件
# cp /dev/cdrom /u01/software/iso/rhel-server-5.4-i386-dvd.iso

# dd if=/dev/cdrom of=/u01/software/iso/rhel-server-5.4-i386-dvd.iso

3. 挂载ISO文件
# mount -t iso9660 -o loop /u01/software/iso/rhel-server-5.4-i386-dvd.iso /u01/software/rhel5
# df -h
Filesystem Size Used Avail Use% Mounted on
...
/u01/software/iso/rhel-server-5.4-i386-dvd.iso
2.8G 2.8G 0 100% /u01/software/rhel5
# ll /u01/software/rhel5

4. 确保系统中已经安装了yum相关软件包
# rpm -qa |grep yum
没有就麻烦啦,先安装yum吧,不过一般都默认安装了。


5. 编辑repo文件, 先把原自带的repo文件去掉或重命名,就是让别的repo文件失效,只使用本地的源
# mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.enc
# vi /etc/yum.repos.d/rhel5.repo
-------------------------------------------------------------------------------
[Server]
name=rhel5server
baseurl=file:///u01/software/rhel5/Server
enable=1
gpcheck=1
gpgkey=file:///u01/software/rhel5/RPM-GPG-KEY-redhat-release
-------------------------------------------------------------------------------
注意这里的baseurl指向Server目录, 如果还要安装诸如集群和虚拟机等软件, 则还需建立指向Cluster,ClusterStorage,VT的baseurl.

6. 测试
# system-config-packages (在XWindow下, 选择安装需要的软件包)
# yum install lrzsz (下载安装lrzsz软件包,自动查找解决依赖关系)




其实你刚刚跟我解决了问题。。。但是我还不知道你是怎么解决的呢
我有三个问题:
1.怎么把镜像文件改名了?
2.为什么刚刚你建议我使用ln做事为什么?
3.假如不改为mnt2的话带空格的名称可不可链接repomd.xml文件去。。。


1、镜像文件是不能改名的,因为镜像文件只能只读挂载,没权限改名;
2、ln-s做软连接,就相当于给rhel镜像做个别名了一下,就可以指定一个没空格的文件名,排除空格问题;
3、你原理没懂,yum配置文件目标是找到仓库的配置文件,你repo的配置文件在哪儿就配置到哪儿

[oracle@localhost test]$ cat test1
this is a file ,name is test1
[oracle@localhost test]$ cat test2
this is test2 name is test2
[oracle@localhost test]$ ll
total 32
drwxr--r-x 2 root root 4096 Dec 20 23:04 package1
drwxr-xr-x 2 root root 4096 Dec 20 23:07 package2
-rw-r--r-- 1 root root 30 Dec 20 23:16 test1
-rwxr--r-x 1 root root 28 Dec 20 23:16 test2
[oracle@localhost test]$ su root
Password:
[root@localhost test]# ll
total 32
drwxr--r-x 2 root root 4096 Dec 20 23:04 package1
drwxr-xr-x 2 root root 4096 Dec 20 23:07 package2
-rw-r--r-- 1 root root 30 Dec 20 23:16 test1
-rwxr--r-x 1 root root 28 Dec 20 23:16 test2
[root@localhost test]# chmod 744 package1
[root@localhost test]# ll
total 32
drwxr--r-- 2 root root 4096 Dec 20 23:04 package1
drwxr-xr-x 2 root root 4096 Dec 20 23:07 package2
-rw-r--r-- 1 root root 30 Dec 20 23:16 test1
-rwxr--r-x 1 root root 28 Dec 20 23:16 test2
[root@localhost test]# su - oracle
[oracle@localhost ~]$ cd /test/
[oracle@localhost test]$ ll
total 32
drwxr--r-- 2 root root 4096 Dec 20 23:04 package1
drwxr-xr-x 2 root root 4096 Dec 20 23:07 package2
-rw-r--r-- 1 root root 30 Dec 20 23:16 test1
-rwxr--r-x 1 root root 28 Dec 20 23:16 test2
[oracle@localhost test]$ cd package1
-bash: cd: package1: Permission denied
[oracle@localhost test]$ cd
package1/ package2/ test1 test2
[oracle@localhost test]$ cd package2
[oracle@localhost package2]$ touch oracle1
touch: cannot touch `oracle1': Permission denied
[oracle@localhost package2]$
总结:当是一个目录时,假如只有读的权限还是不够的,一定需要具备XR两个权限才能进入该目录
当是一个文件时,假如只有读的权限,那么就可以读取你面的内容

oracle002

oracle的安装

Checking the Software Requirements

1. 切换到系统用户:su root
2. grep MemTotal /prop/meminfo 检查内存大小
3. grep SwapTotal /pro/meminfo 检查swap分区大小
4. free 查看RAM 和 swap
5. 查看硬盘使用情况
6. grep "model name" /prop/cpuinfo 检查cpu
7. cat /prop/version 检查版本
8. uname -r Linux的内核
9. rpm -qa | grep packagename 检查某个安装包是否安装

Checking the Network Setup

1. cat /etc/nsswitch.conf | grep hosts 检查hosts文件是否存在
2. hostname 查看主机名
3. domainname 查看域名
4. cat /etc/hosts | grep 'eval hostname' 查看文件中是否有hostname配置
5. cat /etc/sysconifg/network-scripts/ifcfg-etho //查看网络配置

Creating Required Operating System Groups and Users//建立用户组

[root@localhost /]# groupadd oinstall
[root@localhost /]# groupadd dba
[root@localhost /]# useradd -g oinstall -G dba oracle

Configuring Kernel Parameters//配置系统的核心参数

[root@localhost /]# vi /etc/sysctl.conf
[root@localhost /]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

Setting Shell Limits for the oracle User


[root@localhost /]# cd /etc/secur
securetty security/
[root@localhost /]# vi /etc/security/limits.conf
[root@localhost /]# vi /etc/pam.d/login
[root@localhost /]# vi /etc/pro
profile profile.d/ protocols
[root@localhost /]# vi /etc/pro
profile profile.d/ protocols
[root@localhost /]# vi /etc/profile

Identifying Required Software Directories

[root@localhost /]# mkdir /u01/app/oracle -p
[root@localhost /]# chmod -R oracle:oinstall /u01
chmod: invalid mode: `oracle:oinstall'
Try `chmod --help' for more information.
[root@localhost /]# chown -R oracle:oinstall /u01
[root@localhost /]# chmod -R 755 /u01

Configuring the oracle User's Environment

[oracle@localhost ~]$ vi .bash_profile
[oracle@localhost ~]$ exit
logout
[root@localhost /]# su - oracle
[oracle@localhost ~]$

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/product/10.2.0/db_1
export ORACLE_SID=jiagulun
export NLS_LANG=american_america.zhs16gbk
~

Installing the Oracle Database Software

[root@localhost oraapp]# ls
database winx64_12c_database_1of2.zip winx64_12c_database_2of2.zip
[root@localhost oraapp]# cd database/
[root@localhost database]# ls
install response setup.exe stage welcome.html
[root@localhost database]# w
05:35:09 up 6:28, 3 users, load average: 3.12, 2.58, 1.90
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/1 192.168.91.1 23:08 34:10 1.61s 1.56s -bash
root :0 - 23:49 ?xdm? 2:49 0.58s /usr/bin/gnome-session
root pts/2 192.168.91.1 05:14 1.00s 0.15s 0.11s w
[root@localhost database]# xhost +
access control disabled, clients can connect from any host
[root@localhost database]# export DISPLAY=192.168.91.1
[root@localhost database]# su - oracle
[oracle@localhost ~]$ cd /oraapp/database/

oracle003

安装配置创建数据库:
Linux redhat5.5下安装oracle 11g:http://blog.csdn.net/yakson/article/details/9012129
创建数据库:dbca
创建监听:netca
开启EM:emctl start dbconsole
查看监听情况:lsnrctl status
开启监听:lsnrctl start


注意事项:
1.

【ERROR】while loading shared libraries: /u01/app/oracle/product/11.2.0/lib/libclntsh.so.11.1: cannot





问题:

[oracle@mydb]$ lsnrctl status

lsnrctl: error while loading shared libraries: /u01/app/oracle/product/11.2.0/lib/libclntsh.so.11.1: cannot

restore segment prot after reloc: Permission denied

解答:

什么原因导致这些错误呢?原凶就是在安装LINUX时开启了SELinux,记得关闭SELinux

解决方法:

(1)查看selinux的状态为Enforcing模式(setenforce 1设置SELinux 成为Enforcing模式,即开启SElinux)

[root@mydb]# getenforce

Enforcing

(2)setenforce 0 设置SELinux 成为permissive模式(即临时关闭SElinux)

[root@mydb]# setenforce 0

(3)查看selinux的状态为Permissive模式(setenforce 0设置SELinux 成为Permissive模式)

[root@mydb]# getenforce

Permissive

5、查看Selinux的配置文件是否修改

[root@mydb bin]# vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of enforcing.

# disabled - SELinux is fully disabled.

SELINUX=disabled

# SELINUXTYPE= type of policy in use. Possible values are:

# targeted - Only targeted network daemons are protected.

# strict - Full SELinux protection.

SELINUXTYPE=targeted


注意:
su只是切换了root身份,但Shell环境仍然是普通用户的Shell;
而su - 连用户和Shell环境一起切换成root身份了。
只有切换了Shell环境才不会出现PATH环境变量错误。
su切换成root用户以后,pwd一下,发现工作目录仍然是普通用户的工作目录;
而用su -命令切换以后,工作目录变成root的工作目录了

2.
linux下如何关闭防火墙?如何查看防火墙当前的状态

http://blog.csdn.net/liqfyiyi/article/details/7698032


从配置菜单关闭防火墙是不起作用的,索性在安装的时候就不要装防火墙
查看防火墙状态:
/etc/init.d/iptablesstatus
暂时关闭防火墙:
/etc/init.d/iptablesstop
禁止防火墙在系统启动时启动
/sbin/chkconfig--level2345iptablesoff
重启iptables:
/etc/init.d/iptablesrestart
题外话:
BT或者骡子速度慢用不着关防火墙,只要把相应端口开放就可以了
在文件
/etc/sysconfig/iptables
在系统原始配置的:RH-Firewall-1-INPUT规则链增加类似这样的行:
-ARH-Firewall-1-INPUT-mstate--stateNEW-mtcp-ptcp--dport39764-jACCEPT
-ARH-Firewall-1-INPUT-mstate--stateNEW-mudp-pudp--dport39764-jACCEPT
如果发现原有-jREJECT一类的语句,上面两句要放在它的前面

重启后生效
开启:chkconfigiptableson
关闭:chkconfigiptablesoff或者/sbin/chkconfig--level2345iptablesoff

2)即时生效,重启后失效
service方式
开启:serviceiptablesstart
关闭:serviceiptablesstop
iptables方式
查看防火墙状态:
/etc/init.d/iptablesstatus
暂时关闭防火墙:
/etc/init.d/iptablesstop
重启iptables:
/etc/init.d/iptablesrestart

3.
让listener能够识别出数据库:

1. sqlplus /as sysdba
2. alter system register
3. lsnrctl start
4. lsnrctl status

4. 通过浏览器链接不到EM
http: nmehl_connect_internal: connect failed to (localhost.localdomain:1158)


今天打开oracle em后发现无法使用IE浏览器登录,emctl 进入日志后,发现emdctl.trc文件报以下警告信息
2013-07-24 09:46:40,320 Thread-4124116736 WARN http: nmehl_connect_internal: connect failed to (vmware2:1158): Connection refused (error = 111)
2013-07-24 09:47:01,340 Thread-770500352 WARN http: nmehl_connect_internal: connect failed to (vmware2:1158): Connection refused (error = 111)
2013-07-24 09:47:32,320 Thread-1596827392 WARN http: nmehl_connect_internal: connect failed to (vmware2:1158): Connection refused (error = 111)
2013-07-24 13:01:13,226 Thread-3029894912 WARN http: nmehl_connect_internal: connect failed to (vmware2:1158): Connection refused (error = 111)
2013-07-24 13:01:19,245 Thread-3235116800 WARN http: nmehl_connect_internal: connect failed to (vmware2:1158): Connection refused (error = 111)
2013-07-24 13:10:17,248 Thread-3960440576 WARN http: nmehl_connect_internal: connect failed to (vmware2:1158): Connection refused (error = 111)
发现通过火狐浏览器是可以登录的,通过了解发现是IE浏览器安全性的问题
[oracle@vmware2 log]$emctl unsecure dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
https://vmware2:1158/em/console/aboutApplication
Configuring DBConsole for HTTP... Done.
DBCONSOLE successfully stopped... Done.
Agent is already stopped... Done.
Unsecuring dbconsole... Started.
DBConsole is now unsecured... Done.
Unsecuring dbconsole... Sucessful.
DBCONSOLE successfully restarted... Done.
[oracle@vmware2 log]$ pwd
/app/oracle/product/11.2.0/db_1/vmware2_tdb/sysman/log

在启动后,改为emctl unsecure dbconsole后,打开IE通过http的方式,可以正常登录了。






分类:数据库开发技术

11G Dbconsole 在启动时报以下错误:

WARNhttp: snmehl_connect: connect failed to (ehrprod:1158): Connection refused (error = 111)

解决办法是查找emagent的进程,kill掉,再启,最后终于OK了。

[oracle@ehrprod persistence]$ ps -ef | grep emagent

oracle1984310 14:03 pts/000:00:09 /u01/oracle/product/10.2.0.1/bin/emagent

oracle29162 154480 17:04 pts/100:00:00 grep emagent

[oracle@ehrprod persistence]$ kill -9 19843

[@more@]









http://www.cnblogs.com/mophee/archive/2013/06/03/3115805.html

1.安装好Oracle数据库后:执行dbstart和dbshut会提示:

[oracle@oracle11g ~]$ dbstart
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/oracle/product/10.2.0/db_1/bin/dbstart ORACLE_HOME

错误原因是:dbstart和dbshut脚本文件中ORACLE_HOME_LISTNER的设置有问题,分别打开两个文件找到:ORACLE_HOME_LISTNER=$1,修改为

ORACLE_HOME_LISTNER=$ORACLE_HOME,命令如下:

[oracle@oracle11g ~]$ vi $ORACLE_HOME/bin/dbstart

[oracle@oracle11g ~]$ vi $ORACLE_HOME/bin/dbshut

修改后保存退出,第一个问题已解决;

2.如何在Linux启动时自动启动Oracle监听和实例

首先要解决上面的问题,才能继续哟!

第一步:修改/etc/oratab文件,命令如下:

[oracle@oracle11g ~]$ vi /etc/oratab //起到了开关的作用当启动或者关闭时都会读改文件,可以自己cat看下

找到:accp:/u01/oracle:N 修改为:accp:/u01/oracle:Y

第二步:把lsnrctl start和dbstart添加到rc.local文件中,命令如下:

[oracle@oracle11g ~]$ vi /etc/rc.d/rc.local // 表示修改启动项

添加

su oracle -lc "/u01/produc/bin/lsnrctl start"//-l 表示切换用户的同时改变工作目录,-c表示执行命令后切换原来的身份

su oracle -lc/u01/product/bin/dbstart

注意:第一个命令有空格,所以要用引号的

重启试试吧!



如果此进在windows的IE浏览器中仍无法访问linux中安装的oracle的em和isqlplus。
多半原因是由于iptables中对端口做了限制访问。用iptables -L查看是否不允许访问。若是用以下方法解决。
解决方法1:直接用命令加,只是命令加是当前生效。
iptables -I INPUT -p tcp --dport 1158 -j ACCEPT
iptables -I INPUT -p tcp --dport 5560 -j ACCEPT
再次从客户端访问,成功!
解决方法2:修改/etc/sysconfig/iptables文件。增加2行。
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1158 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5560 -j ACCEPT
重启防火墙,这里有两种方式重启防火墙
a) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
b) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
再次从客户端访问,成功!
解决方法3:若是测试机,可直接关闭iptables。
service iptables stop
再次从客户端访问,成功!


7.
  • netstat 查看某个端口的使用情况 查看指定端口的连接
    我们知道netstat 命令可以查看 电脑的tcp dup 的连接IP数及端口号,那么我们怎么查看指定端口的连接情况呢?下面代码可以实现
  • 这是BAT文件

    @echo off
    time /t >>log.log
    netstat -n -p tcp |find ":80">>Log.log
    notepad log.log
    exit
    改成命令为
    netstat -n -p -tcp |find ":2005" //-n直接使用IP地址而不使用域名服务器 ;-p显示正在使用socket的程序 ; -tcp显示使用tcp链接的链接
    这样就可以啦

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
IBM/AIX RISC System/6000 Error: 79: Connection refused
然后手动启动数据库报如下错误:
$ lsnrctl start


HOSTS文件中的内容出错,重复几个IP对应一个域名


EM Configuration issue. /u01/app/product/11.2.0/db_1/jiagulun_jiagulun not found.
上面的错误是在你已经创建oracle数据以后再去改hosts 的文件所报的错误,因为在创建oracle的时候已经使用了里面的配置,所以修改该文件
一定要在创建oracle之前就应该改变的地方
通过连接文件来做也是可以的,下面的示例是大小写原因所导致的,但是这样的方式也是没有问题的;只是导致的问题一样,而原因不一样

emctl 错误一例: OC4J Configuration issue

新装的系统经常会碰到这个问题,建完库以后想看看EM是不是正常启动

[oracle@node2 dbs]$ emctl status dbconsole

OC4J Configuration issue. /u01/app/oracle/product/11.2.3/db_1/oc4j/j2ee/OC4J_DBConsole_node2_MOMORAC not found.
[oracle@node2 dbs]$ ll /u01/app/oracle/product/11.2.3/db_1/oc4j/j2ee/OC4J_DBConsole_node2_MOMORAC
ls: cannot access /u01/app/oracle/product/11.2.3/db_1/oc4j/j2ee/OC4J_DBConsole_node2_MOMORAC: No such file or directory
[oracle@node2 dbs]$
[oracle@node2 dbs]$ cd /u01/app/oracle/product/11.2.3/db_1/oc4j/j2ee/
[oracle@node2 j2ee]$ ll |grep OC4J_DBConsole_node2_
drwxr-xr-x 10 oracle oinstall 4096 Jun 4 18:21 OC4J_DBConsole_node2_momorac/
[oracle@node2 j2ee]$

很简单,是因为DB_UNIQUE_NAME 大小写导致的,或者建库的时候,最好各种name都用大写,省的麻烦

简单处理,创建个链接

[oracle@node2 j2ee]$ ln -s OC4J_DBConsole_node2_momorac OC4J_DBConsole_node2_MOMORAC
[oracle@node2 j2ee]$

再次查看

[oracle@node2 j2ee]$ emctl status dbconsole
EM Configuration issue. /u01/app/oracle/product/11.2.3/db_1/node2_MOMORAC not found.
[oracle@node2 j2ee]$

还是大小写,再去建个链接

[oracle@node2 j2ee]$ cd /u01/app/oracle/product/11.2.3/db_1/
[oracle@node2 db_1]$ ll|grep node2_
drwxr-xr-x 3 oracle oinstall 4096 Jun 4 18:31 node2_momorac/
[oracle@node2 db_1]$ ln -s node2_momorac node2_MOMORAC
[oracle@node2 db_1]$ ll|grep node2_
drwxr-xr-x 3 oracle oinstall 4096 Jun 4 18:31 node2_momorac/
lrwxrwxrwx 1 oracle oinstall 13 Jun 6 14:29 node2_MOMORAC -> node2_momorac/
[oracle@node2 db_1]$

然后再次检查

[oracle@node2 db_1]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
https://node1.momo.org:1158/em/console/aboutApplication
EM Daemon is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.3/db_1/node2_MOMORAC/sysman/log
[oracle@node2 db_1]$



IE--> EM --> listener --> 数据库









分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics