Alter database operation

Source: Internet
Author: User

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.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.