· 7 years ago · Oct 03, 2018, 08:44 AM
1RECAP
2==================
3file-system: one drive, no backup, no access to oracle server
4ASM (Automatic storage): 2 or more drives,if any fails, you can have an automatic backup for the filesystem
5install without yum (inside the folder of downloads): rpm ivh whatever.rpm
6
7
8Learn to use vi commands to pass command during the oracle installation process
9================================================================================
10To Start vi
11===========
12To use vi on a file, type in vi filename. If the file named filename exists,
13then the first page (or screen) of the file will be displayed; if the file does not exist,
14then an empty file and screen are created into which you may enter text.
15
16vi filename ---- edit filename starting at line 1
17vi -r filename ---- recover filename that was being edited when system crashed
18
19To Edit vi
20===========
21By default, the vi mode is in a non-editable state at launch.
22However, you can enable or disable the edit mode.
23
24i ---- enables the editor mode.
25esc ---- disables the editor mode.
26
27To Exit vi
28===========
29Usually, the new or modified file is saved when you leave vi.
30However, it is also possible to quit vi without saving the file.
31Note: The cursor moves to bottom of screen whenever a colon (:) is typed.
32This type of command is completed by hitting the <Return> (or <Enter>) key.
33
34:wq ---- <Return> save and quit vi, writing out modified file to file named in original invocation
35:q ---- <Return> quit (or exit) vi
36:q! ---- <Return> quit vi even though latest changes have not been saved for this vi call
37
38To cat file content
39======================
40To use cat on a file, type in cat filename. If the file named filename exists,
41then the contents of the file will be displayed; if the file does not exist,
42an error is returned with: No such file or directory.
43
44cat filename ---- displays the contents of the file.
45
46
47============================================================================================================================
48
49
50Step 1: Download oracle 12c grid home and database
51==============================================================
52linuxx64_12201_grid_home.zip
53linuxx64_12201_database.zip
54from: http://www.oracle.com
55
56Step 2: Confirm that the hostname is set.
57==============================================================
58# hostname
59
60If not, add the hostname to the network file
61# vi /etc/sysconfig/network
62
63Step 3: Add the IP address and Hostname to the hosts file
64==============================================================
65# vi /etc/hosts
66// 192.168.56.100 oracle.nhsng.com oracle
67
68Step 4: Configure the Network Connection Settings
69==============================================================
70Enable the Network to use two adapters
71// One set on NAT, while the other is set on host adapter only
72
73In the Connection Settings, configure the protocol to match their respective adapters.
74// NAT configured as Manual (for local communication on the network),
75// while host adapter sets to Automatic (for external and internet communication).
76
77Step 5: Confirm if the set protocol access the Internet
78==============================================================
79// Using the IP address
80# ping -c 3 192.168.56.100
81
82// Using the hostname
83# ping -c 3 oracle.nhsng.com
84
85// Using the assigned name
86# ping -c 3 oracle
87
88Step 6: Install the prerequisite packages using automatic setup.
89==============================================================
90# yum install oracle-rdbms-server-12cR1-preinstall -y
91
92When installed, the Oracle Preinstallation RPM does the following:
93â– Automatically downloads and installs any additional RPM packages needed for
94installing Oracle Grid Infrastructure and Oracle Database, and resolves any
95dependencies
96â– Creates an oracle user, and creates the oraInventory (oinstall) and OSDBA (dba)
97groups for that user
98â– As needed, sets sysctl.conf settings, system startup parameters, and driver
99parameters to values based on recommendations from the Oracle Preinstallation
100RPM program
101â– Sets hard and soft resource limits
102â– Sets other recommended parameters, depending on your kernel version
103
104Step 7: Confirm the oracle parameters are set in sysctl.conf file.
105==============================================================
106# cat /etc/sysctl.conf
107
108If not, add the following lines:
109# vi /etc/sysctl.conf
110
111fs.file-max = 6815744
112kernel.sem = 250 32000 100 128
113kernel.shmmni = 4096
114kernel.shmall = 1073741824
115kernel.shmmax = 4398046511104
116net.core.rmem_default = 262144
117net.core.rmem_max = 4194304
118net.core.wmem_default = 262144
119net.core.wmem_max = 1048576
120fs.aio-max-nr = 1048576
121net.ipv4.ip_local_port_range = 9000 65500
122
123Step 8: Set the Kernel Parameters for the ulimits.
124==============================================================
125# vi /etc/security/limits.conf
126
127# Oracle Setting
128oracle soft nproc 2047
129oracle hard nproc 16384
130oracle soft nofile 1024
131oracle hard nofile 65536
132oracle soft stack 10240
133oracle hard stack 32768
134
135# Grid Setting
136grid soft nproc 2047
137grid hard nproc 16384
138grid soft nofile 1024
139grid hard nofile 65536
140grid soft stack 10240
141grid hard stack 32768
142
143Step 9: Confirm the oracle user is created with the installation.
144==============================================================
145# id oracle
146
147If not, create user and group for oracle.
148# groupadd -g 54321 oinstall
149# groupadd -g 54322 dba
150# groupadd -g 54323 oper
151# useradd -u 54321 -g oinstall -G dba,oper oracle
152
153Step 10: Create user and group for grid ASM
154==============================================================
155# groupadd -g 54324 osasm
156# useradd -u 54324 -g oinstall -G dba,osasm grid
157
158Step 11: Create additional Group for grid ASM (Optional)
159==============================================================
160# groupadd -g 54324 backupdba
161# groupadd -g 54325 dgdba
162# groupadd -g 54326 kmdba
163# groupadd -g 54327 asmdba
164# groupadd -g 54328 asmoper
165# groupadd -g 54329 asmadmin
166# useradd -u 54321 -g oinstall -G backupdba,dgdba,kmdba,asmdba,asmoper,asmadmin grid
167
168Step 12: Create passwords for the oracle and grid users
169==============================================================
170# passwd oracle
171# passwd grid
172
173Step 13: Update the Linux Security Policy configuration (SELINUX)
174==============================================================
175# vi /etc/selinux/config
176
177Change from Selinux=enforcing
178To SELINUX=Disabled
179(OR)
180SELINUX=permissive
181
182enforcing ---- SELinux security policy is enforced.
183permissive ---- SELinux prints warnings instead of enforcing.
184disabled ---- No SELinux policy is loaded.
185
186Step 14: Disable Linux firewall and check if the configuration is off
187==============================================================
188# service iptables stop
189# # chkconfig iptables off
190# service iptables status (check the status of firewall)
191
192Step 15: Create Directories to install oracle and grid ASM
193==============================================================
194# mkdir -p /u01/app/oracle/product/12.2.0.1/db_1
195# mkdir -p /u01/app/grid
196# mkdir -p /u01/app/12.2.0.1/grid
197
198Step 16: Unzip the database and gridhome to their respective locations.
199==============================================================
200Open a terminal from the OVF Gateway and run the unzip command from there
201// Unzip Linux grid files into the grid home (because its a binary file)
202# unzip grid_home.zip -d /u01/app/12.2.0.1/grid
203
204// Unzip Linux database files into oracle user desktop or other locations (because its a runInstaller file)
205# unzip database.zip -d /home/oracle/Desktop
206
207Step 17: Confirm the files were extracted to their specified directories.
208==============================================================
209# ls -l /u01/app/12.2.0.1/grid
210# ls -l /home/oracle/Desktop/database
211
212Step 18: Change Permissions and Ownership for the specified directories.
213==============================================================
214# chown -R grid:oinstall /u01
215# chown -R oracle:oinstall /u01/app/oracle
216# chmod -R 775 /u01
217# chown -R oracle:oinstall /home/oracle/Desktop
218# chmod 775 /home/oracle/Desktop
219
220Step 19: Update the pam.d login file.
221==============================================================
222# vi /etc/pam.d/login
223
224Add the following:
225session required pam_limits.so
226
227Step 20: Set the environment variables (inside .bash_profile) for the oracle user.
228==============================================================
229Switch to oracle user
230# su - oracle
231
232Open the .bash_profile file
233$ vi .bash_profile
234
235Add the following at the end of the file:
236# Oracle Settings
237export TMP=/tmp
238export TMPDIR=$TMP
239
240export JAVA_HOME=/usr/bin/java
241export ORACLE_UNQNAME=cdb1
242export ORACLE_HOSTNAME=oracle.nhsng.com
243export ORACLE_BASE=/u01/app/oracle
244export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1
245export ORACLE_SID=cdb1
246
247export NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"
248export TNS_ADMIN=$ORACLE_HOME/network/admin
249export PATH=/usr/sbin:$PATH
250export PATH=.:$JAVA_HOME/bin:$ORACLE_HOME/bin:$PATH
251
252export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
253export CLASSPATH=.:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
254
255umask 022
256#End of file
257
258Save and quit after editting, then exit to go back to the root user.
259
260Step 21: Set the environment variables (inside .bash_profile) for the grid user.
261==============================================================
262Switch to grid user
263# su - grid
264
265Open the .bash_profile file
266$ vi .bash_profile
267
268Add the following at the end of the file:
269# Grid Settings
270export TMP=/tmp
271export TMPDIR=$TMP
272
273export JAVA_HOME=/usr/bin/java
274export ORACLE_BASE=/u01/app/grid
275export ORACLE_HOME=/u01/app/12.2.0.1/grid
276export ORACLE_SID=+ASM
277
278export PATH=/usr/sbin:$PATH
279export PATH=.:$JAVA_HOME/bin:$ORACLE_HOME/bin:$PATH
280export TNS_ADMIN=$ORACLE_HOME/network/admin
281
282umask 022
283#End of file
284
285Save and quit after editting, then exit to go back to the root user.
286
287Step 22: Install the oracleasm support libraries in the following order.
288==============================================================
289# yum install oracleasm-support* -y
290# yum install oracleasmlib* -y
291# yum install kmod-oracleasm -y
292
293If any doesn't install from using yum installer,, download the file.
294Change the path to the directory where the file resides, and install using:
295rpm -i filename.extension
296
297Step 23: Confirm the oracleasm support libraries were installed. P
298==============================================================
299# rpm -qa|grep oracleasm
300
301Step 24: List all the disks attached to the machine with their names and sizes.
302==============================================================
303# fdisk -l|grep "Disk /dev/sd"
304
305Step 25: Format the disks, create the necessary partitions.
306==============================================================
307Run the fdisk command with the disk path and the disk name
308# fdisk /dev/sdb
309
310Use the following when prompted for inputs
311n = to add a new partition
312p = to make primary partition
3131 = to set the number of partition
314Enter = to select the start of the first cyclinder
315Enter = to select the end of the last cyclinder
316w = to write table to disk and exit
317
318Step 26: List all the formatted disks with the disk partitions.
319==============================================================
320# fdisk -l|grep "dev/s"
321
322Step 27: Configure and Initialize oracleasm
323==============================================================
324# oracleasm configure -i // To configure
325# oracleasm init // To initialize
326# oracleasm status // To check the status
327
328Step 28: Create and Prepare the disks using oracleasm
329==============================================================
330# oracleasm createdisk FRADK1 /dev/sdb1
331
332Step 29: Scan and List the disks using oracleasm to confirm availability
333==============================================================
334# oracleasm scandisks
335# oracleasm listdisks
336
337After confirming the availability of the disks, restart and switch user
338
339Step 30: Disable access for all users and grant access only to authorized users.
340==============================================================
341# xhost
342# xhost + oracle
343
344Step 31: Confirm the system specifications meet with the grid requirements (Optional).
345==============================================================
346OPTION A:
347If running the installation from the grid user GUI, change directory to the grid home.
348Run the following:
349./runcluvfy.sh stage -pre hacfg
350
351OPTION B:
352If running the installation from the root user GUI, list the xauth parameters.
353# xauth list
354
355Copy the returned list and switch user to grid via terminal.
356Add the xauth list copied from the root user to the grid user.
357$ xauth add paste_copied_list
358
359Change directory to the grid home and run as in Option A.
360
361Step 31: Install the grid
362==============================================================
363OPTION A:
364If running the installation from the grid user GUI, change directory to the grid home
365
366as root
367open terminal,
368# xauth list
369Copy the xauth list returned
370
371==============================================================
372switch user to grid, and add the xauth list
373su - grid
374$ xauth add (xauth list)
375
376==============================================================
377$ cd /u01/app/12.2.0.1/grid
378
379
380==============================================================
381$ ./gridsetup.sh
382
383
384
385https://insightintooracle.blogspot.com/2013/08/installing-oracle-grid-infrastructure.html
386https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/11g/r2/prod/install/gridinstss/gridinstss.htm
387http://oracle-help.com/oracle-12c/oracle-12cr2/steps-install-grid-infrastructure-12c-standalone-server/