在sun solaris suncluster and volume manger環境下的ORACLE資料庫表空間的擴容
某使用者使用ORACLE資料庫,其中SCP資料庫採用雙機冷備份,隨著使用者量的增加,scu資料庫空間達到閥值80%,需要增加資料檔案。現網SCP硬體如下:
SUN dual-Fire V880-6*1.2GHz-12G-6*73G-2*NIC-2*SCSI-2*3310(12*73G) JBOD-2*72" Rack-Solaris8/SC3.0-Without Service-Eng. Doc-DDS4-Conf. Sheet
ORACLE資料庫資訊如下:
ORACLE 9i Enterprise Edition, V9.2.0, SUN SPARC Solaris 64Bit Platform, English Version, 25 Users, English Document
其中ORACLE的資料檔案安裝在共享磁碟中。
目前表空間的擴容方案為首先檢查目前的磁碟空間是否足夠,在磁碟空間允許的情況下,增加邏輯卷,然後再將該資料檔案加入到ORACLE資料庫;
操作步驟
? 資訊確認
1) 明確卷組資訊:
# vxdg list
NAME STATE ID
rootdg enabled 1095846169.1025.scp1
scpdg enabled 1095847191.1235.scp1
sharedg enabled 1095847234.1272.scp1
其中sharedg是用來存放oracle資料檔案的,scpdg用來存放scu應用。因此新增的邏輯卷將存放於sharedg卷組中;
2) 確定新增邏輯卷的位置和名字
ORACLE所使用的邏輯卷的詳細資訊如下:
# ls -al
total 4
drwxr-xr-x 2 root root 512 Sep 24 2004 .
drwxr-xr-x 4 root root 512 Sep 22 2004 ..
crw-rw---- 1 oracle dba 315,123008 Apr 25 2005 lvcontrol01_150
crw-rw---- 1 oracle dba 315,123007 Apr 25 2005 lvcontrol02_150
crw-rw---- 1 oracle dba 315,123009 Apr 25 2005 lvcontrol03_150
crw-rw---- 1 oracle dba 315,123005 Feb 27 09:36 lvindex_1024
crw-rw---- 1 oracle dba 315,123010 Mar 2 15:00 lvredo1_350
crw-rw---- 1 oracle dba 315,123011 Mar 2 15:00 lvredo2_350
crw-rw---- 1 oracle dba 315,123012 Mar 2 15:00 lvredo3_350
crw-rw---- 1 oracle dba 315,123015 Feb 27 09:36 lvscudata
crw-rw---- 1 oracle dba 315,123013 Apr 18 2005 lvspfile
crw-rw---- 1 oracle dba 315,123014 Sep 22 2004 lvsrvmcfg
crw-rw---- 1 oracle dba 315,123000 Feb 27 09:36 lvsystem_650
crw-rw---- 1 oracle dba 315,123002 Sep 24 2004 lvtemp_1024
crw-rw---- 1 oracle dba 315,123006 Feb 27 09:36 lvtools_150
crw-rw---- 1 oracle dba 315,123003 Feb 27 09:36 lvundo1_1024
crw-rw---- 1 oracle dba 315,123004 Sep 22 2004 lvundo2_1024
crw-rw---- 1 oracle dba 315,123001 Feb 27 09:36 lvuser_120
# pwd
/global/.devices/node@1/dev/vx/rdsk/sharedg
因此新增的邏輯卷將位於/dev/vx/rdsk/sharedg目錄下,名字為lvscudata_1
3) 瞭解sharedg的磁碟使用資訊
# vxdisk -g sharedg list
DEVICE TYPE DISK GROUP STATUS
c2t3d0s2 sliced c2t3d0 sharedg online spare
c2t4d0s2 sliced c2t4d0 sharedg online
c2t5d0s2 sliced c2t5d0 sharedg online
c2t8d0s2 sliced c2t8d0 sharedg online
c2t9d0s2 sliced c2t9d0 sharedg online
c2t10d0s2 sliced c2t10d0 sharedg online
c2t11d0s2 sliced c2t11d0 sharedg online
c2t12d0s2 sliced c2t12d0 sharedg online
c2t13d0s2 sliced c2t13d0 sharedg online
c3t3d0s2 sliced c3t3d0 sharedg online spare
c3t4d0s2 sliced c3t4d0 sharedg online
c3t5d0s2 sliced c3t5d0 sharedg online
c3t8d0s2 sliced c3t8d0 sharedg online
c3t9d0s2 sliced c3t9d0 sharedg online
c3t10d0s2 sliced c3t10d0 sharedg online
c3t11d0s2 sliced c3t11d0 sharedg online
c3t12d0s2 sliced c3t12d0 sharedg online
c3t13d0s2 sliced c3t13d0 sharedg online
該lvscudata_1將佔用c2t4d0 c2t5d0 c2t8d0 c2t9d0 c2t10d0 c2t11d0 c2t12d0 c2t13d0 c3t4d0 c3t5d0 c3t8d0 c3t9d0 c3t10d0 c3t11d0 c3t12d0 c3t13d0 磁碟;
? 具體操作步驟
以下步驟必須在當前擁有sharedg的節點上操作,如下假設當前主機為scp1。
1) 確認目前的磁碟空間是否足夠
# vxassist -g sharedg maxsize layout=stripe-mirror,nolog
Maximum volume size: 1121720320 (547715Mb)
可以看出sharedg能作raid10的邏輯卷最大能到(547715Mb),空間足夠;
2) 增加邏輯卷
# vxassist -g sharedg make lvscudata_1 5100m layout=stripe,nolog
c2t4d0 c2t5d0 c2t8d0 c2t9d0 c2t10d0 c2t11d0 c2t12d0 c2t13d0
增加邏輯卷,注意如果要增加的資料檔案的大小為5000m,那麼建立的邏輯卷應該略大於資料檔案的大小,如本例中設定邏輯卷的大小為5100m。另外,對於ORACLE資料庫,沒有象INFORMIX類似的使用的邏輯卷最大為2G的限制;但是一般情況下,建議一個資料檔案的大小不要超過5000M.
3) 進行邏輯卷映象
# vxassist -g sharedg mirror lvscudata_1
c3t4d0 c3t5d0 c3t8d0 c3t9d0 c3t10d0 c3t11d0 c3t12d0 c3t13d0
4) 邏輯卷條帶化
# vxassist -g sharedg convert lvscudata_1 layout=stripe-mirror,nolog
5) 設定邏輯卷日誌方式
# vxassist -g sharedg addlog lvscudata_1
6) 設定邏輯卷的宿主和許可權
# vxedit -g sharedg set user=oracle group=dba mode=0660 lvscudata_1
7) 下面這步比較關鍵,否則雙機切換後因為卷資訊不同步將會出問題
# scconf -c -D name=sharedg,sync
8) 然後是用oracle使用者把/dev/vx/rdsk/sharedg/lvscudata_1加入資料庫
# su - oracle
scp1% sqlplus "/ as sysdba"
SQL> SELECT * FROM V_$TABLESPACE;
TS# NAME INC
---------- ------------------------------ ---
0 SYSTEM YES
1 UNDOTBS1 YES
2 TEMP YES
3 INDX YES
4 TOOLS YES
5 USERS YES
6 SCUDATATBS YES
7 rows selected.
執行如下命令:
SQL> ALTER TABLESPACE SCUDATATBS ADD DATAFILE '/dev/vx/rdsk/sharedg/lvscudata_1' SIZE 5000M;
commit;
9) 檢查確認
SQL> select NAME from V_$DATAFILE;
可以使用如上命令檢視資料檔案是否生效;
SQL> select b.file_id ID, b.tablespace_name tablespacename, b.bytes byte, (b.bytes-sum(nvl(a.bytes,0))) used,sum(nvl(a.bytes,0)) freespace,sum(nvl(a.bytes,0))/(b.bytes)*100 freepercentage FROM dba_free_space a,dba_data_files b where a.file_id=b.file_id group by b.tablespace_name,b.file_id,b.bytes order by b.file_id;
使用如上命令檢視各個資料檔案和表空間的使用情況;
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9479798/viewspace-1050078/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 達夢資料庫DSC架構下ASM擴容及表空間擴容實施資料庫架構ASM
- Oracle RAC+DG 表空間擴容Oracle
- 在 Homestead 環境下為 PHP 新增 Oracle 資料庫擴充套件(OCI)PHPOracle資料庫套件
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- oracle RAC+DG 擴容ASM和表空間(Linux)OracleASMLinux
- 華納雲:如何配置oracle表空間自動擴容?Oracle
- 清理oracle資料庫空間Oracle資料庫
- Oracle案例11——Oracle表空間資料庫檔案收縮Oracle資料庫
- PostgreSQL:表空間-->資料庫-->表SQL資料庫
- 在 kubernetes 環境下如何優雅擴縮容 Pulsar
- 在擴容表空間的時候出現ORA-19502,ORA-27072
- 【資料庫資料恢復】LINUX環境下ORACLE資料庫誤刪除的資料恢復資料庫資料恢復LinuxOracle
- oracle表空間的整理Oracle
- oracle建立臨時表空間和資料表空間以及刪除Oracle
- Oracle資料庫 ASM磁碟線上擴容Oracle資料庫ASM
- 2.5.9 在資料庫建立期間支援大檔案表空間資料庫
- python環境連結Oracle資料庫PythonOracle資料庫
- Oracle 刪除使用者、表空間、資料檔案、使用者下的所有表Oracle
- mysql共享表空間擴容,收縮,遷移MySql
- oracle dg庫資料檔案空間不足Oracle
- Oracle資料庫閃回區空間不足Oracle資料庫
- Oracle表空間Oracle
- oracle 表空間Oracle
- 【伺服器資料恢復】SUN SOLARIS資料恢復案例伺服器資料恢復
- 聊聊Oracle表空間Offline的三種引數(下)Oracle
- Oracle 擴充磁碟空間Oracle
- python批量統計Oracle資料庫的空間使用量PythonOracle資料庫
- oracle 普通表空間資料檔案壞塊Oracle
- ORACLE expdp在表空間較多的情況下執行非常緩慢Oracle
- PostgreSQL在不同的表空間移動資料檔案SQL
- Oracle的表空間quota詳解Oracle
- Oracle OCP(47):表空間的建立Oracle
- Ubuntu 22.04擴容LVM空間UbuntuLVM
- Ubuntu空間不足,如何擴容Ubuntu
- lvm 擴充邏輯卷空間(linux的磁碟擴容)LVMLinux
- 增加oracle表空間Oracle
- oracle temp 表空間Oracle
- Oracle臨時表空間檢視、新增臨時表空間資料檔案、修改預設臨時表空間 方法!Oracle
- pve 下的群暉虛擬機器硬碟空間擴容的記錄虛擬機硬碟