دیتابیس اوراکل

دیتابیس اوراکل
طبقه بندی موضوعی

۳ مطلب با موضوع «Oracle Linux» ثبت شده است

Create LVM in Oracle Linux

1- lsblk

 

 

 

 

 

 

 

 

2- fdisk /dev/sda (add a new partition)

3- pvcreate /dev/sda4

4- pvscan

5- pvdisplay

6- pvs

7- vgcreate vg_bk /dev/sda4

8- vgdisplay

9- vgs

10- lvcreate -l 100%FREE -n backup vg_bk (OR lvcreate -L 500G -n backup vg_bk)

11- lvs

12- mkfs.xfs /dev/vg_bk/backup

13- lsblk

14- mkdir /BK

15- mount  /dev/vg_bk/backup /BK

16- chown -R oracle:oinstall /BK

17- chmod -R 775 /BK

18- df -h

آماده سازی دیسک ها با EMC PowerPath و Oracle ASMLIB قبل از نصب Oracle Grid

Oracle Linux Server release = 7.5

EMC PowerPath version = DellEMCPower.LINUX-6.5.0.00.00-067.OL7.x86_64.rpm

 

انجام کارهای مربوط به PowerPath

 

  1. نصب پکیج DellEMCPower

[root@TEST ~]# yum localinstall DellEMCPower.LINUX-6.5.0.00.00-067.OL7.x86_64.rpm

 

  1. استارت کردن سرویس PowerPath در لینوکس

[root@TEST ~]# systemctl start PowerPath.service

[root@TEST ~]# systemctl enable PowerPath.service

[root@TEST ~]# systemctl status PowerPath.service

 

  1. رجیستر کردن EMC PowerPath

[root@TEST ~]# emcpreg -install

===========   Dell EMC PowerPath Registration ===========

Do you have a new registration key or keys to enter?[n] y

                  Enter the registration keys(s) for your product(s),

                  one per line, pressing Enter after each key.

                  After typing all keys, press Enter again.

 

Key (Enter if done): **emc-powerpath-license-key**

1 key(s) successfully added.

Key successfully installed.

 

[root@TEST ~]# powermt check_registration

**emc-powerpath-license-key**

  Product: PowerPath

  Capabilities: ALL

 

  1. برای اینکه مطمئن شویم تنظیمات PowerPath، بعد از ریستارت کردن host به همین شکل باقی می­ ماند، باید دستور زیر را اجرا کنیم.

[root@TEST]# powermt save

 

  1. با دستور زیر می­توانیم وضعیت hbaهای موجود را مشاهده کنیم. همانطور که در خروجی دستور مشخص است، دو hba به سرور ما متصل هستند و هر دو hba در وضعیت enable قرار دارند.

[root@TEST ~]# powermt display hba_mode

VNX logical device count=4

==============================================================================

----- Host Bus Adapters ---------  ------ I/O Paths -----  Stats

###  HW Path                       Summary   Total   Dead  Q-IOs Mode

==============================================================================

   0 qla2xxx                       optimal       0      0       0  Enabled

   4 qla2xxx                       optimal       0      0       0  Enabled

 

  1. برای اسکن کردن hbaها و کانفیگ کردن deviceهای جدید، دستور زیر را اجرا می­ کنیم.

[root@TEST ~]# /etc/opt/emcpower/emcplun_linux scan 0

WARNING: Dell EMC recommends that all I/O on the SCSI devices should be quiesced prior to attempting to rescan the SCSI bus.

Continue operation? [y,q->quit]: y

---------------------------------------------------------------------

Scanning qla SCSI host number: 0

---------------------------------------------------------------------

INFO: 'powermt config' is required to recognize the new LUN(s) under PowerPath

Continue operation? [y,n,q->quit]: y

---------------------------------------------------------------------

INFO: Executing 'powermt config', please wait ...

---------------------------------------------------------------------

INFO: Executing 'powermt save'

---------------------------------------------------------------------

INFO: Following new device(s) discovered

------------------------------------------------------------------------------------------------

Pseudo Dev      :Array ID       :Logical Dev    :Native Dev(s)=SCSI Address

------------------------------------------------------------------------------------------------

emcpowerb       :CKM00133604349 :P02Live_REDO01_LUN     :sdq=0:0:1:1     sdn=0:0:0:1

emcpowerc       :CKM00133604349 :P02Live_FRA01_LUN      :sdr=0:0:1:2     sdo=0:0:0:2

emcpowerd       :CKM00133604349 :P02LIVE_DATA_LUN02     :sds=0:0:1:3     sdp=0:0:0:3

دستور بالا را مجددا برای hba 4 هم اجرا می­کنیم:

[root@TEST ~]# /etc/opt/emcpower/emcplun_linux scan 4

 

  1. دستور زیر یکی از دستورهای کاربردی است که با استفاده از آن میتوان وضعیت تمامی logical deviceهای متصل به سرور را مشاهده کرد.

[root@TEST ~]# powermt display dev=all

Pseudo name=emcpowera

VNX ID=CKM00133604349 [P02LIVE_SG]

Logical device ID=60060160D3F035008B8C01E0F41CEB11 [P02LIVE_DATA_LUN01]

state=alive; policy=CLAROpt; queued-IOs=0

Owner: default=SP A, current=SP A       Array failover mode: 4

==============================================================================

--------------- Host ---------------   - Stor -  -- I/O Path --   -- Stats ---

###  HW Path               I/O Paths    Interf.  Mode     State   Q-IOs Errors

==============================================================================

   0 qla2xxx                sdb        SP A1     active   alive      0      0

   0 qla2xxx                sdc        SP B2     active   alive      0      0

   4 qla2xxx                sdg        SP A2     active   alive      0      0

   4 qla2xxx                sdh        SP B1     active   alive      0      0

 

Pseudo name=emcpowerb

VNX ID=CKM00133604349 [P02LIVE_SG]

Logical device ID=60060160D3F03500186C96B2ED1CEB11 [P02Live_REDO01_LUN]

state=alive; policy=CLAROpt; queued-IOs=0

Owner: default=SP B, current=SP B       Array failover mode: 4

==============================================================================

--------------- Host ---------------   - Stor -  -- I/O Path --   -- Stats ---

###  HW Path               I/O Paths    Interf.  Mode     State   Q-IOs

==============================================================================

  4 qla2xxx                sdw        SP B1     active   alive      0      0

   4 qla2xxx                sdt        SP A2     active   alive      0      0

   0 qla2xxx                sdq        SP B2     active   alive      0      0

   0 qla2xxx                sdn        SP A1     active   alive      0      0

 

Pseudo name=emcpowerc

VNX ID=CKM00133604349 [P02LIVE_SG]

Logical device ID=60060160D3F035006C904CABEB1CEB11 [P02Live_FRA01_LUN]

state=alive; policy=CLAROpt; queued-IOs=0

Owner: default=SP A, current=SP A       Array failover mode: 4

==============================================================================

--------------- Host ---------------   - Stor -  -- I/O Path --   -- Stats ---

###  HW Path               I/O Paths    Interf.  Mode     State   Q-IOs Errors

==============================================================================

   4 qla2xxx                sdx        SP B1     active   alive      0      0

   4 qla2xxx                sdu        SP A2     active   alive      0      0

   0 qla2xxx                sdr        SP B2     active   alive      0      0

   0 qla2xxx                sdo        SP A1     active   alive      0      0

 

Pseudo name=emcpowerd

VNX ID=CKM00133604349 [P02LIVE_SG]

Logical device ID=60060160D3F03500CE6361F0F41CEB11 [P02LIVE_DATA_LUN02]

state=alive; policy=CLAROpt; queued-IOs=0

Owner: default=SP B, current=SP B       Array failover mode: 4

==============================================================================

--------------- Host ---------------   - Stor -  -- I/O Path --   -- Stats ---

###  HW Path               I/O Paths    Interf.  Mode     State   Q-IOs Errors

==============================================================================

   4 qla2xxx                sdy        SP B1     active   alive      0      0

   4 qla2xxx                sdv        SP A2     active   alive      0      0

   0 qla2xxx                sds        SP B2     active   alive      0      0

   0 qla2xxx                sdp        SP A1     active   alive      0      0

 

انجام کارهای مربوط به Oracle ASMLIB

  1. نصب پکیج­های oracleasm

[root@TEST ~]# yum install -y oracleasm-support.x86_64

پکیج زیر در dvd مربوط به Oracle Linux 7.5 وجود نداشت و به صورت جداگانه دانلود شد.

[root@TEST ~]# yum localinstall oracleasmlib-2.0.12-1.el7.x86_64.rpm

[root@TEST ~]# rpm -qa |grep oracleasm

oracleasmlib-2.0.12-1.el7.x86_64

oracleasm-support-2.1.11-2.el7.x86_64

 

  1. کانفیگ کردن oracleasm

[root@TEST ~]# /usr/sbin/oracleasm configure -i

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

 

[root@TEST ~]# /usr/sbin/oracleasm init

Creating /dev/oracleasm mount point: /dev/oracleasm

Loading module "oracleasm": oracleasm

Configuring "oracleasm" to use device physical block size

Mounting ASMlib driver filesystem: /dev/oracleasm

 

  1. برای پارتیشن کردن دیسک­ها مراحل زیر را انجام می­دهیم.

[root@TEST ~]# fdisk -l /dev/emcpowera

Disk /dev/emcpowera: 1099.5 GB, 1099511627776 bytes, 2147483648 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

 

همانطور که در بالا مشاهده می ­شود، برای این دیسک پارتیشنی وجود ندارد. برای پارتیشن کردن آن به تریتب دستورهای زیر را اجرا می­ کنیم.

­[root@TEST ~]# parted /dev/emcpowera mklabel msdos

[root@TEST ~]# fdisk -l /dev/emcpowera

Disk /dev/emcpowera: 1099.5 GB, 1099511627776 bytes, 2147483648 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x0003e25f

 

[root@TEST ~]# parted /dev/emcpowera mkpart p 0% 100%

[root@TEST ~]# fdisk -l /dev/emcpowera

Disk /dev/emcpowera: 1099.5 GB, 1099511627776 bytes, 2147483648 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x0003e25f

 

         Device Boot      Start         End      Blocks   Id  System

/dev/emcpowera1            2048  2147483647  1073740800   83  Linux

دستورات بالا را برای هریک از deviceهای emcpowerb، emcpowerc و emcpowerd هم اجرا می­ کنیم.

 

  1. زدن label روی دیسک­ها با استفاده از oracleasm

[root@TEST ~]# oracleasm createdisk P02LIVE_DATA_LUN01 /dev/emcpowera1

[root@TEST ~]# oracleasm createdisk P02LIVE_DATA_LUN01 /dev/emcpowerb1

[root@TEST ~]# oracleasm createdisk P02LIVE_DATA_LUN01 /dev/emcpowerc1

[root@TEST ~]# oracleasm createdisk P02LIVE_DATA_LUN01 /dev/emcpowerd1

 

  1. با استفاده از دستور زیر می­ توانیم لیست دیسک­های label زده شده توسط oracleasm را مشاهده کنیم.

[root@TEST ~]# oracleasm listdisks

P02LIVE_DATA_LUN01

P02LIVE_DATA_LUN02

P02LIVE_FRA01_LUN

P02LIVE_REDO01_LUN

 

[root@TEST ~]# oracleasm-discover

Using ASMLib from /opt/oracle/extapi/64/asm/orcl/1/libasm.so

[ASM Library - Generic Linux, version 2.0.12 (KABI_V2)]

Discovered disk: ORCL:P02LIVE_DATA_LUN01 [2147481600 blocks (1099510579200 bytes), maxio 1024, integrity none]

Discovered disk: ORCL:P02LIVE_DATA_LUN02 [2147481600 blocks (1099510579200 bytes), maxio 1024, integrity none]

Discovered disk: ORCL:P02LIVE_FRA01_LUN [1048573952 blocks (536869863424 bytes), maxio 1024, integrity none]

Discovered disk: ORCL:P02LIVE_REDO01_LUN [356513792 blocks (182535061504 bytes), maxio 1024, integrity none]

 

  1. برای اینکه ASMLIB هر بار موقع استارت شدن فقط سراغ دیسک­های powerpath برود و بقیه دیسک­ ها را scan نکند، باید در فایل  etc/sysconfig/oracleasm/  تغییرات زیر اعمال شود.

[root@TEST ~]# vim /etc/sysconfig/oracleasm

# ORACLEASM_ENABLED: 'true' means to load the driver on boot.

ORACLEASM_ENABLED=true

# ORACLEASM_UID: Default user owning the /dev/oracleasm mount point.

ORACLEASM_UID=oracle

# ORACLEASM_GID: Default group owning the /dev/oracleasm mount point.

ORACLEASM_GID=oinstall

# ORACLEASM_SCANBOOT: 'true' means scan for ASM disks on boot.

ORACLEASM_SCANBOOT=true

# ORACLEASM_SCANORDER: Matching patterns to order disk scanning

ORACLEASM_SCANORDER="emcpower"

# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan

ORACLEASM_SCANEXCLUDE="sd dm-"

 

 

 

 

 

HugePage

وقتی که یک پروسس میخواهد از memory استفاده کند ، CPU  یک تکه از RAM را به آن اختصاص میدهد. در واقع CPU به اندازه یک  4k bytes ) chunk ) حافظه را به پروسس اختصاص میدهد. هر یک از اون chunkها یک page نامیده میشوند.

 

از اونجایی که آدرس فضایی که به یک پروسس اختصاص داده میشود ( همان pageها )  به صورت virtual است ، CPU و OS مجبور هستند که به خاطر بسپارند که هر page به چه process اختصاص دارد و  در کجا ذخیره شده است.

 

اگر تعداد pageها زیاد باشد ، این موضوع زمان زیادی میبرد و همچنین فضای زیادی اشغال میشود.

 

فرض کنید یک پروسس به 1G از ram نیاز دارد. اگر این 1G را بر اون 4K تقسیم کنیم ، باید در page table به اندازه  262144  ، entry وارد شود (1GB/4K) . اگر فرض کنید هر entry در Page Table  حدود 8bytes فضا مصرف میکند کل فضایی که فقط برایی ذخیره آدرس فیزیکی مصرف شده است  (2MB(262144*8 است. که وقتی تعداد پروسس ها زیاد شود هم فضای زیادی اشغال میشود هم جستجو در این page table سخت تر میشود.

 

در حال حاضر در معماری CPUهای جدید ، Pageها میتوانند اندازه بزرگتری داشته باشند.

 

نکته 1 ) اگر hardware شما پشتیبانی کند سایز Huge Page حداکثر میتواند 1G باشد.