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
How do you create and manage user accounts in MySQL?How do you create and manage user accounts in MySQL?Apr 22, 2025 pm 06:05 PM

The steps to create and manage user accounts in MySQL are as follows: 1. Create a user: Use CREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password'; 2. Assign permissions: Use GRANTSELECT, INSERT, UPDATEONmydatabase.TO'newuser'@'localhost'; 3. Fix permission error: Use REVOKEALLPRIVILEGESONmydatabase.FROM'newuser'@'localhost'; then reassign permissions; 4. Optimization permissions: Use SHOWGRA

How does MySQL differ from Oracle?How does MySQL differ from Oracle?Apr 22, 2025 pm 05:57 PM

MySQL is suitable for rapid development and small and medium-sized applications, while Oracle is suitable for large enterprises and high availability needs. 1) MySQL is open source and easy to use, suitable for web applications and small and medium-sized enterprises. 2) Oracle is powerful and suitable for large enterprises and government agencies. 3) MySQL supports a variety of storage engines, and Oracle provides rich enterprise-level functions.

What are the disadvantages of using MySQL compared to other relational databases?What are the disadvantages of using MySQL compared to other relational databases?Apr 22, 2025 pm 05:49 PM

The disadvantages of MySQL compared to other relational databases include: 1. Performance issues: You may encounter bottlenecks when processing large-scale data, and PostgreSQL performs better in complex queries and big data processing. 2. Scalability: The horizontal scaling ability is not as good as Google Spanner and Amazon Aurora. 3. Functional limitations: Not as good as PostgreSQL and Oracle in advanced functions, some functions require more custom code and maintenance.

How do you perform a JOIN operation in MySQL?How do you perform a JOIN operation in MySQL?Apr 22, 2025 pm 05:41 PM

MySQL supports four JOIN types: INNERJOIN, LEFTJOIN, RIGHTJOIN and FULLOUTERJOIN. 1.INNERJOIN is used to match rows in two tables and return results that meet the criteria. 2.LEFTJOIN returns all rows in the left table, even if the right table does not match. 3. RIGHTJOIN is opposite to LEFTJOIN and returns all rows in the right table. 4.FULLOUTERJOIN returns all rows in the two tables that meet or do not meet the conditions.

How does MySQL's performance compare to other RDBMS under high load?How does MySQL's performance compare to other RDBMS under high load?Apr 22, 2025 pm 05:37 PM

MySQL's performance under high load has its advantages and disadvantages compared with other RDBMSs. 1) MySQL performs well under high loads through the InnoDB engine and optimization strategies such as indexing, query cache and partition tables. 2) PostgreSQL provides efficient concurrent read and write through the MVCC mechanism, while Oracle and Microsoft SQLServer improve performance through their respective optimization strategies. With reasonable configuration and optimization, MySQL can perform well in high load environments.

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.

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

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

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

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

MinGW - Minimalist GNU for Windows

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.