1Alter database: Modify data files
Alter database datafile 4 offline;
Alter database datafile '/opt/Oracle/datafile/users01.dbf' offline;
Alter database datafile '/opt/oracle/datafile/users01.dbf' resize 100 M;
Alter database datafile '/opt/oracle/datafile/users01.dbf' autoextend on next 100 M maxsize 1000 M;
Alter database datafile 4 end backup;
2Alter database: Modify temporary files (Tempfile)
Alter database tempfile 4 resize 100 M;
Alter database tempfile 4 autoextend on next 100 M maxsize 1000 M;
Alter database tempfile 4 drop including datafiles;
Alter database tempfile 4 offline;
3Alter database: Archiving logs (Archivelog) Mode command
Alter database archivelog;
Alter database noarchivelog;
Alter database force logging;
Alter database clear logfile '/opt/oracle/logfiles/redo01.rdo ';
Alter database clear unarchived logfile '/opt/oracle/logfiles/redo01.rdo ';
Alter database add supplemental log data;
Alter database add supplemental log data (primary key, unique );
Alter database drop supplemental log data;
4Alter database: Control File Operations
Alter database backup controlfile to trace;
Alter database backup controlfile to trace as '/opt/oracle/logfile_backup/backup_logfile.trc' reuse resetlogs;
Alter database backup controlfile to '/opt/oracle/logfile_backup/backup_logfile.ctl ';
5Alter database: Create a data file
Alter database create datafile '/opt/oracle/datafile/users01.dbf 'as'/opt/oracle/datafile/users01.dbf ';
Alter database create datafile 4 as '/opt/oracle/datafile/users01.dbf ';
Alter database create datafile '/opt/oracle/datafile/users01.dbf' as new;
6Alter database: Log file command
Alter database add logfile group 2 ('/opt/oracle/logfiles/redo02a. rdo', '/opt/oracle/logfile/redo02b. rdo') size 300 M reuse;
Alter database add logfile member '/opt/oracle/logfiles/redo02c. rdo' to gourp 2
Alter database add logfile thread 3 group 2 ('/opt/oracle/logfiles/redo02a. rdo', '/opt/oracle/logfiles/redo02b. rdo') size 300 M reuse;
Alter database drop logfile group 3
Alter database drop logfile member '/opt/oracle/logfiles/redo02b. rdo ';
7Alter database: Install and open a database
Alter database mount;
Alter database open;
8Alter database: Move or rename database files or online redo logs
Note: The database must have been installed before renaming or moving online redo logs. Only when the database has been installed or the data file is offline can the data files in the database be moved.
Alter database rename file '/ora/datafile/oldfile. dbf' to'/ora/datafile/newfile. dbf ';
9Alter database: Open the database in read-only mode
Alter database open read only;
10Alter database: UseResetlogsOpen Data
Alter database open resetlogs;
11Alter database: Restore database
We recommend that you restore the database.RecoverCommand.