Home Database Mysql Tutorial CentOS 4.8 安装 Oracle 10g

CentOS 4.8 安装 Oracle 10g

Jun 07, 2016 pm 05:05 PM

检测内存、交换分区的大小 # grep MemTotal /proc/meminfo # grep SwapTotal /proc/meminfo 检测磁盘空间大小 # df -h 检测 li

检测内存、交换分区的大小
# grep MemTotal /proc/meminfo
# grep SwapTotal /proc/meminfo

检测磁盘空间大小
# df -h

检测 libaio 包,CentOS 4.8 默认不安装
注意:不安装创建数据库时会报错“ORA-12547:TNS:lost contact”
# rpm -qa|grep libaio
# rpm -ivh libaio-0.3.105-2.i386.rpm
# rpm -ivh libaio-devel-0.3.105-2.i386.rpm

修改内核参数
# cat >> /etc/sysctl.conf 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
EOF

设置配置生效
# sysctl -p

创建组及用户及安装目录
# groupadd dba
# groupadd oinstall
# useradd -g oinstall -G dba Oracle
# mkdir -p /opt/oracle
# chown -R oracle:oinstall /opt/oracle
# id nobody
# passwd oracle

设置 oracle 用户的环境变量
# su - oracle
# vi .bash_profile
ORACLE_BASE=/opt/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1
export ORACLE_HOME
ORACLE_SID=orcl
export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin
export PATH

设置环境生效
# . .bash_profile
# env | grep oracle
# echo $ORACLE_SID

开始安装,,如果运行runInstaller报字体转换错误,执行export LANG=en

一般来说,出于性能上的考虑,还需要需要进行如下的设定,以便改进Oracle用户的有关 nofile(可打开的文件描述符的最大数)和nproc(单个用户可用的最大进程数量)
# 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
session required pam_limits.so

# 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

安装配置 ASM
到 oracle 官方网站下 asm 的安装包:
注意根据CPU的型号选择不同的下载包。下载完成后,直接通过 rpm 命令安装就OK了。

使用 ASMLib 之前,必须运行配置脚本以准备驱动程序。以 root 用户身份运行以下命令,并响应如下示例中所显示的提示。
# /etc/init.d/oracleasm configure

现在,如下所示启用 ASMLib 驱动程序。
# /etc/init.d/oracleasm enable

确认ASMLib已经自动加载
# dmesg | grep oracleasm
ASM: oracleasmfs mounted with options:

为 ASM 配置磁盘
接下来,告诉 ASM 驱动程序您要使用的磁盘。请注意,这些磁盘是不包含任何内容(甚至不包含分区)的空磁盘。可以将磁盘分区用于 ASM,但不建议这样做。
通过以 root 用户身份运行以下命令来标记由 ASMLib 使用的磁盘:
# /etc/init.d/oracleasm createdisk DISK_NAME device_name

(提示:DISK_NAME 应由大写字母组成。当前版本有一个错误,即如果使用小写字母,ASM 实例将无法识别磁盘。)

例如:
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "/dev/sdb" as an ASM disk                     [  OK  ]
# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
Marking disk "/dev/sdc" as an ASM disk                     [  OK  ]
# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1
Marking disk "/dev/sdd" as an ASM disk                     [  OK  ]

以下示例演示了如何列出标记为由 ASMLib 使用的所有磁盘。

# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3

既然已经安装了 ASMLib,且已将磁盘标记为可用,接下来便可以创建一个 ASM 实例,并构建一个使用 ASM 进行磁盘存储的数据库。最容易的方法就是使用数据库配置助手 (DBCA) 来完成此操作。
注意:创建ASM实例会报错“ORA-12547:TNS:lost contact”,需要安装 libaio-0.3.105-2.i386.rpm


运行常用工具的命令:
# dbca
# lsnrctl
# netmgr
# emctl start dbconsole

在windows下的IE里访问oracle10g的em(企业管理器),网页界面上的按钮出现“口口”的乱码,网页上的其他部分显示正常。
在 $ORACLE_HOME/jdk/jre/lib 和 $ORACLE_HOME/jre/1.4.2/lib/ 目录下都有多种字符集字体配置文件
选择使用font.properties.zh_CN.RedHat来替换缺省字体定义文件
# cp font.properties.zh_CN.Redhat font.properties

删除$ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs中的gif文件;
重启dbconsole
如果问题还存在,请设置 IE 浏览器的语言首选为 英文


增加磁盘空间:
# fdisk /dev/sdb
p
n
w

创建分区挂载目录
# mkdir /u03

将新文件系统添加到 /etc/fstab
/dev/sdb1         /           ext3    defaults       1 1

挂载新分区
# mount /u03

查看新分区的空间
# df -h /u03

linux

Statement of this Website
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

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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you drop a table in MySQL using the DROP TABLE statement? How do you drop a table in MySQL using the DROP TABLE statement? Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you create indexes on JSON columns? How do you create indexes on JSON columns? Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? Mar 18, 2025 pm 12:00 PM

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)

How do you represent relationships using foreign keys? How do you represent relationships using foreign keys? Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

See all articles