《[计算机软件及应用]VMWare实现Solaris SUN Cluster 323oracle10g 安装配置5集群下Oracle10G安装.doc》由会员分享,可在线阅读,更多相关《[计算机软件及应用]VMWare实现Solaris SUN Cluster 323oracle10g 安装配置5集群下Oracle10G安装.doc(46页珍藏版)》请在三一办公上搜索。
1、VMWare Server 2.0.2 实现 SUN Cluster 3.2.3 安装配置 篇五、Oracle数据库软件安装篇 撰写人郭晖联系邮箱kelantas现在安装 oracle for solaris x86 64bit。要点,在两台机器上安装 oracle 软件,注意只安装软件,不创建数据库,其实也可以只在一台机器上安装oracle 软件,安装配置好后,复制到另外一台机器上,不过注意,要把 /var/opt/oracle/oratab 这个文件也拷贝过去。rootguosol10a1#cat /var/opt/oracle/oratab# This file is used by O
2、RACLE utilities. It is created by root.sh# and updated by the Database Configuration Assistant when creating# a database.# A colon, :, is used as the field terminator. A new line terminates# the entry. Lines beginning with a pound sign, #, are comments.# Entries are of the form:# $ORACLE_SID:$ORACLE
3、_HOME:# The first and second fields are the system identifier and home# directory of the database respectively. The third filed indicates# to the dbstart utility that the database should , Y, or should not,# N, be brought up at system boot time.# Multiple entries with the same $ORACLE_SID are not al
4、lowed.#orcl:/u01/app/oracle/product/10.2.0/db_1:N因为 solaris 10 是选的完全安装,所以不用检查包依赖了,直接装就是。在两台机器上创建oracle 用户和组guosol10aX# groupadd oinstallguosol10aX# groupadd dba在两台机器上创建文件目录guosol10aX# mkdir -p /u01/app/oracle/product/10.2.0guosol10aX# mkdir -p /oradata/10gR2guosol10aX# chmod -R 775 /u01guosol10aX# c
5、hmod -R 775 /oradata在两台机器上创建oracle用户guosol10aX# useradd -g dba -G oinstall -d /u01/app/oracle/product/10.2.0 oracleguosol10aX# passwd -r files oracleNew Password: Re-enter new Password: passwd: password successfully changed for oracle在两台机器上修改文件目录属性guosol10aX# chown -R oracle:dba /u01guosol10aX# chow
6、n -R oracle:dba /oradata修改两台机器上的 /home/oracle/ 下的.profile 文件,我这里用的是bash是oracle的默认shell。oracleguosol10aX#cat .profile# Copyright (c) 2001 by Sun Microsystems, Inc.# All rights reserved.# ident (#)local.profile 1.10 01/06/23 SMIstty istripORACLE_BASE=/u01/app/oracleexport ORACLE_BASEORACLE_HOME=$ORACL
7、E_BASE/product/10.2.0/db_1export ORACLE_HOMEORACLE_PATH=$ORACLE_BASE/dba_scripts/common/sql:.:$ORACLE_HOME/rdbms/adminexport ORACLE_PATHORACLE_SID=orclexport ORACLE_SIDNLS_DATE_FORMAT=YYYY-MON-DD HH24:MI:SSexport NLS_DATE_FORMATPATH=/usr/bin:/usr/ucb:/etc:.:$ORACLE_HOME/binexport PATHDISPLAY=127.0.0
8、.1:0.0export DISPLAY修改两台机器上的 /etc/system 文件和oracle安装相关的内核参数。rootguosol10aX#cat /etc/system*ident (#)system 1.18 97/06/27 SMI /* SVR4 1.5 */* SYSTEM SPECIFICATION FILE* moddir:* Set the search path for modules. This has a format similar to the* csh path variable. If the module isnt found in the first
9、 directory* it tries the second and so on. The default is /kernel /usr/kernel* Example:* moddir: /kernel /usr/kernel /other/modulesset noexec_user_stack=1set semsys:seminfo_semmni=300set semsys:seminfo_semmns=1050set semsys:seminfo_semmsl=400set semsys:seminfo_semvmx=32767set shmsys:shminfo_shmmax=4
10、294967295 set shmsys:shminfo_shmmin=1set shmsys:shminfo_shmmni=300set shmsys:shminfo_shmseg=30* root device and root filesystem configuration:* The following may be used to override the defaults provided by* the boot program:* rootfs: Set the filesystem type of the root.* rootdev: Set the root devic
11、e. This should be a fully* expanded physical pathname. The default is the* physical pathname of the device where the boot* program resides. The physical pathname is* highly platform and configuration dependent.* Example:* rootfs:ufs* rootdev:/sbus1,f8000000/esp0,800000/sd3,0:a* (Swap device configur
12、ation should be specified in /etc/vfstab.)* exclude:* Modules appearing in the moddir path which are NOT to be loaded,* even if referenced. Note that exclude accepts either a module name,* or a filename which includes the directory.* Examples:* exclude: win* exclude: sys/shmsys* forceload:* Cause th
13、ese modules to be loaded at boot time, (just before mounting* the root filesystem) rather than at first reference. Note that* forceload expects a filename which includes the directory. Also* note that loading a module does not necessarily imply that it will* be installed.* Example:* forceload: drv/f
14、oo* set:* Set an integer variable in the kernel or a module to a new value.* This facility should be used with caution. See system(4).* Examples:* To set variables in unix:* set nautopush=32* set maxusers=40* To set a variable named debug in the module named test_module* set test_module:debug = 0x13
15、* Start of lines added by SUNWscrset rpcmod:svc_default_stksize=0x6000set ge:ge_intr_mode=0x833* Disable task queues and send all packets up to Layer 3* in interrupt context.* Uncomment the appropriate line below to use the corresponding * network interface as a Sun Cluster private interconnect. Thi
16、s * change will affect all corresponding network-interface instances. * For more information about performance tuning, see * * set ipge:ipge_taskq_disable=1* set ixge:ixge_taskq_disable=1* set ce:ce_taskq_disable=1* End of lines added by SUNWscr* Begin MDD root info (do not edit)rootdev:/pseudo/md0:
17、0,0,blk* End MDD root info (do not edit)rootguosol10aX#重启两台solaris10的系统,如果是已经启动到cluster模式下,就用 scshutdown -g 0 -y 来停机启动。现在来安装 oracle 软件,只在一台机器上做 guosol10a1.注意,这里选 advanced installation. 不要系统自动创建数据库。先在 gusol10a1 上安装好数据库软件。 下面是在共享文件系统上创建数据库。先把 oraset 的主导权切换到 gusol10a1 上来。rootguosol10a2#cldevicegroup sw
18、itch -n guosol10a1 oraset在 guosol10a1 上挂载文件系统rootguosol10a1#mount /dev/md/oraset/dsk/d0 /oradata/10gR2我们将在guosol10a1 上创建数据库,把数据文件,日志文件,控制文件等都放到共享文件目录 /oradata/10gR2 上面。在 guosol10a1 上oracle 用户使用 dbca 来创建数据库。把所有数据库使用的日志,控制,归档,闪回文件目录都放到 /oradata/10gR2 下面检查文件目录参数把 oracle_base 的目录都改到 /oradata/10gR2 下面配置过
19、程我就不展示了,直接看配置文件guosol10a1 主机上oracleguosol10a1#cat /etc/hosts# Internet host table#127.0.0.1 localhost 192.168.1.31 guosol10a1 loghost192.168.1.32 guosol10a2192.168.1.30 guooraserver这个 guooraserver 的 30 IP 是对外的集群服务IP。oracleguosol10a1#cat listener.ora # listener.ora Network Configuration File: /u01/ap
20、p/oracle/product/10.2.0/db_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = ORCL) (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1) (SID_NAME = ORCL) ) )LOG_DIRECTORY_LISTENER = /oradata/10gR2/network/logLOG_FILE_LIS
21、TENER = LISTENER.logLISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = guosol10a1)(PORT = 1521) (ADDRESS = (PROTOCOL = TCP)(HOST = guooraserver)(PORT = 1521) )oracleguosol10a1#cat tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsna
22、mes.ora# Generated by Oracle configuration tools.TNSNAMES.ORA = (DESCRIPTION = (ADDRESS_LIST = # (ADDRESS = (PROTOCOL = TCP)(HOST = guosol10a1)(PORT = 1521) (ADDRESS = (PROTOCOL = TCP)(HOST = guooraserver)(PORT = 1521) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) )TNSNAMES.ORA1 = (
23、DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = guosol10a1)(PORT = 1521) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) )oracleguosol10a1#cat /var/opt/oracle/oratab#orcl:/u01/app/oracle/product/10.2.0/db_1:N(ADDRESS = (PROTOCOL = TCP)(HOST = guooraserver)(PORT = 1521
24、) 注意监听 要监听这个公共服务IP 的 1521 端口。自己用sqlplus 连接 TNSNAMES.ORA1 测试一下是否能连通。现在 给 guosol10a2 安装数据软件。其实不用安装,把 guosol10a1 下的 /u01 目录 tar 了。然后压缩一把, ftp 到 guosol10a2 的 / 目录下,解开 tar,文件,然后把 那两个脚本 运行一下。orainstRoot.sh,root.sh 运行一下,然后把 guosol10a1 的 /var/opt/oracle/oratab 文件也放到 guosol10a2 对应的位置上。 guosol10a2 的数据库文件就安装好了
25、。guosol10a2 的对应配置文件也要做更改oracleguosol10a2#cat /etc/hosts# Internet host table#127.0.0.1 localhost192.168.1.32 guosol10a2 loghost192.168.1.31 guosol10a1192.168.1.30 guooraserveroracleguosol10a2#oracleguosol10a2#cat listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/d
26、b_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = ORCL) (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1) (SID_NAME = ORCL) ) )LOG_DIRECTORY_LISTENER = /oradata/10gR2/network/logLOG_FILE_LISTENER = LISTENER.logLISTE
27、NER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = guosol10a2)(PORT = 1521) (ADDRESS = (PROTOCOL = TCP)(HOST = guooraserver)(PORT = 1521) )oracleguosol10a2#vi tnsnames.oratnsnames.ora 15 lines, 426 characters (ADDRESS = (PROTOCOL = TCP)(HOST = guooraserver)(PORT = 1521)# (ADDRESS = (PROTOCOL =
28、TCP)(HOST = guosol10a2)(PORT = 1521)# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.TNSNAMES.ORA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = guooraserver)(PORT = 1521) ) (CONNEC
29、T_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) )TNSNAMES.ORA2 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = guosol10a2)(PORT = 1521) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL) ) )oracleguosol10a2#cat /var/opt/oracle/oratab orcl:/u01/app/oracle/product/10.2.0/db_1:N手工测试数据库切换的方法。1、guosol10a1 停oracle 数据库。2、guosol10a1 上卸载 /oradata/10gR2 文件目录。3、切换 oraset 的主导权给 guosol10a2.4、在 guosol10a2 上挂载 /oradata/10gR2 文件目录。5、在 guosol10a2 上启动oracle数据库。oracle 数据库软件的安装和数据库的建立完毕。