Home Database Mysql Tutorial AIX环境文件系统迁移到ASM存储

AIX环境文件系统迁移到ASM存储

Jun 07, 2016 pm 02:52 PM
asm storage document environment system

AIX环境文件系统迁移到ASM存储 系统环境: 操作系统:AIX5.3-08 Oracle: Oracle 10gR2 一、构建ASM 存储环境 http://tiany.blog.51cto.com/513694/1418564 Oracle DataBase单实例使用ASM案例(4)--AIX系统Oracle 10g应用 二、迁移文件系统到ASM 1、查看ASM I

AIX环境文件系统迁移到ASM存储

系统环境:

操作系统:AIX5.3-08

Oracle:  Oracle 10gR2


一、构建ASM 存储环境

http://tiany.blog.51cto.com/513694/1418564

Oracle DataBase单实例使用ASM案例(4)--AIX系统Oracle 10g应用

二、迁移文件系统到ASM

1、查看ASM Instance

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

[oracle@aix211 ~]$!sql

sqlplus '/as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 29 17:23:24 2014

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

Connected to an idle instance.

SQL> startup

ASM instance started

Total System Global Area  130023424 bytes

Fixed Size                  2019136 bytes

Variable Size             102838464 bytes

ASM Cache                  25165824 bytes

ASM diskgroups mounted

SQL> select name ,state from v$asm_diskgroup;

NAME                           STATE

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

DG1                            MOUNTED

RCY1                           MOUNTED


SQL> 

2、修改实例参数

SQL> alter system set db_create_file_dest ='+dg1' scope=spfile;

System altered.

SQL> show parameter control

NAME                                 TYPE        VALUE

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

control_file_record_keep_time        integer     7

control_files                        string      /u01/app/oracle/oradata/prod/c

                                                 ontrol01.ctl, /dsk1/oradata/pr

                                                 od/control02.ctl

SQL> alter system set control_files='+dg1' scope=spfile;

System altered.

3、转储控制文件到控制文件

RMAN> shutdown immediate;

database closed

database dismounted

Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)

Oracle instance started

Total System Global Area    1258291200 bytes


Fixed Size                     2020552 bytes

Variable Size                318769976 bytes

Database Buffers             922746880 bytes

Redo Buffers                  14753792 bytes

RMAN> restore controlfile from '/u01/app/oracle/oradata/prod/control01.ctl';

Starting restore at 29-MAY-14

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: copied control file copy

output filename=+DG1/prod/controlfile/backup.256.848857069

Finished restore at 29-MAY-14

4、转储数据文件到ASM磁盘组

RMAN> alter database mount;

database mounted

released channel: ORA_DISK_1

RMAN> backup as copy database format '+dg1';

Starting backup at 29-MAY-14

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: starting datafile copy

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

output filename=+DG1/prod/datafile/system.257.848857161 tag=TAG20140529T173920 recid=12 stamp=848857281

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:05

channel ORA_DISK_1: starting datafile copy

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

output filename=+DG1/prod/datafile/sysaux.258.848857287 tag=TAG20140529T173920 recid=13 stamp=848857355

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15

channel ORA_DISK_1: starting datafile copy

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

output filename=+DG1/prod/datafile/example.259.848857363 tag=TAG20140529T173920 recid=14 stamp=848857404

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45

channel ORA_DISK_1: starting datafile copy

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

output filename=+DG1/prod/datafile/undotbs1.260.848857407 tag=TAG20140529T173920 recid=15 stamp=848857434

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35

channel ORA_DISK_1: starting datafile copy

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

output filename=+DG1/prod/datafile/users.261.848857443 tag=TAG20140529T173920 recid=16 stamp=848857457

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25

Finished backup at 29-MAY-14

Starting Control File and SPFILE Autobackup at 29-MAY-14

piece handle=/backup/c-259825570-20140529-01 comment=NONE

Finished Control File and SPFILE Autobackup at 29-MAY-14

RMAN> switch database to copy;

datafile 1 switched to datafile copy "+DG1/prod/datafile/system.257.848857161"

datafile 2 switched to datafile copy "+DG1/prod/datafile/undotbs1.260.848857407"

datafile 3 switched to datafile copy "+DG1/prod/datafile/sysaux.258.848857287"

datafile 4 switched to datafile copy "+DG1/prod/datafile/users.261.848857443"

datafile 5 switched to datafile copy "+DG1/prod/datafile/example.259.848857363"

5、恢复数据库

RMAN> recover database;

Starting recover at 29-MAY-14

using channel ORA_DISK_1

starting media recovery

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

Finished recover at 29-MAY-14

RMAN> alter database open;

database opened

6、迁移临时表空间

SQL> select name from v$datafile;

NAME

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

+DG1/prod/datafile/system.257.848857161

+DG1/prod/datafile/undotbs1.260.848857407

+DG1/prod/datafile/sysaux.258.848857287

+DG1/prod/datafile/users.261.848857443

+DG1/prod/datafile/example.259.848857363

SQL> select name from v$tempfile;

NAME

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

/u01/app/oracle/oradata/prod/temp01.dbf

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

Tablespace altered.

SQL> select name from v$tempfile;

NAME

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

/u01/app/oracle/oradata/prod/temp01.dbf

+DG1/prod/tempfile/temp.262.848858041

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

Tablespace altered.

SQL> select name from v$tempfile;

NAME

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

+DG1/prod/tempfile/temp.262.848858041

7、迁移redo日志组

SQL> set linesize 120

SQL> select * from v$log


    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

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

         1          1        114   52428800          2 YES INACTIVE                989355 29-MAY-14

         2          1        115   52428800          2 YES INACTIVE                989368 29-MAY-14

         3          1        113   52428800          2 YES INACTIVE                988986 29-MAY-14

         4          1        116   52428800          2 NO  CURRENT                 989387 29-MAY-14


SQL> col member for a50

SQL> select group#,member from v$logfile;

    GROUP# MEMBER

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

         3 /dsk1/oradata/prod/redo03a.log

         2 /dsk1/oradata/prod/redo02a.log

         1 /dsk1/oradata/prod/redo01a.log

         1 /dsk2/oradata/prod/redo01b.log

         2 /dsk2/oradata/prod/redo02b.log

         3 /dsk2/oradata/prod/redo03b.log

         4 /dsk1/oradata/prod/redo04a.log

         4 /dsk2/oradata/prod/redo04b.log

8 rows selected.

添加新的日志组到ASM diskgroup:

SQL> alter database add logfile  

  2  ('+dg1','+rcy1') size 10m;


SQL> alter database add logfile

  2  ('+dg1','+rcy1') size 10m;


SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

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

         1          1        114   52428800          2 YES INACTIVE                989355 29-MAY-14

         2          1        115   52428800          2 YES INACTIVE                989368 29-MAY-14

         3          1        113   52428800          2 YES INACTIVE                988986 29-MAY-14

         4          1        116   52428800          2 NO  CURRENT                 989387 29-MAY-14

         5          1          0   10485760          2 YES UNUSED                       0

         6          1          0   10485760          2 YES UNUSED                       0


6 rows selected.

SQL> select group#,member from v$logfile order by 1;

    GROUP# MEMBER

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

         1 /dsk1/oradata/prod/redo01a.log

         1 /dsk2/oradata/prod/redo01b.log

         2 /dsk1/oradata/prod/redo02a.log

         2 /dsk2/oradata/prod/redo02b.log

         3 /dsk1/oradata/prod/redo03a.log

         3 /dsk2/oradata/prod/redo03b.log

         4 /dsk1/oradata/prod/redo04a.log

         4 /dsk2/oradata/prod/redo04b.log

         5 +RCY1/prod/onlinelog/group_5.256.848858217

         5 +DG1/prod/onlinelog/group_5.263.848858213

         6 +RCY1/prod/onlinelog/group_6.257.848858259


    GROUP# MEMBER

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

         6 +DG1/prod/onlinelog/group_6.264.848858253

12 rows selected.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

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

         1          1        114   52428800          2 YES INACTIVE                989355 29-MAY-14

         2          1        115   52428800          2 YES INACTIVE                989368 29-MAY-14

         3          1        113   52428800          2 YES INACTIVE                988986 29-MAY-14

         4          1        116   52428800          2 YES ACTIVE                  989387 29-MAY-14

         5          1        117   10485760          2 YES ACTIVE                  990481 29-MAY-14

         6          1        118   10485760          2 NO  CURRENT                 990483 29-MAY-14

6 rows selected.

删除旧的日志组:

SQL> alter database drop logfile group 1;

Database altered.

SQL> alter database drop logfile group 2;

Database altered.

SQL> alter database drop logfile group 3;

Database altered.

SQL> alter system checkpoint;

System altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

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

         4          1        119   52428800          2 YES ACTIVE                  990548 29-MAY-14

         5          1        120   10485760          2 NO  CURRENT                 990566 29-MAY-14

         6          1        118   10485760          2 YES INACTIVE                990483 29-MAY-14

SQL> alter system switch logfile;

System altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

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

         4          1        119   52428800          2 YES INACTIVE                990548 29-MAY-14

         5          1        120   10485760          2 NO  ACTIVE                  990566 29-MAY-14

         6          1        121   10485760          2 NO  CURRENT                 991692 29-MAY-14

SQL> alter database drop logfile group 4;

Database altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM

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

         5          1        122   10485760          2 NO  CURRENT                 991711 29-MAY-14

         6          1        121   10485760          2 YES INACTIVE                991692 29-MAY-14

SQL> select group#,member from v$logfile order by 1;

    GROUP# MEMBER

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

         5 +DG1/prod/onlinelog/group_5.263.848858213

         5 +RCY1/prod/onlinelog/group_5.256.848858217

         6 +DG1/prod/onlinelog/group_6.264.848858253

         6 +RCY1/prod/onlinelog/group_6.257.848858259

调整recover area参数:

SQL> show parameter recover

NAME                                 TYPE        VALUE

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

db_recovery_file_dest                string

db_recovery_file_dest_size           big integer 0

recovery_parallelism                 integer     0

SQL> alter system set db_recovery_file_dest='+rcy1' scope=spfile;

System altered.

SQL> alter system set db_recovery_file_dest_size=2g scope=spfile;

System altered.

8、删除文件系统下的原数据文件

[oracle@aix211 ~]$cd /u01/app/oracle/oradata/prod/

[oracle@aix211 prod]$ls

control01.ctl  example01.dbf  sysaux01.dbf   system01.dbf   undotbs01.dbf  users01.dbf

[oracle@aix211 prod]$rm *

[oracle@aix211 prod]$ls

[oracle@aix211 prod]$

对于spfile参数可以存储在文件系统或ASM磁盘组上:

SQL> show parameter pfile;

NAME                                 TYPE        VALUE

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

spfile                               string      /u01/app/oracle/product/10.2.0

                                                 /db_1/dbs/spfileprod.ora

@至此,在AIX下迁移文件系统到ASM磁盘组工作完成,通过ASM存储,数据库读写性能得到了一定的提升。

附注:

Oracle官方文档提供的redo日志组迁移脚本

Example 8-1 Migrating the online redo logs


SET SERVEROUTPUT ON;

DECLARE

   CURSOR rlc IS

      SELECT GROUP# GRP, THREAD# THR, BYTES, 'NO' SRL

      FROM   V$LOG

      UNION

      SELECT GROUP# GRP, THREAD# THR, BYTES, 'YES' SRL

      FROM   V$STANDBY_LOG

      ORDER BY 1;

   stmt     VARCHAR2(2048);

BEGIN

   FOR rlcRec IN rlc LOOP

      IF (rlcRec.srl = 'YES') THEN

         stmt := 'ALTER DATABASE ADD STANDBY LOGFILE THREAD ' ||

                 rlcRec.thr || ' SIZE ' || rlcRec.bytes;

         EXECUTE IMMEDIATE stmt;

         stmt := 'ALTER DATABASE DROP STANDBY LOGFILE GROUP ' || rlcRec.grp;

         EXECUTE IMMEDIATE stmt;

      ELSE

         stmt := 'ALTER DATABASE ADD LOGFILE THREAD ' ||

                 rlcRec.thr || ' SIZE ' ||  rlcRec.bytes;

         EXECUTE IMMEDIATE stmt;

         BEGIN

            stmt := 'ALTER DATABASE DROP LOGFILE GROUP ' || rlcRec.grp;

            DBMS_OUTPUT.PUT_LINE(stmt);

            EXECUTE IMMEDIATE stmt;

         EXCEPTION

            WHEN OTHERS THEN

               EXECUTE IMMEDIATE 'ALTER SYSTEM SWITCH LOGFILE';

               EXECUTE IMMEDIATE 'ALTER SYSTEM CHECKPOINT GLOBAL';

               EXECUTE IMMEDIATE stmt;

         END;

      END IF;

   END LOOP;

END;

/


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CUDA's universal matrix multiplication: from entry to proficiency! CUDA's universal matrix multiplication: from entry to proficiency! Mar 25, 2024 pm 12:30 PM

General Matrix Multiplication (GEMM) is a vital part of many applications and algorithms, and is also one of the important indicators for evaluating computer hardware performance. In-depth research and optimization of the implementation of GEMM can help us better understand high-performance computing and the relationship between software and hardware systems. In computer science, effective optimization of GEMM can increase computing speed and save resources, which is crucial to improving the overall performance of a computer system. An in-depth understanding of the working principle and optimization method of GEMM will help us better utilize the potential of modern computing hardware and provide more efficient solutions for various complex computing tasks. By optimizing the performance of GEMM

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Jul 30, 2024 pm 02:17 PM

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. Mar 21, 2024 pm 09:17 PM

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

How to transfer files from Quark Cloud Disk to Baidu Cloud Disk? How to transfer files from Quark Cloud Disk to Baidu Cloud Disk? Mar 14, 2024 pm 02:07 PM

Quark Netdisk and Baidu Netdisk are currently the most commonly used Netdisk software for storing files. If you want to save the files in Quark Netdisk to Baidu Netdisk, how do you do it? In this issue, the editor has compiled the tutorial steps for transferring files from Quark Network Disk computer to Baidu Network Disk. Let’s take a look at how to operate it. How to save Quark network disk files to Baidu network disk? To transfer files from Quark Network Disk to Baidu Network Disk, you first need to download the required files from Quark Network Disk, then select the target folder in the Baidu Network Disk client and open it. Then, drag and drop the files downloaded from Quark Cloud Disk into the folder opened by the Baidu Cloud Disk client, or use the upload function to add the files to Baidu Cloud Disk. Make sure to check whether the file was successfully transferred in Baidu Cloud Disk after the upload is completed. That's it

What is hiberfil.sys file? Can hiberfil.sys be deleted? What is hiberfil.sys file? Can hiberfil.sys be deleted? Mar 15, 2024 am 09:49 AM

Recently, many netizens have asked the editor, what is the file hiberfil.sys? Can hiberfil.sys take up a lot of C drive space and be deleted? The editor can tell you that the hiberfil.sys file can be deleted. Let’s take a look at the details below. hiberfil.sys is a hidden file in the Windows system and also a system hibernation file. It is usually stored in the root directory of the C drive, and its size is equivalent to the size of the system's installed memory. This file is used when the computer is hibernated and contains the memory data of the current system so that it can be quickly restored to the previous state during recovery. Since its size is equal to the memory capacity, it may take up a larger amount of hard drive space. hiber

Huawei will launch innovative MED storage products next year: rack capacity exceeds 10 PB and power consumption is less than 2 kW Huawei will launch innovative MED storage products next year: rack capacity exceeds 10 PB and power consumption is less than 2 kW Mar 07, 2024 pm 10:43 PM

This website reported on March 7 that Dr. Zhou Yuefeng, President of Huawei's Data Storage Product Line, recently attended the MWC2024 conference and specifically demonstrated the new generation OceanStorArctic magnetoelectric storage solution designed for warm data (WarmData) and cold data (ColdData). Zhou Yuefeng, President of Huawei's data storage product line, released a series of innovative solutions. Image source: Huawei's official press release attached to this site is as follows: The cost of this solution is 20% lower than that of magnetic tape, and its power consumption is 90% lower than that of hard disks. According to foreign technology media blocksandfiles, a Huawei spokesperson also revealed information about the magnetoelectric storage solution: Huawei's magnetoelectronic disk (MED) is a major innovation in magnetic storage media. First generation ME

Which version of Apple 16 system is the best? Which version of Apple 16 system is the best? Mar 08, 2024 pm 05:16 PM

The best version of the Apple 16 system is iOS16.1.4. The best version of the iOS16 system may vary from person to person. The additions and improvements in daily use experience have also been praised by many users. Which version of the Apple 16 system is the best? Answer: iOS16.1.4 The best version of the iOS 16 system may vary from person to person. According to public information, iOS16, launched in 2022, is considered a very stable and performant version, and users are quite satisfied with its overall experience. In addition, the addition of new features and improvements in daily use experience in iOS16 have also been well received by many users. Especially in terms of updated battery life, signal performance and heating control, user feedback has been relatively positive. However, considering iPhone14

Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Jun 02, 2024 pm 02:58 PM

On April 11, Huawei officially announced the HarmonyOS 4.2 100-machine upgrade plan for the first time. This time, more than 180 devices will participate in the upgrade, covering mobile phones, tablets, watches, headphones, smart screens and other devices. In the past month, with the steady progress of the HarmonyOS4.2 100-machine upgrade plan, many popular models including Huawei Pocket2, Huawei MateX5 series, nova12 series, Huawei Pura series, etc. have also started to upgrade and adapt, which means that there will be More Huawei model users can enjoy the common and often new experience brought by HarmonyOS. Judging from user feedback, the experience of Huawei Mate60 series models has improved in all aspects after upgrading HarmonyOS4.2. Especially Huawei M

See all articles