当前位置:网站首页>Tablespace creation management and control file management
Tablespace creation management and control file management
2022-07-03 11:13:00 【User 8006012】
Table space is a logical concept , Physically corresponding to one or more data files datafile Or temporary files tempfiles, Logically, table spaces are containers for storage segments .( Segment is also a logical concept , Are objects in the database, such as tables 、 Index, etc. )
Tablespace type
①PERMANENT Permanent table space
②UNDO Undo tablespace
③TEMPORARY Temporary table space
The management mode focuses on the management mode of sections and districts , It is determined when establishing the table space .
1.1 View tablespace types 、 Section and area management mode
[email protected]> select tablespace_name,contents,segment_space_management,extent_management from dba_tablespaces;
TABLESPACE_NAME CONTENTS SEGMEN EXTENT_MAN
------------------------------ --------- ------ ----------
SYSTEM PERMANENT MANUAL LOCAL
SYSAUX PERMANENT AUTO LOCAL
UNDOTBS1 UNDO MANUAL LOCAL
TEMPTS1 TEMPORARY MANUAL LOCAL
USERS PERMANENT MANUAL LOCAL
[email protected]> select * from v$tablespace;
TS# NAME INC BIG FLA ENC
---------- ------------------------------ --- --- --- ---
0 SYSTEM YES NO YES
1 SYSAUX YES NO YES
2 UNDOTBS1 YES NO YES
3 TEMPTS1 NO NO YES
4 USERS YES NO YES1.2 View tablespaces ( Data files ) size 、 Whether to automatically expand
select file_id,file_name,tablespace_name,bytes/1024/1024 M,status,
AUTOEXTENSIBLE from dba_data_files order by 1;1.3 View tablespace size
select TABLESPACE_NAME,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;1.4 Check the free size of the table space
select tablespace_name,sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;1.5 establish smallfile Table space
The size of the table space is equal to the sum of the sizes of the data files under it , By default small Table space
Commonly used when there is a problem of insufficient table space 3 There is a solution :
1) Increase the size of the original data file (resize)
2) Add a data file (add datafile)
3) Set the table space to grow automatically (autoextend)
create tablespace test datafile '/u01/app/oracle/oradata/orcl/test01.dbf' size 5m;1.5.1 resize Expand the table space
select file_id,file_name,tablespace_name from dba_data_files;
alter database datafile 6 resize 10m;1.5.2 add datafile Expand the table space :
alter tablespace test add datafile '/u01/app/oracle/oradata/orcl/test02.dbf' size 30G;1.5.3 autoextend on Expand the table space
alter database datafile 6 autoextend on maxsize 30G;
select FILE_ID,TABLESPACE_NAME,BYTES/1024/1024 M_size,
AUTOEXTENSIBLE,MAXBYTES/1024/1024 M_max from dba_data_files;1.6 Create large files (bigfile) Table space
①smallfile: A table space can contain multiple data files ( Default ), Block size 8k when , The size should be less than 32G.
②bigfile: A table space contains only one data file , 8k Of block when , Up to 32T.
create bigfile tablespace bigtbs
datafile '/u01/app/oracle/oradata/orcl/bigtbs01.dbf' size 20m
autoextend on maxsize 4T
extent management local uniform size 2m
segment space management auto;1.61. View large tablespace files
select name,bigfile from v$tablespace;1.7 Delete tablespace
drop tablespace test including contents and datafiles;
drop tablespace bigtbs including contents and datafiles;2. Control documents
2.1 Functions and features :
1) Record the current physical state of the database
2) Maintain database consistency
3) It's a small binary file
4) stay mount The stage is read
5) Record RMAN Backup metadata
select name from v$datafile;
select member from v$logfile;View control file location :
show parameter control_files;
select name from v$controlfile;2.2 Real time update mechanism
① When you add 、 rename 、 When deleting a data file or an online log file , Oracle Server process (Server
Process) The control file is immediately updated to reflect changes in the database structure .
② Log writing process LGWR Responsible for recording the current log serial number in the control file .
③ Checkpoint process CKPT Be responsible for recording the information of verification point in the control file .
④ Archiving process ARCN Be responsible for recording the information in the archive log into the control file .
Through view v$controlfile_record_section It can be learned that a large number of current database status information is recorded in the control file
2.3 Control file multiplexing
2.3.1 modify spfile Medium control_files Parameters
[email protected]>create pfile from spfile;
[email protected]>select name from v$controlfile;
[email protected]>alter system set control_files='/u01/app/oracle/oradata/PROD1/control01.ctl',
'/u01/app/oracle/oradata/PROD1/control02.ctl','/u01/app/oracle/oradata/PROD1/control03.ctl' scope=spfile;2.3.2 Normal shutdown , Boot to nomount Status view
[email protected]>shutdown immediate;
[email protected]>startup nomount;
[email protected]>show parameter control_files2.3.3 Copy control file , It is recommended to allocate to different physical disks
[email protected]>! cp /u01/app/oracle/oradata/PROD1/control02.ctl /u01/app/oracle/oradata/PROD1/control03.ctl
[email protected]> alter database mount;
[email protected]> alter database open;
边栏推荐
- 如何成为一名高级数字 IC 设计工程师(1-4)Verilog 编码语法篇:表达式
- Definition and properties of summation symbols
- QT: QSS custom qtabwidget and qtabbar instances
- The testing department of the company came to the king of the Post-00 roll, and the veteran exclaimed that it was really dry, but
- Use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
- What kind of living condition is a tester with a monthly salary of more than 10000?
- Lecture 1 number field
- What experience is there only one test in the company? Listen to what they say
- Exclusive analysis | truth about resume and interview
- 《通信软件开发与应用》
猜你喜欢

AIDL

有赞CTO崔玉松:有赞Jarvis核心目标是使产品变得更加聪明和可靠

【蓝桥杯选拔赛真题44】Scratch消灭骷髅军团 少儿编程scratch蓝桥杯选拔赛真题讲解

What kind of living condition is a tester with a monthly salary of more than 10000?

Solution: jupyter notebook does not pop up the default browser

Solve the problem that pycharm Chinese input method does not follow

How did I grow up in the past eight years as a test engineer of meituan? I hope technicians can gain something after reading it

I, a tester from a large factory, went to a state-owned enterprise with a 50% pay cut. I regret it

How to realize automatic testing in embedded software testing?

Comment réaliser des tests automatisés pour les tests logiciels embarqués?
随机推荐
I have been doing software testing for three years, and my salary is less than 20K. Today, I put forward my resignation
反正切熵(Arctangent entropy):2022.7月最新SCI论文
8年测试工程师总结出来的《测试核心价值》与《0基础转行软件测试超全学习指南》
Qt:qss custom qpprogressbar instance
AMS Series 1 - AMS startup process
QT: QSS custom qtoolbar and qtoolbox instances
嵌入式軟件測試怎麼實現自動化測試?
T5 的尝试
如何成为一名高级数字 IC 设计工程师(1-2)Verilog 编码语法篇:Verilog 1995、2001、2005 标准
项目管理精华读书笔记(六)
数据库增量备份 - DB INCR DB FULL
BI技巧丨权限轴
如何让让别人畏惧你
QT: QSS custom qtabwidget and qtabbar instances
Qt:qss custom qradiobutton instance
IIS修改配置信息后不生效
glassfish org. h2.server. Shutdownhandler classnotfoundexception exception exception handling
In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
触摸与屏幕自动旋转调试
Qt:qss custom QSlider instance