RAC環境手工添加表空間詳細過程
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 確認成功添加。