|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
闪回的目的是要让数据库在commit之后,还能恢复到之前的某个状态,整库或指定的表。数据
常常在resize数据文件的时分,resize的尺寸欠好把握,上面供应一个办法:
SQL>declare
2cursorc_dbfileis
3selecttablespace_name
4,file_name
5,file_id
6,bytes
7fromsys.dba_data_files
8wherestatus!=INVALID
9orderbytablespace_name,file_id;
10cursorc_space(v_file_idinnumber)is
11selectblock_id,blocks
12fromsys.dba_free_space
13wherefile_id=v_file_id
14orderbyblock_iddesc;
15blocksizebinary_integer;
16filesizebinary_integer;
17extsizebinary_integer;
18begin
19selectvalue
20intoblocksize
21fromv$parameter
22wherename=db_block_size;
23forc_rec1inc_dbfile
24loop
25filesize:=c_rec1.bytes;
26<<outer>>
27forc_rec2inc_space(c_rec1.file_id)
28loop
29extsize:=((c_rec2.block_id-1)*blocksize+c_rec2.blocks*blocksize);
30ifextsize=filesize
31then
32filesize:=(c_rec2.block_id-1)*blocksize;
33else
34exitouter;
35endif;
36endloopouter;
37iffilesize=c_rec1.bytes
38then
39dbms_output.put_line(Tablespace:
40||||c_rec1.tablespace_name||Datafile:||c_rec1.file_name);
41dbms_output.put_line(Cannotberesized,nofreespaceatendoffile.)
42;
43dbms_output.put_line(.);
44else
45iffilesize<2*blocksize
46then
47dbms_output.put_line(Tablespace:
48||||c_rec1.tablespace_name||Datafile:||c_rec1.file_name);
49dbms_output.put_line(Canberesizeduptil:||2*blocksize
50||Bytes,Actualsize:||c_rec1.bytes||Bytes);
51dbms_output.put_line(.);
52else
53dbms_output.put_line(Tablespace:
54||||c_rec1.tablespace_name||Datafile:||c_rec1.file_name);
55dbms_output.put_line(Canberesizeduptil:||filesize
56||Bytes,Actualsize:||c_rec1.bytes);
57dbms_output.put_line(.);
58endif;
59endif;
60endloop;
61end;
62/
Tablespace:DRSYSDatafile:/usr/oracle/data/oradata/cint208/drsys01.dbf
Canberesizeduptil:4333568Bytes,Actualsize:5242880
.
Tablespace:INDXDatafile:/usr/oracle/data/oradata/cint208/indx01.dbf
Canberesizeduptil:16384Bytes,Actualsize:5242880Bytes
.
Tablespace:RBSDatafile:/usr/oracle/data/oradata/cint208/rbs01.dbf
Canberesizeduptil:57155584Bytes,Actualsize:57671680
.
Tablespace:SYSTEMDatafile:/usr/oracle/data/oradata/cint208/system01.dbf
Canberesizeduptil:280182784Bytes,Actualsize:283115520
.
Tablespace:TEMPDatafile:/usr/oracle/data/oradata/cint208/temp01.dbf
Canberesizeduptil:16384Bytes,Actualsize:5242880Bytes
.
Tablespace:TESTSPACEDatafile:/usr/oracle/data/oradata/cint208/testspace1.dbf
Canberesizeduptil:16384Bytes,Actualsize:5242880Bytes
.
Tablespace:TOOLSDatafile:/usr/oracle/data/oradata/cint208/tools01.dbf
Canberesizeduptil:16384Bytes,Actualsize:5242880Bytes
.
Tablespace:USERSDatafile:/usr/oracle/data/oradata/cint208/users01.dbf
Canberesizeduptil:23076864Bytes,Actualsize:23592960
.
PL/SQLproceduresuccessfullycompleted.
SQL>
SQL>
SQL>
在JOIN操作中(需要从多个数据表提取数据时),MySQL只有在主键和外键的数据类型相同时才能使用索引。 |
|