Manual management of data files in Oracle via guard

Source: Internet
Author: User
Tags manual

In general, the automatic management of standby database file files is used, but sometimes manual management, such as the standby database using bare devices.

Look at an example:

Sql> select Name, Open_mode, Database_role, Db_unique_name

2 from V$database;

NAME Open_mode Database_role Db_unique_name

------------------------------ ---------- ---------------- ------------------------------

PRIMARY READ WRITE PRIMARY PRIMARY

Sql> select name from V$datafile;

NAME

----------------------------------------

/data/oradata/primary/system01.dbf

/data/oradata/primary/undotbs01.dbf

/data/oradata/primary/sysaux01.dbf

/data/oradata/primary/users01.dbf

/data/oradata/primary/test01.dbf

Check standby database file information:

Sql> select Name, Open_mode, Database_role, Db_unique_name

2 from V$database;

NAME Open_mode Database_role Db_unique_name

------------------------------ ---------- ---------------- ------------------------------

PRIMARY Mounted Physical STANDBY STANDBY

Sql> select name from V$datafile;

NAME

-----------------------------------

/data/oradata/standby/system01.dbf

/data/oradata/standby/undotbs01.dbf

/data/oradata/standby/sysaux01.dbf

/data/oradata/standby/users01.dbf

/data/oradata/standby/test01.dbf

Sql> Show Parameter Standby_file

NAME TYPE VALUE

------------------------------- ----------- ------------------------------

Standby_file_management string AUTO

Sql> Show parameter Convert

NAME TYPE VALUE

------------------------------- ----------- ------------------------------

Db_file_name_convert String/data/oradata/primary,/data/oradata/standby

Log_file_name_convert String/data/oradata/primary,/data/oradata/standby

Although the file paths of the primary and standby are inconsistent, but the standby database is configured with the File_name_convert parameter, Oracle can automatically create the data files for the repository based on the name of the main library:

Sql> Create tablespace New

2 datafile '/data/oradata/primary/new01.dbf '

3 size100m;

Tablespace created.

sql> alter system switch logfile;

System altered.

To check the data file additions for the standby library:

Sql> select name from V$datafile;

NAME

----------------------------------------

/data/oradata/standby/system01.dbf

/data/oradata/standby/undotbs01.dbf

/data/oradata/standby/sysaux01.dbf

/data/oradata/standby/users01.dbf

/data/oradata/standby/test01.dbf

/data/oradata/standby/new01.dbf

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.