Log Management
1.forcing Log Switches
sql> alter system switch logfile;
2.forcing checkpoints
Sql> alter system checkpoint;
3.adding Online Redo Log groups
sql> ALTER DATABASE Add logfile [Group 4]
Sql> ('/disk3/log4a.rdo ', '/disk4/log4b.rdo ') size 1m;
4.adding Online Redo Log Members
sql> ALTER DATABASE Add logfile Member
Sql> '/disk3/log1b.rdo ' to group 1,
Sql> '/disk4/log2b.rdo ' to group 2;
5.changes the name of the online redo logfile
sql> ALTER DATABASE rename file ' C:/oracle/oradata/oradb/redo01.log '
sql> to ' C:/oracle/oradata/redo01.log ';
6.drop Online Redo Log groups
sql> ALTER DATABASE drop logfile Group 3;
7.drop Online Redo Log Members
sql> ALTER DATABASE drop logfile member ' C:/oracle/oradata/redo01.log ';
4.change the storage setting
sql> alter tablespace App_Data minimum extent 2m;
sql> alter tablespace app_data default storage (initial 2m next 2m maxextents 999);
5.taking tablespace offline or online
sql> alter tablespace App_Data offline;
sql> alter tablespace App_Data online;
6.read_only tablespace
Sql> alter tablespace App_Data read only|write;
7.droping tablespace
Sql> drop tablespace app_data including contents;
8.enableing automatic extension of data files
Sql> alter tablespace app_data add datafile ' c:\oracle\oradata\app_data01.dbf ' size 200m
Sql> Autoextend on next 10m maxsize 500m;
9.change the size fo data files manually
sql> ALTER DATABASE datafile ' C:\ORACLE\ORADATA\APP_DATA.DBF ' resize 200m;
10.Moving Data Files:alter tablespace
sql> alter tablespace app_data rename datafile ' c:\oracle\oradata\app_data.dbf '
sql> to ' c:\oracle\app_data.dbf ';
11.moving Data Files:alter Database
sql> ALTER DATABASE rename file ' c:\oracle\oradata\app_data.dbf '
sql> to ' c:\oracle\app_data.dbf ';
7.move tablespace
Sql> ALTER TABLE employee move tablespace users;
8.deallocate of unused space
Sql> ALTER TABLE table_name deallocate unused [keep integer]
9.truncate a table
Sql> TRUNCATE TABLE table_name;
10.drop a table
sql> DROP TABLE table_name [cascade constraints];
11.drop a column
Sql> ALTER TABLE table_name DROP COLUMN comments cascade constraints checkpoint 1000;
ALTER TABLE table_name DROP columns continue;
12.mark a column as unused
Sql> ALTER TABLE TABLE_NAME SET UNUSED column comments cascade constraints;
ALTER TABLE table_name drop unused columns checkpoint 1000;
ALTER TABLE orders drop columns continue checkpoint 1000
Data_dictionary:dba_unused_col_tabs
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.