Bo's Oracle Station

查看: 2963|回复: 0

第87/88/89/90次:2016-03-05双休日

[复制链接]

75

主题

115

帖子

2772

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2772
发表于 2016-3-7 11:20:56 | 显示全部楼层 |阅读模式
克隆脚本
http://124.16.180.178:8080/studentguide_sec_O11g/1Z0-053-20/

游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0

2016-03-05a.sql:
  1. select  * from dba_flashback_archive;

  2. select  * from dba_flashback_archive_ts;

  3. select  * from dba_flashback_archive_tables;

  4. create tablespace tbsnew19 datafile size 50M  autoextend on ;

  5. select object_id  from dba_objects
  6. where object_name='TNEW19' and owner='HR';

  7. select  * from hr.sys_fba_hist_80166;

  8. alter flashback archive fba2  modify retention 31 day;

  9. alter flashback archive fba2 modify tablespace users quota 11M ;

  10. alter flashback archive fba1 purge before timestamp sysdate-1/144;

  11. alter flashback archive fba2 add tablespace  tbsnew19 quota 20M;

  12. alter flashback archive fba2 remove  tablespace tbsnew19;

  13. create undo tablespace undotbs1 datafile size 20M autoextend on ;

  14. alter system set undo_tablespace=undotbs1;

  15. drop tablespace undotbs2;

  16. alter system flush buffer_cache;
复制代码


2016-03-05b.sql:
  1. select * from dba_flashback_archive_tables;

  2. begin
  3.    dbms_flashback_archive.disassociate_fba(owner_name => 'HR',
  4.    table_name => 'TNEW19_4') ;
  5.    end;
  6.   
  7.    begin
  8.    dbms_flashback_archive.reassociate_fba(owner_name => 'HR',
  9.    table_name => 'TNEW19_4') ;
  10.    end;
  11.    

  12.      select   dbms_flashback.get_system_change_number from dual;
  13.      
  14.      ---
  15.      
  16.      select  
  17.        d.SUPPLEMENTAL_LOG_DATA_MIN,
  18.        d.SUPPLEMENTAL_LOG_DATA_PK,
  19.        d.SUPPLEMENTAL_LOG_DATA_UI,
  20.        d.SUPPLEMENTAL_LOG_DATA_FK,
  21.        d.SUPPLEMENTAL_LOG_DATA_ALL,
  22.        d.SUPPLEMENTAL_LOG_DATA_PL
  23.       from v_$database d;
  24.      
  25.      
  26.      alter database add supplemental log data;
  27.      
  28.      alter database add supplemental log data ( primary key)  columns;   
  29.      
  30.      
  31.    
  32.        alter database add supplemental log data ( foreign key)  columns;
  33.       
  34.        select  * from dba_flashback_txn_state;
  35.       
  36.    
  37.       
  38.        grant execute on sys.xid_array to hr;
  39.       
  40.        grant execute on dbms_flashback to hr;
  41.       
  42.        alter database drop supplemental log data ( foreign key)  columns;
  43.      
  44.             select      *   from dba_flashback_txn_report;
  45.             
  46.                select      *  from dba_flashback_txn_report  order by commit_time desc;
复制代码

2016-03-06a.sql:

  1. select  
  2.        d.SUPPLEMENTAL_LOG_DATA_MIN,
  3.        d.SUPPLEMENTAL_LOG_DATA_PK,
  4.        d.SUPPLEMENTAL_LOG_DATA_UI,
  5.        d.SUPPLEMENTAL_LOG_DATA_FK,
  6.        d.SUPPLEMENTAL_LOG_DATA_ALL,
  7.        d.SUPPLEMENTAL_LOG_DATA_PL
  8.       from v_$database d;
  9.       
  10. alter database add supplemental log data ( foreign key ) columns;


  11. alter database drop supplemental log data ( foreign key ) columns;

  12. select  * from dba_directories;


  13. select  index_name from dba_indexes i where i.owner='HR' and i.table_name='DEPARTMENTS';

  14. select  
  15.     dbms_metadata.get_ddl('INDEX','DEPT_LOCATION_IX','HR') from dual;
复制代码

my2.par:

  1. directory=dir1
  2. dumpfile=my2.dmp  
  3. schemas=hr
  4. job_name=my2_job  
  5. exclude=table:"in ('T_BANK_INVOICE')", procedure:"in ('SECURE_DML')"  
  6. query='employees:where department_id=90'
  7. flashback_time='2014-10-14:20:34:12'
复制代码

rc.local:
  1. #!/bin/sh
  2. #
  3. # This script will be executed *after* all the other init scripts.
  4. # You can put your own initialization stuff in here if you don't
  5. # want to do the full Sys V style init stuff.

  6. touch /var/lock/subsys/local
  7. losetup /dev/loop0 /u01/loop/device/loop0.img
  8. losetup /dev/loop1 /u01/loop/device/loop1.img
  9. losetup /dev/loop2 /u01/loop/device/loop2.img
  10. losetup /dev/loop3 /u01/loop/device/loop3.img
  11. losetup /dev/loop4 /u01/loop/device/loop4.img
  12. losetup /dev/loop5 /u01/loop/device/loop5.img
  13. losetup /dev/loop6 /u01/loop/device/loop6.img
  14. losetup /dev/loop7 /u01/loop/device/loop7.img
  15. losetup /dev/loop8 /u01/loop/device/loop8.img
  16. losetup /dev/loop9 /u01/loop/device/loop9.img
  17. oracleasm scandisks

  18. /u01/app/oracle/product/11.2.0/grid/bin/acfsload



  19. su - oracle -c "export ORACLE_SID=+ASM; export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid; asmcmd volenable -G ACFS  ACFS_DB1"
  20. mount.acfs -o all


  21. su - oracle -s "crsctl start res ora.orcl.db"
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-5 02:55 , Processed in 0.041569 second(s), 27 queries .

快速回复 返回顶部 返回列表