How to copy ASM files in Oracle using DD

Source: Internet
Author: User
Tags valid

With the extension of the new version of the database ASM will certainly be more and more attention, the recent preparation of the system to learn the ASM, in case of unexpected needs, this is the ASM in-depth study of the first, reference: DD copy datafile in ASM

Query asm Some data file au information

Sql> SELECT group_number, File_number, NAME

2 from V$asm_alias

3 WHERE NAME like '%user% '

4 GROUP by Group_number, File_number, NAME;

Group_number File_number NAME

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

2 259 users.259.776961317

Sql> SELECT Disk_kffxp, AU_KFFXP, XNUM_KFFXP

2 from X$KFFXP

3 WHERE group_kffxp=2

4 and number_kffxp=259;

DISK_KFFXP AU_KFFXP XNUM_KFFXP

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

1 817 0

0 507 1

1 818 2

0 508 3

1 819 4

1 820 5

Sql> Select Disk_number,group_number,path from V$asm_disk

2 where group_number=2 and Disk_number in (1,0);

Disk_number Group_number PATH

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

1 2/dev/oracleasm/disks/vol4

0 2/dev/oracleasm/disks/vol3

Query the disk or partition for ASM disks

[Grid@rac1 ~]$/etc/init.d/oracleasm querydisk-d VOL3

Disk "VOL3" is a valid ASM disk on device [8,17]

[Grid@rac1 ~]$/etc/init.d/oracleasm querydisk-d VOL4

Disk "VOL4" is a valid ASM disk on device [8,18]

[Grid@rac1 ~]$ cat/proc/partitions |grep "8 17"

8 2409718 SDB1

[Grid@rac1 ~]$ cat/proc/partitions |grep "8 18"

8 3879697 SDB2

More Wonderful content: http://www.bianceng.cn/database/Oracle/

DD operation disk or partition

[Root@rac1 ~]# dd if=/dev/sdb2 bs=1024k count=1 skip=817 of=/tmp/user_1.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.188362 seconds, 5.6 MB/s

[Root@rac1 ~]# dd if=/dev/sdb1 bs=1024k count=1 skip=507 of=/tmp/user_2.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.259001 seconds, 4.0 MB/s

[Root@rac1 ~]# dd if=/dev/sdb2 bs=1024k count=1 skip=818 of=/tmp/user_3.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.182559 seconds, 5.7 MB/s

[Root@rac1 ~]# dd if=/dev/sdb1 bs=1024k count=1 skip=508 of=/tmp/user_4.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.10011 seconds, 10.5 mb/s

[Root@rac1 ~]# dd if=/dev/sdb2 bs=1024k count=2 skip=819 of=/tmp/user_5.dbf

2+0 Records in

2+0 Records out

2097152 bytes (2.1 MB) copied, 0.22389 seconds, 9.4 mb/s

[Root@rac1 ~]# ll/tmp/user_*

-rw-r--r--1 root 1048576 Apr 18:50/tmp/user_1.dbf

-rw-r--r--1 root 1048576 Apr 18:51/tmp/user_2.dbf

-rw-r--r--1 root 1048576 Apr 18:51/tmp/user_3.dbf

-rw-r--r--1 root 1048576 Apr 18:51/tmp/user_4.dbf

-rw-r--r--1 root 2097152 Apr 18:51/tmp/user_5.dbf

[Root@rac1 ~]# dd if=/tmp/user_1.dbf bs=1024k count=1 of=/tmp/user_dd.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.0104619 seconds, MB/s

[Root@rac1 ~]# dd if=/tmp/user_2.dbf bs=1024k count=1 seek=1 of=/tmp/user_dd.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.0129077 seconds, 81.2 MB/s

[Root@rac1 ~]# dd if=/tmp/user_3.dbf bs=1024k count=1 seek=2 of=/tmp/user_dd.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.00737324 seconds, MB/s

[Root@rac1 ~]# dd if=/tmp/user_4.dbf bs=1024k count=1 seek=3 of=/tmp/user_dd.dbf

1+0 Records in

1+0 Records out

1048576 bytes (1.0 MB) copied, 0.0143482 seconds, 73.1 MB/s

[Root@rac1 ~]# dd if=/tmp/user_5.dbf bs=1024k count=2 seek=4 of=/tmp/user_dd.dbf

2+0 Records in

2+0 Records out

2097152 bytes (2.1 MB) copied, 0.0809296 seconds, 25.9 MB/s

[Root@rac1 ~]# ll/tmp/user_*

-rw-r--r--1 root 1048576 Apr 18:50/tmp/user_1.dbf

-rw-r--r--1 root 1048576 Apr 18:51/tmp/user_2.dbf

-rw-r--r--1 root 1048576 Apr 18:51/tmp/user_3.dbf

-rw-r--r--1 root 1048576 Apr 18:51/tmp/user_4.dbf

-rw-r--r--1 root 2097152 Apr 18:51/tmp/user_5.dbf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.