admin 管理员组

文章数量: 1087139


2023年12月23日发(作者:自己搭建棋牌源码)

1、oracle linux 6.5.0安装及套件选择

1

2

3

用户名root,密码martin

4

使用Basic Server进行安装,并需添加以下套件

5

(1)Base System

Base System需安装8个套件

Base System > Base

Base System > Client management tools

Base System > Compatibility libraries

Base System > Hardware monitoring utilities

Base System > Large Systems Performance

Base System > Network file system client

Base System > Performance Tools

Base System > Perl Support

Oracle Linux 6.5.0上

Base System中默认已勾选套件:Base、Hardware monitoring utilities、Large Systems

Performance、Network file system client、Performance Tools、Perl Support;

Base System中默认无Client management tools套件;

Base System中需手动勾选Compatibility libraries套件。

6

(2)Servers

Servers需安装2个套件

Servers > Server Platform

Servers > System administration tools

Oracle Linux 6.5.0上

Servers中默认已勾选套件:Server Platform;

Servers中需手动勾选System administration tools套件。

7

(3)Desktops

Desktops需安装7个套件

Desktops > Desktop

Desktops > Desktop Platform

Desktops > Fonts

Desktops > General Purpose Desktop

Desktops > Graphical Administration Tools

Desktops > Input Methods

Desktops > X Window System

Oracle Linux 6.5.0上

Desktops中默认没有已勾选套件;

Desktops中需手动勾选Desktop、Desktop Platform、Fonts、General Purpose Desktop、Graphical

Administration Tools、Input Methods、X Window System套件。

8

(4)Development

Development需安装2个套件

Development > Additional Development

Development > Development Tools

Oracle Linux 6.5.0上

Development中默认没有已勾选套件;

Development中需手动勾选Additional Development、Development Tools套件;

9

(5)Applications

Applications需安装1个套件

Applications > Internet Browser

Oracle Linux 6.5.0上

Applications中默认没有已勾选套件;

Applications中需手动勾选Internet Browser套件;

10

套件选择完毕,英文版共1317个Packages,next开始安装。中文版是1321个Packages

建议使用英文版

11

安装完成,重启

12

13

14

15

2、oracle linux 6.5.0安装后的配置

登录用户名

root

lbj

(1)网络配置

停止NetworkManager服务,并设为不自动启动

密码

martin

lbj

修改eth0和eth1的配置文件

vi /etc/sysconfig/network-scripts/ifcfg-eth0

默认为:

修改为:

ONBOOT改为yes,BOOTPROTO改为none,并添加IPADDR、NETMASK、GATEWAY、DNS1/2

vi /etc/sysconfig/network-scripts/ifcfg-eth1

默认为:

修改为:

16

ONBOOT改为yes,BOOTPROTO改为none,并添加IPADDR、NETMASK

使network服务自动启动:chkconfig network on

重启network服务:service network restart

网络测试

配置完毕。经过以上配置,已可使用ssh登录。

若SSH服务未启动:

service sshd restart

chkconfig sshd on

修改eth0和eth1的配置文件也可通过setup命令进行。

17

(2)主机名、DNS配置

确认主机名配置:VM

在/etc/hosts中将主机名对应配置进去:

格式:

192.168.1.69 VM OracleDB

(3)安全配置

关闭防火墙:

[root@DB ~]# service iptables stop

iptables: Setting chains to policy ACCEPT: filter [ OK ]

iptables: Flushing firewall rules: [ OK ]

iptables: Unloading modules: [ OK ]

[root@DB ~]# chkconfig iptables off

[root@DB ~]#

18

将SELinux设为Permissive模式

(1)permissive对于违反规则的操作只会予以记录而并不会拒绝操作)

(2)enforcing违反Policy的规则(Rules)都会被SELinux拒绝

(3)disable完全禁用SELinux

3、修改主要配置文件

(1)/etc/

[root@DB ~]# vim /etc/

增加如下参数(oracle建议):

_dumpable = 1

-max-nr = 1048576

-max = 6815744

= 2097152

= 536870912

= 4096

= 250 32000 100 128

_local_port_range = 9000 65500

_default = 262144

_max = 4194304

_default = 262144

_max = 1048586

其中中已有,需注释掉:

= 68719476736

= 4294967296

19

执行sysctl -p让配置生效

[root@DB ~]# sysctl -p

(2)/etc/security/

增加如下参数:

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft nproc 16384

oracle hard nproc 16384

oracle soft stack 10240

4、从Oracle Linux 6.5 光盘安装以下软件包

# From Oracle Linux 6 DVD

[root@OracleDB ~]# cd /media/OL6.5 x86_64 Disc 1 20131125/Server/Packages/

rpm -Uvh binutils-2*x86_64*

rpm -Uvh glibc-2*x86_64* nss-softokn-freebl-3*x86_64*

rpm -Uvh glibc-2*i686* nss-softokn-freebl-3*i686*

rpm -Uvh compat-libstdc++-33*x86_64*

rpm -Uvh glibc-common-2*x86_64*

rpm -Uvh glibc-devel-2*x86_64*

rpm -Uvh glibc-devel-2*i686*

rpm -Uvh glibc-headers-2*x86_64*

rpm -Uvh elfutils-libelf-0*x86_64*

20

rpm -Uvh elfutils-libelf-devel-0*x86_64*

rpm -Uvh gcc-4*x86_64*

rpm -Uvh gcc-c++-4*x86_64*

rpm -Uvh ksh-*x86_64*

rpm -Uvh libaio-0*x86_64*

rpm -Uvh libaio-devel-0*x86_64*

rpm -Uvh libaio-0*i686*

rpm -Uvh libaio-devel-0*i686*

rpm -Uvh libgcc-4*x86_64*

rpm -Uvh libgcc-4*i686*

rpm -Uvh libstdc++-4*x86_64*

rpm -Uvh libstdc++-4*i686*

rpm -Uvh libstdc++-devel-4*x86_64*

rpm -Uvh make-3.81*x86_64*

rpm -Uvh numactl-devel-2*x86_64*

rpm -Uvh sysstat-9*x86_64*

rpm -Uvh compat-libstdc++-33*i686*

rpm -Uvh compat-libcap*

经测试,只需安装以下包,其他已安装:

rpm -Uvh glibc-devel-2*i686*

rpm -Uvh ksh-*x86_64*

rpm -Uvh libaio-devel-0*x86_64*

rpm -Uvh libaio-0*i686*

rpm -Uvh libaio-devel-0*i686*

rpm -Uvh libstdc++-4*i686*

rpm -Uvh numactl-devel-2*x86_64*

rpm -Uvh compat-libstdc++-33*i686*

5、添加oracle的用户和群组

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 -G dba,asmdba,oper oracle

passwd oracle

oracle用户的密码也是oracle

21

按官方文档需执行本步骤,但我本步未执行

Amend the "/etc/security/limits.d/" file as described below.

# Change this

* soft nproc 1024

# To this

* - nproc 16384

6、路径、权限与环境变量配置

(1)路径与权限

mkdir -p /opt/oracle/product/11.2.0/db_1

mkdir -p /opt/oracle/oradata

mkdir -p /opt/oraInventory

chown -R ll /opt

chmod -R 775 /opt

(2)环境变量

[oracle@DB root]$ vim /home/oracle/.bash_profile

# .bash_profile

22

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_HOSTNAME=VM

export ORACLE_UNQNAME=DB

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

export ORACLE_SID=orcl

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$CLASSPATH

7、安装FTP并上传zip文件

ftp用于上传oracle的安装文件

[root@DB ~]# yum install vsftpd

23

Vsftpd默认为不随系统自动启动

[root@DB ~]# chkconfig --list | grep vsftpd

上传文件前,再启动vsftpd

[root@DB ~]# service vsftpd start

使用oracle用户登录FTP,上传以下zip文件到/home/oracle

linux.x64_11gR2_database_

linux.x64_11gR2_database_

用oracle用户登录linux系统,解压zip

unzip linux.x64_11gR2_database_

unzip linux.x64_11gR2_database_

获得/home/oracle/database目录

若建立oracle用户后未重启过,可能出现FTP无法登陆oracle用户的情况。重启即可

24

8、界面安装

以界面方式登录linux系统进行最后一个步骤的安装。

为确保各项参数正确,请先source /home/oracle/.bash_profile

[oracle@OracleDB database]$ ./runInstaller

25

26

Administrator密码为:oracle

27

28

安装缺少的套件:

[root@DB ~]# yum install libaio glibc compat-libstdc++-33 elfutils-libelf-devel libaio-devel libgcc

libstdc++ unixODBC unixODBC-devel ksh

29

如安装不了,kill -9 进程ID号

经测试,仅缺unixODBC-2.*、unixODBC-devel-2.*,并需升级6_5.4.x86_64。

30

安装开始

31

32

修改sys,system的密码:均为oracle

33

使用root用户执行以上2个脚本。

34

安装完成后,Oracle Enterprise Manager(ip:1158/em)就可以打开,数据库已可以使用。重启服务器后,需手动启动Oracle Enterprise Manager服务:emctl start dbconsole,ip:1158/em才可以打开。

9、启动和关闭oracle数据库步骤

(1)启动

[oracle@DB ~]$ lsnrctl start

[oracle@DB ~]$ sqlplus /nolog

SQL> connect /as sysdba

SQL> startup

SQL> quit

[oracle@DB ~]$

35

(2)关闭

[oracle@DB ~]$ sqlplus /nolog

SQL> shutdown immediate

SQL> quit

[oracle@DB ~]$

36

10、安装时选择install database software only

(1)没有数据库,新建一个数据库

安装时若选择install database software only,则需要在安装完成后建立监听和建立数据库。

建立监听

[oracle@DB ~]$ export LANG=en_us 安装中文版操作系统才需执行

[oracle@DB ~]$ netca

启动监听

[oracle@DB ~]$ lsnrctl start

建立数据库

[oracle@DB ~]$ export LANG=en_us 安装中文版操作系统才需执行

[oracle@DB ~]$ dbca

选项1:一般用途或事务处理;选项2:定制数据库;选项3:数据仓库

37

38

39

40

41

42

43

44

45

(2)已有一个数据库,再新建一个数据库

在原有数据库基础上建立了第二个数据库,重启服务器后,在启动默认数据库的基础上(oracle用户的.bash_profile文件中定义的ORACLE_SID),重新export ORACLE_SID=第二数据库的sid,重复sqlplus /nolog、connect /as sysdba、startup,方可使用新建的数据库。

数据库关闭操作亦如此。

首先启动监听

在启动默认数据库和第二个数据库

46

Last login: Wed Mar 19 14:23:40 2014 from 192.168.16.9

*****************************启动监听******************************************

必须先启动监听,否则默认数据库会连接不上

[oracle@db ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 19-MAR-2014 14:54:27

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Starting /opt/oracle/product/11.2.0/db_1/bin/tnslsnr:

TNSLSNR for Linux: Version 11.2.0.1.0 - Production

System parameter file is /opt/oracle/product/11.2.0/db_1/network/admin/

Log messages written to /opt/oracle/diag/tnslsnr/db/listener/alert/

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux)(PORT=1521)))

47

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date 19-MAR-2014 14:54:29

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /opt/oracle/product/11.2.0/db_1/network/admin/

Listener Log File /opt/oracle/diag/tnslsnr/db/listener/alert/

Listening

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux)(PORT=1521)))

The listener supports no services

The command completed successfully

*****************************启动第一个数据库**********************************

[oracle@db ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 19 14:39:25 2014

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

SQL> connect /as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 6747725824 bytes

Fixed Size 2213976 bytes

Variable Size 3690989480 bytes

Database Buffers 3019898880 bytes

Redo Buffers 34623488 bytes

Database mounted.

Database opened.

SQL> quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

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

[oracle@db ~]$

*****************************启动第二个数据库**********************************

[oracle@db ~]$ export ORACLE_SID=newdb

[oracle@db ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 19 14:40:08 2014

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

48

SQL> connect /as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 534462464 bytes

Fixed Size 2215064 bytes

Variable Size 176161640 bytes

Database Buffers 348127232 bytes

Redo Buffers 7958528 bytes

Database mounted.

Database opened.

SQL> quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

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

[oracle@db ~]$

49


本文标签: 数据库 安装 套件 启动 配置