Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Add data files to the tablespace and store them in ASM

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

* * the instance name of 10.1.80.174 is controlled by PGJT2, and the tablespace ODS is full. Apply for additional data files.

Col tablespace_name for a15

Select d.tablespaceplayName space "sum_space (m)", blocks sum_blocks,space-nvl (free_space,0) "used_space (m)"

Round ((1-nvl (free_space,0) / space) * 100Pol 2) "used_rate (%)", free_space "free_space (m)"

From

(select tablespace_name,round (sum (bytes) / (1024 / 1024), 2) space,sum (blocks) blocks

From dba_data_files

Group by tablespace_name) d

(select tablespace_name,round (sum (bytes) / (1024 / 1024), 2) free_space

From dba_free_space

Group by tablespace_name) f

Where d.tablespace_name = f.tablespace_name (+) union all

Select d.tablespaceplayName space "sum_space (m)", blocks sum_blocks

Used_space "used_space (m)", round (nvl (used_space,0) / space*100,2) "used_rate (%)"

Nvl (free_space,0) "free_space (m)"

From

(select tablespace_name,round (sum (bytes) / (1024 / 1024), 2) space,sum (blocks) blocks

From dba_temp_files

Group by tablespace_name) d

(select tablespace_name,round (sum (bytes_used) / (1024 / 1024), 2) used_space

Round (sum (bytes_free) / (1024 / 1024), 2) free_space

From v$temp_space_header

Group by tablespace_name) f

Where d.tablespace_name = f.tablespace_name (+)

-ASM--

Select NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup

It is found that the utilization rate of ODS is 99%, and the remaining 1.3T of DATA

Select file_name,tablespace_name, status from dba_data_files where tablespace_name='ODS'

FILE_NAME TABLESPACE_NAME STATUS

+ DATA/pgjt/datafile/ods.539.784460919 ODS AVAILABLE

How to find this path?

Ps-ef | grep smon

Will find asm_smon_+ASM2.

[oracle] $export ORACLE_SID=+ASM2

[oracle] $asmcmd

ASMCMD > lsdg

ASMCMD > cd data

ASMCMD > ls

ASMCMD > cd DATAFILE

ASMCMD > ls

Found ods.539.784460919.

Add data file alter tablespace ODS add datafile'+ DATA' size 8G

(note: you can add + DATA directly. You don't have to write / pgjt/datafile/ods.539.784460919, it will be generated automatically.)

Verification: use the previous method to also view the system log

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report