Detailed process of manually adding a tablespace In the RAC environment, and manually adding a tablespace In the rac Environment

Source: Internet
Author: User

Detailed process of manually adding a tablespace In the RAC environment, and manually adding a tablespace In the rac Environment

######################################## #####################
# Detailed process of manually adding a tablespace In the RAC environment #
##
# Beijing Zhongmei chuangyi Technology Co., Ltd #
# Yangzhiz1@chinacoal.com #
##
##
##
######################################## #####################


1,

Node 1 (db01) check:


[Oraprod @ db01 archivelog] $ lsvg-l sharevg1 | grep lv16_41
Lv16_41 raw 128 128 1 closed/syncd N/A -- check whether the format and usage are raw or close.
[Oraprod @ db01 archivelog] $
[Oraprod @ db01 archivelog] $ ls-alt/dev/rlv16_41
Crw-rw ---- 1 oraprod dba 50, 34 Aug 28/dev/rlv16_41 -- View permissions, which should belong to database users, the same below
[Oraprod @ db01 archivelog] $

2,
$ Lsvg-l sharevg1 | grep lv16_41
Lv16_41 raw 128 128 1 closed/syncd N/
$ Ls-alt/dev/rlv16_41
Crw-rw ---- 1 oraprod dba 50, 34 Aug 28 13:31/dev/rlv16_41
$

The file can be added to the verification result.

 

3. Enable sqlplus on any node
Execute the Add command:
SQL> ALTER TABLESPACE into _ts_media ADD DATAFILE '/dev/rlv16_41' SIZE 16000 M AUTOEXTEND OFF;
 
Tablespace altered.
 
SQL>
 
Prompt successful


4. View alarm log information:

Fri Aug 29 09:09:23 2014
Alter tablespace pai_ts_media add datafile '/dev/rlv16_41' SIZE 16000 M AUTOEXTEND OFF
WARNING: You are creating datafile/dev/rlv16_41.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. the command "/usr/sbin/mklv-y LVname-t o-w n-s n-r n VGname NumPPs" can be used. please contact Oracle customer support for more details.
Fri Aug 29 09:10:44 2014
WARNING: You are creating/reusing datafile/dev/rlv16_41.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. the command "/usr/sbin/mklv-y LVname-t o-w n-s n-r n VGname NumPPs" can be used. please contact Oracle customer support for more details.
Completed: alter tablespace into _ts_media add datafile '/dev/rlv16_41' SIZE 16000 M AUTOEXTEND OFF

The last line indicates that the operation is successfully added.

5. Verification results


5.1 Node 1 login like sqlplus
SQL> show parameter name
 
NAME TYPE VALUE
-----------------------------------------------------------------------------
Db_file_name_convert string
Db_name string PROD
Db_unique_name string PROD
Global_names boolean FALSE
Instance_name string PROD1
Lock_name_space string
Log_file_name_convert string
Service_names string
SQL> col file_name for a20
SQL> select file_id, file_name from dba_data_files where file_name like '% rlv16_41 % ';
 
FILE_ID FILE_NAME
------------------------------
252/dev/rlv16_41
 
SQL>

5.2 Node 2 login sqlplus

SQL> show parameter name;
 
NAME TYPE VALUE
-----------------------------------------------------------------------------
Db_file_name_convert string
Db_name string PROD
Db_unique_name string PROD
Global_names boolean FALSE
Instance_name string PROD2
Lock_name_space string
Log_file_name_convert string
Service_names string PROD
 
SQL> col file_name for a20
SQL> select file_id, file_name from dba_data_files where file_name like '% rlv16_41 % ';
 
FILE_ID FILE_NAME
------------------------------
252/dev/rlv16_41
 
SQL>

6. confirm that the configuration is successfully added.

 


 


In RAC, how does one expand the tablespace?

1. The operation is performed when the customer's business is idle.
2. Check whether the datavg has free space (the data file is on datavg). If yes, we can create a logical volume (bare device) on it ).
Lsvg datavg can view the remaining space. Only when there is space available can we create a bare device on it.
3. A. Use lsvg datavg to view the volume group pp size. The size of the volume group is 128 MB. Therefore, it is required to create 80 logical volumes of 10 Gb.
B. smitty lv
Add a logical volume. Five raw devices and five tablespaces are added this time. 10000 M respectively
Alternatively, run the mklv-y rac_xjsiqyb04 command (rac_xjsiqyb05, rac_xjsi05, rac_xjsi06, rac_xjsi07) datavg 80 raw (rac_xjsiqyb04) to name the new logical volume)
4. Check whether the access attribute of the new logical volume is oracle. If not, modify the access attribute to oracle.
A. ls-al
B. chown oracle: dba/dev/rrac_xjsiqyb04 (the other four also do this)
C. chmod 755/dev/rrac_xjsiqyb04)
D. Assign permissions to the owner five times on 10.200.5.8 respectively.
E. After all the operations are completed, you can expand the table space. You can do it on 5.6 or 5.8, Which is 10000 M respectively. Why is it not 10240M? The reason is that a certain amount of space should be reserved for the head of the bare device, and the application cannot cover this part when using the bare device; otherwise, the bare device will be damaged. Therefore, the actual available space of a bare device is the space allocated to the bare device and then the reserved space of this part of the operating system.
Alter tablespace xjsi add datafile '/dev/rrac_xjsiqyb04 'size 10000 m;
(Note: rrac_xjsiqyb corresponds to character devices, and rac_xjsiqyb corresponds to block devices. When adding a data file, if it is written as rrac_xjsiqyb, the data will be written to the bucket where the volume datavg is located. If it is written as rac_xjsiqyb, it will actually generate a space on, check under/dev/datavg. A non-Created directory will be added, that is, the data write location will be changed and then checked by du)
5. log on to the database and add the new bare device to the tablespace.
Take sqlplus as an Example
Su-oracle
Sqlplus/nolog
Conn/as sysdba
Alter tablespace xjsi add datafile/dev/rxjsilv size 10G;
6. Use lsvg-0 to check whether the volume group datavg is activated. If not, varyoffvg datavg is activated. After these operations are completed in RAC, the dual-host synchronization is no longer required because they share a storage device.

I want to ask if the tablespace of rac must be created in + ASM from time to time?

If you still have a shared file system, just put the data file in the shared file system.

Related Article

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.