Home Database Mysql Tutorial Oracle for Linux 双机 控制文件报错问题

Oracle for Linux 双机 控制文件报错问题

Jun 07, 2016 pm 05:23 PM

2台服务器分别安装RHEL 6.3,oracle 分别在2台服务器上安装,软件都放在服务器本地,库文件都放在共享盘(使用的iscsi),第一台

linux版本:RHEL 6.3          Oracle 版本:oracle 11g R2 (11.2.0.3)

2台服务器分别安装RHEL 6.3,oracle 分别在2台服务器上安装,软件都放在服务器本地,库文件都放在共享盘(使用的iscsi),第一台oracle安装完成,测试成功。然后把库文件从共享盘删除或重命名,再安装第二台oracle,库文件放在共享盘,供2台oracle 实例使用,在第二台上测试成功。

oracle 安装默认会有2个控制文件,一个放在共享盘里(control01.ctl),一个放在$ORACLE_BASE/fast_recovery_area/下面(control02.ctl)。当安装完第二台oracle,测试都没有问题,然后把共享盘切换到第一台oracle,可以启动实例,但是不能mount,提示ORA-00214报错,其实就是控制文件版本不一致,然后把共享盘的control01.ctl覆盖掉第一台本地的$ORACLE_BASE/fast_recovery_aera/control02.ctl,再mount 数据库,就可以了,但是当切换到第二台,还是第一台同样问题,也是把共享盘的control01.ctl覆盖掉control02.ctl,就可以mount了!所以,做双机,oracle控制不能放在本地,,需要放在共享盘里。

个人试了一下,直接修改参数文件(init.ora)的control_files,始终不能生效,所以放弃了通过静态参数文件更改控制文件路劲,而是创建一个spfile,来更改control_files。

1、关闭oracle (shutdown immediate)

2、在$ORACLE_BASE/admin/SID/pfile/下面把init.ora 复制为一个oracle.ora文件。(init.ora和oracle.ora的所有参数、路劲都一样),然后使用vim  oracle.ora,修改oracle.ora文件,把control_files里面控制文件的路劲,根据自己需要进行更改,但是所有控制文件都需要放在共享盘路劲里。

3、conn / as sysdba

>startup pfile="$ORACLE_BASE/admin/SID/pfile/oracle.ora"。这样就可以通过oracle.ora参数启动oracle数据库。可以通过select * from v$controlfile;查看控制文件路劲。

4、> create spfile from pfile='$ORACLE_BASE/admin/SID/pfile/oracle.ora'。这样就生成了一个spfile了,在spfile后面可以指定存放路劲,默认是放在$ORACLE_HOME/dbs/spfileSID.ora。

5、另一台同样的道理,生成一个spfile,就可以了。

备份控制文件:SQL>alter database backup controlfile to trace;

这时候会再udump目录下生产SID_ora_*.trc文件,该文件中有创建控制文件脚本,一般分为归档模式和非归档模式。

oracle 参数文件、控制文件、数据文件、日志文件位置查看:

参数文件:SQL>show parameter spfile;

其它参数文件也位于:$ORACLE_HOME/dbs/

网络参数文件位于:$ORACLE_HOME/network/admin

控制文件:SQL>select * from  v$controlfile;

数据文件:SQL>select FILE_NAME from dba_data_files;

日志文件:SQL>select * from  v$logfile;

控制文件:SQL>show parameter

oracle启动过程加载文件顺序:spfileSID.ora——>spfile.ora——>initSID.ora——>init.ora

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve the problem of mysql cannot open shared library How to solve the problem of mysql cannot open shared library Mar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

Reduce the use of MySQL memory in Docker Reduce the use of MySQL memory in Docker Mar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin) Run MySQl in Linux (with/without podman container with phpmyadmin) Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overview What is SQLite? Comprehensive overview Mar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Running multiple MySQL versions on MacOS: A step-by-step guide Running multiple MySQL versions on MacOS: A step-by-step guide Mar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles