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读书笔记(6) - 配置Oracle网络环境

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

  2. OCA读书笔记(11) - 实现Oracle数据库审计

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

  3. OCA读书笔记(1) - 浏览Oracle数据库架构

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

  4. Linux下搭建Oracle11g RAC(7)----安装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 $oracle_home (克隆安装oracle软件)

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

  8. [读书笔记]Linux命令行与shell编程读书笔记04 安装软件,编辑器注意事项

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

  9. OCA读书笔记(3) - 使用DBCA创建Oracle数据库

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

随机推荐

  1. sed学习笔记整理

    1.sed简介 sed (Stream Editor)是一种在线编辑器,它一次处理一行内容.处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处 ...

  2. vim 小技巧总结

    1.v+移动光标可以选中文本. 2.y可以复制已经选中的文本 3.p可以粘贴 复制一行则:yy 复制当前光标所在的位置到行尾:y$ 复制当前光标所在的位置到行首:y^ 复制三行则:3yy,即从当前光标 ...

  3. JS给元素增加className

    function(element,value) //给元素添加className { if(!element.className) { element.className=value; } else{ ...

  4. linux chmod权限

    Linux chmod 命令 chmod用于改变文件或目录的访问权限.用户用它控制文件或目录的访问权限.该命令有两种用法.一种是包含 字母和操作符表达式的文字设定法:另一种是包含数字的数字设定法. 1 ...

  5. phpmailer发送邮件,可以带附件

    先从网上下载phpmailer压缩包 将解压的文件导入到你的项目中 实例 require_once ('PHPMailer/class.phpmailer.php'); //引入phpmailer文件 ...

  6. 测试DOM0级事件和DOM2级事件的堆叠

    1. 问题 如果大家看过北风网CJ讲师的Javascript视频教程,就可以看到其封装了一个很强的事件添加和删除函数,如下所示 function addEvent(obj, evtype, fn) { ...

  7. SDK Hello world(直接使用SDK封装)

    前言 将代码拆分了一下, 如果处理更多的消息也不怕看的眼花 SDK编程就是对各种Windows消息的处理 实验工程 /// @file exam_1.cpp /// @brief 查阅本地MSDN,  ...

  8. 在大型项目上,Python 是个烂语言吗

    Robert Love, Google Software Engineer and Manager on Web Search. Upvoted by Kah Seng Tay, I was the ...

  9. AT&T汇编

    AT&T汇编和8086汇编语言虽然两者很相似,但是还是不能根据8086的语法规则来读AT&T汇编的吧,所以还是要看看AT&T汇编的语法规则,因为在读内核代码时,跟硬件打交道的部 ...

  10. JEECG社区 一个微信教育站点案例源代码分享

    微信教育站点案例演示: http://t.cn/RvPgLcb 源代码分享: http://pan.baidu.com/s/1cUImy 截图演示: watermark/2/text/aHR0cDov ...