程序员人生 网站导航

RAC环境手工添加表空间详细过程

栏目:互联网时间:2014-09-07 04:46:39

#############################################################
#           RAC环境手工添加表空间详细过程                   #
#                                                           #
#              北京中煤创益科技有限公司                     #
#              yangzhiz1@chinacoal.com                      #
#                                                           #      
#                                                           #
#                                                           #
#############################################################


1、

节点一(db01)检查情况:


 [oraprod@db01 archivelog ]$ lsvg -l sharevg1 | grep lv16_41
 lv16_41             raw        128     128     1    closed/syncd  N/A  --查看格式和使用情况 应该是 raw类型,close状态,下同
 [oraprod@db01 archivelog ]$
 [oraprod@db01 archivelog ]$ ls -alt /dev/rlv16_41
 crw-rw----    1 oraprod  dba          50, 34 Aug 28 13:30 /dev/rlv16_41   --查看权限,应该是数据库用户的,下同
 [oraprod@db01 archivelog ]$

2、
 $  lsvg -l sharevg1 | grep lv16_41
 lv16_41             raw        128     128     1    closed/syncd  N/A
 $ ls -alt /dev/rlv16_41
 crw-rw----    1 oraprod  dba          50, 34 Aug 28 13:31 /dev/rlv16_41
 $

  验证结果是可以添加该文件。

 

3、在任意节点打开sqlplus
 执行添加命令:
 SQL> ALTER TABLESPACE APPS_TS_MEDIA ADD DATAFILE '/dev/rlv16_41' SIZE 16000M AUTOEXTEND OFF;
 
 Tablespace altered.
 
 SQL>
 
 提示成功


4、观看告警日志信息:

 Fri Aug 29 09:09:23 2014
 ALTER TABLESPACE APPS_TS_MEDIA ADD DATAFILE '/dev/rlv16_41' SIZE 16000M 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 APPS_TS_MEDIA ADD DATAFILE '/dev/rlv16_41' SIZE 16000M AUTOEXTEND OFF

最后一行提示添加成功

5、校验结果


5.1节点1登如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节点2登入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 确认成功添加。

 


 

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐