Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Modify the ASM DG name in the RAC environment

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

-

# 1. Generate a data file rename script

-

-

-1.1 Log file path replacement

-

SQL > select 'ALTER DATABASE RENAME FILE''| | MEMBER | |''TO''| | REPLACE (MEMBER,'+ARCH_DG','+helloWorldARCH') | |''; 'FROM v$logfile where member like'% ARCH_DG%'

ALTER DATABASE RENAME FILE'+ ARCH_DG/helloWorlddb/onlinelog/group_1.257.946749259' TO'+ helloWorldARCH/helloWorlddb/onlinelog/group_1.257.946749259'

.

-

-1.2 Log file path replacement

-

SQL > select 'ALTER DATABASE RENAME FILE''| | MEMBER | |''TO''| | REPLACE (MEMBER,'+DATA01_DG','+helloWorldDATA1') | |''; 'FROM v$logfile where member like'% DATA01_DG%'

ALTER DATABASE RENAME FILE'+ DATA01_DG/helloWorlddb/onlinelog/group_1.257.946749257' TO'+ helloWorldDATA1/helloWorlddb/onlinelog/group_1.257.946749257'

.

-

-1.3 data file path replacement

-

SQL > select 'ALTER DATABASE RENAME FILE''| | NAME | |''TO''| | REPLACE (NAME,'+DATA01_DG','+helloWorldDATA1') | |''; 'FROM v$datafile

ALTER DATABASE RENAME FILE'+ DATA01_DG/helloWorlddb/datafile/system.267.946748147' TO'+ helloWorldDATA1/helloWorlddb/datafile/system.267.946748147'

.

-

1.4 temporary file path replacement

-

SQL > select 'ALTER DATABASE RENAME FILE''| | NAME | |''TO''| | REPLACE (NAME,'+DATA01_DG','+helloWorldDATA1') | |''; 'FROM v$tempfile

ALTER DATABASE RENAME FILE'+ DATA01_DG/helloWorlddb/tempfile/temp.264.946748289' TO'+ helloWorldDATA1/helloWorlddb/tempfile/temp.264.946748289'

.

-

-1.5 backup parameter files

-

SQL > create pfile='/home/oracle/helloWorld.pfile' from spfile

-

# 2. Stop the database

-

Oracle@helloWorlddb1: [/ home/oracle] srvctl config database-d helloWorlddb

Oracle@helloWorlddb1: [/ home/oracle] srvctl stop database-d helloWorlddb

-

# 3. Rename DG (grid user Action)

-

-

-- 3.1 View DG information

-

Grid@helloWorlddb1: [/ home/grid] kfod aisle RDIKUGUR 'disks=all ds=true o=all

Grid@helloWorlddb1: [/ home/grid] crsctl stat res-t

-

-3.2Delete old DG information

-

Grid@helloWorlddb1: [/ home/grid] srvctl stop diskgroup-g ARCH_DG-n helloWorlddb1,helloWorlddb2

Grid@helloWorlddb1: [/ home/grid] srvctl stop diskgroup-g DATA01_DG-n helloWorlddb1,helloWorlddb2

Grid@helloWorlddb1: [/ home/grid] srvctl remove diskgroup-g ARCH_DG-f

Grid@helloWorlddb1: [/ home/grid] srvctl remove diskgroup-g DATA01_DG-f

-

-- 3.3rename DG

-

Grid@helloWorlddb1: [/ home/grid] renamedg dgname=DATA01_DG newdgname=helloWorldDATA1 asm_diskstring='/dev/rdisk/disk*' verbose=true

Grid@helloWorlddb1: [/ home/grid] renamedg dgname=ARCH_DG newdgname=helloWorldARCH asm_diskstring='/dev/rdisk/disk*' verbose=true

-

-- 3.4View new DG information

-

Grid@helloWorlddb1: [/ home/grid] kfod aisle RDIKUGUR 'disks=all ds=true o=all

-

-- 3.5Mount the new DG

-

Grid@helloWorlddb1: [/ home/grid] sqlplus / as sysasm

SQL > alter diskgroup helloWorldDATA1 mount

SQL > alter diskgroup helloWorldARCH mount

-

-- 3.6 check the parameter information in the ASM instance

-

SQL > show parameter asm_diskgroups

-- manually adjust the disk group information corresponding to the parameters if necessary

SQL > alter system set asm_diskgroups=helloWorldDATA1,helloWorldARCH sid='+ASM1'

SQL > alter system set asm_diskgroups=helloWorldDATA1,helloWorldARCH sid='+ASM2'

-

-3.7Checking crs resource information

-

Grid@helloWorlddb1: [/ home/grid] crsctl stat res-t

-

# 4. Modify database-related DG paths (oracle users)

-

-

4.1 modify the database parameter file path (two nodes)

-

Oracle@helloWorlddb1: [/ home/oracle] cd $ORACLE_HOME/dbs

Oracle@helloWorlddb1: [/ oracle/app/oracle/11.2.0.4/db_1/dbs] vi inithelloWorlddb1.ora

Oracle@helloWorlddb2: [/ oracle/app/oracle/11.2.0.4/db_1/dbs] vi inithelloWorlddb2.ora

:% s/DATA01_DG/helloWorldDATA1/g

-

-- 4.2 modify the parameter file and DG information recorded in crs

-

Oracle@helloWorlddb1: [/ home/oracle] srvctl modify database-d helloWorlddb-p + helloWorldDATA1/helloWorlddb/spfilehelloWorlddb.ora-a helloWorldDATA1,helloWorldARCH

-

-4.3Boot the database to nomount status

-

Oracle@helloWorlddb1: [/ home/oracle] sqlplus / as sysdba

SQL > startup nomount

-

-- 4.4 modify database parameters related to DG names

-

Oracle@helloWorlddb1: [/ home/oracle] grep DATA01_DG helloWorld.pfile

Oracle@helloWorlddb1: [/ home/oracle] grep ARCH_DG helloWorld.pfile

Oracle@helloWorlddb1: [/ home/oracle] sqlplus / as sysdba

Alter system set control_files='+helloWorldDATA1/helloWorlddb/controlfile/current.265.946748283','+ helloWorldARCH/helloWorlddb/controlfile/current.256.946748283' scope=spfile

Alter system set db_create_file_dest='+helloWorldDATA1' scope=spfile

Alter system set db_create_online_log_dest_1='+helloWorldDATA1' scope=spfile

Alter system set db_create_online_log_dest_2='+helloWorldARCH' scope=spfile

-

4.5 restart and mount the database

-

SQL > shutdown immediate

SQL > startup mount

-

4.6 execute the database rename script generated in step 1

-

-

-4.7 Open the database

-

SQL > alter database open

-

-4.8 restart the cluster for verification

-

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report