Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
[root@oracle srv]#
[root@oracle srv]# fdisk /dev/sde
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-130, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
[root@oracle srv]#
2.3. 创建组和用户:
groupadd oinstall groupadd dba groupadd oper
useradd -g oinstall -G dba oracle passwd oracle
第 16 页 共 51 页
2.4. 配置ASM磁盘
? root下运行
/etc/init.d/oracleasm configure
[root@oracle srv]# /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
Default user to own the driver interface []: oracle Default group to own the driver interface []: dba 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@oracle srv]#
? 手动加载asmlib driver
/etc/init.d/oracleasm enable
? 创建ASM磁盘
/etc/init.d/oracleasm createdisk VOL1 /dev/sdb1 /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1 /etc/init.d/oracleasm createdisk VOL3 /dev/sdd1 /etc/init.d/oracleasm createdisk VOL4 /dev/sde1
/etc/init.d/oracleasm listdisks
第 17 页 共 51 页
2.5. 安装Oracle,不建数据库
? 创建安装oracle的目录并设置主属
mkdir -p /u01/app/oracle/product/10.2.0/db_1 mkdir -p /u02/oradata
chown -R oracle.oinstall /u01 /u02/oradata
? 设置oracle用户的环境变量
用oracle登录,把下列行加在.bash_profile文件末尾,注意把其中ORACLE_SID换成自己的实例名: # Oracle Settings TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME ORACLE_SID=xll; export ORACLE_SID ORACLE_TERM=xterm;
第 18 页 共 51 页
export ORACLE_TERM PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
#LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL
if [ $USER = \if [ $SHELL = %ulimit -p 16384 ulimit -n 65536 else
ulimit -u 16384 -n 65536 fi fi
? 配置内核参数
切换到root用户:
1、在/etc/sysctl.conf文件中加入下列行: kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096
kernel.sem = 250 32000 100 128 fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default=262144 net.core.rmem_max=262144 net.core.wmem_default=262144 net.core.wmem_max=262144 2、运行下面命令改变核心参数: /sbin/sysctl -p
3、在/etc/security/limits.conf文件中加入下列行:
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
4、在/etc/pam.d/login文件中加入下列行:
第 19 页 共 51 页
session required /lib/security/pam_limits.so
5、通过编辑/etc/selinux/config 文件禁用secure linux,确认其中的SELINUX标记如下:SELINUX=disabled。 也可以通过GUI工具(Applications > System Settings > Security Level),选择SELinux禁用该属性。 这个选项在安装系统的时候,如果一经设置就不需要修改。
? 修改host文件
在/etc/hosts文件中添加一个全限定域名,如: 127.0.0.1 localhost 192.168.16.127 oracle10g
? 上传安装包
用rz命令,或者用图形界面的SSH Secure Shell将数据库的安装包上传。
? 安装oracle软件,不安装数据库 3. 建ASM实例
3.1. 建目录结构
以oracle用户登录,运行以下命令:
mkdir -p $ORACLE_BASE/admin/+ASM/udump mkdir -p $ORACLE_BASE/admin/+ASM/bdump mkdir -p $ORACLE_BASE/admin/+ASM/cdump
3.2. 建初始文件
以oracle用户登录
cd $ORACLE_HOME/dbs
vi init+ASM.ora
*.asm_diskstring='ORCL:VOL*'
*.background_dump_dest='/u01/app/oracle/admin/+ASM/bdump' *.core_dump_dest='/u01/app/oracle/admin/+ASM/cdump' *.instance_type='asm' *.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/u01/app/oracle/admin/+ASM/udump'
第 20 页 共 51 页