在这篇文章中,我们将带领您了解Oracle提交补丁,可使Linux内核引导提速6%-49%的全貌,包括linux打oracle补丁的相关情况。同时,我们还将为您介绍有关Fororacledatabas
在这篇文章中,我们将带领您了解Oracle 提交补丁,可使 Linux 内核引导提速 6%-49%的全貌,包括linux打oracle补丁的相关情况。同时,我们还将为您介绍有关For oracle databases, if the top showing the oracle database, then oracle process is using the top c、How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6、Intel 提交补丁,用于 Linux 内核初步支持 USB4、linux oracle 上如何用 shell 脚本来将 oracle 的各项性能数据查询出来,并上传的知识,以帮助您更好地理解这个主题。
本文目录一览:- Oracle 提交补丁,可使 Linux 内核引导提速 6%-49%(linux打oracle补丁)
- For oracle databases, if the top showing the oracle database, then oracle process is using the top c
- How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6
- Intel 提交补丁,用于 Linux 内核初步支持 USB4
- linux oracle 上如何用 shell 脚本来将 oracle 的各项性能数据查询出来,并上传
Oracle 提交补丁,可使 Linux 内核引导提速 6%-49%(linux打oracle补丁)
Oracle 团队提交的一个补丁将有望使 Linux 内核的引导时间大大缩减,最高可以提速 49%。
Oracle 开发者在邮件列表中指出,该补丁扩展了 padata,使其可以处理多线程作业。padata 原本只是可以用于处理多个并行单线程作业的框架,补丁添加了 padata 在 CPU 内核之间平均分配工作来处理多线程作业的能力,它会将最小工作量分配给适合处理的协作线程,并且在这些协作线程之间进行负载均衡。
该补丁会推迟 Linux 引导中的 struct page init,这是内核引导过程中的一大性能瓶颈,它并不需要并发限制、资源控制或优先级调整。在各种 x86 系统上进行测试,开发者发现该补丁将延迟的初始化速度提高 63% 至 91%,而这可以将内核引导速度提高 6% 至 49%。尤其是在具有大量 RAM 的多节点环境中,性能改进更为明显。
此补丁的改进同时也使启动虚拟机的时间缩减,这对于云计算环境来说非常重要,因为需要应对不断变化的容量 / 需求伸缩变化的情况。
For oracle databases, if the top showing the oracle database, then oracle process is using the top c
Note 805586.1 Troubleshooting Session Administration (Doc ID 805586.1) Note 822527.1 How To Find Where The Memory Is Growing For A Process (Doc ID 822527.1) Note 273646.1 How to diagnose the high cpu utilization of ORACLE.EXE in Windows environment Note 728539.1 Find Blocking Sessions In sqlPLUS Note 61552.1 Troubleshooting Oracle Database Hanging Issues for versions from 7 to 9--Exhaustive Note 164760.1 Detecting and Resolving Locking Conflicts using TopSessionsHow I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6
How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6
by Ginny Henningsen; updated by Michele Casey
How to simplify the installation of Oracle Database 12c or 11g on Oracle Linux 6 by installing the oracle-rdbms-server-12cR1-preinstall
or oracle-rdbms-server-11gR2-preinstall
RPM package, which automatically performs a number of tasks, such as installing required software packages, resolving package dependencies, and modifying kernel parameters.
Published September 2012 (updated September 2017)
READ THIS FIRST: Important Changes Since Publication
While the content in this article is still valid, several details have changed. For example:
- For Oracle Database 12c Release 2, the preinstall RPM has a different name than the one used in the article belowpu:
- oracle-database-server-12cR2-preinstall
- See also this documentation: Automatically Configuring Oracle Linux with Oracle Preinstallation RPM
- The preinstall RPMs are published on Oracle Linux yum server for both Oracle Linux 6 and 7 in the Latest repositories which are configured and enabled by default in recent releases of Oracle Linux 6 and 7
Introducing the oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
RPM for Oracle Linux
Before installing Oracle Database 12c or 11g on a system, you need to preconfigure the operating environment since the database requires certain software packages, package versions, and tweaks to kernel parameters. (Be sure to review the appropriate Oracle Database installation guide to familiarize yourself with hardware, software, and operating system requirements.)
|
Note: This article applies to Oracle Linux 6. A previous article, "How I Simplified Oracle Database Installation on Oracle Linux," covered performing a similar task on versions of Oracle Linux 5.
On Oracle Linux, I discovered that there is a remarkably easy way to address these installation prerequisites: First, depending on your database version, install either the RPM package called oracle-rdbms-server-12cR1-preinstall
or oracle-rdbms-server-11gR2-preinstall
. This RPM performs a number of preconfiguration steps, including the following:
- Automatically downloading and installing any additional software packages and specific package versions needed for installing Oracle Grid Infrastructure and Oracle Database 12 c Release 1 (12.1) or 11g Release 2 (11.2.0.3), with package dependencies resolved via
yum
orup2date
capabilities. - Creating the user
oracle
and the groupsoinstall
(forOraInventory
) anddba
(forOSDBA
), which are used during database installation. (For security purposes, this user has no password by default and cannot log in remotely. To enable remote login, please set a password using thepasswd
tool.) - Modifying kernel parameters in
/etc/sysctl.conf
to change settings for shared memory, semaphores, the maximum number of file descriptors, and so on. - Setting hard and soft shell resource limits in
/etc/security/limits.conf
, such as the locked-in memory address space, the number of open files, the number of processes, and core file size. - Setting
numa=off
in the kernel for x86_64 machines.
Note that oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
parses the existing /etc/sysctl.conf
and /etc/security/limits.conf
files and updates values only as needed for database installation. Any precustomized settings not related to database installation are left as is.
The oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
RPM packages are accessible through the Oracle Unbreakable Linux Network (ULN, which requires a support contract), from the Oracle Linux distribution media, or from the Oracle public yum repository. Thus, whether or not your system is registered with ULN to access Oracle patches and support, you can use oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
to simplify database installation on Oracle Linux. In addition, the Oracle public yum repository now includes all security and bug errata, ensuring systems are secured and stable with the latest security updates and bug fixes.
Installing the oracle-rdbms-server-12cR1-preinstall
or oracle-rdbms-server-11gR2-preinstall
RPM
The remainder of this article steps through the procedure that I used for installing oracle-rdbms-server-11gR2-preinstall
on Oracle Linux via the Oracle public yum repository. The same steps outlined in the following section can be used for either version of the preinstall RPM package. I started with a system running Oracle Linux Release 6 Update 4 for x86_64, a 64-bit version of Oracle Linux that I downloaded from the Oracle software delivery cloud (requires registration or login). First, I set up a yum
configuration file that pointed to the correct repository, and then I installed the oracle-rdbms-server-11gR2-preinstall
RPM from that repository.
Here are the steps for preconfiguring a system for Oracle Database installation using oracle-rdbms-server-11gR2-preinstall
. Remember, the steps are the same when using the oracle-rdbms-server-12cR1-preinstall
package; you simply need to change the name of the RPM package during the yum installation step.
- As an authorized user (for example,
root
), retrieve the file that configures repository locations:
# cd /etc/yum.repos.d # wget http://yum.oracle.com/public-yum-ol6.repo
- Using a text editor, modify the file, changing the field
enabled=0
toenabled=1
to reflect repositories that correspond to the machine''s operating system release.
Here is an excerpt of
public-yum-old6.repo
with the changed lines in boldface.[ol6_latest] name=Oracle Linux $releasever Latest ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/ gpgkey=http://yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=1 [ol6_UEK_latest] name=Latest Unbreakable Enterprise Kernel for Oracle Linux $releasever ($basearch) baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/UEK/latest/$basearch/ gpgkey=http://yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=1
Because the target system is running Oracle Linux Release 6 Update 4 for x86_64, which installs the Oracle Unbreakable Enterprise Kernel by default, there are two repositories to enable,
[ol6_latest]
and[ol6_UEK_latest]
. - Next, install the
oracle-rdbms-server-11gR2-preinstall
RPM using theyum install
command. If you are using Oracle Database 12c, then you would typeyum install
.
The output in Listing 1 shows how the installation checks dependencies and then downloads and installs the required packages.
# yum install oracle-rdbms-server-11gR2-preinstall Loaded plugins: refresh-packagekit, rhnplugin, security Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6 will be installed --> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: gcc for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: glibc-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 --> Running transaction check ---> Package compat-libcap1.x86_64 0:1.10-1 will be installed ---> Package compat-libstdc++-33.x86_64 0:3.2.3-69.el6 will be installed ---> Package gcc.x86_64 0:4.4.6-4.el6 will be installed --> Processing Dependency: cpp = 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.x86_64 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.6-4.el6.x86_64 ---> Package gcc-c++.x86_64 0:4.4.6-4.el6 will be installed --> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++-4.4.6-4.el6.x86_64 ---> Package glibc-devel.x86_64 0:2.12-1.80.el6_3.4 will be installed --> Processing Dependency: glibc-headers = 2.12-1.80.el6_3.4 for package: glibc-devel-2.12-1.80.el6_3.4.x86_64 --> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.80.el6_3.4.x86_64 ---> Package ksh.x86_64 0:20100621-16.el6 will be installed ---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed ---> Package libstdc++-devel.x86_64 0:4.4.6-4.el6 will be installed --> Running transaction check ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed --> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 --> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 ---> Package cpp.x86_64 0:4.4.6-4.el6 will be installed ---> Package glibc-headers.x86_64 0:2.12-1.80.el6_3.4 will be installed --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.80.el6_3.4.x86_64 --> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.80.el6_3.4.x86_64 ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed --> Running transaction check ---> Package kernel-uek-headers.x86_64 0:2.6.32-300.32.1.el6uek will be installed ---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: oracle-rdbms-server-11gR2-preinstall x86_64 1.0-6.el6 ol6_latest 15 k Installing for dependencies: cloog-ppl x86_64 0.15.7-1.2.el6 ol6_latest 93 k compat-libcap1 x86_64 1.10-1 ol6_latest 17 k compat-libstdc++-33 x86_64 3.2.3-69.el6 ol6_latest 183 k cpp x86_64 4.4.6-4.el6 ol6_latest 3.7 M gcc x86_64 4.4.6-4.el6 ol6_latest 10 M gcc-c++ x86_64 4.4.6-4.el6 ol6_latest 4.7 M glibc-devel x86_64 2.12-1.80.el6_3.4 ol6_latest 970 k glibc-headers x86_64 2.12-1.80.el6_3.4 ol6_latest 600 k kernel-uek-headers x86_64 2.6.32-300.32.1.el6uek ol6_latest 713 k ksh x86_64 20100621-16.el6 ol6_latest 684 k libaio-devel x86_64 0.3.107-10.el6 ol6_latest 13 k libstdc++-devel x86_64 4.4.6-4.el6 ol6_latest 1.5 M mpfr x86_64 2.4.1-6.el6 ol6_latest 156 k ppl x86_64 0.10.2-11.el6 ol6_latest 1.3 M Transaction Summary ================================================================================ Install 15 Package(s) Total download size: 25 M Installed size: 61 M Is this ok [y/N]: Downloading Packages: -------------------------------------------------------------------------------- Total 710 kB/s | 25 MB 00:35 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : mpfr-2.4.1-6.el6.x86_64 1/15 Installing : libstdc++-devel-4.4.6-4.el6.x86_64 2/15 Installing : cpp-4.4.6-4.el6.x86_64 3/15 Installing : ppl-0.10.2-11.el6.x86_64 4/15 Installing : cloog-ppl-0.15.7-1.2.el6.x86_64 5/15 Installing : kernel-uek-headers-2.6.32-300.32.1.el6uek.x86_64 6/15 Installing : glibc-headers-2.12-1.80.el6_3.4.x86_64 7/15 Installing : glibc-devel-2.12-1.80.el6_3.4.x86_64 8/15 Installing : gcc-4.4.6-4.el6.x86_64 9/15 Installing : gcc-c++-4.4.6-4.el6.x86_64 10/15 Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64 11/15 Installing : libaio-devel-0.3.107-10.el6.x86_64 12/15 Installing : ksh-20100621-16.el6.x86_64 13/15 Installing : compat-libcap1-1.10-1.x86_64 14/15 Installing : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 15/15 Verifying : gcc-4.4.6-4.el6.x86_64 1/15 Verifying : compat-libcap1-1.10-1.x86_64 2/15 Verifying : ksh-20100621-16.el6.x86_64 3/15 Verifying : glibc-devel-2.12-1.80.el6_3.4.x86_64 4/15 Verifying : libaio-devel-0.3.107-10.el6.x86_64 5/15 Verifying : oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64 6/15 Verifying : gcc-c++-4.4.6-4.el6.x86_64 7/15 Verifying : glibc-headers-2.12-1.80.el6_3.4.x86_64 8/15 Verifying : libstdc++-devel-4.4.6-4.el6.x86_64 9/15 Verifying : compat-libstdc++-33-3.2.3-69.el6.x86_64 10/15 Verifying : mpfr-2.4.1-6.el6.x86_64 11/15 Verifying : kernel-uek-headers-2.6.32-300.32.1.el6uek.x86_64 12/15 Verifying : cpp-4.4.6-4.el6.x86_64 13/15 Verifying : ppl-0.10.2-11.el6.x86_64 14/15 Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 15/15 Installed: oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el6 Dependency Installed: cloog-ppl.x86_64 0:0.15.7-1.2.el6 compat-libcap1.x86_64 0:1.10-1 compat-libstdc++-33.x86_64 0:3.2.3-69.el6 cpp.x86_64 0:4.4.6-4.el6 gcc.x86_64 0:4.4.6-4.el6 gcc-c++.x86_64 0:4.4.6-4.el6 glibc-devel.x86_64 0:2.12-1.80.el6_3.4 glibc-headers.x86_64 0:2.12-1.80.el6_3.4 kernel-uek-headers.x86_64 0:2.6.32-300.32.1.el6uek ksh.x86_64 0:20100621-16.el6 libaio-devel.x86_64 0:0.3.107-10.el6 libstdc++-devel.x86_64 0:4.4.6-4.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6 Complete!
Listing 1: Installing the
oracle-rdbms-server-11gR2-preinstall
RPMThe yum installation logs messages about kernel changes in the file
/var/log/oracle-rdbms-server-11gR2-preinstall/results/orakernel.log
, and it makes backups of current system settings in the directory/var/log/oracle-rdbms-server-11gR2-preinstall/backup
. - At this point, the system is ready for the installation of Oracle Database. For example, to install Oracle Database 11g Release 2, follow the directions in Chapter 4, "Installing Oracle Database," of the Database Installation Guide for Linux."
Here are the steps I followed while installing Oracle Database 11g Release 2 in my test environment. Make sure you review all documentation and follow recommended best practices before installing into your production environment.
- As
root
, create a parent directory in a file system that has sufficient space to be the target location for the downloaded files:
# mkdir /home/OraDB11g # cd /home/OraDB11g
The amount of disk space needed in the file system varies according to the specific installation type, but roughly twice the size of the zip archives, or 5 GB, is enough to house the software and data files.
- Into this target directory, download the installation media files from the Oracle Database Software Downloads page on Oracle Technology Network.
- Extract the files:
# unzip linux.x64_11gR2_database_1of2.zip # unzip linux.x64_11gR2_database_2of2.zip
- Log in as the user
oracle
. Change directory to thedatabase
directory and enter the following command to run the Oracle Universal Installer:
$ cd /home/OraDB11g/database $ ./runInstaller
The Oracle Universal Installer performs a number of checks, verifying that the necessary OS packages and versions are installed. In addition, it checks kernel parameters set by the
oracle-rdbms-server-11gR2-preinstall
installation. During the kernel settings check, the installer might flag a few settings as "failed," and you should investigate these failures. In some cases, you still might be able to continue with the database installation. If you check kernel settings in/etc/sysctl.conf
, you''ll see thatoracle-rdbms-server-11gR2-preinstall
has modified and added the necessary settings to ensure the minimum requirements are met, as defined in section 2.10.1, "Displaying and Changing Kernel Parameter Values," in Chapter 2, "Oracle Database Preinstallation Requirements," of the Oracle Database Installation Guide 11g Release2 (11.2) for Linux. Below is the list of requirements:fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 4294967295 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
If necessary, you can (as
root
) edit the file/etc/sysctl.conf
to specify a setting manually, for example:# vi /etc/sysctl.conf # /sbin/sysctl -p
The Oracle Universal Installer performs additional checks, such as verifying the
glibc
version, sufficient disk space, environmental variable and path settings, and sufficient physical memory and swap space. Generally, installingoracle-rdbms-server-11gR2-preinstall
takes care of the prerequisites so that you can proceed directly with installing the database. - As
Final Thoughts
Installing the oracle-rdbms-server-12cR1-preinstall
and oracle-rdbms-server-11gR2-preinstall
RPMs can save time when installing Oracle Database 12c and 11g on Oracle Linux. These RPMs address most Oracle Database installation prerequisites and greatly simplify the installation process.
See Also
Here are the resources referenced earlier in this document:
- Oracle Unbreakable Linux Network: https://linux.oracle.com
- Oracle Linux yum server: http://yum.oracle.com/
- Oracle software delivery cloud (requires registration or login): https://edelivery.oracle.com/linux
- Chapter 4, "Installing Oracle Database," of the Database Installation Guide for Linux: http://docs.oracle.com/cd/E11882_01/install.112/e24321/inst_task.htm#BABBBHJH
- Oracle Database Software Downloads page on Oracle Technology Network: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
And here are some additional resources from the Oracle Database Documentation Library (http://www.oracle.com/pls/db112/homepage). Relevant subsections from the Oracle Database Installation Guide 11g Release 2 (11.2) for Linux (http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/toc.htm) with currently valid URLs are as follows:
- "About the Oracle RDBMS Pre-Install and Oracle Validated RPMs" from Chapter 1, "Overview of Oracle Database Installation": http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/install_overview.htm#BABDBHCJ
- Chapter 2, "Oracle Database Preinstallation Requirements": http://download.oracle.com/docs/cd/E11882_01/install.112/e16763/pre_install.htm#BABFDGHJ
- "Downloading Oracle Software" from Chapter 4, "Installing Oracle Database," which describes how to download installation files from the Oracle Technology Network Website: http://docs.oracle.com/cd/E11882_01/install.112/e16763/inst_task.htm#autoId6
Also see the blog entry "Oracle RDBMS Server 11gR2 Pre-Install RPM for Oracle Linux 6 has been released": https://blogs.oracle.com/linux/entry/oracle_rdbms_server_11gr2_pre
About the Authors
Ginny Henningsen has worked for the last 15 years as a freelance writer developing technical collateral and documentation for high-tech companies. Prior to that, Ginny worked for Sun Microsystems, Inc. as a Systems Engineer in King of Prussia, PA and Milwaukee, WI. Ginny has a BA from Carnegie-Mellon University and a MSCS from Villanova University.
Michele Casey is the Director of Product Management for Oracle Linux. She has worked with commercial Linux distributions and open source projects as a product manager since 2006. She has also held positions as a system administrator, project manager, and technical support engineer.
Revision 1.1, 07/09/2013; added information about using theoracle-rdbms-server-12cR1-preinstall package to installOracle Database 12c |
Follow us:
Intel 提交补丁,用于 Linux 内核初步支持 USB4
上个月初,推动 USB 技术采用的组织 USB-IF 宣布正式推出 USB4™ 规范,USB4 是 USB 的一个重大更新,由于使用了 Intel 授权的 Thunderbolt 3 协议,速度得到大幅提升,新版本带宽是 USB 3.2 的两倍,同时扩展了 USB Type-C 性能。
本周二,Intel 开源工程师在 Linux 内核邮件列表中提交了 22 个 USB4 补丁,如果获得通过,这些补丁将为 Linux 内核提供基本的 USB4 支持。
比如上图这一个补丁描述到:“由于现在我们可以在软件连接管理器中执行与固件几乎相同的操作,因此默认情况下没有必要启动它。相反,我们可以继续使用软件连接管理器。”
这些最初的 Linux 内核支持包括 PCIe 隧道、DisplayPort 隧道、USB 3.x 隧道、P2P 网络与固件升级等,但目前还没有 USB4 电源管理支持,这是短期内需要完成的主要项目之一。初步估计几个月内 Linux Kernel 5.5 上将会看到 USB4 支持。
Intel 的补丁可以在这里查看:
http://lkml.iu.edu/hypermail/linux/kernel/1910.0/00350.html
linux oracle 上如何用 shell 脚本来将 oracle 的各项性能数据查询出来,并上传
这是抄的一个 DBA 的脚本,在服务器上用 shell 将 oracle 数据库的数据查到,包括查询 141 主库,和 142 备库,然后用 ftp 上传到外网的一个服务器上进行展示,脚本有些长,直接用 nodepad++ 打开即可
#!/bin/ksh
time=date +''%Y%m%d%T''
. ~/.bash_profile
VALUE=sqlplus -silent "/ as sysdba" << END <br/>set pagesize 0 feedback off verify off heading off echo off <br/>select ''空闲空间:''||round(free_mb/1024)||''G,使用率:''||trunc((total_mb-free_mb)/total_mb*100)||''%'' from v\\\$asm_diskgroup where name=''FRA'';<br/>exit; <br/>END
echo "电子税务局数据库巡检时间 ${time}:${VALUE}"> /home/oracle/monitor/mon_space/logs/framon${time}.log
#mon session cnt
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
VALUE=sqlplus -silent "/ as sysdba" << END<br/>set pagesize 0 feedback off verify off heading off echo off<br/>select ''会话数 ''||listagg(info, '','') WITHIN GROUP(ORDER BY info) names<br/>from (select ''节点'' || inst_id || '':'' || count(*) info<br/>from gv\\\$session<br/>group by inst_id);<br/>exit;<br/>END
echo "${VALUE}">> /home/oracle/monitor/mon_space/logs/framon${time}.log
#mon wait cnt
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
VALUE=sqlplus -silent "/ as sysdba" << END<br/>set pagesize 0 feedback off verify off heading off echo off<br/>select /*+rule*/''活动会话数:''||count(*) from gv\\\$session where type=''USER'' and wait_class<>''Idle''<br/>union all<br/>select ''CPU使用率 ''||listagg(info, '','') WITHIN GROUP(ORDER BY info) names<br/>from (<br/>select ''节点''||inst_id||'': ''||round(sum(value)/2,1)||''%'' info from gv\\\$sysmetric where metric_name in (''Host CPU Utilization (%)'') group by inst_id<br/>);<br/>exit;<br/>END
echo "${VALUE}">> /home/oracle/monitor/mon_space/logs/framon${time}.log
#mon tablespace
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
VALUE=sqlplus -silent "/ as sysdba" << END<br/>set pagesize 0 feedback off verify off heading off echo off<br/>select ''表空间使用率超过75%为:''||listagg(used_percent,'','') WITHIN GROUP(ORDER BY used_percent) names<br/>from<br/>(select a.tablespace_name||'' ''||<br/>round(replace((a.sz-b.sz)/a.sz*100,'','',''.''),2)||''%'' used_percent<br/>from (select tablespace_name,sum(bytes)/1048576 sz<br/>from dba_data_files group by tablespace_name) a,<br/>(select tablespace_name,sum(bytes)/1048576 sz<br/>from dba_free_space group by tablespace_name) b<br/>where a.tablespace_name=b.tablespace_name(+) <br/>and round(replace((a.sz-b.sz)/a.sz*100,'','',''.''),2)>=75);<br/>exit;<br/>END
echo "${VALUE}">> /home/oracle/monitor/mon_space/logs/framon${time}.log
#mon lock cnt
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
VALUE=sqlplus -silent "/ as sysdba" << END<br/>set pagesize 0 feedback off verify off heading off echo off<br/>select /*+rule*/''数据库锁数量:''||count(*) from gv\\\$lock where request<>0;<br/>exit;<br/>END
echo "${VALUE}">> /home/oracle/monitor/mon_space/logs/framon${time}.log
#disk=df -mP /home|column -t |sed 1d | awk ''{print "disk:"$5}''|tr -d %
#echo ",141 磁盘空间:/home"${disk}>>/home/oracle/monitor/mon_space/logs/framon${time}.log
#disk=df -mP /|column -t |sed 1d | awk ''{print "disk:"$5}''|tr -d %
#echo ",/:"${disk}>>/home/oracle/monitor/mon_space/logs/framon${time}.log
#mon memory 141
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
memused=free -m |grep buffers\/ |awk -F '':'' ''{print $2}'' |awk ''{print $1}''
available=free -m |grep buffers\/ |awk -F '':'' ''{print $2}'' |awk ''{print $2}''
memtotal=free -m |grep Mem |awk ''{print $2}''
memrate=expr $memused \* 100 / $memtotal
echo "服务器 141 内存使用率:" >>/home/oracle/monitor/mon_space/logs/framon${time}.log
echo ${memrate}%, >>/home/oracle/monitor/mon_space/logs/framon${time}.log
#mon memory 142
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
memused=ssh 87.12.74.142 free -m |grep buffers\/ |awk -F '':'' ''{print $2}'' |awk ''{print $1}''
available=ssh 87.12.74.142 free -m |grep buffers\/ |awk -F '':'' ''{print $2}'' |awk ''{print $2}''
memtotal=ssh 87.12.74.142 free -m |grep Mem |awk ''{print $2}''
memrate=expr $memused \* 100 / $memtotal
echo "服务器 142 内存使用率:" >>/home/oracle/monitor/mon_space/logs/framon${time}.log
echo ${memrate}% >>/home/oracle/monitor/mon_space/logs/framon${time}.log
#mon disk
spvalue=70
SPACE=df -hP 2>/dev/null | awk ''int($5)>''$spvalue'' {print $6,$5}'' | wc -l
if [ $SPACE -gt 0 ]
then
echo 141 文件系统使用率: >>/home/oracle/monitor/mon_space/logs/framon${time}.log
df -hP 2>/dev/null | awk ''int($5)>''$spvalue'' {print $6,$5}'' >>/home/oracle/monitor/mon_space/logs/framon${time}.log
fi
SPACE=ssh gxgs-xwssb-nwyw-db2 df -hP 2>/dev/null | awk ''int($5)>''$spvalue'' {print $6,$5}'' | wc -l
if [ $SPACE -gt 0 ]
then
echo 142 文件系统使用率: >>/home/oracle/monitor/mon_space/logs/framon${time}.log
ssh gxgs-xwssb-nwyw-db2 df -hP 2>/dev/null | awk ''int($5)>''$spvalue'' {print $6,$5}'' >>/home/oracle/monitor/mon_space/logs/framon${time}.log
fi
#weblogic thread count
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
VALUE=sqlplus -silent "/ as sysdba" << END<br/>set pagesize 0 feedback off verify off heading off echo off<br/>select ''weblogic独占线程超过30的数量:''||count(1) from hlwsb_sjfx.dzswj_monitor_weblogic_thread t where t.mon_date>sysdate- (30/1440) and t.hoggingthreadcount>30;<br/>exit;<br/>END
echo "${VALUE}">> /home/oracle/monitor/mon_space/logs/framon${time}.log
#weblogic thread mingxi
echo >>/home/oracle/monitor/mon_space/logs/framon${time}.log
VALUE=sqlplus -silent "/ as sysdba" << END<br/>set pagesize 0 feedback off verify off heading off echo off<br/>select ''weblogic独占线程超过30的服务明细:''|| to_char(wmsys.wm_concat(t.serverport)) from hlwsb_sjfx.dzswj_monitor_weblogic_thread t where t.mon_date>sysdate- (30/1440) and t.hoggingthreadcount>30<br/>group by t.serverport;<br/>exit;<br/>END
echo "${VALUE}">> /home/oracle/monitor/mon_space/logs/framon${time}.log
USER=weblogic
#密码
PASSWORD=Hlwsb101#%
#下载文件目录 1
SRCDIR=/home/weblogic/logstail/oracle_monitor/logs/
#FTP 目录 (待下载文件目录)
DESDIR=/home/oracle/monitor/mon_space/logs/
IP=87.16.16.218
PORT=3522
lftp -u ${USER},${PASSWORD} sftp://${IP}:${PORT}<<EOF
lcd ${DESDIR}
cd ${SRCDIR}
mput mon
by
EOF
rm -f /home/oracle/monitor/mon_space/logs/*
今天关于Oracle 提交补丁,可使 Linux 内核引导提速 6%-49%和linux打oracle补丁的讲解已经结束,谢谢您的阅读,如果想了解更多关于For oracle databases, if the top showing the oracle database, then oracle process is using the top c、How I Simplified Oracle Database 12c and 11g Installations on Oracle Linux 6、Intel 提交补丁,用于 Linux 内核初步支持 USB4、linux oracle 上如何用 shell 脚本来将 oracle 的各项性能数据查询出来,并上传的相关知识,请在本站搜索。
本文标签: