|
本帖最后由 botang 于 2016-5-23 17:40 编辑
课程第22/23/24次(2016-05-16/18/20星期一/星期三/星期五):052第5章ASM,ASM相关多个Hands-on, 开始上1Z0-053的第10章
【上完1Z0-052的第5章】:ASM
【1Z0-051】:共10章(0 1 2 3 4 5 6 7 8 9)
【1Z0-052】:共10章(0 1 2 3 4 5 6 9 10 14)
【1Z0-053】:共2章(0 1)
创建盘组命令:
如果用裸设备,配置文件/etc/sysconfig/rawdevices:
/dev/raw/raw7 /dev/sda7
/dev/raw/raw8 /dev/sda8
/dev/raw/raw9 /dev/sda9
/dev/raw/raw10 /dev/sda10
/dev/raw/raw11 /dev/sda11
/dev/raw/raw12 /dev/sda12
/dev/raw/raw13 /dev/sda13
/dev/raw/raw14 /dev/sda14
/dev/raw/raw15 /dev/sda15
裸设备启动文件/etc/rc.d/init.d/rawdevices:
- #!/bin/bash
- #
- # rawdevices This shell script assignes rawdevices to block devices
- #
- # chkconfig: 345 56 44
- # description: This scripts assignes raw devices to block devices \
- # (such as hard drive partitions). This is for the use \
- # of applications such as Oracle. You can set up the \
- # raw device to block device mapping by editing \
- # the file /etc/sysconfig/rawdevices.
- #
- # config: /etc/sysconfig/rawdevices
- [ -f /bin/raw ] || exit 0
- [ -f /etc/sysconfig/rawdevices ] || exit 0
- # Exit if the file just has the default comments.
- LC_ALL=C /bin/egrep -q -v "^ *#" /etc/sysconfig/rawdevices 2>/dev/null || exit 0
- . /etc/init.d/functions
- function assign_raw()
- {
- LC_ALL=C egrep -v '^ *#' /etc/sysconfig/rawdevices |
- while read RAW BLOCK; do
- if [ -n "$RAW" -a -n "$BLOCK" ]; then
- rawdirname=${RAW%/*}
- if [ "$rawdirname" = "/dev" -a -d /dev/raw ]; then
- echo [ DISCUZ_CODE_0 ]quot; Please correct your /etc/sysconfig/rawdevices:"
- echo [ DISCUZ_CODE_0 ]quot; rawdevices are now located in the directory /dev/raw/ "
- echo [ DISCUZ_CODE_0 ]quot; If the command 'raw' still refers to /dev/raw as a file."
- echo [ DISCUZ_CODE_0 ]quot; you'll have to upgrade your util-linux package"
- exit 0
- fi
- if [ "$rawdirname" = "/dev/raw" -a -f /dev/raw ]; then
- echo [ DISCUZ_CODE_0 ]quot; Please correct your /etc/sysconfig/rawdevices:"
- echo [ DISCUZ_CODE_0 ]quot; rawdevices are now located in the directory /dev/raw/ "
- echo [ DISCUZ_CODE_0 ]quot; If the command 'raw' still refers to /dev/raw as a file."
- echo [ DISCUZ_CODE_0 ]quot; you'll have to upgrade your util-linux package"
- exit 0
- fi
- echo " $RAW --> $BLOCK";
- raw $RAW $BLOCK
- fi
- done
- }
- # See how we were called.
- case "$1" in
- start)
- # Assign devices
- echo [ DISCUZ_CODE_0 ]quot;Assigning devices: "
- assign_raw
- sleep 3
- chown -R oracle:oinstall /dev/raw/
- echo [ DISCUZ_CODE_0 ]quot;done"
- ;;
- stop)
- # No action to be taken here
- ;;
- status)
- ID=`id -u`
- if [ $ID -eq 0 ]; then
- raw -qa
- else
- echo [ DISCUZ_CODE_0 ]quot;You need to be root to use this command ! "
- fi
- ;;
- restart|reload)
- $0 start
- ;;
- *)
- echo [ DISCUZ_CODE_0 ]quot;Usage: $0 {start|stop|status|restart}"
- exit 1
- esac
- exit 0
复制代码
从ASM中迁移数据库到文件系统的RMAN脚本:
- run {
- allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/sysaux01.dbf';
- backup as copy datafile 2 ;
- allocate channel c2 device type disk format '/u01/app/oracle/oradata/orcl/undotbs1.dbf';
- backup as copy datafile 3;
- allocate channel c3 device type disk format '/u01/app/oracle/oradata/orcl/users01.dbf';
- backup as copy datafile 4 ;
- allocate channel c4 device type disk format '/u01/app/oracle/oradata/orcl/example01.dbf';
- backup as copy datafile 5;
- allocate channel c5 device type disk format '/u01/app/oracle/oradata/orcl/tbshigh01.dbf';
- backup as copy datafile 6 ;
- allocate channel c6 device type disk format '/u01/app/oracle/oradata/orcl/tbshigh201.dbf';
- backup as copy datafile 7;
- allocate channel c7 device type disk format '/u01/app/oracle/oradata/orcl/tbshigh301.dbf';
- backup as copy datafile 8 ;
- allocate channel c9 device type disk format '/u01/app/oracle/oradata/orcl/tbshigh401.dbf';
- backup as copy datafile 9;
- }
复制代码
虚拟机的一部分命令历史:
|
|