SnapManager Oracle
본 한국어 번역은 사용자 편의를 위해 제공되는 기계 번역입니다. 영어 버전과 한국어 버전이 서로 어긋나는 경우에는 언제나 영어 버전이 우선합니다.

ASMLib 없이 ASM 데이터베이스를 지원하는 샘플 스크립트


샘플 스크립트는 SnapManager for Oracle 설치 디렉토리의 plugins/examples/noasmlib 디렉토리에 있습니다.


# Run the script which takes the disklist from the asmcmd
# use appropriate user , here grid user is being used to run
# asmcmd command.
su -c "plugins/noasmlib/" -s /bin/sh grid
cat /home/grid/disklist

# Construct the final file as .bak file with propre inputs
awk -v guser=$griduser -v ggroup=$gridgroup '/^\/dev\/mapper/ { print "chown -R "guser":"ggroup" "$1; print "chmod 777 " $1; }' /home/grid/disklist > /etc/initasmdisks.bak

# move the bak file to the actual file.
mv /etc/initasmdisks.bak /etc/initasmdisks

# Set full full permission for this file to be called while rebooting and restore
chmod 777 /etc/initasmdisks

# If the /etc/initasmdisks needs to be updated in all the RAC nodes
# or /etc/initasmdisks script has to be executed in the RAC nodes, then the following
# section needs to be uncommented and used.
# Note: To do scp or running scripts in remote RAC node via ssh, it needs password less login
# for root user with ssh keys shared between the two nodes.
# The following 2 lines are used for updating the file in the RAC nodes:
# scp /etc/initasmdisks root@racnode1:/etc/initasmdisks
# scp /etc/initasmdisks root@racnode2:/etc/initasmdisks
# In order to execute the /etc/initasmdisks in other RAC nodes
# The following must be added to the master RAC node /etc/initasmdisks file
# from the script itself. The above scp transfer will make sure
# the permissions and mode for the disk list contents are transferred to the other RAC nodes
# so now appending any command in the /etc/initasmsdisks will be retained only in the master RAC node.
# The following lines will add entries to the /etc/initasmsdisks file in master RAC node only. When this script is executed
#  master RAC node, /etc/initasmdisks in all the RAC nodes will be executed.
# echo 'ssh racnode1 /etc/initasmdisks' >> /etc/initasmdisks
# echo 'ssh racnode2 /etc/initasmdisks' >> /etc/initasmdisks

export  ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/grid/product/

# Get the Disk List and save this in a file called dglist.
asmcmd lsdsk  > /home/grid/disklist

# In oracle 10g the above used command 'asmcmd' is not available so use SQL
# query can be used to take the disk list. Need to uncomment the following
# line and comment the above incase oracle 10g is being in use.
# The disk_list.sql script is availbe in this noasmlib examples folder itself
# which can be modified as per customer needs.
# sqlplus "/as sysdba" @/home/grid/disk_list.sql > /home/grid/disklist

disk_list.sql 을 참조하십시오

# su - oracle
-bash-4.1$ cat disk_list.sql
select path from v$asm_disk;