Sei sulla pagina 1di 94

Solutions & Engineering of Defense and Security Information Systems

Oracle RAC Database Deployment

Solutions & Engineering of Defense and Security Information Systems

Agenda
Linux OS Installation Linux OS Configuration Oracle Grid Infrastructure Oracle Database Software RAC Database Creation Manage RAC database

Solutions & Engineering of Defense and Security Information Systems

Linux OS installation
Version RedHat Enterprise Linux 5.8 x86_64 Hardware Memory: 6G at least Hard Disk: 500G Network device: two network device each server

Solutions & Engineering of Defense and Security Information Systems

Linux OS installation
Skip Entering Installation Number

Solutions & Engineering of Defense and Security Information Systems

Linux OS installation
Customize Hard Disk partitions Root partition 200G Swap partition 32G /u01: software installation directory 200G

Solutions & Engineering of Defense and Security Information Systems

Linux OS installation
The default Installation of Red Hat Enterprise Linux Server

Other required Packages can be installed after completing OS installation.

Solutions & Engineering of Defense and Security Information Systems

Linux OS installation
Disable firewall

Solutions & Engineering of Defense and Security Information Systems

Linux OS installation
Disable SELinux Since Oracle Database 11g, it can be installed when enabling SELinux

Solutions & Engineering of Defense and Security Information Systems

Linux OS Configuration
Set up yum Set shell resource limits Verify Kernel parameters Install required packages Install asmlib packages Customize Linux services

Solutions & Engineering of Defense and Security Information Systems

10

Set up YUM
Create yum configuration file
#vi /etc/yum.repos.d/rhel-dvd.repo [rhel-dvd] name=Red Hat Enterprise Linux DVD media baseurl=file:///rhel5/Server enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Mount redhat Enterprise ISO # mount -o loop rhel-server-5.8-x86_64-dvd.iso /rhel5/ Install packages via yum # yum install <package_name>

Solutions & Engineering of Defense and Security Information Systems

11

Check OS resource
Physical memory #grep MemTotal /proc/meminfo #free Swap space # grep SwapTotal /proc/meminfo #swapon a Storage space #df h #fdisk -l OS architecture #uname a

Solutions & Engineering of Defense and Security Information Systems

12

Install required packages


Install the following packages, all the 32-bit packages listed are no longer required.
binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.125 elfutils-libelf-devel-0.125 gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-24 glibc-2.5-24 (32 bit) glibc-common-2.5 glibc-devel-2.5 glibc-devel-2.5 (32 bit) glibc-headers-2.5 ksh-20060214 libaio-0.3.106 libaio-0.3.106 (32 bit) libaio-devel-0.3.106 libaio-devel-0.3.106 (32 bit) libgcc-4.1.2 libgcc-4.1.2 (32 bit) libstdc++-4.1.2 libstdc++-4.1.2 (32 bit) libstdc++-devel 4.1.2 make-3.81 sysstat-7.0.2 unixODBC-2.2.11 unixODBC-2.2.11 (32 bit) unixODBC-devel-2.2.11 unixODBC-devel-2.2.11 (32 bit)

Check if the package is installed.


#rpm -qa --qf %{name}-%{version}-%{release}.%{arch}\n | grep <package_name>

Solutions & Engineering of Defense and Security Information Systems

13

Install required packages (cons)


If the package is not installed, then install it via yum
For example:
#yum install elfutils-libelf-devel-3.el5-0.137.x86_64 #rpm -qa --qf "%{name}-%{release}-%{version}.%{arch}\n"|grep elfutils elfutils-libelf-devel-static-3.el5-0.137.x86_64 elfutils-libelf-devel-3.el5-0.137.x86_64 # yum install gcc # rpm -qa --qf "%{name}-%{version}-%{release}.%{arch}\n" |grep '^gcc' gcc-4.1.2-52.el5.x86_64

# yum install gcc-c++ # rpm -qa --qf "%{name}-%{version}-%{release}.%{arch}\n" |grep '^gcc' gcc-c++-4.1.2-52.el5.x86_64 gcc-4.1.2-52.el5.x86_64

Solutions & Engineering of Defense and Security Information Systems

14

Verify kernel parameters


Edit/modify /etc/sysctl.conf with the following change
fs.file-max = 6815744 kernel.msgmni = 2878 kernel.msgmax = 8192 kernel.msgmnb = 65536 kernel.sem = 250 32000 100 142 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 kernel.sysrq = 1 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 fs.aio-max-nr = 3145728 net.ipv4.ip_local_port_range = 9000 65500 vm.min_free_kbytes = 51200

Take it effect : #sysctl p


Solutions & Engineering of Defense and Security Information Systems
15

Create database user and group


Create user and group
# groupadd -g 501 dba # groupadd -g 500 oinstall # groupad -g 502 asmadmin # useradd -u 500 -g oinstall -G dba,asmadmin grid # useradd -u 501 -g oinstall -G dba oracle

Check user information


# id grid uid=500(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(asmadmin) # id oracle uid=501(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)

Set password for the user


#passwd oracle #passwd grid

Solutions & Engineering of Defense and Security Information Systems

16

Creating Installation directory


# # # # # # mkdir -p /u01/app/11.2.0/grid mkdir -p /u01/app/grid mkdir -p /u01/app/oracle chown -R grid:oinstall /u01 chown oracle:oinstall /u01/app/oracle/ chmod -R 775 /u01

When installing grid infrastructure, the installer will modify the attributes of /u01/app/11.2.0/grid.

Solutions & Engineering of Defense and Security Information Systems

17

Shell resource limits


Sets shell limits if necessary to required values.
oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle soft hard soft hard soft hard soft hard soft hard nofile 131072 -- the maximum number of open file descriptors nofile 131072 nproc 131072 -- the maximum number of user processes nproc 131072 core unlimited core unlimited memlock 3500000 -- the maximum size a process may lock into memory memlock 3500000 stack 32768 stack 32768

grid grid grid grid grid grid grid grid grid grid

soft hard soft hard soft hard soft hard soft hard

nofile 131072 -- the maximum number of open file descriptors nofile 131072 nproc 131072 -- the maximum number of user processes nproc 131072 core unlimited core unlimited memlock 3500000 -- the maximum size a process may lock into memory memlock 3500000 stack 32768 stack 32768
18

Solutions & Engineering of Defense and Security Information Systems

Configuring security login


Add the following line at the end of /etc/pam.d/login

# pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open session required pam_limits.so

Solutions & Engineering of Defense and Security Information Systems

19

Install ASMlib
Download ASMlib packages ASMlib packages can be downloaded from oracle official website.http://www.oracle.com/technetwork/topics/ linux/asmlib/index-101839.html
Install asmlib package
# rpm -ivh oracleasm* warning: oracleasm-2.6.18-308.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-308.el########################################### [ 67%] 3:oracleasmlib

Solutions & Engineering of Defense and Security Information Systems

20

Network Time Protocol Setting


Cluster Time Synchronization Service
Oracle clusterware requires the same time zone setting on all cluster nodes. We have two options for time synchronization: Network time protocol(NTP) Oracle Cluster Time Synchronization Service.

Stop NTP service


# /sbin/service ntpd stop # chkconfig ntpd off # mv /etc/ntp.conf /etc/ntp.conf.old

Solutions & Engineering of Defense and Security Information Systems

21

Install cvuqdisk
Cvuqdisk is necessary for shared disk check during installation
# CVUQDISK_GRP=oinstall; export CVUQDISK_GRP # rpm -iv packag

The cvuqdisk package is located in the grid install media.

Solutions & Engineering of Defense and Security Information Systems

22

Customize Linux Sevices


Stop the following servies
# chkconfig --level 345 cups off # chkconfig --level 345 avahi-daemon off # chkconfig --level 345 cpuspeed off # chkconfig --level 345 hidd off # chkconfig --level 345 hplip off # chkconfig --level 345 iscsi off # chkconfig --level 345 iscsid off # chkconfig --level 345 isdn off # chkconfig --level 345 pcscd # chkconfig --level 345 pcscd off # chkconfig --level 345 rhnsd off # chkconfig --level 345 sendmail off # chkconfig --level 345 smartd off # chkconfig --level 345 kudzu off # chkconfig --level 345 iptables off # chkconfig --level 345 ip6tables off #chkconfig --level 345 bluetooth #chkconfig --level 345 yum-updatesd

Solutions & Engineering of Defense and Security Information Systems

23

Set Environment variables


Edit .bash_profile in the user home directory
ORACLE_BASE=/u01/app/oracle ORACLE_HOME= ORACLE_SID= PATH=$PATH:$ORACLE_HOME/bin export ORACLE_BASE export ORACLE_HOME export ORACLE_SID export PATH

Based on different user, set ORACLE_* variables to different values.

Solutions & Engineering of Defense and Security Information Systems

24

Grid Infrastructure Installation


RAC network setting Configure ssh equivalence Configure Oracleasm Set up Grid Infrastructure

Solutions & Engineering of Defense and Security Information Systems

25

Network Setting
Add the following to dns configuration file
192.168.20.101 192.168.20.102 racbox1.nom.com racbox1 racbox2.nom.com racbox2

172.16.20.101 172.16.20.102

racbox1-priv.nom.com racbox2-priv.nom.com

racbox1-priv racbox2-priv

192.168.20.121 racbox1-vip.nom.com racbox1-vip 192.168.20.122 racbox2-vip.nom.com racbox2-vip 192.168.20.201 racdb-scan.nom.com racdb-scan 192.168.20.202 racdb-scan.nom.com racdb-scan 192.168.20.203 racdb-scan.nom.com racdb-scan

In the above example, the sub network 192.168.20.xxx is used for public network, and 172.16.20.xxx is used for private network.
Solutions & Engineering of Defense and Security Information Systems
26

Configure ssh equivalence


Generate ssh keys
[oracle@racbox1 ]$ ssh-keygen t rsa [oracle@racbox1 ]$ ssh-keygen t dsa [oracle@racbox1 ]$ ssh racbox2 [oracle@racbox2 ]$ ssh-keygen t rsa [oracle@racbox2 ]$ ssh-keygen t dsa

Copy and transfer ssh keys


[oracle@racbox2 ]$ cat /home/oracle/.ssh/id_*.pub >/home/oracle/.ssh/ authorized_keys [oracle@racbox2 ]$ ssh racbox1 cat /home/oracle/.ssh/id_*.pub>>/home/oracle/.ssh/authorized_keys [oracle@racbox2 ]$ scp /home/oracle/.ssh/authorized_keys racbox1:/home/oracle/.ssh/

Verify ssh equivalence


[oracle@racbox2 ]$ ssh racbox2 [oracle@racbox2 ]$ exit [oracle@racbox2 ]$ ssh racbox1 [oracle@racbox1]$ ssh racbox1 [oracle@racbox1]$ exit [oracle@racbox1 ]$ssh racbox2 [oracle@racbox2 ]$

Solutions & Engineering of Defense and Security Information Systems

27

Configure Oracleasm
Create asmlib device
# service oracleasm createdisk 'RACOVD' /dev/sdb1 Marking disk "RACOVD" as an ASM disk: [ OK ] # service oracleasm createdisk 'RACDATA' /dev/sdc1 Marking disk "RACDATA" as an ASM disk: [ OK ] # service oracleasm createdisk 'RACDFRA' /dev/sdd1 Marking disk "RACDFRA" as an ASM disk: [ OK ]

List asmlib devices


# service oracleasm listdisks; RACDATA RACDFRA RACOVD

Scan asmlib devices #service oracleasm scandisks

Solutions & Engineering of Defense and Security Information Systems

28

Configure Oracleasm(conts)
Configure oracleasm
# /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]: Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ]

Specify default user and group for asmlib devices: grid and asmadmin
Solutions & Engineering of Defense and Security Information Systems
29

Perform pre-installation check


$ ./runcluvfy.sh stage -pre crsinst -n node -fixup verbose where node is a comma-delimited list of nodes you want to make cluster members:
For example: $ ./runcluvfy.sh stage -pre crsinst -n node1,node2 -fixup verbose

Solutions & Engineering of Defense and Security Information Systems

30

Set up Grid Infrastructure


Login as grid user
$ pwd /home/grid/grid $ ./runInstaller

Select skip software updates Then click next

Solutions & Engineering of Defense and Security Information Systems

31

Set up Grid Infrastructure


Install and configure Oracle Grid Infrastructure for a cluster. Then click next

Solutions & Engineering of Defense and Security Information Systems

32

Set up Grid Infrastructure


Select Advanced Installation which gives more flexibility on grid configuration Then click next

Solutions & Engineering of Defense and Security Information Systems

33

Set up Grid Infrastructure


Select languages in which your product will run. Then click next

Solutions & Engineering of Defense and Security Information Systems

34

Set up Grid Infrastructure


Input cluster name and scan name. The scan name must be resolved by dns.

Then click next

Solutions & Engineering of Defense and Security Information Systems

35

Set up Grid Infrastructure


Add all the other cluster nodes. Test ssh connectivity Then click next

Solutions & Engineering of Defense and Security Information Systems

36

Set up Grid Infrastructure


Specify the network interface type: Public private Then click next

Solutions & Engineering of Defense and Security Information Systems

37

Set up Grid Infrastructure


Configure OCR and voting disk files on Oracle ASM storage.
Then click next

Solutions & Engineering of Defense and Security Information Systems

38

Set up Grid Infrastructure


Create ASM disk group for ocr and voting disk files. After creation, click next

Solutions & Engineering of Defense and Security Information Systems

39

Set up Grid Infrastructure


Specify ASM password Use same password for sys/asmsnmp accounts.
Then click next

Solutions & Engineering of Defense and Security Information Systems

40

Set up Grid Infrastructure

Do not use Intelligent Platform Management Interface(IPMI)


Then click next

Solutions & Engineering of Defense and Security Information Systems

41

Set up Grid Infrastructure


Specify privileged operating system group for ASM instance dba: asmadmin:

Then click next

Solutions & Engineering of Defense and Security Information Systems

42

Set up Grid Infrastructure


Specify installation location Then click next

Solutions & Engineering of Defense and Security Information Systems

43

Set up Grid Infrastructure


Specify Inventory location

Then click next

Solutions & Engineering of Defense and Security Information Systems

44

Set up Grid Infrastructure


Perform prerequisit checks If it passed, then click next

Solutions & Engineering of Defense and Security Information Systems

45

Set up Grid Infrastructure


Configuration summary
If correct, then clickinstall

Solutions & Engineering of Defense and Security Information Systems

46

Set up Grid Infrastructure


Install grid infrastructure software

Solutions & Engineering of Defense and Security Information Systems

47

Set up Grid Infrastructure


Execute configuration scripts from all cluster nodes.
Then clickok and continue installing.

Solutions & Engineering of Defense and Security Information Systems

48

Set up Grid Infrastructure


The installation of Oracle Grid Infrastructure for a cluster was successful.
Click finishto compete installation

Solutions & Engineering of Defense and Security Information Systems

49

Manage ASM group


Check asm disk group Create data disk group Create FRA disk group

Solutions & Engineering of Defense and Security Information Systems

50

Check ASM disk group


Login as grid user
Run asmca command $ asmca

Solutions & Engineering of Defense and Security Information Systems

51

Create data disk group


click create ondisk grouptab page, Then input disk group name , select redundancy type and asmlib device. Click OK

Solutions & Engineering of Defense and Security Information Systems

52

Create data disk group(conts)


the disk group created successfully.

Solutions & Engineering of Defense and Security Information Systems

53

Create FRA disk group


Create FRA disk group as the same as data disk group

Solutions & Engineering of Defense and Security Information Systems

54

Install Oracle database

Solutions & Engineering of Defense and Security Information Systems

55

Installing Database
Login as oracle user Run the script $./runInstaller
Uncheck I wish to receive security updates via My Oracle Support. Then click next

Solutions & Engineering of Defense and Security Information Systems

56

Installing Database
Click yes and dont provide email address.

Solutions & Engineering of Defense and Security Information Systems

57

Installing Database
Skip software updates
Then click next

Solutions & Engineering of Defense and Security Information Systems

58

Installing Database
Install database software only

Solutions & Engineering of Defense and Security Information Systems

59

Installing Database
Oracle Real Application Clusters database installation Select all cluster nodes. Then click next

Solutions & Engineering of Defense and Security Information Systems

60

Installing Database
Select the languages in which your software will run. Then click next

Solutions & Engineering of Defense and Security Information Systems

61

Installing Database
Select Database edition: Enterprise edition Then click next

Solutions & Engineering of Defense and Security Information Systems

62

Installing Database
Specify installation location

Then click next

Solutions & Engineering of Defense and Security Information Systems

63

Installing Database
Specify privileged operating system groups dba: OSDBA Then click next

Solutions & Engineering of Defense and Security Information Systems

64

Installing Database
Perform prerequisite checks
If successful, then click next

Solutions & Engineering of Defense and Security Information Systems

65

Installing Database
Database configuration summary Then click install

Solutions & Engineering of Defense and Security Information Systems

66

Installing Database
Install database product

Solutions & Engineering of Defense and Security Information Systems

67

Installing Database
Execute configuration scripts Then clickOK and continue to install

Solutions & Engineering of Defense and Security Information Systems

68

Installing Database
Click close and complete installation

Solutions & Engineering of Defense and Security Information Systems

69

Creating RAC database


Login as oracle user Then run dbca command Select oracle Real Application Cluster database Click next

Solutions & Engineering of Defense and Security Information Systems

70

Creating RAC database


Select create a Database Then click next

Solutions & Engineering of Defense and Security Information Systems

71

Creating RAC database


Database template: General purpose or transaction processing
Then click next

Solutions & Engineering of Defense and Security Information Systems

72

Creating RAC database


Specify database name Select nodes for cluster database Then click next

Solutions & Engineering of Defense and Security Information Systems

73

Creating RAC database


Configure database control for local management
Then click next

Solutions & Engineering of Defense and Security Information Systems

74

Creating RAC database


Use the same Administrative password for all accounts Then click next

Solutions & Engineering of Defense and Security Information Systems

75

Creating RAC database


Specify storage type and locations for database files Use OracleManaged files
Then click next

Solutions & Engineering of Defense and Security Information Systems

76

Creating RAC database


Enter asm password
Then click ok

Solutions & Engineering of Defense and Security Information Systems

77

Creating RAC database


Specify FRA location and enable archiving Then click next

Solutions & Engineering of Defense and Security Information Systems

78

Creating RAC database


Select sample schemas
Then click next

Solutions & Engineering of Defense and Security Information Systems

79

Creating RAC database


Specify database character set Adjust other parameters after completion. Then click next

Solutions & Engineering of Defense and Security Information Systems

80

Creating RAC database


Database storage: accept the default setting Then clicknext

Solutions & Engineering of Defense and Security Information Systems

81

Creating RAC database


Click finishand start to create rac database

Solutions & Engineering of Defense and Security Information Systems

82

Creating RAC database


Once database creation complete, then click exit

Solutions & Engineering of Defense and Security Information Systems

83

Manage RAC database


Oracle Clusterware Control crsctl Server control untility srvctl Use the database console

Solutions & Engineering of Defense and Security Information Systems

84

Oracle Clusterware Control --crsctl


Login as grid user Check the status of cluster $crsctl status res t $crsctl check cluster Start/stop cluster $crsctl start cluster $crsctl stop cluster $crsctl start crs $crsctl stop crs

Solutions & Engineering of Defense and Security Information Systems

85

Server Control Utility--srvctl


Login as oracle user Start RAC database
$srvctl start database d <dbname> $srvctl start asm n <node>

Stop RAC database


$srvctl stop database d <dbname> $srvctl stop asm n <node> Eg: $srvctl start database d racdb $srvctl stop database d racdb

.
Solutions & Engineering of Defense and Security Information Systems
86

Database Control
Configure database control $emca deconfig dbcontrol db repos create -cluster Check the status $emctl status dbconsole Start db control $emctl start dbconsole Stop db control $emctl stop dbconsole

Solutions & Engineering of Defense and Security Information Systems

87

Database Control
Monitor the cluster
Eg: the cluster name is racdb

Solutions & Engineering of Defense and Security Information Systems

88

Database control
Moniter the performance of RAC database

Solutions & Engineering of Defense and Security Information Systems

89

Database Control
Monitor the schema of RAC database

Solutions & Engineering of Defense and Security Information Systems

90

Database Control
Monitor instances of the cluster

Solutions & Engineering of Defense and Security Information Systems

91

Database Control
Monitor the home page of database instance

Solutions & Engineering of Defense and Security Information Systems

92

Database Control
Monitor Memory usage of database instance

Solutions & Engineering of Defense and Security Information Systems

93

Gracias

Solutions & Engineering of Defense and Security Information Systems

Potrebbero piacerti anche