快捷搜索:   nginx

Oracle 在Tru64unix的安装步骤

Oracle 在Tru64unix的安装步骤
一、配置unix 系统配置文件(sysconfigtab)

Parameter Recommended Value Description
SHMMAX2139095040 (2 GB - 8 MB)The maximum size (in bytes) of a single shared memory segment.
SHMMIN1The minimum size (in bytes) of a single shared memory segment.
SHMMNI100        The number of shared memoryIdentifiers.
SHMSEG32       The maximum number of sharedmemory segments that can be attached  by a process.
查询系统现有的参数设置:
#/sbin/sysconfig -q ipc
如果系统原有参数大于推荐的参数,则保留原有参数,否则设置如下:
vi /etc/sysconfigtab
ipc: shm-max = 2139095040 (2GB - 8MB)
shm-mni = 128
shm-seg = 32
重建核心,重启系统。
二、创建相关组和用户
 创建两个组dba和oinstall及用户oracle
其中oracle的主组为oinstall,次组为dba
adduser
addgroup
三、修改环境变量


Environment Variable Summary

DISPLAYThe the name, server number, and screen number of thesystem where the Oracle Universal Installer will display.
ORACLE_BASEDirectory at the top of the Oracle software andadministrative file structure.
ORACLE_HOMEDirectory containing Oracle software for a given release.
NLS_LANGCharacter set to use when installing. No
ORA_NLS33Location of National Language Support character set data.
ORACLE_SIDThe Oracle server instance identifier to use during installation.
ORACLE_DOCDirectory where documentation will be installed.

$ DISPLAY= workstation_name:0.0
$ export DISPLAY
$ xhost + server_name
修改.profile如下:
umask 022
PATH= $ORACLE_HOME/bin, /usr/bin, /etc, /usr/ccs/bin, /usr/bin/X11
(the local bin directory, /usr/local/bin, if it exists
If you require /usr/ucb in your search path, make sure it
comes after /usr/ccs/bin in the PATH setting)
ORACLE_BASE
ORACLE_BASE specifies the directory at the top of the Oracle software and
administrative file structure. The OFA-recommended value is
software_mount_point/app/oracle. For example: /u01/app/oracle.
ORACLE_HOME
ORACLE_HOME specifies the directory containing the Oracle software for a given
release. The Optimal Flexible Architecture recommended value is:
$ORACLE_BASE/product/ release.
For example:
/u01/app/oracle/product/8.1.6.

Automating Database Startup and Shutdown
This process must be completed for every new database that you want to configure
for automated startup and shutdown. Perform the following tasks to set up the
dbstart and dbshut scripts so that they are called at system startup:
1. Log in as root.
2. Edit the /etc/oratab file.
Database entries in the /etc/oratab file appear in the following format:
ORACLE_SID:ORACLE_HOME:{Y|N}
where Y or N specifies whether you want the dbstart and dbshut scripts to
start up and shut down the database.
3. Find the entries for all the databases that you want to start up. They are
identified by the sid in the first field. Change the last field for each to Y.
4. Change directories to /sbin/init.d.
5. Create a file named oracle and chmod to 750.
6. Add the following contents to the /sbin/init.d/oracle file:
#!/bin/sh
#
# change the value of ORACLE_HOME to be correct for your
# installation
Note: This script assumes that a password is not set for the
listener. If a password is set, the listener will not be stopped.
ORACLE_HOME and ORACLE are examples only. Use
information as appropriate to your installation.
ORACLE_HOME=/opt/oracle/product/8.1.6
PATH=${PATH}:$ORACLE_HOME/bin
HOST=‘hostname‘
#
# change the value of ORACLE to the login name of the
# oracle owner at your site
#
ORACLE=oracle
export ORACLE_HOME PATH
#
if [ ! "$2" = "ORA_DB" ] ; then
rsh $HOST -l $ORACLE /sbin/init.d/oracle $1 ORA_DB
exit
fi
#
LOG=$ORACLE_HOME/startup.log
touch $LOG
chmod a+r $LOG
#
case $1 in
''start'')
echo "$0: starting up" >> $LOG
date >> $LOG
# Start Net8
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "starting Net8 listener"
$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &
fi
echo "starting Oracle databases"
$ORACLE_HOME/bin/dbstart >> $LOG 2>&1
;;
''stop'')
echo "$0: shutting down" >> $LOG
date >> $LOG
# Stop Net8
Configuration Tasks to Perform as the oracle User
if [ -f $ORACLE_HOME/bin/tnslsnr ] ;
then
echo "stopping net8 listener"
$ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1
fi
echo "stopping Oracle databases"
$ORACLE_HOME/bin/dbshut >> $LOG 2>&1
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
#
exit
7. Change the .rhosts file in the oracle user login home directory to allow root
login access to the account.
<your_host_name> root
8. Link files into the startup and shutdown directories using the ln -s command.
ln -s /sbin/init.d/oracle /sbin/rc3.d/S99oracle
ln -s /sbin/init.d/oracle /sbin/rc0.d/K01oracle
This file automatically starts and stops Oracle8i when the system is started or
stopped..

1. Platform
Compaq GS60 Server (2 nodes)
2GB RAM, 4GB Swap
9GB local disk
HSG80 Disk array, 10 X 18GB disks, RAID 1
Compaq Tru64 UNIX 4.0F, TruCluster 1.6

2. UNIX kernel parameters
Add following lines to /etc/sysconfigtab and reboot server
##################################
ipc:
       shm-max = 1073741824
       shm-mni = 128
       shm-seg = 32

dlm:
       dlm_disable_grptx = 0
##################################

3. Create unix group and user account
用addgroup和adduser命令创建组和用户
group name: dba
group id: 101
use adduser to add an user
username: oracle
userid: 101
home dir: /oracle/oracle
primary group: dba
password: Oracle

4. add following line to /oracle/oracle/.profile
##################################
ORACLE_BASE=/oracle/oracle
ORACLE_HOME=$ORACLE_BASE
ORACLE_SID=ORA8
ORACLE_TERM=vt100
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
NLS_LANG=american_america.us7ascii
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
DISPLAY=localhost:0.0
export ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_TERM ORA_NLS33 NLS_LANG LD_LIBRARY_PATH DISPLAY
PATH=$ORACLE_HOME/bin:$PATH:.
umask 022
##################################

5. mount oracle cdrom
mount -t cdfs -r -o nodefperm,noversion,rrip /dev/rz28c /mnt

6. execute /mnt/orainst/oratab.sh as root user
ORACLE_OWNER=oracle
export ORACLE_OWNER
cd /mnt/orainst
sh oratab.sh

7. confirm that TruCluster is running
cnxshow

8. startup oracle installer as oracle user
cd /mnt/orainst
orainst /c
select install software, not create database
select necessary products

9. distribute oracle software to another node in the cluster
tar cvf /tmpdir/oracle.tar /oracle/oracle/*
rcp /tmpdir/oracle.tar xjqssv2:/tmpdir
rlogin xjqssv2
tar xvpf /tmpdir/oracle.tar

10. change owner of drd device on both nodes
chown oracle:dba /dev/rdrd/drd*

11. create database with oracle installer (login as oracle user)
cd $ORACLE_HOME/orainst
orainst /c
select create database objects

12. run root.sh as root user
ORACLE_OWNER=oracle
export ORACLE_OWNER
ORACLE_SID=ORA8
export ORACLE_SID
cd /oracle/oracle/orainst
sh root.sh

13. change database to archivelog mode
svrmgrl <<EOF
connect internal
shutdown immediate
startup mount
alter database archivelog;
shutdown
exit
EOF

14. copy all sub-directory and file under /oracle/oracle/admin/ORA8 to another node
cd $ORACLE_HOME/dbs
ln -s /oracle/oracle/admin/ORA8/pfile/initORA8.ora initORA8.ora
ln -s /oracle/oracle/admin/ORA8/pfile/configORA8.ora configORA8.ora

15. confirm the followin parameters in initORA8.ora on node 1

log_archive_start = true      # if you want automatic archiving
log_archive_dest = /archive1/ORA8/arch
log_archive_format = %t_%s.dbf

rollback_segments= (r01,r02,r03,r04)

PARALLEL_SERVER=TRUE
instance_number=1
thread=1

16. confirm the followin parameters in initORA8.ora on node 2

log_archive_start = true      # if you want automatic archiving
log_archive_dest = /archive2/ORA8/arch
log_archive_format = %t_%s.dbf

rollback_segments= (rbs2)

PARALLEL_SERVER=TRUE
instance_number=2
thread=2

17. run root.sh as root user on the second node
ORACLE_OWNER=oracle
export ORACLE_OWNER
ORACLE_SID=ORA8
export ORACLE_SID
cd /oracle/oracle/orainst
sh root.sh

18. create dbstart_ops and dbshut_ops in $ORACLE_HOME/bin on both nodes
# dbstart_ops, used to startup OPS
ORACLE_HOME=/oracle/oracle
ORACLE_SID=ORA8

ogmsctl start
lsnrctl start
svrmgrl <<EOF
connect internal
startup
exit
EOF

# dbshut_ops, used to shutdown OPS
ORACLE_HOME=/oracle/oracle
ORACLE_SID=ORA8

lsnrctl stop
svrmgrl <<EOF
connect internal
shutdown immediate
exit
EOF
ogmsctl stop

19. create another database for rman by using $ORACLE_HOME/orainst/orainst
ORACLE_SID=rman
(datafiles, control files and online redologs stored in /backup/rman/oradata/rman)
create tablespace rcvcat;
create user rman identified by rman default tablespace rcvcat
temporary tablespace temp quota unlimited on rcvcat;
grant recover_catalog_owner to rman;
connect rman/rman
@?/rdbms/admin/catrman.sql

20. copy all sub-directory and file under /oracle/oracle/admin/rman to another node
cd $ORACLE_HOME/dbs
ln -s /oracle/oracle/admin/rman/pfile/initrman.ora initrman.ora
ln -s /oracle/oracle/admin/rman/pfile/configrman.ora configrman.ora

21. create dbstart_rman and dbshut_rman in $ORACLE_HOME/bin on both nodes
# dbstart_rman, used to startup rman catalog database
ORACLE_HOME=/oracle/oracle
ORACLE_SID=rman
export ORACLE_HOME ORACLE_SID

lsnrctl start lsnr_rman
svrmgrl <<EOF
connect internal
startup
exit
EOF

# dbshut_ops, used to shutdown rman catalog database
ORACLE_HOME=/oracle/oracle
ORACLE_SID=rman
export ORACLE_HOME ORACLE_SID

lsnrctl stop lsnr_rman
svrmgrl <<EOF
connect internal
shutdown immediate
exit
EOF

22. config listener.ora an tnsnames.ora by using $ORACLE_HOME/bin/net8asst.sh
Please refer to $ORACLE_HOME/network/admin/listener.ora and $ORACLE_HOME/network/admin/tnsnames.ora

23. reserve 1521 and 1526 port in /etc/services
Please refer to this file

Note:
1. OPS should be startup after TruCluster is up
2. OPS should be shutdown before shutdown TruCluster
3. passwords of system and sys user are manager
4. drd devices and disk partitions, please refer to "drd" and "disks" files
5. rman database should be startup on the node owner filesystem "backup"
6. for using rman, please refer to files in /oracle/oracle/

v
顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论