这两天在Ubuntu上安装Oracle把人折腾毁了,即使照着网上的教程来,还是出了很多问题。好在最后终于搞定了。写出来总结一下,免得
这两天在Ubuntu上安装Oracle把人折腾毁了,即使照着网上的教程来,还是出了很多问题。好在最后终于搞定了。写出来总结一下,免得以后忘了。
标题注明32位是因为网上教程几乎全是以64位安装为例的,32位系统下照着做是绝对会安装失败的。
出现的问题主要有两方面,一个是安装过程中出现的,另一个是安装完成后出现的。
安装过程(主要过程就直接copy别人的教程了)及问题:
1.将系统更新到最新:
sudo apt-get update
sudo apt-get dist-upgrade
2.如果使用的Ubuntu不是桌面版(如Ubuntu server),由于Oracle安装需要用到图形界面,所以需要安装桌面程序:
sudo apt-get install gnome-core
相信很多都是使用的桌面版,那么这个步骤就不需要了。
3. 安装Oracle所需的依赖包:
sudo apt-get install automake
sudo apt-get install autotools-dev
sudo apt-get install binutils
sudo apt-get install bzip2
sudo apt-get install elfutils
sudo apt-get install expat
sudo apt-get install gawk
sudo apt-get install gcc
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib
sudo apt-get install ia32-libs
sudo apt-get install ksh
sudo apt-get install less
sudo apt-get install lesstif2
sudo apt-get install lesstif2-dev
sudo apt-get install lib32z1
sudo apt-get install libaio1
sudo apt-get install libaio-dev
sudo apt-get install libc6-dev
sudo apt-get install libc6-dev-i386
sudo apt-get install libc6-i386
sudo apt-get install libelf-dev
sudo apt-get install libltdl-dev
sudo apt-get install libmotif4
sudo apt-get install libodbcinstq4-1 libodbcinstq4-1:i386
sudo apt-get install libpth-dev
sudo apt-get install libpthread-stubs0
sudo apt-get install libpthread-stubs0-dev
sudo apt-get install libstdc++5
sudo apt-get install lsb-cxx
sudo apt-get install make
sudo apt-get install openssh-server
sudo apt-get install pdksh
sudo apt-get install rlwrap
sudo apt-get install rpm
sudo apt-get install sysstat
sudo apt-get install unixodbc
sudo apt-get install unixodbc-dev
sudo apt-get install unzip
sudo apt-get install x11-utils
sudo apt-get install zlibc
很多都是Ubuntu自带的了,谨慎6起见都执行一遍吧。
4.创建用户(此步可省略,直接使用当前的用户即可,下面的安装过程都是以不执行这一步为准的)
sudo groupadd oinstall
sudo groupadd dba
sudo useradd -g oinstall -G dba -d /opt/oracle -s /bin/bash oracle
sudo passwd oracle
5.检查系统变量
/sbin/sysctl -a | grep sem
/sbin/sysctl -a | grep shm
/sbin/sysctl -a | grep file-max
/sbin/sysctl -a | grep aio-max
/sbin/sysctl -a | grep ip_local_port_range
/sbin/sysctl -a | grep rmem_default
/sbin/sysctl -a | grep rmem_max
/sbin/sysctl -a | grep wmem_default
/sbin/sysctl -a | grep wmem_max
然后根据上面命令中得到的参数值在/etc/sysctl.conf中增加对应数据,比如:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152kernel.shmmax = 536870912
kernel.shmmni = 4096kernel.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 = 1048586
运行一下命令更新内核参数:
sysctl –p
6.添加对oracle用户的内核限制在 /etc/security/limits.conf 文件中增加以下数据
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
其中oracle是在第四步中创建的用户,跳过第四步的话就写当前用户
7.查看/etc/pam.d/login,增加以下行(有了就不用增加了):
session required pam_limits.so
同样检查/etc/pam.d/su,没有以下行就自己加上:
session required pam_limits.so
7.创建需要的文件夹(用于安装oracle)并设置其所有权:
mkdir -p /opt/oracle
mkdir -p /opt/oraInventory
chown -R oracle:oinstall /opt/oracle
chown -R oracle:oinstall /opt/oraInventory
同样,如果跳过了第四步,那就将所有权设置命令中的用户oracle和组oinstall改为自己当前用户和组(通常二者是一样的),当然这时也可以不执行这两个chown命令,本来目录创建者就是所有者了。另外,需要root权限执行这些命令(sudo,下同)
8.如果Ubuntu上没安装JRE的话,需要安装JRE(我这里直接安装了JDK,以JDK为例):
到Oracle官网下载JDK6(最新为7,考虑到兼容性问题,安装6):
下载jdk-6u45-linux-i586.bin这个文件。放到主文件夹(home目录)下,进入终端:
$sudo chmod 777 jdk-6u37-linux-x64.bin // 将文件赋予运行权限
$sudo -s ./jdk-6u37-linux-x64.bin /usr/lib/jdk //将JDK安装到/usr/lib/jdk 目录下。
注意:最后安装完成后可能安装到了主文件夹下了,这是使用命令将其全部复制到/usr/lib/jdk目录下即可。(如果没有权限,就使用sudo chmod 777获取权限再复制)
配置JDK的环境变量,使用编辑器打开主文件夹下的.bashrc配置文件(隐藏),向其中加入如下内容:

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

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

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

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),

SublimeText3 Mac version
God-level code editing software (SublimeText3)

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor