中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

修改RAC環境中的ASM DG名稱

發布時間:2020-06-30 07:50:15 來源:網絡 閱讀:312 作者:背向天堂 欄目:關系型數據庫

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

# 1. 生成數據文件重命名腳本

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


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

--1.1 日志文件路徑替換

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

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 日志文件路徑替換

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

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 數據文件路徑替換

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

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 臨時文件路徑替換

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

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 備份參數文件

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

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


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

# 2. 停數據庫

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

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


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



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

# 3. 重命名DG (grid用戶操作)

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


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

--3.1 查看DG信息

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

grid@helloWorlddb1:[/home/grid]kfod a='/dev/rdisk/*' disks=all ds=true o=all?


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


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

--3.2 刪除舊DG信息

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

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.3 重命名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.4 查看新DG信息

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

grid@helloWorlddb1:[/home/grid]kfod a='/dev/rdisk/*' disks=all ds=true o=all?


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

--3.5 掛載新DG

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

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

SQL> alter diskgroup helloWorldDATA1 mount;

SQL> alter diskgroup helloWorldARCH mount;


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

--3.6 檢查ASM實例中參數信息

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

SQL> show parameter asm_diskgroups;


--如果有需要,手工調整參數所對應的磁盤組信息

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

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

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

--3.7 檢查crs資源信息

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

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


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

# 4. 修改數據庫相關DG路徑 (oracle用戶)

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


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

--4.1 修改數據庫參數文件路徑 (兩個節點)

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


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 修改crs中記錄的參數文件與DG信息

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

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


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

--4.3 啟動數據庫到nomount狀態

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

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

SQL> startup nomount;


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

--4.4 修改與DG名稱相關的數據庫參數

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

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 重新啟動并掛載數據庫

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

SQL> shutdown immediate;

SQL> startup mount;


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

--4.6 執行步驟1中生成的數據庫重命名腳本

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


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

--4.7 打開數據庫

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

SQL> alter database open;


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

--4.8 重啟集群進行驗證

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


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

乐亭县| 衡山县| 故城县| 南华县| 桑日县| 遂川县| 抚顺市| 泽普县| 临桂县| 苏州市| 卓资县| 北海市| 延长县| 曲沃县| 开远市| 锡林郭勒盟| 彭泽县| 渭南市| 历史| 秦皇岛市| 监利县| 洛隆县| 北碚区| 西宁市| 和平区| 三原县| 冷水江市| 临邑县| 五河县| 高安市| 二连浩特市| 浦县| 龙游县| 寿阳县| 元朗区| 衡阳县| 朔州市| 丰顺县| 武功县| 丹东市| 邓州市|