2015년 1월 11일 일요일

crs 명령어 정리

1.check
1) CRS stack의 서비스 실행 여부 확인
/u01/app/grid/bin# crsctl check crs
2)전체 노드상의 CRS stack 상태 확인
/u01/app/grid/bin# crsctl check cluster -all
3)명령어 : crsctl check cluster -n 노드명
root@exadatadb01:/u01/app/grid/bin# crsctl check cluster -n exadatadb
**************************************************************
edwdb01t:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
root@exadatadb01:/u01/app/grid/bin# crsctl check cluster -n exadatadb
**************************************************************
exadatadb:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
4) CRS autostart 설정 확인 및 변경
- crsctl config crs
- crsctl enable crs
- crsctl disable crs
2. DB node 확인
srvctl status database -d <db_unique_name>
srvctl start database -d <db_unique_name>
srvctl config database -d 디비명
srvctl config nodeapps -a -g -s
3.listener 확인
srvctl status scan_listener
srvctl config scan_listener
4.cluster
- 시작
$ srvctl start instance -d <db_unique_name> -i <인스턴스명>
$ srvctl start asm -n 노드명
$ srvctl start nodeapps -n 노드명
-종료
$ srvctl stop instance -d <db_unique_name> -i <인스턴스명>
$ srvctl stop asm -n 노드명

$ srvctl stop nodeapps -n 노드명

Network for Solaris11

Network Configuration in solaris 11
network configuration in solaris 11 using ipadm command

root@hari:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 up --
net1 phys 1500 unknown --
net2 phys 1500 unknown --
root@hari:~#

---here I am using net1 and net2 for demo purpose:
----How to give the ip address in solaris 11 ?

1.plumb the interface
2.give the ip for the inferface
3.Add the entries into /etc /hosts file


root@hari:~# ipadm help
The following subcommands are supported:
Address : create-addr delete-addr disable-addr
down-addr enable-addr refresh-addr
reset-addrprop set-addrprop show-addr
show-addrprop up-addr
Interface : disable-if enable-if reset-ifprop
set-ifprop show-if show-ifprop
IP interface : create-ip delete-ip
IPMP interface : add-ipmp create-ipmp delete-ipmp
remove-ipmp
Protocol property : reset-prop set-prop show-prop
VNI interface : create-vni delete-vni
For more info, run: ipadm help <subcommand>
root@hari:~#

root@hari:~# ipadm create-ip net1
------It plumbs interface.

root@hari:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 up --
net1 phys 1500 up --
net2 phys 1500 unknown --


root@hari:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip down no --
root@hari:~#


root@hari:~# ipadm create-addr -T static -a 192.168.29.167/24 net1/v4

root@hari:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 192.168.29.166/24
net1/v4 static ok 192.168.29.167/24
lo0/v6 static ok ::1/128
root@hari:~#

root@hari:~# ifconfig net1
net1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
inet 192.168.29.167 netmask ffffff00 broadcast 192.168.29.255
ether 0:c:29:4d:db:74
root@hari:~# ping 192.168.29.167
192.168.29.167 is alive
root@hari:~#

---add the entry into /etc/hosts file as below.

root@hari:~# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
192.168.29.166 hari
192.168.29.167 net1-ip
root@hari:~#
##################To delete the ip address in solaris 11#########

root@hari:~# ipadm delete-ip net1

---It deletes ip and unplumb the interface

root@hari:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip ok -- --
net0/v4 static ok -- 192.168.29.166/24
root@hari:~#

--comment the entry in the /etc/hosts file

root@hari:~# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
192.168.29.166 hari
##192.168.29.167 net1-ip
root@hari:~#

------------------ipmp configuration in solaris 11____________________

steps:
1.Take 2 Nic cards and plumb both of them.
2.Give the ip addresses as below
3.Create one ipmp group
4.Add the interfaces into ipmp group
5.Give the ip address for the ipmp group




Demo:
root@hari:~# ipadm create-ip net1
root@hari:~# ipadm create-ip net2

root@hari:~# ipadm create-addr -T static -a 192.168.29.161/24 net1/v4
root@hari:~# ipadm create-addr -T static -a 192.168.29.162/24 net2/v4

root@hari:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip ok -- --
net0/v4 static ok -- 192.168.29.166/24
net1 ip ok -- --
net1/v4 static ok -- 192.168.29.161/24
net2 ip ok -- --
net2/v4 static ok -- 192.168.29.162/24

root@hari:~# ipadm create-ipmp ipmp0

root@hari:~# ipadm add-ipmp -i net1 -i net2 ipmp0

root@hari:~# ipadm create-addr -T static -a 192.168.29.163/24 ipmp0/v4
Example >

ipadm create-ipmp -i eth1,eth2 bondeth0
ipadm create-addr -T static -a 202.31.182.131/24 bondeth0/v4

root@hari:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip ok yes --
net2 ip ok yes --
ipmp0 ipmp ok yes net1 net2
root@hari:~#

Add the entry in the /etc/hosts file.
root@hari:~# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
192.168.29.166 hari
##192.168.29.167 net1-ip
192.168.29.163 ipmp0-ip
root@hari:~# ping ipmp0-ip
ipmp0-ip is alive
root@hari:~#


---------How to delete ipmp in solaris 11-------



root@hari:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip ok yes --
net2 ip ok yes --
ipmp0 ipmp ok yes net1 net2
root@hari:~# ipadm delete-ipmp ipmp0

ipadm: cannot delete IPMP interface ipmp0: IPMP group is not empty

2015년 1월 7일 수요일

OSWatcher / ExaWatcher archive data 추출 하는 방법

Exadata image버젼에 따라 해당 디렉토리가 달라 집니다.이유는 exadata image버젼에 따라 제품 이름이 달라졌습니다.

11.2.3.3.0이전 버젼은 OSwatcher라고 해서 "/opt/oracle.oswatcher/osw/archive/"를 사용을 했고,11.2.3.3.0이상의 상위 버젼으로 올라 오면서 ExaWatcher라고 해서 "/opt/oracle.ExaWatcher/archive/"를 사용을 하게 됩니다.
해당 디렉토리에소 시스템 모니터링을 하게 되는 component들에 대한 하위 디렉토리에 시간대별 시스템 로깅 데이타를 수집을 하게 됩니다.

따라서 특정 문제가 발생을 했던 시간대 데이타만 수집을 할 필요가 있을때 아래와 같이 수집을 하시면 됩니다.
<Before 11.2.3.3 >
----------------
find /opt/oracle.oswatcher/osw/archive/. -name "*14.05.13.1[1-2]00*" -exec zip /tmp/osw_`hostname -a`_0711.zip {} \;

<After 11.2.3.3 or higher >
--------------------------

find /opt/oracle.ExaWatcher/archive/. -name "*2014_05_13_1[1-2]*" -exec zip /tmp/osw_`hostname -a`_20140513.zip {} \;

CISCO switch ip 변경 방법

 Cisco : 기존 IP telnet으로 접속
Switch> enable
Switch# configure terminal
Switch (config) # interface vlan 1
Switch (config-if) # ip address 변경할IP 255.255.255.0

--> 시점에서 network 끊김니다. (ip 변경되었으므로)
변경한 ip 다시 telnet 접속합니다.
Switch> enable
Switch# copy running-config startup-config
Switch# write memory

Switch# exit

2015년 1월 6일 화요일

vsftp and telnet 설정 하기

1.Package 구하기
아래사이트는 Oracle사의 Yum Server 버젼별 모든 RPM 있습니다.
위사이트 화면 밑에 있는 "Browse the Repositories" 해당 RPM 받습니다.
  • Check : 내가 설치할 시스템의 버젼 정보 확인
#cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
#uname -a
Linux.oradb01.kr.oracle.com 2.6.32-400.21.1.el5uek

에서 관련 화일을 받아서 설치할 서버에 winscp uploading 합니다.

  • telnet-server-0.17-39.el5.x86_64.rpm
  • vsftpd-2.0.5-24.el5.x86_64.rpm
2. telnet 설치 하기
[root@oradb01  ~]# rpm -Uvh telnet-0.17-39.el5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:telnet                 ########################################### [100%]
[root@oradb01 ~]# which telnet
/usr/bin/telnet

2.1 telnet 환경 화일 수정 하기
  • /etc/xinetd.d/telnet 화일 수정

# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        disable         = no   <==== default yes
}
  • root login enable하려면 ( 회사 보안 정책과 협의 사항 )
* root 로긴은 기본적으로 막혀있음.
/etc/securetty pts/1 ~ pst/9 추가하면 root login 가능하며
화일을 다른 이름으로 변경을 해 버려도 됩니다.
or
$mv /etc/securetty /etc/securetty.old 해도 root login 가능

  • /etc/hosts.allow 화일 수정
sshd : ALL
snmpd : ALL
in.telnetd : ALL            <=== 추가
ALL : localhost
  • 서비스 daemon start
[root@oradb01 etc]# service xinetd restart
Stopping xinetd: [  OK  ]
Starting xinetd: [  OK  ]

  • telnet client 설치 (옵션사항으로 server용 telnet client 설치 하기시 바랍니다.)




3. vsftp 설치 하기( rpm -Uvh vsftpd-2.0.5-24.el5.x86_64.rpm )

 3.1 /etc/hosts.allow 추가 아래 내용 추가
  • vsftpd : ALL
 3.2 /etc/vsftpd/vsftpd.conf 수정 ( 아래 내용 밑에 추가 )
  • ftp_username=nobody
 3.3 /etc/vsftpd/ 있는 사용자 주석처리
  • /etc/vsftpd/user_list  /etc/vsftpd/ftpusers 사용할 user 주석처리
 3.4 서비스 restart

[root@oradb01 etc]# service xinetd restart
Stopping xinetd: [  OK  ]
Starting xinetd: [  OK  ]

4.서비스 daemon run level 등록 
4.1 서비스 run level 확인
[root@krx3bdb01 ~]# chkconfig --list | grep vsftp
vsftpd          0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@krx3bdb01 ~]# chkconfig --list | grep xinetd
xinetd          0:off   1:off   2:off   3:off   4:off   5:off   6:off
 4.2 run level 변경 ( 부팅시에 자동 실행하기 위해 )
[root@krx3bdb01 ~]# chkconfig vsftpd on
[root@krx3bdb01 ~]# chkconfig --list | grep vsftp
vsftpd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@krx3bdb01 ~]# chkconfig --level 2345 xinetd on
[root@krx3bdb01 ~]# chkconfig --list | grep xinetd
xinetd          0:off   1:off   2:on    3:on    4:on    5:on    6:off

두가지 방법 결과는 동일 합니다. ( run level 2,3,4,5에서 ON )

Linux filesystem label 재생성

리눅스 시스템에서 사용자 정의 label이 깨져 부팅시 문제가 될 경우 아래와 같은 방법으로
복구를 할 수 있습니다.
아래와 같이 /etc/fstab에는 여러가지 filesystem들 이 마운트 정보가 있습니다.


[root@exadatadb03:/ ] $ cat /etc/fstab
LABEL=DBSYS             /                       ext3    defaults        1 1
LABEL=BOOT              /boot                   ext3    defaults,nodev        1 1
LABEL=DBORA             /u01                    ext3    defaults,nodev  1 1
tmpfs                   /dev/shm                tmpfs   defaults,size=109697m 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP              swap                    swap    defaults        0 0
192.168.10.231:/export/share10  /cbrebckup      nfs     noauto,rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=1048576,wsize=1048576,actimeo=0   0 0
그중에서 2개의 label중 하나라도 문제가 발생이 되면 DBORA, DBSYS가 인식을 하지 못하고 부팅중 복구모드로 빠지게 됩니다.
일단 rescure모드 또는 single user모드 에서는 파일시스템이 read only 파일 시스템이므로 아래와 같이 root 파일 시스템을 재 마운트 합니다.
#mount o rw,remount  /

#root@exadatadb03:/etc# lvscan
 ACTIVE            '/dev/VGExaDb/LVDbSys1' [30.00 GB] inherit
 ACTIVE            '/dev/VGExaDb/LVDbSys2' [30.00 GB] inherit
 ACTIVE            '/dev/VGExaDb/LVDbSwap1' [24.00 GB] inherit
 ACTIVE            '/dev/VGExaDb/LVDbOra1' [100.00 GB] inherit

# e2label /dev/mapper/VGExaDb-LVDbSys1 DBSYS
#e2label  /dev/mapper/VGExaDb-LVDbOra1  DBORA

#reboot

Web base ilom를 사용을 위한 port 설정

Oracle Sun X86 시스템 에서 iLOM시스템을 remote web console로 사용을 하고 싶으면 아래 port 들이 firewall 상에서 open되어 있는지 확인해 보시기 바랍니다.

443 TCP HTTPS
5120 TCP Remote CD
5121 TCP Remote keyboard and mouse
5123 TCP Remote Floppy
6577 TCP CURI (API) - TCP and SSL
7578 TCP Video Data
161 UDP SNMP V3 Access

3072 UDP Trap Out (outgoing only)