node ->rman to RAC (迁移)
版权声明:本文为博主原创文章。未经博主同意不得转载。 https://blog.csdn.net/lmocm/article/details/34435699
--- DOMINIC 大写
---
---
recover 数据库
在运行restore的节点运行,由于备份文件在该节点上。
RMAN> recover database;
Starting recover at 21-JUN-14
using channel ORA_DISK_1
starting media recovery
unable to find archived log
archived log thread=1 sequence=11
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/21/2014 21:02:01
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 11 and starting SCN of 995895
RMAN> recover database until scn 995895;
Starting recover at 21-JUN-14
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 21-JUN-14
RMAN> restore archivelog all;
Starting restore at 21-JUN-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_DISK_1: reading from backup piece /dba/app/rmanbak/DOMINIC_arch_0ap9pjij_20140601
channel ORA_DISK_1: piece handle=/dba/app/rmanbak/DOMINIC_arch_0ap9pjij_20140601 tag=TAG20140601T232715
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 21-JUN-14
SQL> startup
ORACLE instance started.
Total System Global Area 1152450560 bytes
Fixed Size 2252584 bytes
Variable Size 855638232 bytes
Database Buffers 285212672 bytes
Redo Buffers 9347072 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
DOMINIC READ WRITE
SQL> select comp_name, version, status from sys.dba_registry;
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ --------------------------------------------
OWB
11.2.0.4.0 VALID
Oracle Application Express
3.2.1.00.12 VALID
Oracle Enterprise Manager
11.2.0.4.0 VALID
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ --------------------------------------------
OLAP Catalog
11.2.0.4.0 VALID
Spatial
11.2.0.4.0 VALID
Oracle Multimedia
11.2.0.4.0 VALID
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ --------------------------------------------
Oracle XML Database
11.2.0.4.0 VALID
Oracle Text
11.2.0.4.0 VALID
Oracle Expression Filter
11.2.0.4.0 VALID
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ --------------------------------------------
Oracle Rules Manager
11.2.0.4.0 VALID
Oracle Workspace Manager
11.2.0.4.0 VALID
Oracle Database Catalog Views
11.2.0.4.0 VALID
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ --------------------------------------------
Oracle Database Packages and Types
11.2.0.4.0 VALID
JServer JAVA Virtual Machine
11.2.0.4.0 VALID
Oracle XDK
11.2.0.4.0 VALID
COMP_NAME
--------------------------------------------------------------------------------
VERSION STATUS
------------------------------ --------------------------------------------
Oracle Database Java Packages
11.2.0.4.0 VALID
OLAP Analytic Workspace
11.2.0.4.0 VALID
Oracle OLAP API
11.2.0.4.0 VALID
18 rows selected.
SQL> select * from v$option where parameter = 'Real Application Clusters';
PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
Real Application Clusters
TRUE
SQL> show parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
cluster_interconnects string
SQL> show parameter thread;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
parallel_threads_per_cpu integer 2
thread integer 1
SQL> show parameter instance_number
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_number integer 1
SQL> show parameter cluster_database;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
SQL> show parameter cluster_database_instances
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database_instances integer 2
创建节点2的undo 表空间
SYS@anqing1(rac1)> show parameter undo_tablespace
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_tablespace string UNDOTBS1
这个是rac1上节点的信息。我们在之前的在spfile參数指定的rac2节点的undo 空间是UNDOTBS2.
所以这里我们创建该undo 表空间,并指定相关參数。
SYS@dominic(rac1)> create undo tablespace UNDOTBS2 datafile '+DATA/ANQING/datafile/undotbs02.dbf' size 500m;
SQL> create undo tablespace UNDOTBS2 datafile '+DATA_DISK/DOMINIC/datafile/undotbs02.dbf' size 500m;
Tablespace created.
SQL> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA_DISK/dominic/datafile/system.263.850855443
+DATA_DISK/dominic/datafile/sysaux.262.850855443
+DATA_DISK/dominic/datafile/undotbs1.261.850855443
+DATA_DISK/dominic/datafile/users.265.850855443
+DATA_DISK/dominic/datafile/example.264.850855443
+DATA_DISK/dominic/datafile/dominic_tbs.260.850855443
+DATA_DISK/dominic/datafile/undotbs02.dbf
ASMCMD> pwd
+data_disk/dominic/datafile
ASMCMD> ls
DOMINIC_TBS.260.850855443
EXAMPLE.264.850855443
SYSAUX.262.850855443
SYSTEM.263.850855443
UNDOTBS1.261.850855443
UNDOTBS2.269.850858531
USERS.265.850855443
undotbs02.dbf
SQL> SELECT NAME FROM V$TABLESPACE;
NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
EXAMPLE
DOMINIC_TBS
UNDOTBS2
加入rac2 节点的redo 文件
SQL> alter database add logfile thread 2 group 4 ('+DATA_DISK','+LOG_DISK')
SIZE 50M ;
Database altered.
SQL> alter database add logfile thread 2 group 5('+DATA_DISK','+LOG_DISK')
SIZE 50M ;
Database altered.
SQL> alter database add logfile thread 2 group 6('+DATA_DISK','+LOG_DISK')
SIZE 50M;
Database altered.
=========================
=================================
SQL> alter database enable thread 2;
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down. ---- 重新启动节点1和节点2 上的实例。使相关參数生效
=====(一下在节点2 上)
查看节点二 參数。添加參数 export
ORACLE_UNQNAME=dominic
[oracle@dominic2 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_SID=dominic2
export ORACLE_UNQNAME=dominic
export ORACLE_BASE=/dba/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export LANG=C
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
umask 022
[oracle@dominic2 ~]$
sqlplus / as sysdba --启动节点2
SQL*Plus: Release 11.2.0.4.0 Production on Sat Jun 21 21:52:19 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1152450560 bytes
Fixed Size 2252584 bytes
Variable Size 855638232 bytes
Database Buffers 285212672 bytes
Redo Buffers 9347072 bytes
Database mounted.
Database opened.
SQL> show parameter cluster
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
cluster_interconnects string
SQL> select instance_number,instance_name,host_name from gv$instance; --最后确认是否起来了!
INSTANCE_NUMBER INSTANCE_NAME HOST_NAME
--------------- ---------------- ----------------------------------------------------------------
1 dominic1 dominic1.com
2 dominic2 dominic2.com
到如今已经是集群了。只是另一些收尾的工作要做。
运行catclust.sql脚本来创建相关视图
SQL> @$ORACLE_HOME/rdbms/admin/catclust.sql
重建Temp 表空间
在恢复的时候,会自己主动创建TEMP 表空间。和一个前辈聊到过这个问题,他说这个temp 文件好像没有起到作用。 尤其是数据量大的时候。他建议重建加入temp 数据文件。
这个还是小心为好,反正重建一些也不费什么事。
可是万一出问题,就是大麻烦。
SQL> select name from v$tempfile;
NAME
----------------------------------------------------------------------------------------------------
/dba/app/oracle/oradata/dominic/temp01.dbf --两个节点一样
SQL> alter tablespace temp add tempfile '+DATA_DISK' size 400m;
Tablespace altered.
SQL> select name from v$tempfile;
NAME
----------------------------------------------------------------------------------------------------
/dba/app/oracle/oradata/dominic/temp01.dbf
+DATA_DISK/dominic/tempfile/temp.273.850859907
SQL> alter database tempfile '/dba/app/oracle/oradata/dominic/temp01.dbf' offline;
Database altered.
SQL> alter database tempfile '/dba/app/oracle/oradata/dominic/temp01.dbf' drop including datafiles;
Database altered.
---如今两个节点查看,都是一样的,
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
+DATA_DISK/dominic/tempfile/temp.273.850859907
加入集群的监听:
之前须要确认:
[grid@dominic2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....DISK.dg ora....up.type ONLINE ONLINE dominic1
ora....ER.lsnr ora....er.type ONLINE ONLINE dominic1
ora....N1.lsnr ora....er.type ONLINE ONLINE dominic1
ora....DISK.dg ora....up.type ONLINE ONLINE dominic1
ora....DATA.dg ora....up.type ONLINE ONLINE dominic1
ora.asm ora.asm.type ONLINE ONLINE dominic1
ora.cvu ora.cvu.type ONLINE ONLINE dominic1
ora....SM1.asm application ONLINE ONLINE dominic1
ora....C1.lsnr application ONLINE ONLINE dominic1
ora....ic1.gsd application OFFLINE OFFLINE
ora....ic1.ons application ONLINE ONLINE dominic1
ora....ic1.vip ora....t1.type ONLINE ONLINE dominic1
ora....SM2.asm application ONLINE ONLINE dominic2
ora....C2.lsnr application ONLINE ONLINE dominic2
ora....ic2.gsd application OFFLINE OFFLINE
ora....ic2.ons application ONLINE ONLINE dominic2
ora....ic2.vip ora....t1.type ONLINE ONLINE dominic2
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE dominic1
ora.oc4j ora.oc4j.type ONLINE ONLINE dominic1
ora.ons ora.ons.type ONLINE ONLINE dominic1
ora....ry.acfs ora....fs.type ONLINE ONLINE dominic1
ora.scan1.vip ora....ip.type ONLINE ONLINE dominic1
[grid@dominic1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....DISK.dg ora....up.type ONLINE ONLINE dominic1
ora....ER.lsnr ora....er.type ONLINE ONLINE dominic1
ora....N1.lsnr ora....er.type ONLINE ONLINE dominic1
ora....DISK.dg ora....up.type ONLINE ONLINE dominic1
ora....DATA.dg ora....up.type ONLINE ONLINE dominic1
ora.asm ora.asm.type ONLINE ONLINE dominic1
ora.cvu ora.cvu.type ONLINE ONLINE dominic1
ora....SM1.asm application ONLINE ONLINE dominic1
ora....C1.lsnr application ONLINE ONLINE dominic1
ora....ic1.gsd application OFFLINE OFFLINE
ora....ic1.ons application ONLINE ONLINE dominic1
ora....ic1.vip ora....t1.type ONLINE ONLINE dominic1
ora....SM2.asm application ONLINE ONLINE dominic2
ora....C2.lsnr application ONLINE ONLINE dominic2
ora....ic2.gsd application OFFLINE OFFLINE
ora....ic2.ons application ONLINE ONLINE dominic2
ora....ic2.vip ora....t1.type ONLINE ONLINE dominic2
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE dominic1
ora.oc4j ora.oc4j.type ONLINE ONLINE dominic1
ora.ons ora.ons.type ONLINE ONLINE dominic1
ora....ry.acfs ora....fs.type ONLINE ONLINE dominic1
ora.scan1.vip ora....ip.type ONLINE ONLINE dominic1
将其它信息注冊到CRS里
[grid@dominic1 ~]$ srvctl add database -d dominic -o $ORACLE_HOME
[grid@dominic1 ~]$ srvctl add instance -d dominic -i dominic1 -n dominic1 (-n 为hostname, oracle,grid
用户都能够)
[grid@dominic1 ~]$ srvctl add instance -d dominic -i dominic2 -n dominic2
改动instance 和 asm 之间的依赖关系:
srvctl modify instance -d <db_unique_name> -i <SID1> -s <+ASM1>
[oracle@dominic1 ~]$ srvctl modify instance -d dominic -i dominic1 -s +ASM1
Warning:-s option has been deprecated and will be ignored.
[oracle@dominic1 ~]$ srvctl modify instance -d dominic -i dominic2 -s +ASM2
Warning:-s option has been deprecated and will be ignored.
-----在这里算是能够完毕了:
查询验证一下:
[grid@dominic1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....DISK.dg ora....up.type ONLINE ONLINE dominic1
ora....ER.lsnr ora....er.type ONLINE ONLINE dominic1
ora....N1.lsnr ora....er.type ONLINE ONLINE dominic1
ora....DISK.dg ora....up.type ONLINE ONLINE dominic1
ora....DATA.dg ora....up.type ONLINE ONLINE dominic1
ora.asm ora.asm.type ONLINE ONLINE dominic1
ora.cvu ora.cvu.type ONLINE ONLINE dominic1
ora.dominic.db ora....se.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE dominic1
ora....C1.lsnr application ONLINE ONLINE dominic1
ora....ic1.gsd application OFFLINE OFFLINE
ora....ic1.ons application ONLINE ONLINE dominic1
ora....ic1.vip ora....t1.type ONLINE ONLINE dominic1
ora....SM2.asm application ONLINE ONLINE dominic2
ora....C2.lsnr application ONLINE ONLINE dominic2
ora....ic2.gsd application OFFLINE OFFLINE
ora....ic2.ons application ONLINE ONLINE dominic2
ora....ic2.vip ora....t1.type ONLINE ONLINE dominic2
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE dominic1
ora.oc4j ora.oc4j.type ONLINE ONLINE dominic1
ora.ons ora.ons.type ONLINE ONLINE dominic1
ora....ry.acfs ora....fs.type ONLINE ONLINE dominic1
ora.scan1.vip ora....ip.type ONLINE ONLINE dominic1
---------------------
[grid@dominic1 ~]$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA_DISK.dg
ONLINE ONLINE dominic1
ONLINE ONLINE dominic2
ora.LISTENER.lsnr
ONLINE ONLINE dominic1
ONLINE ONLINE dominic2
ora.LOG_DISK.dg
ONLINE ONLINE dominic1
ONLINE ONLINE dominic2
ora.OCR_DATA.dg
ONLINE ONLINE dominic1
ONLINE ONLINE dominic2
ora.asm
ONLINE ONLINE dominic1 Started
ONLINE ONLINE dominic2 Started
ora.gsd
OFFLINE OFFLINE dominic1
OFFLINE OFFLINE dominic2
ora.net1.network
ONLINE ONLINE dominic1
ONLINE ONLINE dominic2
ora.ons
ONLINE ONLINE dominic1
ONLINE ONLINE dominic2
ora.registry.acfs
ONLINE ONLINE dominic1
ONLINE ONLINE dominic2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dominic1
ora.cvu
1 ONLINE ONLINE dominic1
ora.dominic.db
1 OFFLINE OFFLINE
2 OFFLINE OFFLINE
ora.dominic1.vip
1 ONLINE ONLINE dominic1
ora.dominic2.vip
1 ONLINE ONLINE dominic2
ora.oc4j
1 ONLINE ONLINE dominic1
ora.scan1.vip
1 ONLINE ONLINE dominic1
这里并没有启动,由于我们的服务是刚加入上来的,还没有同步。 我们启动一下就ok了
[grid@dominic1 ~]$ srvctl start database -d dominic
=========================(以上都在节点一操作)
node ->rman to RAC (迁移)的更多相关文章
- 数据迁移_老集群RAC迁移数据恢复到新集群RAC
数据迁移_老集群RAC迁移数据恢复到新集群RAC 作者:Eric 微信:loveoracle11g 1.把老集群RAC备份的数据远程拷贝到新集群RAC [root@old-rac-node1 ~]# ...
- Rman实现数据库迁移
Rman实现数据库迁移(从库A迁移到库B)环境:服务器A:Oracle10g+AS3服务器B:Oracle10g+AS4准备工作: 1 在数据库B上建立与库A相同的目录结构(若由于磁盘空间等原因可以用 ...
- Oracle常用脚本——通过RMAN配置RAC环境的分布式磁带机
RAC的两个节点:node1,node2 RAC的两个实例:dbrac1,dbrac2 用户,密码的东西大家看看就懂了.设置成8能通道的. #!/bin/bash rman target / < ...
- Node.js 指南(迁移到安全的Buffer构造函数)
迁移到安全的Buffer构造函数 移植到Buffer.from()/Buffer.alloc() API. 概述 本指南介绍了如何迁移到安全的Buffer构造函数方法,迁移修复了以下弃用警告: 由于安 ...
- oracle 11g rac for linux add node (oracle 11g rac 节点添加)
说明: Adding Oracle RAC to Nodes with Oracle Clusterware Installed步骤来自ORACLE 官方文档: https://docs.oracle ...
- RAC迁移至单机考虑几大因素
数据库迁移几大因素 1. 停机时间 2. 源端,目标端 操作系统平台,版本,对应的数据库版本 3. 数据量 4. 外界因素,存储空间,网络等
- oracle11g 在azure云中使用rman进行实例迁移
1,開始备份 备份脚本rman_full_backup.sh内容例如以下: #!/bin/sh export DATE=`date +%F` export BACK_DIR='/backupdisk/ ...
- Oracle 11G RAC For ASM 利用RMAN COPY进行存储迁移
转载请注明出处 一.需求背景 客户数据库存储空间接近存满,需购置一台新的存储,进行数据迁移,客户允许少量停机时间. 二.实施方法讨论 利用ASM rebalance 进行迁移 可以实现0宕机进行迁移, ...
- 2级迁移类Q201-Oracle RAC 到单机RMAN迁移(同字节序)非公
项目文档引子系列是根据项目原型,制作的测试实验文档,目的是为了提升项目过程中的实际动手能力,打造精品文档AskScuti. 项目文档引子系列目前不对外发布,仅作为博客记录.如学员在实际工作过程中需提前 ...
随机推荐
- Java 中的代理模式及动态代理
原文:https://blog.csdn.net/briblue/article/details/73928350
- EffecJava Method
坚持使用Overrider注解,可以预防我们并没有重载的情况出现. 除非使用者绝对安全,不然使用保护性拷贝,可以使程序安全. public class Period {//没有拷贝安全 private ...
- L319 Zigbee test coding- field test fail-base on EFR32MG1
1 Test coding Zigbee test of Tx power and frequency for every channel. Testing Procedure1) Power up ...
- JavaServlet的文件上传和下载
关于JSP中的文件上传和下载操作 先分析一下上传文件的流程 1-先通过前段页面中的选择文件选择要上传的图片 index.jsp <%@ page language="java" ...
- php 正则概述
修饰符 s 模式中的点号元字符匹配所有字符 非打印字符 字符 含义 \cx 匹配由x指明的控制字符.例如, \cM 匹配一个 Control-M 或回车符.x 的值必须为 A-Z 或 a-z ...
- LimeSDR Getting Started Quickly | LimeSDR上手指南
0x00 概览 LimeSDR部分特性: USB 3.0 : 4 x Tx 发射天线接口 6 x Rx 接收天线接口: 可用于Wi-Fi, GSM, UMTS, LTE, LoRa, Bluetoot ...
- Java学习笔记28(IO字节流)
IO定义: 写:Output操作:将内存上的数据持久化 到设备上,这个动作称为输出: 读:Input操作:把硬盘上的东西读取到内存,这个动作称为输入: 这两种操作称为IO流 ...
- IDEA_debug窗口问题,debugger窗口消失,窗口漂浮等
- 几种常见数据库的driverClassName和url
DB2: driverClassName:com.ibm.db2.jcc.DB2Driver url:jdbc:db2://localhost:50000/sample Oracle: driverC ...
- freemarker 获取当前日期
在freemarker中获取当前日期:${.now}获取当前日期并比较:<#if holdDate?date gt .now?date>.........</#if> 如果要做 ...