Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

netstat -an | grep 1521 | grep LISTEN

--
[root@dnssrv Desktop]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@dnssrv Desktop]# chkconfig iptables off

--vi /etc/dhcp/dhcpd.conf
ddns-update-style interim;
ignore client-updates;

subnet 192.168.197.0 netmask 255.255.255.0 {

option subnet-mask 255.255.255.0;


option domain-name "oracle.com";

range 192.168.197.140 192.168.197.254;


default-lease-time 21600;
max-lease-time 43200;

}
--
[root@dnssrv ~]# vi /etc/rc.d/init.d/dhcpd
-- modify
user=root
group=root
-- start
[root@dnssrv ~]# service dhcpd start
Starting dhcpd: [ OK ]
-- Cau hinh DNS
[root@dnssrv ~]# vi /etc/named.conf
options
{
/* make named use port 53 for the source of all queries, to allow
* firewalls to block all ports except 53:
*/
query-source port 53;
query-source-v6 port 53;

// Put files that named is allowed to write in the data/ directory:


directory "/var/named"; // the default
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";

allow-transfer {"none";};
zone-statistics yes;
};

logging
{
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "oracle.com" IN {
type master;
file "oracle.com.zone";
allow-transfer { 192.168.197.240; };
};

zone "197.168.192.in-addr.arpa" IN {
type master;
file "oracle.com.reverse";
};
--
[root@dnssrv Desktop]# cd /var/named/
[root@dnssrv named]# vi oracle.com.zone
--
$TTL 86400
$ORIGIN oracle.com.
@ 1D IN SOA dnssrv.oracle.com. hostmaster.oracle.com. (
2002022401 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
; main domain name servers
IN NS dnssrv.oracle.com.
dnssrv IN A 192.168.197.100
; A record for mail server above
;mail IN A 192.168.1.82

rac1 IN A 192.168.197.131
rac2 IN A 192.168.197.132

; sub-domain definitions
$ORIGIN rac.oracle.com.
@ IN NS gns.rac.oracle.com.
; sub-domain address records for name server only - glue record
gns IN A 192.168.197.240 ; 'glue' record
+++++++
$ttl 38400
oracle.com. IN SOA dnssrv.oracle.com. admin.oracle.com. (
1316874398
10800
3600
604800
38400 )
A 192.168.197.100
NS dnssrv ; name server for localdomain
dnssrv A 192.168.197.100
rac1 A 192.168.197.131
rac2 A 192.168.197.132
rac3 A 192.168.197.133
oralab-gns A 192.168.197.240 ; A record for the GNS
;
;sub-domain(oralab.oracle.com) definitions
$ORIGIN oralab.oracle.com.
@ IN NS oralab-gns.oracle.com. ; name server

+++++++
--
[root@dnssrv ~]# vi /var/named/oracle.com.reverse
$TTL 86400 ; 24 hours could have been written as 24h or 1d
@ 1D IN SOA oracle.com. hostmaster.oracle.com. (
2002022401 ; serial
3H ; refresh
15 ; retry
1w ; expire
3h ; minimum
)
IN NS dnssrv.oracle.com.
100 IN PTR dnssrv.oracle.com.
131 IN PTR rac1.oracle.com.
132 IN PTR rac2.oracle.com.
+++++++++++++++++++++++++++
$ttl 38400
197.168.192.in-addr.arpa. IN SOA dnssrv. admin.localdomain. (
1316875143
10800
3600
604800
38400
)
NS dnssrv.oracle.com.
100 PTR dnssrv.oracle.com.
131 PTR rac1.oracle.com
132 PTR rac2.oracle.com
133 PTR rac3.oracle.com
240 PTR oralab-gns.oracle.com. ; reverse mapping for GNS

+++++++++++++++++++++++++++
-- Start service ( co the theo doi tail -f /var/log/messages)
[root@dnssrv ~]# service named start
Starting named: [ OK ]
[root@dnssrv ~]# vi /etc/resolv.conf
# Generated by NetworkManager
search oracle.com
nameserver 192.168.197.100
-- Test DNS server
[root@dnssrv ~]# nslookup rac2
Server: 192.168.197.100
Address: 192.168.197.100#53

Name: rac2.oracle.com
Address: 192.168.197.132
--
[root@rac1 ~]# dig oralab-gns.oracle.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.0.2.el6_4.6 <<>> oralab-gns.oracle.com


;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52310
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;oralab-gns.oracle.com. IN A

;; ANSWER SECTION:
oralab-gns.oracle.com. 38400 IN A 192.168.197.240

;; AUTHORITY SECTION:
oracle.com. 38400 IN NS dnssrv.oracle.com.

;; ADDITIONAL SECTION:
dnssrv.oracle.com. 38400 IN A 192.168.197.100

;; Query time: 2 msec


;; SERVER: 192.168.197.100#53(192.168.197.100)
;; WHEN: Wed Sep 22 09:41:51 2021
;; MSG SIZE rcvd: 92
--
[root@rac1 ~]# dig -x 192.168.197.240

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.0.2.el6_4.6 <<>> -x 192.168.197.240


;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19920
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;240.197.168.192.in-addr.arpa. IN PTR

;; ANSWER SECTION:
240.197.168.192.in-addr.arpa. 38400 IN PTR oralab-gns.oracle.com.

;; AUTHORITY SECTION:
197.168.192.in-addr.arpa. 38400 IN NS dnssrv.oracle.com.

;; ADDITIONAL SECTION:
dnssrv.oracle.com. 38400 IN A 192.168.197.100

;; Query time: 3 msec


;; SERVER: 192.168.197.100#53(192.168.197.100)
;; WHEN: Wed Sep 22 09:40:49 2021
;; MSG SIZE rcvd: 118
-- /etc/hosts
127.0.0.1 localhost localhost.localdomain
192.168.197.131 rac1.oracle.com rac1
192.168.197.132 rac2.oracle.com rac2
192.168.187.133 rac3.oracle.com rac3
192.168.42.131 rac1-priv.oracle.com rac1-priv
192.168.42.132 rac2-priv.oracle.com rac2-priv
192.168.42.133 rac3-priv.oracle.com rac3-priv
192.168.197.100 dnssrv.oracle.com dnssrv

--
VBoxManage clonehd D:\RAC_LAB_SGCTT\Share_disk\OCR_DISK.vdi D:\RAC_LAB_SGCTT_GNS\
Share_disk\OCR_DISK.vdi
--
[root@rac1 ~]# ifconfig -a | grep eth
eth3 Link encap:Ethernet HWaddr 08:00:27:33:B9:0A
eth4 Link encap:Ethernet HWaddr 08:00:27:70:0C:64
eth5 Link encap:Ethernet HWaddr 08:00:27:D0:E0:0C
--
rm -f /etc/udev/rules.d/70-persistent-net.rules
-- Cau hinh asm
[root@rac1 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x4843928d.
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)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to


switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n


Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1566, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1566, default 1566):
Using default value 1566

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.
--ca rac1 va rac2
[root@rac1 ~]# /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 []: oracle


Default group to own the driver interface []: oinstall
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@rac2 network-scripts]# /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 []: oracle


Default group to own the driver interface []: oinstall
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 ]
-- init asm tren ca hai node
[root@rac1 mnt]# /usr/sbin/oracleasm init
[root@rac1 mnt]# ssh rac2 /usr/sbin/oracleasm init
root@rac2's password:
--tren rac1
/etc/init.d/oracleasm createdisk OCR_DISK /dev/sdb1
-- Tren rac 1 va rac2
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
OCR_DISK
--
[root@rac2 network-scripts]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac2 network-scripts]# /etc/init.d/oracleasm listdisks
OCR_DISK
--
Cluster Name : oralab
SCAN Name : oralab-scan.oralab.oracle.com
SCAN Port: : 1521
GNS Sub Domain : oralab.oracle.com
GNS VIP Address : 192.168.197.240
--
perl /u01/app/12.1.0.2/grid/crs/install/rootcrs.pl -verbose -deconfig -force

perl /u01/app/12.1.0.2/grid/crs/install/rootcrs.pl -verbose -deconfig -force -


lastnode
-- Deinstall
cd /u01/app/12.1.0.2/grid/deinstall/
[oracle@rac1 deinstall]$ export ORACLE_HOME=$GRID_HOME
[oracle@rac1 deinstall]$ ./deinstall
dd if=/dev/zero of=/dev/sdb1 bs=1024 count=100
/etc/init.d/oracleasm deletedisk OCR_DISK /dev/sdb1
/etc/init.d/oracleasm createdisk OCR_DISK /dev/sdb1
/etc/init.d/oracleasm createdisk MGMT_DISK /dev/sdc1
./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup

You might also like