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

[Oracle Database] Database tablespace management

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

Share

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

Create tablespace SQL > create tablespace soedatafile'/ u01/app/oracle/oradata/wallet/soe01.dbf'size 1024Mextent management localuniform size 1m; expand tablespace method 1: add data file SQL > alter tablespace soeadd datafile'/ u01/app/oracle/oradata/wallet/soe02.dbf'size 2048M to the tablespace; method 2: automatically extend the data file SQL > alter database datafile'/ u01 shock Method 3: increase the size of the data file in the table space, SQL > alter database datafile'/ u01Accord oradata, move the tablespace data file SQL > alter tablespace soe offline; SQL > host cp / u01/app/oracle/oradata/wallet/soe02.dbf / u02/app/oracle/oradata/walletSQL > alter tablespace soerename datafile'/ u01/app/oracle/oradata/wallet/soe02.dbf'to'/ u02, and increase the size of the data file in the table space. SQL > host rm-rf / u01/app/oracle/oradata/wallet/soe02.dbf delete tablespace SQL > drop tablespace soe including contents and datafiles

Create temporary table space SQL > create temporary tablespace temp01tempfile'/ u01/app/oracle/oradata/wallet/temp01.dbf'size 1024Mextent management localuniform size 1m; expand temporary table space SQL > alter tablespace temp01 add tempfile'/ u01/app/oracle/oradata/wallet/temp02.dbf'size 1024m; query database default temporary table space SQL > col property_name for a40SQL > col property_value for a40SQL > col description for a40SQL > select * from database_properties where property_name='DEFAULT_TEMP_TABLESPACE' PROPERTY_NAME PROPERTY_VALUE DESCRIPTION -- DEFAULT_TEMP_TABLESPACE TEMP Name of default temporary tablespace modifies the database default temporary tablespace SQL > alter database default temporary tablespace temp01 SQL > select * from database_properties where property_name='DEFAULT_TEMP_TABLESPACE' PROPERTY_NAME PROPERTY_VALUE DESCRIPTION -- DEFAULT_TEMP_TABLESPACE TEMP01 Name of default temporary tablespace deletes temporary tablespace SQL > drop tablespace temp including contents and datafiles

Create UNDO tablespace SQL > create undo tablespace undotbs2datafile'/ u01/app/oracle/oradata/wallet/undotbs02.dbf'size 2048m Query active UNDO tablespace SQL > show parameter undo_tablespaceNAME TYPE VALUE -- undo_tablespace string UNDOTBS1SQL > select count (*) from dba_undo_extents where status = 'ACTIVE' and tablespace_name =' UNDOTBS1' COUNT (*)-6 modify the active UNDO tablespace SQL > alter system set undo_tablespace=undotbs2 SQL > show parameter undo_tablespaceNAME TYPE VALUE -undo_tablespace string UNDOTBS2 delete UNDO tablespace SQL > select count (*) from dba_undo_extents where status = 'ACTIVE' and tablespace_name =' UNDOTBS1' COUNT (*)-0 SQL > drop tablespace undotbs1 including contents and datafiles

SQL > @ dba_tablespaces.sql+----+ | Report: Tablespaces | | Instance: wallet | +-+ Tablespace Name Status TS Type Ext. Mgt. Seg. Mgt. TS Size (MB) Used (MB) Pct. Used -SYSAUX ONLINE PERMANENT LOCAL AUTO 2048 482 24UNDOTBS1 ONLINE UNDO LOCAL MANUAL 1024 114 11TEMP ONLINE TEMPORARY LOCAL MANUAL 1024 28 3SYSTEM ONLINE PERMANENT LOCAL MANUAL 2048 738 36SOE ONLINE PERMANENT LOCAL AUTO 4096 1035 25USERS ONLINE PERMANENT LOCAL AUTO 1024 10- -Average 16Total 11264 2 million 3986 rows selected.SQL > @ dba_file_ Space_usage.sql+----+ | Report: File Usage | | Instance: wallet | | +-+ Tablespace Name Filename FILE_ID | File Size (MB) Used (MB) Pct. Used -- SOE / u01/app/oracle/oradata/wallet/soe01.dbf 5 2048 522 25SOE / u01/app/oracle/oradata/wallet/soe02.dbf 6 2048 513 25SYSAUX / u01/app/oracle/oradata/wallet/sysaux01.dbf 2 2048 482 23SYSTEM / u01/app/oracle/oradata/wallet/system01.dbf 1 2048 738 36TEMP / u01/app/oracle/oradata/wallet/temp01.dbf 1 1024 28 2UNDOTBS1 / u01/app/oracle/oradata/wallet/undotbs01.dbf 3 1024 114 11USERS / u01/app/oracle/oradata/wallet/users01.dbf 4 1024 1 0-Average 17Total 11264 2,3987 rows selected.

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