export Oracle_sid =asm,单实例下oracle数据库从文件系统迁移到ASM上

第一步:启动ASM实例(+ASM)

[oracle@oracle ~]$ export ORACLE_SID=+ASM

[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Jan 18 13:25:46 2011

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name,status from v$instance; ASM实例已经启动

INSTANCE_NAME  STATUS

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

+ASM   STARTED

SQL> select instance_name,db_name,status from v$asm_client; ASM实例上没有数据库连接

no rows selected

SQL> select name,state from v$asm_diskgroup; ASM磁盘组已经挂载

NAME          STATE

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

DG          MOUNTED

第二步,修改目标数据库(WM)的参数文件(spfile)

[oracle@oracle ~]$ echo $ORACLE_SID

WM

[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Jan 18 13:33:59 2011

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter control_files;

NAME         TYPE  VALUE

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

control_files        string  /u01/app/oracle/oradata/WM/con

trol01.ctl, /u01/app/oracle/or

adata/WM/control02.ctl, /u01/a

pp/oracle/oradata/WM/control03

.ctl

SQL> show parameter db_create_file_dest;

NAME         TYPE  VALUE

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

db_create_file_dest       string

SQL> create pfile from spfile;

File created.

SQL> alter system set control_files='+DG' scope=spfile;在spfile中把控制文件的路径修改为ASM磁盘组

System altered.

SQL> alter system set db_create_file_dest='+DG' scope=spfile;同上,修改数据文件的创建路径

System altered.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

第三步,利用RMAN迁移目标数据库(WM)的控制文件和数据文件

[oracle@oracle ~]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Tue Jan 18 13:38:22 2011

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

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area     285212672 bytes

Fixed Size                     1273276 bytes

Variable Size                 92275268 bytes

Database Buffers             188743680 bytes

Redo Buffers                   2920448 bytes

RMAN> restore controlfile from '/u01/app/oracle/oradata/WM/control01.ctl';利用文件系统上的控制文件重建控制文件到ASM磁盘组DG上

Starting restore at 18-JAN-11

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: copied control file copy

output filename=+DG/wm/controlfile/current.256.740756507

Finished restore at 18-JAN-11

RMAN> alter database mount;

database mounted

released channel: ORA_DISK_1

RMAN> run{

2> allocate channel c1 device type disk;

3> allocate channel c2 device type disk;

4> backup as copy database format '+DG';

5> }  利用RMAN复制数据文件到ASM磁盘组DG上

allocated channel: c1

channel c1: sid=156 devtype=DISK

allocated channel: c2

channel c2: sid=152 devtype=DISK

Starting backup at 18-JAN-11

channel c1: starting datafile copy

input datafile fno=00001 name=/u01/app/oracle/oradata/WM/system01.dbf

channel c2: starting datafile copy

input datafile fno=00003 name=/u01/app/oracle/oradata/WM/sysaux01.dbf

output filename=+DG/wm/datafile/sysaux.258.740756731 tag=TAG20110118T134523 recid=2 stamp=740757197

channel c2: datafile copy complete, elapsed time: 00:07:58

channel c2: starting datafile copy

input datafile fno=00005 name=/u01/app/oracle/oradata/WM/example01.dbf

output filename=+DG/wm/datafile/system.257.740756727 tag=TAG20110118T134523 recid=3 stamp=740757268

channel c1: datafile copy complete, elapsed time: 00:09:09

channel c1: starting datafile copy

input datafile fno=00002 name=/u01/app/oracle/oradata/WM/undotbs01.dbf

output filename=+DG/wm/datafile/example.259.740757205 tag=TAG20110118T134523 recid=4 stamp=740757287

channel c2: datafile copy complete, elapsed time: 00:01:30

channel c2: starting datafile copy

input datafile fno=00004 name=/u01/app/oracle/oradata/WM/users01.dbf

output filename=+DG/wm/datafile/undotbs1.260.740757277 tag=TAG20110118T134523 recid=6 stamp=740757304

channel c1: datafile copy complete, elapsed time: 00:00:32

output filename=+DG/wm/datafile/users.261.740757299 tag=TAG20110118T134523 recid=5 stamp=740757303

channel c2: datafile copy complete, elapsed time: 00:00:12

Finished backup at 18-JAN-11

Starting Control File and SPFILE Autobackup at 18-JAN-11

piece handle=/u01/app/oracle/flash_recovery_area/WM/autobackup/2011_01_18/o1_mf_s_737250559_6mbbsvw6_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 18-JAN-11

released channel: c1

released channel: c2

RMAN> switch database to copy; 利用RMAN的SWITCH 命令修改控制文件内数据文件的指针,使其指向新位置

datafile 1 switched to datafile copy "+DG/wm/datafile/system.257.740756727"

datafile 2 switched to datafile copy "+DG/wm/datafile/undotbs1.260.740757277"

datafile 3 switched to datafile copy "+DG/wm/datafile/sysaux.258.740756731"

datafile 4 switched to datafile copy "+DG/wm/datafile/users.261.740757299"

datafile 5 switched to datafile copy "+DG/wm/datafile/example.259.740757205"

RMAN> recover database;

Starting recover at 18-JAN-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

starting media recovery

media recovery complete, elapsed time: 00:00:01

Finished recover at 18-JAN-11

RMAN> alter database open;

database opened

第四步,迁移tempfile到ASM磁盘组DG上

[oracle@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Jan 18 14:01:09 2011

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select instance_name,status from v$instance;

INSTANCE_NAME  STATUS

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

WM   OPEN

SQL> select name,status,enabled from v$tempfile;

NAME      STATUS  ENABLED

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

/u01/app/oracle/oradata/WM/temp01.dbf  ONLINE  READ WRITE

SQL> alter tablespace temp add tempfile '+DG';

Tablespace altered.

SQL> alter tablespace temp drop tempfile '/u01/app/oracle/oradata/WM/temp01.dbf';

Tablespace altered.

SQL> select name,status,enabled from v$tempfile;

NAME      STATUS  ENABLED

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

+DG/wm/tempfile/temp.262.740757907  ONLINE  READ WRITE

第五步,迁移redo logfile到ASM磁盘组DG上

SQL> select l.group#,l.sequence#,f.member as name,l.status,l.archived from v$log l,v$logfile f where f.group#=l.group#;

GROUP#  SEQUENCE# NAME           STATUS  ARC

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

3     6 /u01/app/oracle/oradata/WM/redo03.log    CURRENT  NO

2     5 /u01/app/oracle/oradata/WM/redo02.log    INACTIVE  YES

1     4 /u01/app/oracle/oradata/WM/redo01.log    INACTIVE  YES

SQL> alter database add logfile '+DG' size 10M;

Database altered.

SQL> alter database add logfile '+DG' size 10M;

Database altered.

SQL> alter database add logfile '+DG' size 10M; 添加三个redolog组到ASM磁盘组DG上

Database altered.

SQL> select l.group#,l.sequence#,f.member as name,l.status,l.archived from v$log l,v$logfile f where f.group#=l.group#;

GROUP#  SEQUENCE# NAME           STATUS  ARC

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

3     6 /u01/app/oracle/oradata/WM/redo03.log    CURRENT  NO

2     5 /u01/app/oracle/oradata/WM/redo02.log    INACTIVE  YES

1     4 /u01/app/oracle/oradata/WM/redo01.log    INACTIVE  YES

4     0 +DG/wm/onlinelog/group_4.263.740758405   UNUSED  YES

5     0 +DG/wm/onlinelog/group_5.264.740758423   UNUSED  YES

6     0 +DG/wm/onlinelog/group_6.265.740758425   UNUSED  YES

6 rows selected.

SQL> alter database drop logfile '/u01/app/oracle/oradata/WM/redo02.log';

Database altered.

SQL> alter database drop logfile '/u01/app/oracle/oradata/WM/redo01.log';删除文件系统上的redolog组

Database altered.

SQL> select l.group#,l.sequence#,f.member as name,l.status,l.archived from v$log l,v$logfile f where f.group#=l.group#;

GROUP#  SEQUENCE# NAME           STATUS  ARC

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

3     6 /u01/app/oracle/oradata/WM/redo03.log    CURRENT  NO

4     0 +DG/wm/onlinelog/group_4.263.740758405   UNUSED  YES

5     0 +DG/wm/onlinelog/group_5.264.740758423   UNUSED  YES

6     0 +DG/wm/onlinelog/group_6.265.740758425   UNUSED  YES

SQL> alter system switch logfile;

System altered.

SQL> select l.group#,l.sequence#,f.member as name,l.status,l.archived from v$log l,v$logfile f where f.group#=l.group#;

GROUP#  SEQUENCE# NAME           STATUS  ARC

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

3     6 /u01/app/oracle/oradata/WM/redo03.log    ACTIVE  NO

4     7 +DG/wm/onlinelog/group_4.263.740758405   CURRENT  NO

5     0 +DG/wm/onlinelog/group_5.264.740758423   UNUSED  YES

6     0 +DG/wm/onlinelog/group_6.265.740758425   UNUSED  YES

SQL> alter system checkpoint;

System altered.

SQL> select l.group#,l.sequence#,f.member as name,l.status,l.archived from v$log l,v$logfile f where f.group#=l.group#;

GROUP#  SEQUENCE# NAME           STATUS  ARC

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

3     6 /u01/app/oracle/oradata/WM/redo03.log    INACTIVE  NO

4     7 +DG/wm/onlinelog/group_4.263.740758405   CURRENT  NO

5     0 +DG/wm/onlinelog/group_5.264.740758423   UNUSED  YES

6     0 +DG/wm/onlinelog/group_6.265.740758425   UNUSED  YES

SQL> alter database drop logfile group 3;

Database altered.

SQL> select l.group#,l.sequence#,f.member as name,l.status,l.archived from v$log l,v$logfile f where f.group#=l.group#;

GROUP#  SEQUENCE# NAME           STATUS  ARC

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

4     7 +DG/wm/onlinelog/group_4.263.740758405   CURRENT  NO

5     0 +DG/wm/onlinelog/group_5.264.740758423   UNUSED  YES

6     0 +DG/wm/onlinelog/group_6.265.740758425   UNUSED  YES

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> select l.group#,l.sequence#,f.member as name,l.status,l.archived from v$log l,v$logfile f where f.group#=l.group#;

GROUP#  SEQUENCE# NAME           STATUS  ARC

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

4     7 +DG/wm/onlinelog/group_4.263.740758405   ACTIVE  NO

5     8 +DG/wm/onlinelog/group_5.264.740758423   ACTIVE  NO

6     9 +DG/wm/onlinelog/group_6.265.740758425   CURRENT  NO

第六步,删除文件系统上的数据文件

[oracle@oracle oradata]$ cd $ORACLE_BASE/oradata

[oracle@oracle oradata]$ ls

WM

[oracle@oracle oradata]$ rm -rf WM/

[oracle@oracle oradata]$ ls

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/533327.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

linux命令行的操作符,如何在Linux命令行中进行基本的数学运算

原标题:如何在Linux命令行中进行基本的数学运算Linux bash或命令行允许您执行基本和复杂的算术和布尔运算。像expr,jot,bc和factor等命令可以帮助您找到复杂问题的最优数学解决方案。在本文中,我们将描述这些命令并提供示例&#…

在linux关闭的命令,关于关闭Linux计算机的命令操作

关于关闭Linux计算机的命令操作shutdown -h now 立即关机shutdown -r now 立即重启Linux命令:shutdown功能说明:系统关机指令。语法:shutdown [-efFhknr][-t 秒数][时间][警告信息]补充说明:shutdown指令可以关闭所有程序&#xf…

linux什么用户什么任务,linux任务里的1 和2是什么意思

输出学过代码的小伙伴应该知道STDIN、STDOUT、STDERR通常都是指定输出通道的,perl里又称之为句柄那么1代表的就是STDOUT、2代表的是STDERR、jimmy在视频中会翻译成1代表的是正确输出,2代表的是错误输出。其实严格上不能这样去固有化去理解每一个软件的定…

linux 命令 查询丢包率,linux测试丢包率的命令 linux查看丢包率命令

关于用ping命令测网络延迟和丢包率?在工作中,ping命令用于测试网络是否可以连接。其次是网络连接的稳定性,也就是所谓的丢包率。延时参数可手动设定,影响因素较多。输入windows dos并输入Ping/all以查看所有参数分析和单个示例。L…

linux http连接超时时间设置,Linux 下 HTTP连接超时

将项目部署到现场环境,HTTP请求莫名奇妙的连接超时,通过抓包定位了问题,是请求的IP被禁止掉。其中用到了抓包,将记录记录于此。tcpdump host 120.197.89.51 -i any -vvv::06.241085 IP (tos 0x0, ttl , id , offset , flags [DF],…

linux 库的头文件安装在,“找不到jpeg的头文件或库文件”在Alpine Linux上安装枕头...

我试图在基于python:alpine的Docker容器中运行Python的Scrapy。它以前是有效的,但现在我想使用Scrapy的Image Pipeline这需要我安装枕头。作为一个简单的例子,我尝试了以下Dockerfile:FROM python:alpineRUN apk --update add libxml2-dev li…

linux .desktop权限,如何在Ubuntu Xenial Xerus 16.04 Linux Desktop上以root用户身份登录

您可能已经注意到,默认情况下,Ubuntu Xenial Xerus 16.04 Linux Desktop不具备以root管理员用户身份登录的功能。每次尝试以root用户身份在终端上登录都会导致Login incorrect错误信息:。默认的Ubuntu Linux桌面行为的背后原因是,…

DBackup环境部署linux,linux_BackupPC 安装部署

yum installperl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-XML-RSShttpdyum-y install perl-suidperl mod_perlrpm -ivhbackuppc_community-3.2.0beta0-1.rhel5.noarch.rpm1- 上面安装会创建backuppc,apache用户。vi/etc/httpd/conf/httpd.conf修改‘User apache…

linux18配置静态ip,ubuntu18配置静态IP地址

xavier NX板子上安装的事ubuntu18, 简单记录一下ubuntu18如何配置静态IP地址。首先生成一下文件:sudo netplan generate运行这一句的时候如果提示netplan command not found,执行下面的命令sudo apt install netplan.io然后创建文件sudo vim /etc/netpla…

2048游戏c语言linux简易代码,C语言实现2048游戏代码

本文实例为大家分享了C语言实现2048游戏具体代码,供大家参考,具体内容如下效果图:使用文本界面的屏幕绘图库 ncurses.设计思路:在满足条件情况下消除方块允许在游戏主界面(16 宫格)中任意一格输出数据实现代码:#include #include #include #include #inc…

linux访问网站出现443,Linux访问网站一直出现超时

问题描述:开发java应用时,需要访问此网站,在windows上一切正常访问,部署到linux服务器上就出现了访问超时[rootVM_18_115_centos ~]# wget https://wap.zhengzhoubus.com/buswechat/WifiBusInterface/transfer/line!getLineAll.ac…

linux十大证书,验证Linux上的X.509证书

openssl verify会做你想要什么,如果你想有一个简单的工具:从运行:cd /usr/share/ca-certificatesfind . -type f -exec openssl -verify {} \;这里有一个选择的输出:./telesec.de/deutsche-telekom-root-ca-2.crt: OK./brasil.gov…

linux shell结构,linux——Shell的控制结构(附shell编写代码和运行结果)

针对shell的控制结构,也就是shell编程时所需要的三种控制流程,顺序/分支和循环。在bash中,顺序可由简单的输入输出命令组成;分支语句由if、case实现;循环语句用for、while和until来实现。一、if语句1、基本的if语句语句…

c语言里字符串和字符串字面量,string literals(字符串字面量)

构造一个指定字符数组类型的未命名对象,用于需要在源代码中嵌入字符串时使用。句法" s-char-sequence "(1)u8 " s-char-sequence "(2)(since C11)u " s-char-sequence "(3)(since C11)U " s-char-sequence "(4)(since C11)…

c语言 函数指针开销,函数指针是否使程序变慢?

AnT..82您可以看到,在从性能角度来看实际上很重要的情况下,例如在一个周期中多次重复调用该函数,性能可能根本不同.这对于人们来说可能听起来很奇怪,他们习惯于将C代码视为由抽象的C机器执行的,其机器语言与C语言本身密切相关.在这种情况下,"默认情况下"对函数的间接…

tms320c2000 c语言伪指令,TMS320F240XDSP汇编及C语言多功能控制应用(附光盘)

摘要:本书以SNF2407M实验开发系统配合CPLD的SNDSP2407P接口,以简易的C语言和快速的汇编语言编写达20个以上的范例实验及多个专题制作,主要内容如下:TMS320LF2407系列MCU的硬件架构,内存配置及指令格式和其运作功能;C2000的CC或CCS程序的编辑,编译及除错等操作;DSP搭…

用C语言编写绳索运动函数,福建省教师招聘考试小学数学真题试卷

2014年福建省中小学新任教师公开招聘考试小学数学试卷(课程代码09202)1. 本试卷满分150分,考试时间120分钟。2. 本试卷分为两部分:第一部分为选择题,第二部分为非选择题。3. 请把所有答案涂、写在答题卡上。不要错位、越界答题.一、单项选择题…

c语言 三个小球排排坐,关颖三个孩子排排坐 太萌啦

0关颖三个孩子排排坐 太萌啦2019-12-10 10:596月20日,关颖在微博上晒出三个孩子坐在垫子上的照片,配文:“Terrible two has officially started today. Happy happy birthday Phi Phi! 家庭乐趣其中一件事情 就是和小朋友不断的唱生日歌吹蜡烛…

大学生学C语言用什么笔记本电脑,有哪些适合大学生用的笔记本电脑

高考成绩公布之后又有一大波新大学生即将入学,笔记本电脑也将是大学生必不可少的一款电子数码产品,但是现在市面上电脑繁多,又有哪些比较不错的电脑适合新入学的大学生呢?惠普 HP Envy 13 (2019)现在,最适合学生的笔记…

android自带下拉阻尼动画,android 有阻尼下拉刷新列表的实现方法

本文将会介绍有阻尼下拉刷新列表的实现,先来看看效果预览:这是下拉状态:这是下拉松开手指后listView回滚到刷新状态时的样子:1. 如何调用虽然效果图看起来样子不太好看,主要是因为那个蓝色的背景对不对,没关…