当前位置:网站首页>2. Addition and management of Oracle data files

2. Addition and management of Oracle data files

2022-07-05 06:28:00 Cold leaves elegant_

  1. Inquire about V$DATAFILE、DBA_DATA_FILES surface
    Inquire about V$DATAFILE
select name,file#,checkpoint_change# from v$datafile;

 Insert picture description here
Inquire about DBA_DATA_FILES

select tablespace_name,autoextensible,file_name from dba_data_files;

 Insert picture description here

  1. by users Tablespace add data file users03.dbf, size 10mb
alter tablespace users add datafile 'D:\app\Snakewood\oradata\orcl\users03.dbf' size 10m;

 Insert picture description here
 Insert picture description here

  1. by users Tablespace add data file user02.dbf, size 10mb, Automatic extension
alter tablespace users add datafile 'D:\app\Snakewood\oradata\orcl\user02.dbf' size 10m autoextend on;

 Insert picture description here
 Insert picture description here
3. by users Tablespace add data file users05.dbf, size 10mb, Maximum 50mb

alter tablespace users add datafile 'D:\app\Snakewood\oradata\orcl\users05.dbf' size 10m autoextend on maxsize 50m;

 Insert picture description here
 Insert picture description here
4. modify users In tablespace users03.dbf For automatic extension , Every expansion 5mb, Maximum 20mb

alter database datafile 'D:\app\Snakewood\oradata\orcl\users03.dbf' autoextend on next 5m maxsize 20m;

 Insert picture description here

  1. Change the database to archive

First , Query whether the database is currently in archive mode

select name,log_mode from v$database;

 Insert picture description here
Close the database , stay mount Change the database to archive mode , Restart the database
 Insert picture description here
Check the archive mode of the current database
 Insert picture description here
6. take users01.dbf offline , Observe the changes of control documents
Before offline :
 Insert picture description here
 Insert picture description here
After offline :

alter database backup controlfile to trace as 'C:\Users\Snakewood\Desktop\offline.txt';

 Insert picture description here
 Insert picture description here
offline (offline) Return to online after (online):
 Insert picture description here
7. take users03.dbf Renamed users003.dbf,users02 Move to e disc ( Try 3 Methods )
take users03.dbf Renamed users003.dbf:
① Only right users03.dbf offline
First modify the file name to users003.dbf
Go offline
 Insert picture description here
Modify the records in the control document

 Insert picture description here
Reconnect the database and online
 Insert picture description here
② Offline for tablespaces
Change the file name to users03.dbf
Go offline

① Only right users003.dbf offline
 Insert picture description here
Modify the records in the control document

 Insert picture description here
Re connect to the database
 Insert picture description here
② Perform offline operations on tablespaces
Set the tablespace offline
 Insert picture description here
Move users003 The new folder will be named users203
Modify the control file information
 Insert picture description here
Bring tablespaces online
 Insert picture description here

原网站

版权声明
本文为[Cold leaves elegant_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050620030243.html