Oracle 10g RAC RMAN备份异机单实例恢复
本文通过将Oracle10gRACRMAN的完整的备份进行异机恢复的过程,可以对在恢复的过程中可以发现备份时的一些问题。比如规档日志的冗余,控制文件与参数文件的自动备
本文通过将Oracle 10g RAC RMAN的完整的备份进行异机恢复的过程,可以对在恢复的过程中可以发现备份时的一些问题。比如规档日志的冗余,控制文件与参数文件的自动备份的利用等,虚拟主机,本示例是拿了rman的备份集进行备份的,所以在最后的启动数据库的过程中出现了问题,提示控制文件过旧等问题,所以备份需要经过详细高可用的设计,才能在恢复过程中降低风险。
本文出自:
一、环境说明
操作系统版本: Oracle Enterprise linux 5.8 x64
1. 源数据库服务器
Oracle版本: Oracle 10g RAC 10.2.0.5 64位
Oracle_SID: orcl
2. 目标数据库服务器
Oracle版本 : Oracle 10g 10.2.0.5 64位
Oracle_SID : orcl
只安装了oracle软件,监听,没有dbca操作
二、源DB服务器
1. 源服务器环境说明
源服务器通过执行RAC RMAN备份。需要执行异机恢复操作。
2. 打包或拷贝rman备份目录
$ cd /u01
$ tar czvf rman_bak.tar.gz rman_bak/
三、目的服务器上做RMAN恢复准备
1. 拷贝RMAN备份的数据
# cd /u01/rman_bak/data/
# ll
-rw-r----- 1 oracle oinstall 1080751616 07-18 16:58 archlog.ORCL.level.0.0rof2j8q_1_1_20130718
-rw-r----- 1 oracle oinstall 1018279424 07-18 16:58 archlog.ORCL.level.0.0sof2j8n_1_1_20130718
-rw-r----- 1 oracle oinstall 58086912 07-18 16:58 archlog.ORCL.level.0.0tof2j9l_1_1_20130718
-rw-r----- 1 oracle oinstall 493084672 07-18 16:58 data.ORCL.level.0.0vof2j9v_1_1_20130718
-rw-r----- 1 oracle oinstall 409280512 07-18 16:58 data.ORCL.level.0.10of2j9s_1_1_20130718
-rw-r----- 1 oracle oinstall 15466496 07-18 16:58 data.ORCL.level.0.11of2jae_1_1_20130718
-rw-r----- 1 oracle oinstall 98304 07-18 16:58 spfile_12of2jah_1_1_20130718
#
2. 创建规档日志目录
su - oracle
mkdir -p /u01/archivelog
3. 创建数据库基本目录
说明: 由于rman备份的信息都是记录在controlfile中,所以目录结构应该与原数据库的一致。
mkdir -p /u01/app/oracle/admin/orcl/{adump,bdump,cdump,ddump,udump}
mkdir -p /u01/app/oracle/oradata/orcl
mkdir -p /u01/app/oracle/flash_recovery_area/ORCL
三、目标服务器上恢复数据
说明: 在目标服务器上创建好参数文件中定义的目录,美国空间,一一在目标服务器创建完毕。
1. 启动到nomount状态
# su - oracle
$ echo 'db_name=orcl' > $ORACLE_HOME/dbs/initorcl.ora
$ export ORACLE_SID=orcl
$ rman target /
RMAN> startup nomount;
2. 通过恢复spfile文件恢复pfile文件
RMAN> restore spfile to pfile '/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora' from '/u01/rman_bak/data/spfile_12of2jah_1_1_20130718';
Starting restore at 19-7? -13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
channel ORA_DISK_1: autobackup found: /u01/rman_bak/data/spfile_12of2jah_1_1_20130718
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 19-7? -13
RMAN> quit
3. 编辑pfile文件
# 修改pfile使用之适合单实例文件系统数据库
$ vi /u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora
#注释掉RAC集群的配置参数,并修改部分单实例参数。
#orcl2.__db_cache_size=822083584
#orcl1.__db_cache_size=771751936
#orcl2.__java_pool_size=16777216
#orcl1.__java_pool_size=16777216
#orcl2.__large_pool_size=16777216
#orcl1.__large_pool_size=16777216
#orcl2.__shared_pool_size=352321536
#orcl1.__shared_pool_size=402653184
#orcl2.__streams_pool_size=0
#orcl1.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.background_dump_dest='/u01/app/oracle/admin/orcl/bdump'
#*.cluster_database_instances=2
#*.cluster_database=true
*.compatible='10.2.0.5.0'
*.control_file_record_keep_time=40
*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/orcl/cdump'
*.db_block_size=8192
#*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='orcl'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=21474836480
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
#orcl2.instance_number=2
#orcl1.instance_number=1
*.job_queue_processes=10
#*.log_archive_dest_1='LOCATION=+RECOVERY'
*.log_archive_dest_1='LOCATION=/u01/archivelog'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=402653184
*.processes=200
#*.remote_listener='LISTENERS_ORCL'
*.remote_login_passwordfile='exclusive'
*.sessions=225
*.sga_target=1210056704
#orcl2.thread=2
#orcl1.thread=1
*.undo_management='AUTO'
#orcl2.undo_tablespace='UNDOTBS2'
#orcl1.undo_tablespace='UNDOTBS1'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/orcl/udump'
4. 通过修改的pfile重新创建spfile文件
$ sqlplus /nolog
SQL> conn / as sysdba;
SQL> shutdown immediate;
SQL> create spfile from pfile;
# 重新通spfile参数启动
SQL> startup nomount;
SQL> quit
5. 恢复控制文件

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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.

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.

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.

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 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.

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.

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.

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.
