Some adminitration script for RAC % ASM
dd if=/dev/zero of=/dev/VG_Disk1/LV_data01 bs=8192
dd if=/dev/zero of=/dev/VG_Disk2/LV_data02 bs=8192
dd if=/dev/zero of=/dev/VG_Disk2/LV_data03 bs=8192
/etc/init.d/oracleasm deletedisk DISK01
/etc/init.d/oracleasm deletedisk DISK02
/etc/init.d/oracleasm deletedisk DISK03
/etc/init.d/oracleasm createdisk DISK01 /dev/VG_Disk1/LV_data01
/etc/init.d/oracleasm createdisk DISK02 /dev/VG_Disk2/LV_data02
/etc/init.d/oracleasm createdisk DISK03 /dev/VG_Disk2/LV_data03
/etc/init.d/oracleasm querydisk DISK01
/etc/init.d/oracleasm querydisk DISK02
/etc/init.d/oracleasm querydisk DISK03
/PROD/oracle/product/grid/SL/perl/bin/perl -I/PROD/oracle/product/grid/SL/perl/lib -I/PROD/oracle/product/grid/SL/crs/install /PROD/oracle/product/grid/SL/crs/install/rootcrs.pl -deconfig -force
sh /PROD/oracle/product/grid/SL/root.sh
/PROD/oracle/product/grid/SL/perl/bin/perl -I/PROD/oracle/product/grid/SL/perl/lib -I/PROD/oracle/product/grid/SL/crs/install /PROD/oracle/product/grid/SL/crs/install/roothas.pl
/etc/init.d/init.ohasd disable
export ORACLE_SID=+ASM
export ORACLE_BASE=/PROD/oracle/product/grid
export ORACLE_HOME=/PROD/oracle/product/grid/SL
export PATH=$ORACLE_HOME/bin:$PATH:.
crsctl start has
crsctl status resource -t
srvctl status service -d FUSION
srvctl stop database -d FUSION
crsctl stop resource ora.asm
srvctl remove database -d FUSION
srvctl start diskgroup -g [-n ""]
srvctl stop diskgroup -g [-n ""] [-f]
srvctl status diskgroup -g [-n ""] [-a]
srvctl enable diskgroup -g [-n ""]
srvctl disable diskgroup -g [-n ""]
srvctl remove diskgroup -g [-f]
srvctl remove diskgroup -g data03
srvctl remove diskgroup -g data02
srvctl remove diskgroup -g data01
srvctl remove asm -f
srvctl add asm -p $ORACLE_HOME/dbs/init+ASM.ora
sqlplus '/as sysasm'
DROP DISKGROUP DATA01 INCLUDING CONTENTS;
DROP DISKGROUP DATA02 INCLUDING CONTENTS;
DROP DISKGROUP DATA03 INCLUDING CONTENTS;
CREATE DISKGROUP DATA01 EXTERNAL REDUNDANCY DISK 'ORCL:DISK01';
CREATE DISKGROUP DATA02 EXTERNAL REDUNDANCY DISK 'ORCL:DISK02';
CREATE DISKGROUP DATA03 EXTERNAL REDUNDANCY DISK 'ORCL:DISK03';
export ORACLE_SID=FUSION
export ORACLE_BASE=/PROD/oracle/product/fsdb
export ORACLE_HOME=/PROD/oracle/product/fsdb/SL
export PATH=$ORACLE_HOME/bin:$PATH:.
Convert DB from NO ASM to ASM:
set serveroutput on;
declare
cursor df01 is select name from v$datafile where name like '%/PROD/oradata/data01/%';
cursor df02 is select name from v$datafile where name like '%/PROD/oradata/data02/%';
cursor df03 is select name from v$datafile where name like '%/PROD/oradata/data03/%';
begin
dbms_output.put_line('run');
dbms_output.put_line('{');
for dfrec in df01 loop
dbms_output.put_line('set newname for datafile ' || '''' || dfrec.name || '''' || ' to ' || '''+' || 'DATA01' || dfrec.name || '''' || ';');
end loop;
for dfrec in df02 loop
dbms_output.put_line('set newname for datafile ' || '''' || dfrec.name || '''' || ' to ' || '''+' || 'DATA02' || dfrec.name || '''' || ';');
end loop;
for dfrec in df03 loop
dbms_output.put_line('set newname for datafile ' || '''' || dfrec.name || '''' || ' to ' || '''+' || 'DATA03' || dfrec.name || '''' || ';');
end loop;
dbms_output.put_line('restore database;');
dbms_output.put_line('switch datafile all;');
dbms_output.put_line('}');
end;
[@more@]
dd if=/dev/zero of=/dev/VG_Disk2/LV_data02 bs=8192
dd if=/dev/zero of=/dev/VG_Disk2/LV_data03 bs=8192
/etc/init.d/oracleasm deletedisk DISK01
/etc/init.d/oracleasm deletedisk DISK02
/etc/init.d/oracleasm deletedisk DISK03
/etc/init.d/oracleasm createdisk DISK01 /dev/VG_Disk1/LV_data01
/etc/init.d/oracleasm createdisk DISK02 /dev/VG_Disk2/LV_data02
/etc/init.d/oracleasm createdisk DISK03 /dev/VG_Disk2/LV_data03
/etc/init.d/oracleasm querydisk DISK01
/etc/init.d/oracleasm querydisk DISK02
/etc/init.d/oracleasm querydisk DISK03
/PROD/oracle/product/grid/SL/perl/bin/perl -I/PROD/oracle/product/grid/SL/perl/lib -I/PROD/oracle/product/grid/SL/crs/install /PROD/oracle/product/grid/SL/crs/install/rootcrs.pl -deconfig -force
sh /PROD/oracle/product/grid/SL/root.sh
/PROD/oracle/product/grid/SL/perl/bin/perl -I/PROD/oracle/product/grid/SL/perl/lib -I/PROD/oracle/product/grid/SL/crs/install /PROD/oracle/product/grid/SL/crs/install/roothas.pl
/etc/init.d/init.ohasd disable
export ORACLE_SID=+ASM
export ORACLE_BASE=/PROD/oracle/product/grid
export ORACLE_HOME=/PROD/oracle/product/grid/SL
export PATH=$ORACLE_HOME/bin:$PATH:.
crsctl start has
crsctl status resource -t
srvctl status service -d FUSION
srvctl stop database -d FUSION
crsctl stop resource ora.asm
srvctl remove database -d FUSION
srvctl start diskgroup -g
srvctl stop diskgroup -g
srvctl status diskgroup -g
srvctl enable diskgroup -g
srvctl disable diskgroup -g
srvctl remove diskgroup -g
srvctl remove diskgroup -g data03
srvctl remove diskgroup -g data02
srvctl remove diskgroup -g data01
srvctl remove asm -f
srvctl add asm -p $ORACLE_HOME/dbs/init+ASM.ora
sqlplus '/as sysasm'
DROP DISKGROUP DATA01 INCLUDING CONTENTS;
DROP DISKGROUP DATA02 INCLUDING CONTENTS;
DROP DISKGROUP DATA03 INCLUDING CONTENTS;
CREATE DISKGROUP DATA01 EXTERNAL REDUNDANCY DISK 'ORCL:DISK01';
CREATE DISKGROUP DATA02 EXTERNAL REDUNDANCY DISK 'ORCL:DISK02';
CREATE DISKGROUP DATA03 EXTERNAL REDUNDANCY DISK 'ORCL:DISK03';
export ORACLE_SID=FUSION
export ORACLE_BASE=/PROD/oracle/product/fsdb
export ORACLE_HOME=/PROD/oracle/product/fsdb/SL
export PATH=$ORACLE_HOME/bin:$PATH:.
Convert DB from NO ASM to ASM:
set serveroutput on;
declare
cursor df01 is select name from v$datafile where name like '%/PROD/oradata/data01/%';
cursor df02 is select name from v$datafile where name like '%/PROD/oradata/data02/%';
cursor df03 is select name from v$datafile where name like '%/PROD/oradata/data03/%';
begin
dbms_output.put_line('run');
dbms_output.put_line('{');
for dfrec in df01 loop
dbms_output.put_line('set newname for datafile ' || '''' || dfrec.name || '''' || ' to ' || '''+' || 'DATA01' || dfrec.name || '''' || ';');
end loop;
for dfrec in df02 loop
dbms_output.put_line('set newname for datafile ' || '''' || dfrec.name || '''' || ' to ' || '''+' || 'DATA02' || dfrec.name || '''' || ';');
end loop;
for dfrec in df03 loop
dbms_output.put_line('set newname for datafile ' || '''' || dfrec.name || '''' || ' to ' || '''+' || 'DATA03' || dfrec.name || '''' || ';');
end loop;
dbms_output.put_line('restore database;');
dbms_output.put_line('switch datafile all;');
dbms_output.put_line('}');
end;
[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35496/viewspace-1057240/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Some Dictionary Views For ASMViewASM
- script of check repair ASM DISKGROUPAIASM
- [Oracle Script] ASM Disks Performance metricOracleASMORM
- [Oracle Script] ASM Disk Groups UsedOracleASM
- RMAN Duplicate Database From RAC ASM To RAC ASM [ID 461479.1]DatabaseASM
- Using SQL Script Get Information about ASMSQLORMASM
- goldengate + asm + racGoASM
- RAC+ASM+DATAGUARDASM
- RAC(ASM)歸檔模式修改ASM模式
- ORACLE RAC重建ASM磁碟組OracleASM
- ASMIOSTAT Script to collect iostats for ASM disks mos 437996.1ASMiOS996
- ASMIOSTAT Script to collect iostats for ASM disks [ID 437996.1]ASMiOS996
- RAC+DG(asm單例項)ASM單例
- 【RAC】asm_diskgroups 引數ASM
- 11G+ASM RAC關機ASM
- oracle rac 無法建立asm磁碟OracleASM
- JavaScript some()JavaScript
- RAC和ASM環境下打patchASM
- RAC安裝【AIX 7 + 11.2.0.4 + ASM】AIASM
- RAW+ASM 的RAC 安裝文件ASM
- 11gR2 RAC ASM 啟動ASM
- UDEV方式配置Oracle RAC ASM共享磁碟devOracleASM
- RAC 11.2.0.3 ASM管理 (一) 引數ASM
- 11g rac standby asm---04ASM
- RAC asm恢復到單例項ASM單例
- 【RAC】RAC本地資料檔案遷移至ASM的方法(3)ASM
- 【RAC】RAC本地資料檔案遷移至ASM的方法(2)ASM
- 【RAC】RAC本地資料檔案遷移至ASM的方法(1)ASM
- 【RAC】刪除RAC資料庫節點(二)——刪除ASM資料庫ASM
- 【RAC,DATAGUARD】Creating a physical standby from ASM (RAC ) primary之四ASM
- 【RAC】Creating a filesystem physical standby from ASM (RAC ) primary之三ASM
- 【RAC】Creating a filesystem physical standby from ASM (RAC ) primary 之二ASM
- 【RAC】Creating a filesystem physical standby from ASM (RAC ) primary之一ASM
- 11g rac multipath asmlib ASM asm_open error Operation not permittedASMErrorMIT
- 使用RMAN將RAC+ASM複製到單例項+ASM上ASM單例
- JavaScript some pointJavaScript
- some thougts about some work as to db admin in paipai.comAI
- linux_oracle10g_rac_asm_命令列配置rac記錄LinuxOracleASM命令列