实验环境:ORACLE11GR2,CENTOS6.232位版本(免去修改redhat的Yum源,IP设置为192.168.233.10,NAT网络),VM8.0版本安装参考官网文档和一些文章,将配置参数尽量
实验环境:ORACLE11GR2,CENTOS6.2 32位版本(免去修改redhat的Yum源,IP设置为192.168.233.10,NAT网络),VM8.0版本
安装参考官网文档和一些文章,香港虚拟主机,将配置参数尽量补全了一些,其中也将实验无效的地方进行了修正。
首先搭建好环境,centos默认安装的Minitop,配置好了FTP,网络,比较简单,不描述了。下载11G版本也比较简单也不描述了。下载地址,虚拟主机,支持迅雷下载,不用注册
一、Linux安装完成后相关服务的设置:
1.关闭防火墙服务和邮件服务和NTP时间同步服务
[root@leonarding1 etc]# chkconfig --list iptables 查看防火墙服务运行级别设置参数
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off 2345开机都启动
root@leonarding1 etc]# chkconfig --list sendmail 查看邮件服务运行级别设置参数
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off 2345开机都启动
[root@leonarding1 etc]# service iptables stop 临时关闭防火墙服务
[root@leonarding1 etc]# service sendmail stop 临时关闭邮件服务
Shutting down sm-client: [ OK ]
Shutting down sendmail: [ OK ]
[root@leonarding1 etc]# chkconfig --level 35 iptables off 指定35运行级别上开机不启动
[root@leonarding1 etc]# chkconfig --level 35 sendmail off 指定35运行级别上开机不启动
[root@leonarding1 etc]# chkconfig --list iptables 查看是否设置成功35运行级别上开机不启动
iptables 0:off 1:off 2:on 3:off 4:on 5:off 6:off
[root@leonarding1 etc]# chkconfig --list sendmail 查看是否设置成功35运行级别上开机不启动
sendmail 0:off 1:off 2:on 3:off 4:on 5:off 6:off
root@leonarding1 app]# service ntpd status 查看ntp服务状态,香港空间,已经关闭
root@leonarding1 app]# service ntpd stop 临时关闭ntp服务
[root@leonarding1 app]# chkconfig ntpd off 指定ntp服务开机不启动
2. 修改hosts 文件(删除掉默认的内容添加下面两句话)
The "/etc/hosts" file mustcontain a fully qualified name for the server.
127.0.0.1 localhost
192.168.233.10 oracleinstall
3. 设置内核参数并生效
# vim /etc/sysctl.conf
kernel.core_uses_pid = 1
kernel.shmall = 2097152 # ipcs -m 4G*1024*1024/4K = 1048576(页)
kernel.shmmax = 2147483648 2G*1024*1024*1024=2147483648(字节)
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
fs.suid_dumpable = 1
net.ipv4.ip_local_port_range = 9000 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
使其生效
# /sbin/sysctl –p
4.修改Oracle用户的shell限制
4.1 # vim /etc/security/limits.conf
添加如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
4.2 # vim /etc/pam.d/login
添加如下内容
[session required /lib/security/pam_limits.so 对64位操作系统不需要这行]
session required pam_limits.so 我是64位系统只添加这行即可
# ulimit –a 检查配置情况
5. 在/etc/security/limits.conf 文件里添加如下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
6. 创建groups 和 users
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper
useradd -u 502 -g oinstall -Gdba,asmdba,oper oracle
passwd oracle
7. 创建目录并赋权
mkdir -p/u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
8.安装RPM包
8.1 检查相关的RPM包是否安装:
# rpm -q binutils compat-libcap1 compat-libstdc++33 gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++ libaio libaio-devel make sysstat
9。安装sqlplus命令行中的键盘增强工具,可以正常使用上下左右退格键。
#yum install rlwrap
二、用户环境变量配置:
1.修改oracle 用户的.bash_profile环境变量
# su – oracle 登陆oracle用户
[oracle@leonarding1 ~]$ vim .bash_profile 修改.bash_profile
添加如下环境变量
# Oracle Settings #
export TMP=/tmp 指定临时目录
export TMPDIR=$TMP 指定临时目录路径
export ORACLE_BASE=/u01/app/oracle ORACLE基目录
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 ORACLE家目录
export ORACLE_SID=ORCL ORACLE实例名
export ORA_CRS_HOME=/u01/app/product/crs_1 可选,这是集群注册服务目录
export ORACLE_ADMIN=$ORACLE_BASE/admin ORACLE的dump目录
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 如果不写这个环境变量,当每次重启数据库时,在alert日志会
有报错信息
export ORACLE_TERM=xterm 指定安装ORACLE终端的类型
export PATH=/usr/sbin:/usr/bin:/usr/local/bin:$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH
[oracle@leonarding1 ~]$ source .bash_profile 重新加载环境变量使之生效
四、开始安装数据库(切换到Oracle用户安装)
1.安装之前先导入语言,export LANG=en_US,否则安装的图形界面会出现乱码
2.解压压缩文件到相应的地点
#unzip 文件 -r /路径 解压.zip软件到相应的目录
3. ./runInstaller开始安装oracle数据库软件
$ cd database/ 进入安装目录
$ pwd
/home/oracle/database
$ ./runInstaller

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version
Chinese version, very easy to use