Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6660524
  • 博文数量: 1005
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13071
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(1005)

文章存档

2020年(2)

2019年(93)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: Oracle

2012-09-21 14:03:49

环境:
OS:Red Hat Linux As 5
DB:11.2.0.1(ASM)
 
1.查看当前控制文件
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATA/oracl/controlfile/current.260.794393131

2.查看参数文件
SQL> show parameters control_files;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      +DATA/oracl/controlfile/curren
                                                 t.260.794393131

3.关闭数据库
shutdowm immediate
 
4.使用RMAN复制控制文件
[hxl.com::/]$rman target /
RMAN> startup nomount
Oracle instance started
Total System Global Area     338968576 bytes
Fixed Size                     1336400 bytes
Variable Size                276827056 bytes
Database Buffers              54525952 bytes
Redo Buffers                   6279168 bytes
RMAN> restore controlfile to '+RECDATA'  from '+DATA/oracl/controlfile/current.260.794393131';
Starting restore at 2012-09-21 06:53:56
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 2012-09-21 06:54:01
 
5.使用ASMCMD查看控制文件的名字
ASMCMD> pwd
+recdata/oracl/CONTROLFILE
ASMCMD> ls
current.265.794560115

新建的控制文件如下:
+RECDATA/oracl/controlfile/current.265.794560115
 
6.修改spfile
[hxl.com::/]$echo $ORACLE_SID
[hxl.com::/]$sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Fri Sep 21 06:57:42 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> alter system set control_files='+DATA/oracl/controlfile/current.260.794393131','+RECDATA/oracl/controlfile/current.265.794560115' scope=spfile;
System altered.
SQL> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area  338968576 bytes
Fixed Size                  1336400 bytes
Variable Size             276827056 bytes
Database Buffers           54525952 bytes
Redo Buffers                6279168 bytes
Database mounted.
Database opened.
 
7.查看修改后的参数
SQL> show parameters control_files;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      +DATA/oracl/controlfile/curren
                                                 t.260.794393131, +RECDATA/orac
                                                 l/controlfile/current.265.7945
                                                 60115
 
-- The End --
阅读(7898) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~