|
本帖最后由 botang 于 2015-7-5 09:29 编辑
第17和第18次:2015-07-04星期六上下午
- #!/bin/sh
- v_dbname=orcl
- su - oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/srvctl stop database -d $v_dbname"
- su - oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus /nolog" <<EOF
- conn / as sysdba
- startup mount exclusive
- EOF
- rm -f /home/oracle/example01.dbf 2>/dev/null
- su - oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/rman target /" <<EOF
- backup as copy datafile 5 format '/home/oracle/example01.dbf';
- EOF
- dd if=/dev/zero of=/home/oracle/example01.dbf bs=8192 count=1 seek=175 conv=notrunc
- su - oracle -c "export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid ; export ORACLE_SID=+ASM ; /u01/app/oracle/product/11.2.0/grid/bin/asmcmd" <<EOF
- rm -f +data/$v_dbname/DATAFILE/example*
- EOF
- su - oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/rman target /" <<EOF
- run {
- set maxcorrupt for datafile 5 to 1;
- backup as copy datafilecopy '/home/oracle/example01.dbf' format '+data';
- }
- EOF
- sleep 3
- su - oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/rman target /" <<EOF
- delete noprompt datafilecopy '/home/oracle/example01.dbf';
- switch datafile 5 to copy;
- EOF
- su - oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus /nolog" <<EOF
- conn / as sysdba
- alter database open;
- EOF
复制代码
- select * from dba_tables t where t.owner='HR' and t.table_name='DEPARTMENTS';
- select * from v$datafile;
- '+DATA/orcl/datafile/example.265.816169651'
- '+DATA/orcl/datafile/example.265.884169393'
- select * from v$rman_configuration;
- select * from dba_tablespaces;
- alter tablespace users online;
- select * from dba_data_files;
- select * from v$block_change_tracking;
- select d.FILE# ,
- avg(datafile_blocks),
- avg(blocks_read),
- avg(blocks_read/datafile_blocks) * 100 AS PCT_READ_FOR_BACKUP,
- avg(blocks)
- from v_$backup_datafile d
- where d.USED_CHANGE_TRACKING= 'YES'
- group by d.FILE#;
- select * from V$DATABASE_BLOCK_CORRUPTION;
- select * from v$backup_corruption;
- select * from v$copy_corruption;
- select file# , d.SECTION_SIZE from V_$BACKUP_DATAFILE d ;
- select * from v$restore_point;
- create restore point rsp1 as of scn 884195078;
复制代码
上完1Z0-053第4,5章 (52-12)
|
|