OCA读书笔记(2) - 安装Oracle软件

时间:2022-02-08 17:52:41

Objectives:

•Describe your role as a database administrator (DBA) and explain typical tasks and tools

The approach for designing, implementing, and maintaining an Oracle database involves the following tasks:
1. Evaluating the database server hardware
2. Installing the Oracle software
3. Planning the database and security strategy
4. Creating, migrating, and opening the database
5. Backing up the database
6. Enrolling system users and planning for their Oracle Network access
7. Implementing the database design
8. Recovering from database failure
9. Monitoring database performance

Tools:
1.Oracle Universal Installer(OUI)
2.Database Configuration Assistant(DBCA)
3.Database Upgrade Assistant(DBUA)
4.Oracle Net Manager(netmgr)
5.Oracle Net Configuration Assistant(NetCA)
6.Oracle Enterprise Manager(EM)
7.Server Control Utility(srvctl)
8.SQL*Plus
9.Recovery Manager(RMAN)
10.Data Pump
11.SQL*Loader
12.Command-line tools:
emctl start | status | stop dbconsole
lsnrctl start | status | stop

•Plan an Oracle software installation
•Install Oracle Grid Infrastructure for a standalone server
•Install the Oracle database software

安装Linux

虚拟机配置:删除打印机,USB等
硬盘:40G
三个5G

分区:定制分区
/ 8000
/boot 512
/tmp 4096
/swap 4096
/u01 (所有其余的空间)

软件包选取:
Development--Development Tools/ gcc开头的
Services--FTP Server
Language--Chine Support

Firewall: Disabled
SELinux:Disabled
Do not create users

chkconfig --del sendmail

安装VMware工具
cd /media
ls
cd VMware Tools
ls
cp VMware+tab /mnt
cd /mnt
tar -zxvf VMware+tab
cd vm+tab
./vmware-install.pl

安装Grid
xhost +
su - grid
cd /u01/app/grid/grid
./runInstaller

DATA
External /dev/raw/raw1

cd /media/
cd RHEL_5.5\ x86_64\ DVD/
cd /Server

rpm -ivh *.* --nodeps(安装缺失的3个包,然后重新检测)

ctl+a
ctl+e分别到每一行的首部和尾部

su - grid
crs_stat -t

安装Oracle数据库
Installation Option: Install database software only

dbca配置数据库
dbca

Storage Type: File System
Sample Schemas

如果需要添加asm
su - grid
asmca

linux下cpio.gz文件的解压方法linux解压cpiocpio.gz
今天下载了 10201_database_linux_x86_64.cpio.gz 文件,解压方法如下:
1. gunzip 10201_database_linux_x86_64.cpio.gz
得到10201_database_linux_x86_64.cpio文件
2. cpio -idmv <10201_database_linux_x86_64.cpio
即可在当前目录下解压出来

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

第三步、配置Linux系统环境和oracle用户环境变量

对于Oracle软件在Linux 5系统下的安装,需要用户提前在Linux系统下做一些配置,从而满足安装Oracle软件的基本需求。

以下0、1、2、3、4步使用root用户,第5和6步使用分别使用grid用户和oracle用户

0.要配置/etc/hosts 添加ip地址、 主机,否则grid的netca配置的时候会报错。

[root@instuctor ~]# vi /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1      localhost.localdomain localhost

192.168.1.60    student

1.创建oracle用户和组

/usr/sbin/groupadd -g 501 oinstall

/usr/sbin/groupadd -g 502 dba

/usr/sbin/groupadd -g 503 oper

/usr/sbin/groupadd -g 504 asmadmin

/usr/sbin/groupadd -g 505 asmoper

/usr/sbin/groupadd -g 506 asmdba

/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle

/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid

passwd grid

passwd oracle

2.创建安装grid软件和oracle软件的目录,并授予相应的权限

mkdir -p /u01/app/oracle/product/11.2.0/db

mkdir -p /u01/app/grid/product/11.2.0/grid

chown -R oracle:oinstall /u01/app/

chown -R grid:oinstall /u01/app/grid

chmod -R 775 /u01/

3.配置系统文件和进程限制,配置内核参数

cat >> /etc/security/limits.conf <<EOF

#ORACLE SETTING

grid                 soft    nproc   2047

grid                 hard    nproc   16384

grid                 soft    nofile  1024

grid                 hard    nofile  65536

oracle               soft    nproc   2047

oracle               hard    nproc   16384

oracle               soft    nofile  1024

oracle               hard    nofile  65536

EOF

cat >>/etc/pam.d/login<<EOF

#ORACLE SETTING

session    required     pam_limits.so

EOF

cat >>/etc/sysctl.conf<<EOF

#ORACLE SETTING

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmmni = 4096

kernel.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

EOF

 

使配置的内核参数生效,使用sysctl -p命令

sysctl -p

4.关闭NTP服务和删除NTP配置文件

grid时间同步所需要的设置

Network Time Protocol Setting

/sbin/service ntpd stop

chkconfig ntpd off

rm /etc/ntp.conf

or, mv /etc/ntp.conf to /etc/ntp.conf.org.

5.用户grid的环境变量的设置

grid 用户配置文件 ORACLE_HOSTNAME请自行设置,这个配置使用grid用户

#su - grid

$vi .bash_profile

export LD_ASSUME_KERNEL=2.6.18

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_HOSTNAME=student

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid

export ORACLE_SID=+ASM

export ORACLE_TERM=xterm

export PATH=$PATH:$ORACLE_HOME/bin

umask 022

if [ $USER = "oracle" ] || [ $USER = "grid" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

使用source命令是环境变量生效

source  .bash_profile

6.用户oracle的环境变量的设置

oracle用户配置文件 ORACLE_HOSTNAME请自行设置,这个配置使用oacle用户

#su - oracle

$vi .bash_profile

# Oracle Settings oracle

export LD_ASSUME_KERNEL=2.6.18

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_HOSTNAME=student

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db

export ORACLE_SID=db01

export ORACLE_TERM=xterm

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

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

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

if [ $USER = "oracle" ] || [ $USER = "grid" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

使用source使环境变量立即生效

source  .bash_profile

第四步、安装和配置ASM

关闭虚拟机,添加硬盘sdb、sdc和sdd,大小都是3G,启动虚拟机,使用fdisk对添加的硬盘分区,使用wincp上传相应内核的asmlib软件到服务器,并安装

[root@stu1 asm]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n

Command action

e   extended

p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-391, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):

Using default value 391

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

[root@stu1 asm]# fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n

Command action

e   extended

p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-391, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):

Using default value 391

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

[root@stu1 asm]# fdisk /dev/sdd

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n

Command action

e   extended

p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-391, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-391, default 391):

Using default value 391

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

[root@stu1 asm]# ll

oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm

oracleasmlib-2.0.4-1.el5.x86_64.rpm

oracleasm-support-2.1.7-1.el5.x86_64.rpm

[root@stu1 asm]# rpm -Uvh *.rpm

warning: oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159

Preparing...                ################################## [100%]

1:oracleasm-support      ################################## [ 33%]

2:oracleasm-2.6.18-194.el################################## [ 67%]

3:oracleasmlib           ################################## [100%]

[root@stu1 asm]# /etc/init.d/oracleasm configure

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library

driver.  The following questions will determine whether the driver is

loaded on boot and what permissions it will have.  The current values

will be shown in brackets ('[]').  Hitting <ENTER> without typing an

answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid

Default group to own the driver interface []: asmadmin

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver: [  OK  ]

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@stu1 asm]#

[root@stu1 asm]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1

Marking disk "VOL1" as an ASM disk: [  OK  ]

[root@stu1 asm]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1

Marking disk "VOL2" as an ASM disk: [  OK  ]

[root@stu1 asm]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1

Marking disk "VOL3" as an ASM disk: [  OK  ]

[root@stu1 asm]# /etc/init.d/oracleasm scandisks

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@stu1 asm]# /etc/init.d/oracleasm listdisks

VOL1

VOL2

VOL3

第五步、安装grid软件

第六步、添加磁盘组fradata

第七部、安装oracle软件

第八步、使用dbca创建数据库库

OCA读书笔记(2) - 安装Oracle软件的更多相关文章

  1. OCA读书笔记&lpar;6&rpar; - 配置Oracle网络环境

    6.Configuring the Oracle Network Environment su - grid装grid时自动创建了监听netca--创建新的监听 vi $ORACLE_HOME/net ...

  2. OCA读书笔记&lpar;11&rpar; - 实现Oracle数据库审计

    11 Implementing Oracle Database Auditing 描述DBA对于安全和审计的职责使能标准的数据库审计安全审计选项查看审计信息维护审计路径 最小权限原则只在计算机上安装所 ...

  3. OCA读书笔记&lpar;1&rpar; - 浏览Oracle数据库架构

    Objectives: List the major architectural components of Oracle DatabaseExplain the memory structuresD ...

  4. Linux下搭建Oracle11g RAC&lpar;7&rpar;----安装Oracle 软件

    从此步骤开始,我们正式安装oracle软件: ① 以oracle用户登录图形界面,执行/home/oracle/database/runInstaller,进入OUI的图形安装界面: ② 进入OUI安 ...

  5. 使用NFS安装oracle软件

    昨天.使用openfiler创建nas存储系统,安装oracle软件,在所有正面最好,要创建一个数据库时报ora错,原来使用nfs安装oracle数据库,mount选项有特殊要求,如以下.以备查: R ...

  6. Linux下Oracle11G RAC报错:在安装oracle软件时报file not found一例

    Linux下Oracle11G RAC报错:在安装oracle软件时报file notfound一例 1.现象 之前安装一切都比較顺利,安装oracle软件时,进度到30%时报错:file not f ...

  7. Oracle 之 Cloning &dollar;oracle&lowbar;home &lpar;克隆安装oracle软件&rpar;

    用途:Cloning an Oracle Home , 可以免去多台机器重复安装oracle软件 1.停止相关进程[root@node1 bin]# ./crsctl stop cluster -al ...

  8. &lbrack;读书笔记&rsqb;Linux命令行与shell编程读书笔记04 安装软件&comma;编辑器注意事项

    1. debian以及redhat两种主流的linux发行版用的包管理工具 debian的包管理工具是 dpkg 再现安装的是 apt apt的工具主要有 apt-get apt-cache apti ...

  9. OCA读书笔记&lpar;3&rpar; - 使用DBCA创建Oracle数据库

    Objectives: •Create a database by using the Database Configuration Assistant (DBCA) •Generate databa ...

随机推荐

  1. iOS推送流程

    1. 在apple开发者帐号上创建一个BundleID,创建证书或者Xcode上都是用这个BundleID(例如com.mycompany.pushDemo) 2. 代码层面: 在capability ...

  2. Application&period;AddMessageFilter&lpar;this&rpar;&semi;

    开发环境:windows 8(x64), vs2013 只要“项目属性-调试”中选中“启用Visual Studio承载进程“,在VS2013中用F5调试,调用Application.AddMessa ...

  3. 20145120 《Java程序设计》第10周学习总结

    20145120 <Java程序设计>第10周学习总结 教材学习内容总结 转自:http://www.cnblogs.com/springcsc/archive/2009/12/03/16 ...

  4. Java &quot&semi;&equals;&equals;和equals区别&quot&semi;

    本文转载至中软国际电子政务部Jeff Chi总结,转载请说明出处. 概述:        A.==可用于基本类型和引用类型:当用于基本类型时候,是比较值是否相同:当用于引用类型的时候,是比较对象是否相 ...

  5. 为用户增加sudo权限&lpar;修改sudoers文件&rpar;

    在使用Linux系统过程中,通常情况下,我们都会使用普通用户进行日常操作,而root用户只有在权限分配及系统设置时才会使用,而root用户的密码也不可能公开.普通用户执行到系统程序时,需要临时提升权限 ...

  6. 2&period; MariaDB激活二进制日志

    翻译人员: 铁锚 翻译时间: 2013年12月25日 原文地址: Activating the Binary Log 参考了: <高可用MySQL 构建健壮的数据中心> 要启用二进制日志功 ...

  7. POJ 1321-棋盘问题【DFS&plus;递归】

    题目链接 题目大意: Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大 ...

  8. 编写一个程序解决选择问题。令k&equals;N&sol;2。

    import java.util.Arrays; /** * 选择问题,确定N个数中第K个最大值 * @author wulei * 将前k个数读进一个数组,冒泡排序(递减),再将剩下的元素逐个读入, ...

  9. codeforces 256 div2 C&period; Painting Fence 分治

    C. Painting Fence time limit per test 1 second memory limit per test 512 megabytes input standard in ...

  10. MySQL Group Replication 搭建&lbrack;Multi-Primary Mode&rsqb;

    1. 环境准备 CentOS7.3 percona-server-5.7.18-14 两台服务器ip地址和主机名 10.0.68.206 yhjr-osd-mysql01-uat 10.0.68.20 ...