ITPub博客

首页 > 数据库 > Oracle > 安装OMS及部署EMCC(agent)完整步骤

安装OMS及部署EMCC(agent)完整步骤

原创 Oracle 作者:wenjunheyixiao 时间:2016-03-16 19:48:06 0 删除 编辑

1

配置hosts文件

#oms  

IP地址     oracle.us.oracle.com(必须得有域名)

#agent

IP地址    oracle.us.oracle.com(必须得有域名)

2

安装数据库软件

安装数据库

安装网络(配置监听)

3

dbca(选择自定义的方式)

---------不安装oem(因为要安装oms--------中途database  components选项的所有的勾给去了---------下面的standard  database compenents选项只保留前两个勾

---------干掉enterprise Manager Repostiiory

4

 

解压包:

 

5

启动监听:

[oracle@prod2 Desktop]$ lsnrctl start

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-MAR-2016 11:35:31

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

 

TNSLSNR for Linux: Version 11.2.0.4.0 - Production

System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/diag/tnslsnr/prod2/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod2.oracle.com)(PORT=1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod2.oracle.com)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                16-MAR-2016 11:35:33

Uptime                    0 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/dbhome_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/prod2/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod2.oracle.com)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

The listener supports no services

The command completed successfully

开启数据库

[oracle@prod2 Desktop]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 16 11:35:37 2016

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

Connected to an idle instance.

   

SQL> startup

ORACLE instance started.

 

Total System Global Area 1820540928 bytes

Fixed Size                    2254184 bytes

Variable Size                  503319192 bytes

Database Buffers         1308622848 bytes

Redo Buffers                    6344704 bytes

Database mounted.

TTDatabase opened.

SQL> quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@prod2 Desktop]$ lsnrcrl status

bash: lsnrcrl: command not found

查看监听状态:

[oracle@prod2 Desktop]$ lsnrctl status

 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-MAR-2016 11:36:07

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod2.oracle.com)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                16-MAR-2016 11:35:33

Uptime                    0 days 0 hr. 0 min. 34 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/prod2/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod2.oracle.com)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "prod2.oracle.com" has 1 instance(s).

  Instance "prod2", status READY, has 1 handler(s) for this service...

Service "prod2XDB.oracle.com" has 1 instance(s).

  Instance "prod2", status READY, has 1 handler(s) for this service...

The command completed successfully

[oracle@prod2 Desktop]$ hostname

prod2

[oracle@prod2 Desktop]$ cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.70.99   prod2.oracle.com     prod2

 

[oracle@prod2 Desktop]$ cd /u01/app/oracle

[oracle@prod2 oracle]$ ls

admin  cfgtoollogs  checkpoints  diag  fast_recovery_area  oradata  product

[oracle@prod2 oracle]$ cd product/

[oracle@prod2 product]$ ls

11.2.0  agent12c  middleware

[oracle@prod2 product]$ cd middleware/

[oracle@prod2 middleware]$ ls

lost+found

[oracle@prod2 middleware]$ cd ..

[oracle@prod2 product]$ ls

11.2.0  agent12c  middleware

[oracle@prod2 product]$ df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        48G   36G  9.6G  79% /

tmpfs           2.9G  228K  2.9G   1% /dev/shm

/dev/sda1       190M   54M  126M  31% /boot

/dev/sr0        3.7G  3.7G     0 100% /media/OL6.5 x86_64 Disc 1 20131125

/dev/sr0        3.7G  3.7G     0 100% /mnt

/dev/sdb1        50G   52M   47G   1% /u01/app/oracle/product/middleware--------------------因为磁盘空间不足,新创建的磁盘

 

[oracle@prod2 product]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 16 11:42:53 2016

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> show parameter servi

 

NAME                                     TYPE         VALUE

------------------------------------ ----------- ------------------------------

service_names                             string         prod2.oracle.com

SQL> alter system set processes=300 scope=spfile;------------------------------安装的过程中出错,提示修改的参数

 

System altered.

 

 

SQL> alter system set session_cached_cursors=350 scope=spfile;---------------安装过程中出错,提示修改的参数

 

System altered.

 

 

 

SQL> select member from v$Logfile;

 

MEMBER

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/prod2/redo01.log

/u01/app/oracle/oradata/prod2/redo02.log

/u01/app/oracle/oradata/prod2/redo03.log

 

SQL> select * from v$log;

 

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE          MEMBERS ARC

---------- ---------- ---------- ---------- ---------- ---------- ---

STATUS                 FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME

---------------- ------------- --------- ------------ ---------

 1            1              52   52428800           512                1 NO

CURRENT                 780581 16-MAR-16   2.8147E+14

 

 2            1              50   52428800           512                1 NO

INACTIVE                749888 16-MAR-16       755420 16-MAR-16

 

 3            1              51   52428800           512                1 NO

INACTIVE                755420 16-MAR-16       780581 16-MAR-16

 

 

SQL> alter database drop logfile group 2;------------------------------------删除日志文件组2(必须是inactive的状态)

 

Database altered.

 

 

SQL> alter database add logfile group 2 '/u01/app/oracle/oradata/prod2/redo02.log' size 500M reuse;----------------添加日志文件组2

Database altered.

 

SQL> alter database drop logfile group 3;---------------------------删除日志文件组3(必须是inactive的状态)

 

Database altered.

 

SQL>  alter database add logfile group 3 '/u01/app/oracle/oradata/prod2/redo03.log' size 500M reuse;-------------添加日志文件组3

 

 

Database altered.

 

SQL> alter system switch logfile;---------------------------切换日志

System altered.

 

 

SQL> alter system checkpoint;------------------------------发生检查点,此时的日志文件组的状态应该会变。

 

System altered.

 

SQL> alter database drop logfile group 1;-----------------------刚才在没有切换日志,没有发生检查点的时候,日志文件组1还是处于current的状态,是不能删除的,但是我们切换了日志,也发生了检查点,所以此时的日志文件组1的状态就会变成inactive的状态,所以我们可以删除了重新加一个;

Database altered.

 

SQL>  alter database add logfile group 1 '/u01/app/oracle/oradata/prod2/redo01.log' size 500M reuse;------------添加日志文件组1,他是unused的状态,那我们再次切换一下日志,他的状态就会变成current的状态;

 

Database altered.

 

SQL> alter system switch logfile;----------------再一次切换日志

System altered.

 

SQL> SQL> SQL> SQL> select * from v$log;

 

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE          MEMBERS ARC

---------- ---------- ---------- ---------- ---------- ---------- ---

STATUS                 FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME

---------------- ------------- --------- ------------ ---------

 1            1              54  524288000           512                1 NO

CURRENT                 781183 16-MAR-16   2.8147E+14

 

 2            1              53  524288000           512                1 NO

ACTIVE                        781158 16-MAR-16       781183 16-MAR-16

 

 3            1               0  524288000           512                1 YES

UNUSED                             0                            0

 

 

SQL> startup force;--------重启数据库

ORACLE instance started.

 

Total System Global Area 1820540928 bytes

Fixed Size                    2254184 bytes

Variable Size                  553650840 bytes

Database Buffers         1258291200 bytes

Redo Buffers                    6344704 bytes

Database mounted.

Database opened.

SQL> quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@prod2 product]$ df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda3        48G   37G  8.3G  82% /

tmpfs           2.9G  228K  2.9G   1% /dev/shm

/dev/sda1       190M   54M  126M  31% /boot

/dev/sr0        3.7G  3.7G     0 100% /media/OL6.5 x86_64 Disc 1 20131125

/dev/sr0        3.7G  3.7G     0 100% /mnt

/dev/sdb1        50G   52M   47G   1% /u01/app/oracle/product/middleware

[oracle@prod2 product]$

6

[oracle@prod2 Desktop]$ su -

Password:

[root@prod2 ~]# cd $ORACLE_HOME

[root@prod2 ~]# ls -l /u01

total 4

drwxrwxr-x. 4 oracle oinstall 4096 Mar 16 11:40 app

[root@prod2 ~]# cd /u01/app

[root@prod2 app]# ll

total 8

drwxrwxr-x. 9 oracle oinstall 4096 Mar 16 11:40 oracle

drwxrwxr-x. 5 oracle oinstall 4096 Mar 16 09:52 oraInventory

[root@prod2 app]# cd oracle

[root@prod2 oracle]# ll

total 28

drwxr-x---   3 oracle oinstall 4096 Mar 16 10:36 admin

drwxrwxr-x   6 oracle oinstall 4096 Mar 16 11:02 cfgtoollogs

drwxrwxr-x.  2 oracle oinstall 4096 Mar 16 09:53 checkpoints

drwxrwxr-x. 11 oracle oinstall 4096 Mar 16 09:52 diag

drwxr-x---   3 oracle oinstall 4096 Mar 16 10:35 fast_recovery_area

drwxr-x---   3 oracle oinstall 4096 Mar 16 10:36 oradata

drwxrwxr-x.  5 oracle oinstall 4096 Mar 16 11:08 product

[root@prod2 oracle]# cd product/

[root@prod2 product]# ll

total 12

drwxrwxr-x. 3 oracle oinstall 4096 Mar 16 09:50 11.2.0

drwxr-xr-x  2 oracle oinstall 4096 Mar 16 11:11 agent12c

drwxr-xr-x  3 root   root     4096 Mar 16 11:32 middleware

[root@prod2 product]# chmod 775 middleware/ -R-----------修改权限

[root@prod2 product]# chown oracle:oinstall middleware/ -R----------- middleware目录赋权限

[root@prod2 product]#

7

中途报错:说磁盘空间不足,所以必须的加一块磁盘,然后进行分区

[oracle@prod2 Desktop]$ su -

Password:

[root@prod2 ~]# fdisk /dev/sd

sda   sda1  sda2  sda3  sdb --------关机之后新加的一块磁盘 

[root@prod2 ~]# fdisk /dev/sdb---------------------给磁盘分区

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0xe2186245.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

         switch off the mode (command 'c') and change display units to

         sectors (command 'u').

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-6527, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-6527, default 6527):

Using default value 6527

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

[root@prod2 ~]# mkfs.ext4 /dev/sdb1 ------------------------格式化磁盘

mke2fs 1.43-WIP (20-Jun-2013)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

3276800 inodes, 13107024 blocks

655351 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

400 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424

 

Allocating group tables: done                           

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information:       

done

[root@prod2 ~]# mount /dev/sdb1 /u01/app/oracle/product/middleware/----------------将磁盘挂在到此目录下(这个目录是在oracle用户下创建的目录)

[root@prod2 ~]# vim /etc/fstab -----------------------------开机自动挂载

#

# /etc/fstab

# Created by anaconda on Wed Mar 16 15:40:04 2016

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

UUID=cb160f1a-cd12-42a2-9476-71ab0d0ff504 /                       ext4    defaults        1 1

UUID=ef463538-8dbb-474a-92b2-612b2c957c36 /boot                   ext4    defaults        1 2

UUID=431584f6-ff5b-4e04-9d9e-d4d41267e342 swap                    swap    defaults        0 0

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/sdb1               /u01/app/oracle/product/middle  ext4    defaults        0 0----------------------手动添加,意思就是以后开机之后自动挂载了

 

[root@prod2 ~]# su - oracle

[oracle@prod2 ~]$ ls

bipruntime                      libskgxn           stage

database                        Music              Templates

Desktop                         oms                V45344-01.zip

Documents                       Pictures           V45345-01.zip

Downloads                       plugins            V45346-01.zip

install                         Public             Videos

install2016-03-16_10-25-34.log  release_notes.pdf  wls

install2016-03-16_10-48-32.log  response           WT.zip

jdk                             runInstaller

[oracle@prod2 ~]$ ./runInstaller

Starting Oracle Universal Installer...

 

Checking Temp space: must be greater than 400 MB.   Actual 10004 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 11999 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-03-16_11-34-34AM. Please wait ...[oracle@prod2 ~]$ cd /u01/app/oracle/product/middleware

[oracle@prod2 middleware]$ ll

 

8

安装完成之后,然后进网页查看一下:https://prod2.oracle.com:7802/em

 

 

9

箭头向上 代表已经起来

 

SQL> alter user dbsnmp identified by oracle account unlock;---------用户解锁

 

User altered.

 

搜索添加数据库

 

 

刷新一下 ,发现上去了;

 

 


在两台机子上分别配置
IP

[root@enmoedu1 oracle]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.70.55     enmoedu1.oracle.com    enmoedu1

192.168.70.99      prod2.oracle.com      prod2---------------------------------装有oms的机子

 

[root@prod2 product]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.70.99   prod2.oracle.com     prod2

192.168.70.55   enmoedu1.oracle.com   enmoedu1

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

在第二台机子(enmoedu1)上,vim/etc/sudoers-------配置sudu

[root@enmoedu1 oracle]# vi /etc/sudoers

# Disable "ssh hostname sudo <cmd>", because it will show the password in clear.

#         You have to run "ssh -t hostname sudo <cmd>".

#

Defaults    Requiretty-----------原本没有感叹号,现在加上感叹号

 

#

# Refuse to run if unable to disable echo on the tty. This setting should also be

# changed in order to be able to use sudo without a tty. See requiretty above.

#

Defaults   visiblepw---------------原本有感叹号,现在去掉感叹号

。。。。。。。

##      user    MACHINE=COMMANDS

##

## The COMMANDS section may have other options added to it.

##

## Allow root to run any commands anywhere

root    ALL=(ALL)       ALL

 oracle   ALL=(ALL)   NOPASSWD: ALL---------原本没有这一行,现在加上这一行

 

## Allows members of the 'sys' group to run networking, software,

## service management apps and more.

# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

 

## Allows people in group wheel to run all commands

# %wheel        ALL=(ALL)       ALL

 

## Same thing without a password

# %wheel        ALL=(ALL)       NOPASSWD: ALL

然后:wq!保存退出

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

切到oracle用户下

[root@enmoedu1 oracle]# su - oracle

[oracle@enmoedu1 ~]$ sudo ls -l /root

total 112

-rw-------. 1 root root  1674 Mar 14 18:05 anaconda-ks.cfg

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Desktop

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Documents

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Downloads

-rw-r--r--. 1 root root 60339 Mar 14 18:05 install.log

-rw-r--r--. 1 root root 10259 Mar 14 18:02 install.log.syslog

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Music

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Pictures

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Public

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Templates

drwxr-xr-x. 2 root root  4096 Mar 14 18:08 Videos

 

 

现在开始部署,进到网页下

1)setup(设置)---add  target(添加目标)----add  targets manually(手动添加目标)

 

 

2)选择add  host  targets(添加主机目标)----add  host(添加主机)

 

3)add-----输入主机名字(另一台机子)------select选择平台(linux  64-bit

 

4)----next

 

Installation Base Directory        安装基目录(空目录)---------自行创建了一个空目录

[root@prod2 oracle]# mkdir /u01/app/junxiao

 

然后点击named credentail后面的加号;出现以下的图片:

 

点击OK,

 

 

点击deploy agent(部署代理)--------正在初始化进行,等待三个都进行完

 

 

部署代理之后的结果:

 

 

点击Done之后------target-------hosts

 

 

Target------database

 

 

添加数据库------add

 

 

 

 

 

 

NEXT之后

 

NEXT之后

 

 

Save之后

 

close之后,由下图可以看出enmoedu1还没有起来;

 

刷新一下之后发现起来了;

 

完成,现在我们就可以随意点点啦!我也可以再添加数据库,同时管理多台数据库!(以上的所有步骤全是同一版本的数据库之间的操作)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30606702/viewspace-2058417/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-12-02

  • 博文量
    117
  • 访问量
    161256