如何从ASM复制文件到文件系统

发布时间:2021-11-12 16:04:29 作者:柒染
来源:亿速云 阅读:330

本篇文章给大家分享的是有关如何从ASM复制文件到文件系统,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

版本10.2.0.5
1、使用RMAN:

$ sqlplus "/as sysdba"   
 SQL*Plus: Release 10.2.0.5.0 - Production on Fri Mar 16 10:02:41 2012
 Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
 Connected to an idle instance.
 SQL> startup mount;
ORACLE instance started.
 Total System Global Area 2147483648 bytes
Fixed Size                  2097696 bytes
Variable Size             503320032 bytesDatabase Buffers         1627389952 bytes
Redo Buffers               14675968 bytesDatabase mounted.
 SQL> select file#, name, bytes from v$datafile where file#=5;
 
     FILE# NAME                                                    BYTES---------- -------------------------------------------------- ---------- 5 +DATA01/dbname/datafile/users.264.730552875           524288000
 $ rman target / nocatalog
 
Recovery Manager: Release 10.2.0.5.0 - Production on Fri Mar 16 10:06:08 2012
 Copyright (c) 1982, 2007, Oracle.  All rights reserved.
 connected to target database: dbname (DBID=2555001420, not open)using target database control file instead of recovery catalog
 
RMAN> copy datafile 5 to '/arch2/users.264.730552875';
 
Starting backup at 16-MAR-12allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1624 instance=dbname1 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005 name=+DATA01/dbname/datafile/users.264.730552875
output filename=/arch2/users.264.730552875 tag=TAG20120316T100622 recid=2 stamp=778068391channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15Finished backup at 16-MAR-12
 RMAN> exit
 
 
Recovery Manager complete.$ ls -l /arch2/users.264.730552875-rw-r----- 1 oracle oinstall 524296192 Mar 16 10:06 /arch2/users.264.730552875

[@more@]

2、使用dbms_file_transfer包:

SQL> select open_mode from v$database;
 
OPEN_MODE----------READ WRITE
 SQL> create or replace directory SOURCE_DIR1 as '+DATA01/dbname/onlinelog/';
 
Directory created.
 SQL> create or replace directory ORACLE_DEST as '/arch2/';
 
Directory created.
 SQL> SQL> BEGIN  2  dbms_file_transfer.copy_file(
  3  source_directory_object =>'SOURCE_DIR1', 
  4  source_file_name => 'group_1.274.730565825',
  5  destination_directory_object => 'ORACLE_DEST',
  6  destination_file_name => 'group_1.274.730565825'
  7  );  8  END;  9  / 
 PL/SQL procedure successfully completed.
 SQL> ! ls -l /arch2/group_1.274.730565825-rw-r----- 1 oracle oinstall 524288512 Mar 14 10:49 /arch2/group_1.274.730565825

以上就是如何从ASM复制文件到文件系统,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。

推荐阅读:
  1. 从故障ASM磁盘组迁移数据库到新磁盘组
  2. oracle表空间文件系统迁移到ASM

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

asm

上一篇:怎么安装web前端中的Babel

下一篇:Django中的unittest应用是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》