Use bare devices to expand database tablespaces

Source: Internet
Author: User
Welcome to the Oracle Community Forum, interact with 2 million technical staff to enter the hardware environment: minicomputer IBMP670, storage: IBMSHARKF-20 software environment: Operating System AIX5.1 database oracle9i theme: physical volume PV -; volume group VG-; logical Volume LV (type: raw)-; add tablespace operation procedure: 1. First # lsvg?

Welcome to the Oracle Community Forum, interact with 2 million technical staff> enter the hardware environment: minicomputer IBM P670, storage: ibm shark F-20 software environment: Operating System AIX5.1 database oracle9i theme: physical Volume PV-; volume group VG-; logical Volume LV (type: raw)-; add tablespace operation process: 1. First # lsvg?

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

Hardware environment: minicomputer IBM P670, storage: ibm shark F-20
Software environment: Operating System AIX5.1 database oracle9i
Theme: physical volume PV->; volume group VG->; logical Volume LV (type: raw)->; add tablespace

Procedure:
I. First # lsvg? O // view all available volume groups
Datavg03
Datavg02
Datavg01
Datavg00
Rootvg

2. perform the following operations on the volume group used for database preparation:
# Lsvg? L datavg03
Datavg09:
Lv name type LPs PPs PVs LV STATE MOUNT POINT
Lvdata0316 raw 64 64 1 open/syncd N/
Lvdata0317 raw 64 64 1 open/syncd N/
Lvdata0318 raw 64 64 1 closed/syncd N/
Lvdata0319 raw 64 64 1 closed/syncd N/
Lvdata0320 raw 64 64 1 closed/syncd N/
Lvdata0321 raw 64 64 1 closed/syncd N/
Lvdata0322 raw 64 64 1 closed/syncd N/
Lvdata0323 raw 64 64 1 closed/syncd N/
Lvdata0324 raw 64 64 1 closed/syncd N/
Lvdata0325 raw 64 64 1 closed/syncd N/
Lvdata0326 raw 64 64 1 closed/syncd N/
Lvdata0327 raw 64 64 1 closed/syncd N/
Lvdata0328 raw 64 64 1 closed/syncd N/
Lvdata0329 raw 64 64 1 closed/syncd N/
Lvdata0330 raw 64 64 1 closed/syncd N/

As shown in the following figure, 13 logical volumes (raw devices) in the volume group are not used. (if no logical volumes in the closed/syncd status are displayed, go to step 1) but how can we know how large these 13 logical volumes are? You can use the following command:
# Lslv lvdata0315
Logical volume: lvdata0309 volume group: datavg09
Lv identifier: 0037de1d4154c0000000105cd3b6816. 11 PERMISSION: read/write
Vg state: active/complete lv state: opened/syncd
TYPE: raw write verify: off
MAX LPs: 512 pp size: 64 megabyte (s)
COPIES: 1 sched policy: parallel
LPs: 64 PPs: 64
STALE PPs: 0 bb policy: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle upper bound: 32.
Mount point: N/a label: None
Mirror write consistency: on/ACTIVE
Each lp copy on a separate pv? : Yes

We can see that the physical partition size is 64 M. Because it is in the same volume group, we can know that the size of all physical partitions is 64 M. From the display result of lsvg-l datavg09, we can see that PPs: therefore, the SIZE of each logical volume is: LPs × pp size = 64*64 M = 4096 M = 4G. We can see that there are 13 4G logical volumes, not used.
However, it is not completely guaranteed that these 13 logical volumes can be used to expand the tablespace of the database, because we do not know the owner of these bare devices, so the following steps are required:
# Cd/dev
# Ls? L rlvdata03 * // display file attributes starting with rlvdata03
Crw-rw ---- 1 oracle dba 58, 20 Aug 22 :33 rlvdata0318
Crw-rw ---- 1 oracle dba 58, 21 Aug 22 :35 rlvdata0319
Crw-rw ---- 1 oracle dba 58, 22 Aug 22 :37 rlvdata0320
Crw-rw ---- 1 oracle dba 58, 23 Aug 22 :35 rlvdata0321
Crw-rw ---- 1 oracle dba 58, 24 Aug 22 :37 rlvdata0322
Crw-rw ---- 1 oracle dba 58, 25 Aug 22 :39 rlvdata0323
Crw-rw ---- 1 oracle dba 58, 26 Aug 22 :39 rlvdata0324
Crw-rw ---- 1 oracle dba 58, 27 Aug 19 16:14 rlvdata0325

The query results show that the owner of the bare device is oracle, and oracle can add these bare devices. However, if the owner of the bare device is not oracle but other users, you need
# Chown oracle: dab rlvdata03 * // be careful when modifying the data according to actual conditions
3. You can log on to the database by adding a tablespace. you can log on to the database by using a user with the permission to create or modify the tablespace (there are multiple methods). Take sqlplus as an example:
# Su-oracle
$ Sqlplus/nolog

SQL * Plus: Release 9.2.0.5.0-Production on Mon Aug 22 12:49:55 2005

Copyright (c) 1982,200 2, Oracle Corporation. All rights reserved.

SQL>; conn/as sysdba
Connected.
SQL>; alter tablespace ts_index add datafile
2 '/dev/rlvdata0318' size 4090; // The size is 4090 instead of 4096. If 4096 is all used, it is prone to errors.
SQL>; Tablespace altered

You can perform the preceding operations to add other bare devices to expand the tablespace.
However, if the above 13 logical volumes cannot meet the expansion requirements, continue with the following steps:

Iv. # lsvg datavg09 // view the volume group information and usage to check whether there is sufficient space.
Volume group: datavg09 vg identifier: 0037de1d00004c000000010
5cd3b6816
Vg state: active pp size: 64 megabyte (s)
Vg permission: read/write TOTAL PPs: 2605 (166720 megabytes)
MAX LVs: 256 FREE PPs: 557 (35648 megabytes)
LVs: 32 USED PPs: 2048 (131072 megabytes)
OPEN LVs: 16 QUORUM: 3
TOTAL PVs: 5 vg descriptors: 5
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 5 auto on: no
MAX PPs per PV: 1016 MAX PVs: 32
LTG size: 128 kilobyte (s) auto sync: no
Hot spare: no

The displayed information shows that the volume group currently has a space of 35648M. You can perform the following operations:
# Mklv-y 'lvdata0331 '-t 'raw' datavg09 64
Note: On the volume group datavg09, create the logical volume lvdata0331. The logical volume type is raw, and the logical volume lps is 64.
If the logical volume is too large, the database performance will be affected. Therefore, it is not recommended to create a large bare device.
Then proceed to the '3' section above
However, if all the current volume groups are used up and there is no volume group that can be used to add bare devices, you must create a volume group.
5. Before creating a volume group, let's first check whether there are available physical volumes.
# Lspv
Vpath53 000b273dbe31ff50 datavg03
Vpath54 000b273dbe320138 datavg03
Vpath55 000b273dbe320303 datavg03
Vpath56 000b273dbe320795 None
Vpath57 000b273dbe320a46 None
Vpath58 000b273dbe320c29 None

We can see that vpath56, vpath57, and vpath58 are not used by the backup volume group. Because the storage in the current environment is provided as a disk array, the vpath specifies the size on the array. The so-called "physical volume" recognized by the Minicomputer System (in fact, the real physical volume, it should be
Hdisk ).
# Mkvg-f-y 'datavg04 '-S' 64'-n' vpath56 vpath57 vpath58
Note: vpath56 vpath57 vpath58 is used to create the volume group datavg04 and the physical partition size is 64 MB.
After the volume group is created, repeat the previous steps to complete the process.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.