search
HomeDatabaseMysql Tutorial菜鸟在Linux系统中安装Oracle 11G

由于公司ERP系统的平台为RedHat Linux ES4+ORACLE10g,暂时交由我进行维护,所以想借此机会学习一下Linux,对自己的要求不高,就是能

由于公司ERP系统的平台为RedHat Linux ES4+Oracle10g,暂时交由我进行维护,所以想借此机会学习一下Linux,对自己的要求不高,就是能在Linux上安装成功Oracle,然后会备份和恢复数据库.首先就在当当网上买了一本的书,由清华出版社翻译的,经过一段时间的阅读,可以说对我的学习没有任何实质性的帮助,建议初学者不要买这本书.

我首先尝试的是在红帽Linux ES4安装Oracle10g,经过若干天的尝试,同时也下载了许多的资料一步一步的做,最后都是不成功,最主要的是在进入Oracle安装的时候,老是检查出来安装的一些RPM包版本不对,人搞得很烦燥,并且本人对Linux也是一菜鸟,因此在这之后的好长一段时间都没再去尝试了.

最后在Oracle.com.cn的论坛上看到了小布老师专门给菜鸟制作的视频讲座,才又开始新的学习.终于按照视频里的一步一步,安装成功了11g.其实我的文章就是根据视频里的步骤再复述了一遍,我的最大目的是温习一下安装的过程,让自己更熟练一些.,同时也给同级别的菜鸟一些学习的信心.

操作平台:VMWARE6.0+CentOS4.5.(可在下载).大家注意,Linux版本的不同会给菜鸟带来很多纳闷的困扰,我建议如果想按照这篇文章安装,就一定要下载这个Linux版本,它是免费的,不会像红帽一样涉及到版权的问题.可以说等于红帽的ES4版本.

数据库版本:Oracle11G R1(我是在emule上下载的)

辅助软件:SecureCRT Filezella AdobeAcrobatReader

硬件:内存 1GB 硬盘空间>18GB

我下载的是DVD版本的OS,在虚拟机软件中先将OS载入到了光驱中.

在Linux中,一定要注意大小写.特别是命令.

首先在虚拟机软件中安装CentOS,在安装时,

1 SWAP分区我设置了2048MB即内存的2倍,其它空间都装载到了"/"根目录,共计两个分区

2 配置好静态IP地址

3 选择"自定义安装",安装必需的软件包"GNOME图形界面" ,Developments Tools和Legacy Softeare Development, Editors.其它可以不必安装,节省资源.

安装完成OS后.

1 利用SecreCRT利用SSH登录至Linux,我大部分的操作都在这上面进行,因为VMWARE中OS切换很不方便 .并且 在实际环境中,管理中也都是通过SSH远程登录维护Linux,非常方便.

2 利有开源的FileZella FTP工具SSH连接至Linux,传入下载的Oracle文件,我下载的为.ZIP格式.

3 首先修改/etc/inittab文件,将其中的id:5:initdefault:中数字5改成3.就是将启动后进入图形界面改成进入字符界面,以节省资源.这个操作我以前一直想学习到,没想到在这里知道了,当时非常的开心.所以说,会安装Oracle后,一些常见的Linux命令操作也都学习到了. 改完后输入reboot重启一下OS

4 打开Oracle.ZIP中的b32002.pdf文档,从第2节开始就是讲的怎样安装Oracle.用来做参考,同时一些代码可以直接从PDF中COPY,非常方便.

5 检查PDF文档中要求的必需RPM包是否已安装 . 命令:rpm -qa | grep 包名称.

一般都是有6个包未安装,打开OS的映像文件,打开其中的RPMS目录,将6个包提取出来,再FTP到Linux目录下.同时,在其目录下输入rpm -ivh *.rpm安装所有包.OK

binutils-2.15.92.0.2-18

compat-libstdc++-33.2.3-47.3

elfutils-libelf-0.97-5

elfutils-libelf-devel-0.97-5

glibc-2.3.9.4-2.19

glibc-common-2.3.9.4-2.19

glibc-devel-2.3.9.4-2.19

gcc-3.4.5-2

gcc-c++-3.4.5-2

libaio-devel-0.3.105-2

libaio-0.3.105-2

libgcc-3.4.5

libstdc++-3.4.5-2

libstdc++-devel-3.4.5-2

make-3.80-5

sysstat-5.0.5

unixODBC-2.2.11

unixODBC-devel-2.2.11

6 创建Oracle组和用户,安装目录和权限

mkdir -p /u01/Oracle

groupadd dba

groupadd oinstall

useradd -g oinstall -G -d /u01/Oracle Oracle

passwd Oracle 设置密码

chown -R Oracle:oinstall /u01

ls -l 命令查看是否生效.

7 vi /etc/hosts

修改该文件,加入 你的LinuxIP地址 主机名称

主机名称可用hostname查看.

8 检查进程数fs-filemax值,应该是10260这个数值,除以512后为进程数值.具体作用不太明白,这是值是系统会给出的,我们也不要去改.命令为:cat /proc/sys/fs/file-max

9 修改/etc/sysctl.conf,加入以下内容:

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 262144

结束后,

/sbin/sysctl -p 执行一下.

10 修改/etc/security/limits.conf,加入内容

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

11 修改/etc/pam.d/login,加入内容

session required /lib/security/pam_limits.so

session required pam_limits.so

12 修改/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

12 使用Oracle用户登录,修改.bash_profie文件

su - Oracle

vi .bash_profile 加入以下内容

Oracle_BASE=/u01

Oracle_HOME=$Oracle_BASE/Oracle

Oracle_SID=wilson

PATH=$Oracle_HOME/bin:$PATH

export Oracle_BASE Oracle_HOME Oracle_SID PATH

完成

13 用root用户将FTP至Linux中的Oracle安装文件移动到

mv ****.zip /u01/Oracle/

unzip *.zip 命令进行解压.完成后,所以安装文件都会在u01/Oracle/database下.

使用

chown -R Oracle:oinstall database/

修改目录归属

14 使用Oracle用户登陆,输入startx ,进入图形界面,然后再进入安装目录输入

./runInstaller开始安装.

选择高级安装,进行自定义安装

在安装中,会出现一个关于oraInventory目录的警告 ,点击OK,不用理会继续即可,在随后的窗口中将/oraInventory修改为/u01/oraInventory.

随后参数都是默认,在安装中会弹出一个要求执行u01/oraInventory/oraInstRoot.sh和/u01/Oracle /root.sh的提示框,可在secureCRT中,以ROOT用户执行这两个文件 ,一定要注意大小写,其入进行End of installtion窗口,安装结束.

15 输入netca命令进行侦听配置.其中参数一律默认即可.可以用ps -ef 查看该服务是否已启用.

16 输入dbca命令,进行数据库的创建,下面我列出的是一些注意事项

选择gernel purpose,在SID和全局名称中,选择你在.bash_profile中创建的SID.

在Character Sets字符集选项中选择第2项AL32UTF8.

OK,完成.

17 进入u01/Oracle/oradata目录,查看一下会出现一些数据库文件 .

ps -ef查看会增加更多的Oracle相关服务

18 在图形界面中选择LogOut退出至字符界面

19 创建一个实例进行最后测试

注意:在数据库操作中都是用Oracle用户执行命令.

输入

[Oracle@computer ~]$ sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Dec 11 15:32:23 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

SQL> conn / as sysdba

Connected.

SQL> create table testbl ( id integer , name char(10));

Table created.

SQL> insert into testbl values ( 0 , 'wilson' );

1 row created.

SQL> commit;

Commit complete.

SQL> select * from testbl;

ID NAME

---------- ----------

0 wilson

SQL> shutdown immediate

Database closed.

Database dismounted.

Oracle instance shut down.

SQL> !ps -ef

exit

全部完成,推荐大家一定要看看小布教师的视频讲座.

[Oracle@computer ~]$ sqlplus

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Dec 11 15:00:41 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Enter user-name: sys as sysdba

Enter password:

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

linux

Statement
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
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

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.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

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.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

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: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

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: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

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: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

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.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

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.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

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

See all articles

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

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

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

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool