Home Database Mysql Tutorial Oracle 10g R2 RAC+ASM恢复到单实例

Oracle 10g R2 RAC+ASM恢复到单实例

Jun 07, 2016 pm 05:08 PM

RAC asm恢复到单实例 rac源服务器: rac1:192.168.100.201 rac2:192.168.100.202 目标服务器: 192.168.8.201 恢复的主要步骤

RAC asm恢复到单实例

rac源服务器:

rac1:192.168.100.201

rac2:192.168.100.202

目标服务器:

192.168.8.201 

恢复的主要步骤如下:

恢复初始化参数文件->修改参数文件->恢复控制文件->resotre数据文件->recover数据文件 

1、正确安装单实例数据库 1)查看rac文件环境变量

[Oracle@rac2 log]$ cat/etc/profile.d/oraenv.sh

# oracle 10g

export ORACLE_BASE=/oracle/ora10g

export ORACLE_HOME=$ORACLE_BASE/product/db

export CRS_HOME=$ORACLE_BASE/product/crs

exportPATH=$CRS_HOME/bin:$ORACLE_HOME/bin:$PATH

export ORACLE_OWNER=oracle

export ORACLE_SID=jscn2

exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

export NLS_LANG='american_america.ZHS16GBK'

#exportNLS_LANG='american_america.AL32UTF8'

umask 022

目标服务器ORACLE_SID不要设置 

2)安装备份服务器

根据这个环境变量创建目标服务器数据库(包括,数据库的安装,升级包安装,数据库不要创建) 

2、恢复阶段 1)启动目标数据库到nomount

[oracle@IM-8-201 ~]$ rman target /

 

Recovery Manager: Release 10.2.0.4.0 -Production on Tue Nov 22 21:45:18 2011

 

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

 

connected to target database (not started)

 

RMAN> startup nomount;

 

startup failed: ORA-01078: failure inprocessing system parameters

LRM-00109: could not open parameter file'/oracle/ora10g/product/db/dbs/initjscnora'

 

starting Oracle instance without parameterfile for retrival of spfile

Oracle instance started

 

Total System Global Area     159383552 bytes

 

Fixed Size                     2082400 bytes

Variable Size                 67111328 bytes

Database Buffers              83886080 bytes

Redo Buffers                   6303744 bytes

 

2)从备份集中恢复spfile,并保存成pfile,操作如下

把最近的0级备份和后面的备份文件拷贝到

我们看到备份集有如下

-rw-r----- 1 oracle oinstall    622592 Dec 2 16:11 arch_JSCN_20111202_286

-rw-r----- 1 oracle oinstall    266752 Dec 2 16:11 arch_JSCN_20111202_287

-rw-r----- 1 oracle oinstall    140288 Dec 2 16:13 arch_JSCN_20111202_296

-rw-r----- 1 oracle oinstall     36352 Dec 2 16:13 arch_JSCN_20111202_297

-rw-r----- 1 oracle oinstall  16908288 Dec 2 16:13 control_c-2437751542-20111202-00

-rw-r----- 1 oracle oinstall    196608 Dec 2 16:11 lev0_JSCN_20111202_288

-rw-r----- 1 oracle oinstall  32784384 Dec 2 16:11 lev0_JSCN_20111202_289

-rw-r----- 1 oracle oinstall    172032 Dec 2 16:11 lev0_JSCN_20111202_290

-rw-r----- 1 oracle oinstall 388726784Dec  2 16:12 lev0_JSCN_20111202_291

-rw-r----- 1 oracle oinstall 256327680Dec  2 16:13 lev0_JSCN_20111202_292

-rw-r----- 1 oracle oinstall   9658368 Dec 2 16:13 lev0_JSCN_20111202_293

-rw-r----- 1 oracle oinstall  15204352 Dec 2 16:13 lev0_JSCN_20111202_294

-rw-r----- 1 oracle oinstall   1818624 Dec 2 16:13 lev0_JSCN_20111202_295

这几个都是最近的备份,control_c-2437751542-20111202-00一个包含初始化参数文件

 

让我们恢复参数文件

[oracle@IM-8-201 ~]$ rman target /

 

Recovery Manager: Release 10.2.0.4.0 -Production on Tue Nov 22 22:07:18 2011

 

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

 

connected to target database: DUMMY (notmounted)

 

RMAN> restore spfile to pfile'/home/oracle/initjscn.ora' from '/orabak/lev2_JSCN_20111201_182';

 

Starting restore at 22-NOV-11

using target database control file insteadof recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=39 devtype=DISK

 

channel ORA_DISK_1: autobackup found:/orabak/lev2_JSCN_20111201_182

channel ORA_DISK_1: SPFILE restore fromautobackup complete

Finished restore at 22-NOV-11

 

--查看/home/oracle/initjscn.ora

接下来要做的是个体力活,修改 pfile.ora中的初始化参数,主要有两方面的修改

a 修改含文件路径的参数,,达到符合当前服务器环境的实际情况

b 修改多实例相关的参数

c 内存参数(如果源服务器和目录服务器内存一样大,不用调)

原文件内容如下:

 

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

jscn2.__db_cache_size=1207959552

jscn1.__db_cache_size=1207959552

jscn2.__java_pool_size=16777216

jscn1.__java_pool_size=16777216

jscn2.__large_pool_size=16777216

jscn1.__large_pool_size=16777216

jscn2.__shared_pool_size=352321536

jscn1.__shared_pool_size=352321536

jscn2.__streams_pool_size=0

jscn1.__streams_pool_size=0

*.audit_file_dest='/oracle/ora10g/admin/jscn/adump'

*.background_dump_dest='/oracle/ora10g/admin/jscn/bdump'

*.cluster_database_instances=2

*.cluster_database=true

*.compatible='10.2.0.3.0'

*.control_files='+DATA/jscn/controlfile/current.263.768517111'

*.core_dump_dest='/oracle/ora10g/admin/jscn/cdump'

*.db_block_size=8192

*.db_create_file_dest='+DATA'

*.db_domain=''

*.db_file_multiblock_read_count=8

*.db_name='jscn'

*.dispatchers='(PROTOCOL=TCP)(SERVICE=jscnXDB)'

jscn1.instance_number=1

jscn2.instance_number=2

*.job_queue_processes=10

jscn1.log_archive_dest_1='location=/oraarch1/'

jscn2.log_archive_dest_1='location=/oraarch2/'

jscn1.log_archive_dest_2='service=jscn2'

jscn2.log_archive_dest_2='service=jscn1'

*.open_cursors=300

*.pga_aggregate_target=2512388096

*.processes=1500

*.remote_listener='LISTENERS_JSCN'

*.remote_login_passwordfile='exclusive'

*.sessions=1655

*.sga_target=1610612736

jscn1.standby_archive_dest='/oraarch2/'

jscn2.standby_archive_dest='/oraarch1'

jscn2.thread=2

jscn1.thread=1

*.undo_management='AUTO'

jscn1.undo_tablespace='UNDOTBS1'

jscn2.undo_tablespace='UNDOTBS2'

*.user_dump_dest='/oracle/ora10g/admin/jscn/udump'

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

 

最终修改完之后,这里的初始化参数如下,比如原来的文件精简不少:

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

*.audit_file_dest='/oracle/ora10/admin/jscn/adump'

*.background_dump_dest='/oracle/ora10/admin/jscn/bdump'

*.compatible='10.2.0.3.0'

*.control_files='/oracle/ora10/oradata/jscn/control01.ctl','/oracle/ora10/oradata/jscn/control02.ctl','/oracle/ora10/oradata/jscn/control03.ctl'

*.core_dump_dest='/oracle/ora10/admin/jscn/cdump'

*.db_block_size=8192

*.db_domain=''

*.db_file_multiblock_read_count=8

*.db_name='jscn'

*.job_queue_processes=10

*.log_archive_dest_1='location=/oraarch'

*.open_cursors=300

*.pga_aggregate_target=251238809

*.processes=150

*.remote_login_passwordfile='exclusive'

*.sessions=165

*.sga_target=261061273

*.undo_management='AUTO'

undo_tablespace='UNDOTBS1'

*.user_dump_dest='/oracle/ora10/admin/jscn/udump'

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

创建相应的目录

[oracle@ora-bak-100-119 ~]$ mkdir -p/oracle/ora10/admin/jscn/adump

[oracle@ora-bak-100-119 ~]$ mkdir -p/oracle/ora10/admin/jscn/bdump

[oracle@ora-bak-100-119 ~]$ mkdir -p/oracle/ora10/admin/jscn/cdump

[oracle@ora-bak-100-119 ~]$ mkdir -p/oracle/ora10/admin/jscn/udump

[oracle@ora-bak-100-119 ~]$ mkdir -p /oracle/ora10/oradata/jscn/

现在我们开始恢复了

SQL> create spfile from pfile='/home/oracle/initjscn.ora';

 

File created.

SQL> shutdown immediate

SQL> startup nomount

 

ORACLE instance shut down.

SQL> startup nomount

ORA-07446: sdnfy: bad value'/oracle/ora10g/admin/jscn/udump' for parameter user_dump_dest.

SQL> startup nomount

ORACLE instance started.

ORA-04030: out of process memory whentrying to allocate 32 bytes (sqlarea,tmp)

 

如果碰到以上错误

--1、创建相应的目录

--2、修改pga_aggregate_target为合适的值

 

SQL> startup nomount

ORACLE instance started.

 

Total System Global Area  264241152 bytes

Fixed Size                  2083200 bytes

Variable Size              83887744 bytes

Database Buffers          171966464 bytes

Redo Buffers                6303744 bytes

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

When might a full table scan be faster than using an index in MySQL? When might a full table scan be faster than using an index in MySQL? Apr 09, 2025 am 12:05 AM

Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

Difference between clustered index and non-clustered index (secondary index) in InnoDB. Difference between clustered index and non-clustered index (secondary index) in InnoDB. Apr 02, 2025 pm 06:25 PM

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values ​​and pointers to data rows, and is suitable for non-primary key column queries.

MySQL: Simple Concepts for Easy Learning MySQL: Simple Concepts for Easy Learning Apr 10, 2025 am 09:29 AM

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

The relationship between mysql user and database The relationship between mysql user and database Apr 08, 2025 pm 07:15 PM

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

Can mysql and mariadb coexist Can mysql and mariadb coexist Apr 08, 2025 pm 02:27 PM

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Explain different types of MySQL indexes (B-Tree, Hash, Full-text, Spatial). Apr 02, 2025 pm 07:05 PM

MySQL supports four index types: B-Tree, Hash, Full-text, and Spatial. 1.B-Tree index is suitable for equal value search, range query and sorting. 2. Hash index is suitable for equal value searches, but does not support range query and sorting. 3. Full-text index is used for full-text search and is suitable for processing large amounts of text data. 4. Spatial index is used for geospatial data query and is suitable for GIS applications.

See all articles