search
HomeDatabaseMysql Tutorial10gocm-)session2-)ocm02库与GC安装与配置

gc规划 host db/instance gc listener ocm01 ocmdb agent ocmdb1521(ocmdb的监听),ocmsb1621(ocmdb的监听) ocm02 ocmdb02 oms ocmdb021521(ocmdb02的监听),ocmdb1521(ocmdb的监听) 安装顺序:ocmdb02库(host:ocm02) 1.安装ocmdb02库 作用:存放历史数据,用

gc规划
host db/instance gc listener
ocm01 ocmdb agent ocmdb1521(ocmdb的监听),ocmsb1621(ocmdb的监听)
ocm02 ocmdb02 oms ocmdb021521(ocmdb02的监听),ocmdb1521(ocmdb的监听)

安装顺序:ocmdb02库(host:ocm02)
1.安装ocmdb02库 作用:存放历史数据,用于历史分析 --后续安装oms,oms需要一个容器来存放各个agent推送来的信息,ocmdb02就是这个容器。
2.配置oracle用户环境变量
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH
加载环境变量
. .bash_profile
安装数据库软件
./runInstaller

选择“Advanced Installation” 高级安装,点击“Next”
产品清单目录Inventory:/u01/oracle/oraInventory
指定“Custom”安装类型,点击“Next”
指定名称:OraDb10g_home1
安装目录:/u01/oracle/db_1 ,点击“Next” 默认不修改
默认组件不用动,添加一个“Oracle Label Security” 安全标记即可,点击“Next”
检查出有0 个必需的,点击“Next”
指定操作系统组:dba 【用于管理数据库】,点击“Next”
只安装数据库软件,点击“Next”
安装数据库软件的概要信息,点击“Install”
进入安装界面,等待安装完毕,执行2个脚本
sudo /u01/oraInventory/orainstRoot.sh
sudo /u01/oracle/db_1/root.sh 一路回车
此时数据库软件已经成功安装完毕,点击“Exit”退出界面

用dbca创建ocmdb02数据库
dbca
欢迎界面,点击“Next”
选择“Create a Database”,点击“Next”
选择“Custom Database”,点击“Next”
指定数据库名和实例名“ocmdb02”,点击“Next”
不要选择“EM”,因为GC和EM只能选其一,点击“Next”
为SYS 和 SYSTEM 用户设置密码“oracle”,点击“Next”
选择File System文件系统,点击“Next”
指定数据文件存放位置:/u01/oracle/oradata,点击“Next”
取消闪回,点击“Next”
最少组件原则,只保留“Oracle Label Security”选项,点击“Next”
Memory默认
Sizing默认
字符集US7ASCII
连接模式默认
现在点击“Finish”,就可以创建ocmdb02库了->慢慢等待
cd /u01/oracle/oradata/ocmdb02/ 检查一下

用netca配置监听
netca
选择“Listener configuration” ,点击“Next”
选择“Add 添加一个监听”如果已经有监听存在,下面的三个选项都应该可选择,点击“Next”
默认监听名:LISTENER,点击“Next”
选择支持协议“TCP”,点击“Next”
使用默认的端口号:1521,点击“Next”
你还想配置其他监听嘛?->No ,点击“Next”
监听配置完成,点击“Next”
这时此界面就有“Finish”按钮了,点击“Finish”退出监听配置工具
配置
vim /u01/oracle/db_1/network/admin/listener.ora 默认不用修改
vim /u01/oracle/db_1/network/admin/tnsnames.ora
添加如下信息


OCMDB021521 =
(description =
(address = (protocol = tcp)(host = ocm02)(port = 1521))
(connect_data =
(server = dedicated)
(service_name = ocmdb02)
)
)

OCMDB1521 =
(description =
(address = (protocol = tcp)(host = ocm01)(port = 1521))
(connect_data =
(server = dedicated)
(service_name = ocmdb)
)
)
 

检查连接串
sqlplus system/oracle@OCMDB021521
sqlplus system/oracle@OCMDB1521

小结:到此创建数据库完成

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

GC版本

10.2.0.1.0 这是我们所使用的
10.2.0.5.0 这是目前最新的版本
ocm01 :客户端AGENT
ocm02 :服务端OMS

GC OMS安装(第二台机器host:ocm02部署)用一个数据库作为GC资料库

0.对ocm01和ocm02上的数据中的dbsnmp用户解锁
dbsnmp作用:agent与oms之间通信的用户,也是监控实例状态用户
sqlplus / as sysdba
alter user dbsnmp identified by oracle account unlock;
select username,account_status from dba_users;

1.安装OMS
xhost +
必做步骤
ocmdb02库
show parameter session_cached_cursors
alter system set session_cached_cursors=201 scope=spfile;
shut immediate
startup
执行脚本
作用:帮助OMS分析“component 内存分配问题”
@?/rdbms/admin/dbmspool.sql
cd /software/Disk1/
./runInstaller
2.这里选择“Enterprise Manager 10g Grid Control Using an Existing Database”选项,点击“Next”
3.指定OMS安装目录
/u01/oracle/OracleHomes , 点击“Next”
4.系统自动完成先决条件的检查,确保无误,点击“Next”
5.指定GC Repository Database(GC资料库)
hostname:ocm02
port:1521
SID:ocmdb02
SYS password:oracle
我们需要在ocmdb02数据库上指定两个新表空间存放管理GC资料库对象(存放历史数据要求必须有)
/u01/oracle/oradata/ocmdb02/mgmt.dbf 管理表空间
/u01/oracle/oradata/ocmdb02/mgmt_ecm.dbf 数据表空间
当点击“prefill Tablespace Locations” 预指定按钮,自动返填表空间的位置,弹出一个提示框:点击“OK”,这个位置千万不能错了--如果不能点击手动修改表空间位置
6.其他可选配置项,这里保持默认,不进行配置,点击“Next”
7.设置密码(密码要求至少5位必须包含数字)
registration password:oracle1216 【AGENT注册密码】
sysman:oracle1216 【sysman用户密码】
8.安装配置summary页,确保无误后点击”Install”进行安装,默认包括OMS软件和AGENT软件
9.执行脚本(root权限)
sudo /u01/oracle/OracleHomes/oms10g/allroot.sh
10.然后就进入到配置组件界面,这个过程非常耗时,一般1小时左右 --实测30分钟左右
慢在OMS configuration 和 Agent configuration Assistant 两个组件上
in progress 正在进行时
pending 即将执行
关注状态确保完整性和正确性,当所有状态为succeeded时,部署安装OMS完成,点击“Exit”
OMS:1.6G
Agent:437M
你最好预留出足够的安装空间
11.打开firefox登录控制台
End of Installation页面会显示GC 控制台URL
http://ocm02:4889/em
http://192.168.100.104:4889/em
./emctl secure agent

输入用户名:sysman
密码:oracle1216
进入到Grid Control首页
注意事项:
点击“Targets”,因为没有添加其他Agent,此时只能看到本机信息
点击“Targets”,只能看到“ocm02”主机的信息
选 All targets 可以看到目前可管理的所有对象

点击数据 如果没有发现ocmdb02,add配置一下

GC Agent安装(第一台机器host:ocm01部署)
使用agentDownload.linux快速安装
GC Agent作用:代理工具会抓取本机状态信息推送到OMS服务端显示在你面前,有几台数据库就要安装几个Agent代理。
我们使用的Agent代理版本:10.2.0.1.0
现在最新的版本为:10.2.0.5.0

从ocm02拷贝agentDownload.linux软件

[oracle@ocm02 Server]$ find /u01/oracle/ -name agent*linux
/u01/oracle/OracleHomes/oms10g/sysman/agent_download/10.2.0.1.0/linux/agentDownload.linux
/u01/oracle/OracleHomes/oms10g/inventory/Templates/sysman/agent_download/10.2.0.1.0/linux/agentDownload.linux
[oracle@ocm02 Server]$ cd /u01/oracle/OracleHomes/oms10g/sysman/agent_download/10.2.0.1.0/linux/
[oracle@ocm02 linux]$ ls
addons agent agentDownload.linux agent_scripts.jar oui prereqs response
[oracle@ocm02 linux]$ scp agentDownload.linux ocm01:/home/oracle/Desktop/
The authenticity of host 'ocm01 (192.168.100.103)' can't be established.
RSA key fingerprint is 61:ce:64:ff:2b:84:3f:72:ff:01:1d:93:b0:a2:c1:94.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ocm01,192.168.100.103' (RSA) to the list of known hosts.
oracle@ocm01's password:
agentDownload.linux 100% 22KB 22.2KB/s 00:00

1.给安装文件授予权限(如果文件本身拥有可执行权限请忽略此步)
/u01/app/oracle/OracleHomes/oms10g/sysman/agent_download/10.2.0.1.0/linux/agentDownload.linux
chmod 755 agentDownload.linux
2.确保jar包可用
由于GC会用到oracle jdk包,因此需要在.bash_profile中添加$ORACLE_HOME/jdk/bin
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH
3.执行agentDownload.linux

修改etc/hosts添加

192.168.100.103 ocm01.domain ocm01

192.168.100.104 ocm02.domain ocm02

安装agent
./agentDownload.linux -b /u01/oracle 【-b 指定安装目录】
4.运行root.sh脚本(使用root用户)
sudo /u01/oracle/agent10g/root.sh
5.对ocm01上数据库ocmdb中用户dbsnmp解锁(如果已经解锁了就忽略)
dbsnmp作用:agent与oms之间通信的用户,也是监控实例状态用户
alter user dbsnmp identified by oracle account unlock;
select username,account_status from dba_users;

--下6~9实际操作都没有用到

6.在OMS上配置ocmdb实例 --执行从ocm02拷贝过来的agentDownload.linux,有时不需配置,应为拷贝过来的agent软件包含oms信息,安装后自动向oms推送agent信息。
dbsnmp用户的密码(oracle),其他内容自动返填

7.此时直接进入到最后的Review阶段,确定没有问题,点击“Submit”

8.提示ocmdb实例属性已经被更新 properties for instance ocmdb have been updated,点击“OK”
刚刚配置完毕时ocmdb的状态信息还不是很完整,此时可以点击右上角的refresh图标观察实例的状态变化,最终该实例的所有状态都会显示出来
9.同样的流程配置ocmdb02实例
./emctl stop agent
./emctl secure agent
./emctl status agent
./emctl start agent
./emctl upload 必须在agent启动状态下运行

如果GC安装失败按照以下卸载

卸载GC Agent
既然我们会安装也要会卸载,当我们安装不成功的时候可以卸载之后重新安装
注:当需要删除Grid Control Agent的时候,往往会因为删除不完整导致无法重新顺利部署Agent的问题。
1.确认Agent当前状态
cd $AGENT_HOME/bin 进入agent代理bin目录
./emctl status agent 显示agent当前状态
2.停止angent
./emctl stop agent
./emctl status agent
3.使用静默方式删除Agent
cd /u01/oracle/agent10g/oui/bin
./runInstaller -silent -deinstall -removeallfiles -removeAllPatches
4.删除inventory.xml文件中有关Agent的信息
cd /u01/app/oracle/oraInventory/ContentsXML
vim inventory.xml
删除inventory.xml文件中中NAME是agent10g的内容
只删除此行
5.删除agent安装目录
rm -rf $ORACLE_BASE/agent10g 

卸载GC OMS
1.停止agent和oms
cd /u01/oracle/OracleHomes/agent10g
./emctl stop agent
cd /u01/oracle/OracleHomes/oms10g
./emctl status oms
./emctl stop oms -all
./emctl status oms
2.删除ocm02主机上所有与GC相关的内容
rm -rf /u01/oraInventory 删除产品清单目录
使用dbca删除ocmdb02库
rm -rf /tmp/* 删除临时文件
rm -f /etc/oratab
rm -f /usr/local/bin/* 删除本地目录下3个文件,用root权限来删除
重启操作系统
删除SYSMAN和MGMT_VIEW用户
此步骤是为了防止在OMS配置过程中因数据库对象存在导致报错
删除表空间
/u01/oracle/oradata/ocmdb02/mgmt.dbf 管理表空间
/u01/oracle/oradata/ocmdb02/mgmt_ecm.dbf 数据表空间

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
MySQL's Place: Databases and ProgrammingMySQL's Place: Databases and ProgrammingApr 13, 2025 am 12:18 AM

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL: From Small Businesses to Large EnterprisesMySQL: From Small Businesses to Large EnterprisesApr 13, 2025 am 12:17 AM

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

What are phantom reads and how does InnoDB prevent them (Next-Key Locking)?What are phantom reads and how does InnoDB prevent them (Next-Key Locking)?Apr 13, 2025 am 12:16 AM

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.

MySQL: Not a Programming Language, But...MySQL: Not a Programming Language, But...Apr 13, 2025 am 12:03 AM

MySQL is not a programming language, but its query language SQL has the characteristics of a programming language: 1. SQL supports conditional judgment, loops and variable operations; 2. Through stored procedures, triggers and functions, users can perform complex logical operations in the database.

MySQL: An Introduction to the World's Most Popular DatabaseMySQL: An Introduction to the World's Most Popular DatabaseApr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

The Importance of MySQL: Data Storage and ManagementThe Importance of MySQL: Data Storage and ManagementApr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system suitable for data storage, management, query and security. 1. It supports a variety of operating systems and is widely used in Web applications and other fields. 2. Through the client-server architecture and different storage engines, MySQL processes data efficiently. 3. Basic usage includes creating databases and tables, inserting, querying and updating data. 4. Advanced usage involves complex queries and stored procedures. 5. Common errors can be debugged through the EXPLAIN statement. 6. Performance optimization includes the rational use of indexes and optimized query statements.

Why Use MySQL? Benefits and AdvantagesWhy Use MySQL? Benefits and AdvantagesApr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Describe InnoDB locking mechanisms (shared locks, exclusive locks, intention locks, record locks, gap locks, next-key locks).Describe InnoDB locking mechanisms (shared locks, exclusive locks, intention locks, record locks, gap locks, next-key locks).Apr 12, 2025 am 12:16 AM

InnoDB's lock mechanisms include shared locks, exclusive locks, intention locks, record locks, gap locks and next key locks. 1. Shared lock allows transactions to read data without preventing other transactions from reading. 2. Exclusive lock prevents other transactions from reading and modifying data. 3. Intention lock optimizes lock efficiency. 4. Record lock lock index record. 5. Gap lock locks index recording gap. 6. The next key lock is a combination of record lock and gap lock to ensure data consistency.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor