克隆脚本
http://124.16.180.178:8080/studentguide_sec_O11g/1Z0-053-20/
游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0
2016-03-05a.sql:
- select * from dba_flashback_archive;
- select * from dba_flashback_archive_ts;
- select * from dba_flashback_archive_tables;
- create tablespace tbsnew19 datafile size 50M autoextend on ;
- select object_id from dba_objects
- where object_name='TNEW19' and owner='HR';
-
- select * from hr.sys_fba_hist_80166;
-
- alter flashback archive fba2 modify retention 31 day;
-
- alter flashback archive fba2 modify tablespace users quota 11M ;
-
- alter flashback archive fba1 purge before timestamp sysdate-1/144;
-
- alter flashback archive fba2 add tablespace tbsnew19 quota 20M;
-
- alter flashback archive fba2 remove tablespace tbsnew19;
-
- create undo tablespace undotbs1 datafile size 20M autoextend on ;
-
- alter system set undo_tablespace=undotbs1;
-
- drop tablespace undotbs2;
-
- alter system flush buffer_cache;
复制代码
2016-03-05b.sql:
- select * from dba_flashback_archive_tables;
- begin
- dbms_flashback_archive.disassociate_fba(owner_name => 'HR',
- table_name => 'TNEW19_4') ;
- end;
-
- begin
- dbms_flashback_archive.reassociate_fba(owner_name => 'HR',
- table_name => 'TNEW19_4') ;
- end;
-
- select dbms_flashback.get_system_change_number from dual;
-
- ---
-
- select
- d.SUPPLEMENTAL_LOG_DATA_MIN,
- d.SUPPLEMENTAL_LOG_DATA_PK,
- d.SUPPLEMENTAL_LOG_DATA_UI,
- d.SUPPLEMENTAL_LOG_DATA_FK,
- d.SUPPLEMENTAL_LOG_DATA_ALL,
- d.SUPPLEMENTAL_LOG_DATA_PL
- from v_$database d;
-
-
- alter database add supplemental log data;
-
- alter database add supplemental log data ( primary key) columns;
-
-
-
- alter database add supplemental log data ( foreign key) columns;
-
- select * from dba_flashback_txn_state;
-
-
-
- grant execute on sys.xid_array to hr;
-
- grant execute on dbms_flashback to hr;
-
- alter database drop supplemental log data ( foreign key) columns;
-
- select * from dba_flashback_txn_report;
-
- select * from dba_flashback_txn_report order by commit_time desc;
复制代码
2016-03-06a.sql:
- select
- d.SUPPLEMENTAL_LOG_DATA_MIN,
- d.SUPPLEMENTAL_LOG_DATA_PK,
- d.SUPPLEMENTAL_LOG_DATA_UI,
- d.SUPPLEMENTAL_LOG_DATA_FK,
- d.SUPPLEMENTAL_LOG_DATA_ALL,
- d.SUPPLEMENTAL_LOG_DATA_PL
- from v_$database d;
-
- alter database add supplemental log data ( foreign key ) columns;
-
-
- alter database drop supplemental log data ( foreign key ) columns;
-
- select * from dba_directories;
-
-
- select index_name from dba_indexes i where i.owner='HR' and i.table_name='DEPARTMENTS';
-
- select
- dbms_metadata.get_ddl('INDEX','DEPT_LOCATION_IX','HR') from dual;
复制代码
my2.par:
- directory=dir1
- dumpfile=my2.dmp
- schemas=hr
- job_name=my2_job
- exclude=table:"in ('T_BANK_INVOICE')", procedure:"in ('SECURE_DML')"
- query='employees:where department_id=90'
- flashback_time='2014-10-14:20:34:12'
复制代码
rc.local:
- #!/bin/sh
- #
- # This script will be executed *after* all the other init scripts.
- # You can put your own initialization stuff in here if you don't
- # want to do the full Sys V style init stuff.
- touch /var/lock/subsys/local
- losetup /dev/loop0 /u01/loop/device/loop0.img
- losetup /dev/loop1 /u01/loop/device/loop1.img
- losetup /dev/loop2 /u01/loop/device/loop2.img
- losetup /dev/loop3 /u01/loop/device/loop3.img
- losetup /dev/loop4 /u01/loop/device/loop4.img
- losetup /dev/loop5 /u01/loop/device/loop5.img
- losetup /dev/loop6 /u01/loop/device/loop6.img
- losetup /dev/loop7 /u01/loop/device/loop7.img
- losetup /dev/loop8 /u01/loop/device/loop8.img
- losetup /dev/loop9 /u01/loop/device/loop9.img
- oracleasm scandisks
- /u01/app/oracle/product/11.2.0/grid/bin/acfsload
- su - oracle -c "export ORACLE_SID=+ASM; export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid; asmcmd volenable -G ACFS ACFS_DB1"
- mount.acfs -o all
- su - oracle -s "crsctl start res ora.orcl.db"
复制代码
|