当前位置:网站首页>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 YES
1.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_files
2.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;
边栏推荐
- 表空间创建管理及控制文件管理
- 图解网络:什么是虚拟路由器冗余协议 VRRP?
- Qt:qss custom qscrollbar instance
- 做软件测试三年,薪资不到20K,今天,我提出了辞职…
- Overview of testing theory
- The element form shows the relationship between elementary transformation and elementary matrix
- Clion debug
- Use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
- What are the strengths of "testers"?
- php服务器 与redis交互大量CLOSE_WAIT分析
猜你喜欢
Hal - General
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
Multiple IO transfer - preamble
17K薪资要什么水平?来看看95后测试工程师的面试全过程…
Stack, monotone stack, queue, monotone queue
历经一个月,终于拿到金蝶Offer!分享一下四面面经+复习资料
《通信软件开发与应用》
反正切熵(Arctangent entropy):2022.7月最新SCI论文
QT: QSS custom qtableview instance
【蓝桥杯选拔赛真题44】Scratch消灭骷髅军团 少儿编程scratch蓝桥杯选拔赛真题讲解
随机推荐
QT: QSS custom qtreeview instance
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
Test what the leader should do
图解网络:什么是虚拟路由器冗余协议 VRRP?
Snownlp emotion analysis
Ext file system mechanism principle
The normal one inch is 25.4 cm, and the image field is 16 cm
历经一个月,终于拿到金蝶Offer!分享一下四面面经+复习资料
12. Nacos server service registration of source code analysis of Nacos service registration
Hard goods | write all the codes as soon as you change the test steps? Why not try yaml to realize data-driven?
Software testing redis database
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
Encapsulation attempt of network request framework of retro + kotlin + MVVM
In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
A simple method of adding dividing lines in recyclerview
Summary of the history of Mathematics
解决undefined reference to `__aeabi_uidivmod‘和undefined reference to `__aeabi_uidiv‘错误
Clion debug
UI自动化测试如何走出困境?价值又如何体现?
File upload and download test point