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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Apr 02, 2025 pm 07:05 PM

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.

The relationship between mysql user and database The relationship between mysql user and database Apr 08, 2025 pm 07:15 PM

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

Can mysql and mariadb coexist Can mysql and mariadb coexist Apr 08, 2025 pm 02:27 PM

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

See all articles