CentOS上Oracle 11gR2创建数据库
1. tmpfs配置
tmpfs默认为内存的一半,如果CentOS上只装了Oracle做数据库服务器使用,想要设置Oracle AMM利用80%~90%的内存,必须将tmpfs的设置改大。
本例中使用
虚拟机为1024M内存,此处更改/etc/fstab设置文件,设置tmpfs大小为896M
www.2cto.com
[root@localhost ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Oct 2 00:56:54 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root / ext4 defaults 1 1
UUID=c82b7a71-352a-448d-ab80-4b38ecfc119d /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=896M 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
www.2cto.com
重新mount并查看更改后的结果
[root@localhost ~]# mount -o remount,size=896M /dev/shm
[root@localhost ~]# df -m
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
17552 10352 6310 63% /
tmpfs 896 1 896 1% /dev/shm
/dev/sda1 485 51 409 12% /boot
/dev/sr0 3542 3542 0 100% /media/CentOS_6.3_Final
注:发现即使更改了/etc/fstab文件的配置,重启后tmpfs仍回还原到内存的一半(网上查询为CentOS 6的Bug),所以我们要在/etc/rc.local文件中手动加入remount命令
www.2cto.com
[root@localhost ~]# vim /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
mount -o remount,size=896M /dev/shm
2. 配置Oracle监听器
www.2cto.com
[1] 以oracle用户登陆系统, startx启动图形界面
[2] 桌面上打开一个终端执行netca命令
[oracle@localhost ~]$ netca
出现以下窗口。“Next”
[3] 选择 “Next”
[4] 填写listener的名称,然后“Next”
[5] 默认TCP,然后“Next”
[7] 选择“No”,然后“Next”
3. 创建
数据库
[1] CentOS桌面上的终端窗口中执行以下命令
[oracle@localhost ~]$ netca
出现以下窗口,直接Next
[3] 选择“General Purpose or Transaction Processing”
[5] Enterprise Manager配置
[7] 存储类型,保持默认的文件
系统
[9] 是否建立示便表,这里选是
字符集设置:使用Unicode.
Default Language: 选择Simplified Chinese
Default Territory: 选择China
[12] 点击Finish
[13] 数据库创建完毕,点Exit退出