Use LVM to build bare devices and build libraries on red Flag DC Server (Linux) ____linux

Source: Internet
Author: User
Tags chmod sybase

Use LVM to build bare devices and build libraries on red Flag DC server (Linux)

Some of the things you need to be aware of when creating LVM, creating raw device and building repositories.

In addition, using LVM allows you to dynamically add the size of the raw device to dynamically expand the size of the Oracle tablespace.

1 first create a primary partition: Fdisk/dev/hdb Create a partition/DEV/HDB5
2 Creating PV:PVCREATE/DEV/HDB5
3 Creating Vg:vgcreate ORACLEVG/DEV/HDB5
4 Create LV: There are several LV, each LV corresponds to 1 bare devices.
Oracle's SPFile redolog controlfile datafile, each of which uses 1 bare devices.
Lvcreate-l8m-nlv_spfile ORACLEVG on ORACLEVG to create 1 LV 8M of size, called Lv_spfile,
The other, just a little.

Note: 1 spfile LV should be at least 8M;
2 You must allocate more space to each Oracle file, or you will report a lack of space errors when you build the library.
For example, the undo tablespace specified 200M, the corresponding LV if only 200m, then the library will be in the error, larger.

Mknod/dev/raw/log1_3 C 162 16
Mknod/dev/raw/log1_4 C 162 17
Mknod/dev/raw/log2_3 C 162 18
Mknod/dev/raw/log2_4 C 162 19
5 to create a bare device:
Raw/dev/raw/raw1/dev/oraclevg/lv_spfile
Here, create a bare device called RAW1, using Lv_spfile. To create a raw controlfile for each spfile redolog datafile device.

Note: 1 After the creation is completed, check with RAW-QA query;
2 authorization, the default is root to access, to let Oracle use them, to
chmod 777/dev/raw
chmod 777/dev/raw/*
3 system reboot after the raw device information is not, in order to keep it permanently, to the raw device information recorded in the/etc/sysconfig/rawdevices file.
4 reboot after the authorization, that is, redo the 2nd step, you can add chmod statements to the/etc/rc.local file, so that the system automatically completed.
6 Login with Oracle user, set up raw device mapping file.
The raw device mapping file records the mapping information for Oracle's SPFile redolog controlfile datafile and raw devices. Used when building a library in DBCA.
VI Dbca_raw_config.txt
Spfile=/dev/raw/raw1
Control1=/dev/raw/raw2
Control2=/dev/raw/raw3
Control4=/dev/raw/raw4
Redo1_1=/dev/raw/raw5
Redo1_2=/dev/raw/raw6
Redo1_3=/dev/raw/raw7
System=/dev/raw/raw8
Sysaux=/dev/raw/raw9
Users=/dev/raw/raw10
Temp=/dev/raw/raw11
Undotbs1=/dev/raw/raw12


After the edit is complete, export dbca_raw_config=/u01/oracle/admin/dbca_raw_config.txt
Alternatively, you can specify a mapping relationship in DBCA without this step.

7 Here again, the various files specified in the DBCA are smaller than the corresponding bare devices, and if they are equal, they will report an error of insufficient space. The library will fail.
The rest of the building is the same as the common library. Don't say much.

8 dynamic enlargement of the LV size. Thereby dynamically expanding the size of Oracle's tablespace.

Sql> Select file#,name,bytes/1024/1024 MB from V$datafile;

Sql> Select file#,name,bytes/1024/1024 MB from V$datafile;

file# NAME MB
---------- ---------------------------------------- ----------
1/DEV/RAW/RAW6 300
2/DEV/RAW/RAW10 200
3/DEV/RAW/RAW7 120
4/DEV/RAW/RAW8 50

Raw8 corresponds to the Users table space, corresponding to the Lv_users

[Root@vm4 ~]# Lvscan
[Root@linux-oracle ~]# Lvscan
ACTIVE '/dev/oraclevg/lv_spfile ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_control1 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_control2 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_control3 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo01 ' [100.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo02 ' [100.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo03 ' [100.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_system ' [500.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_sysaux ' [252.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_users ' [100.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_temp ' [200.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_undo ' [500.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_test1 ' [500.00 MB] Inherit


The current LV size is 100mb,users tablespace used 98m

sql> ALTER DATABASE datafile 4 resize 60m;
ALTER DATABASE datafile 4 resize 60m
*
ERROR at line 1:
Ora-01237:cannot Extend DataFile 4
Ora-01110:data file 4: '/dev/raw/raw8 '
Ora-27042:not enough spaces on raw partition to Fullfill request
Additional Information:3

Spread to 60m, error not enough
then expand LV with Lvextend.

[Root@vm4 ~]# Lvscan
ACTIVE '/dev/oraclevg/lv_spfile ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_control ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo01 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo02 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo03 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_system ' [500.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_sysaux ' [252.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_users ' [52.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_temp ' [200.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_undo ' [300.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_control2 ' [8.00 MB] Inherit
[Root@vm4 ~]# Lvextend-l80m/dev/oraclevg/lv_users
Extending logical Volume Lv_users to 80.00 MB
Logical Volume lv_users successfully resized
[Root@vm4 ~]# Lvscan
ACTIVE '/dev/oraclevg/lv_spfile ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_control ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo01 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo02 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_redo03 ' [8.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_system ' [500.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_sysaux ' [252.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_users ' [80.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_temp ' [200.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_undo ' [300.00 MB] Inherit
ACTIVE '/dev/oraclevg/lv_control2 ' [8.00 MB] Inherit

Then, in Oracle, increase the users table space.

sql> ALTER DATABASE datafile 4 resize 60m;

Database altered.

Sql> Select file#,name,bytes/1024/1024 MB from V$datafile;

file# NAME MB
---------- ---------------------------------------- ----------
1/DEV/RAW/RAW6 300
2/DEV/RAW/RAW10 200
3/DEV/RAW/RAW7 120
4/DEV/RAW/RAW8 60

How to create a bare device by MKLV under AIX

MKLV Command function
Creates a logical volume.
Grammar:
MKLV [-A Position] [-B badblocks] [-c copies] [-D Schedule] [-e-Range] [-i] [-L-Label] [M-mapfile] [-O Y /N
] [-R Relocate] [-s Strict] [-t Type] [-u upperbound] [-v Verify] [-W mirrorwriteconsistency] [-xmaximum] [- Y
Newlogicalvolume | -y Prefix] [s stripesize] [-u Userid] [g Groupid] [P Modes] Volumegroup number [physicalvolume
... ]
-C copies set the number of mirrors, up to three, the default is 1-i from the standard input to obtain the PV style, this parameter only for PV through the standard input to join the situation
-L SETS the LV volume label with the default value of No. Maximum 127 characters, if the volume is used for JFS,JFS will use this value to record the mount point of the JFS in the LV
modes specifies the file mode license for the LV special file-T type to set the LV types. The standard type is jfs,jfslog,paging and can be used to define other LV types (except the boot type), default JFS
If you create a log for a file system, the user will use the Logform command to clear the new Jfslog before the log is used to use the command format alias for Logdev Lv:logform
/dev/logdev. -Y
NEWLV Specifies the name for the LV, which must be unique on this computer and can be 1-15 characters. If the VG is Varyon in concurrent mode, the new name should be unique across all concurrent nodes. The name
It cannot be the same as the prefix defined by the PDDV class in the device configuration database.
Example: Use MKLV to create a new LV in the datavg named Lv_control1, which corresponds to 1 PP per LP.
Mklv-t ' raw '-y ' lv_control1 '-u sybase-g Sybase datavg 1 Hdisk2

Database Operating Environment: AIX
Create a table space times the following error:

ORA-01119: Error creating database file '/dev/jc2_dzda_dat01.dbf '
Ora-27040:skgfrcre: Create error, cannot create file

IBM AIX RISC system/6000 Error:13:permisson denied

1, with the root user in/dev directory to establish the bare equipment:
Mklv-y ' jc2_dzda_dat01 ' Cxdatavg 2
Note that two files are generated jc2_dzda_dat01, rjc2_dzda_dat01, and the system uses only rjc2_dzda_dat01

2. Change RJC2_DZDA_DAT01 permissions to Oracle Users
Chown ORACLE:DBA rjc2_dzda_dat01

3, with Sqlplus or graphical interface to create a table space can be
Note here that the corresponding data file is rjc2_dzda_dat01, and the path is/dev

To create a script:
CREATE tablespace "Jc_dzda_dat"
LOGGING
DataFile '/dev/rjc2_dzda_dat01 ' SIZE 1024M reuse EXTENT MANAGEMENT local SEGMENT spaces
MANAGEMENT AUTO

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.