当前位置: 首页 > news >正文

什么网站免费制作网站开发与建设主要干什么

什么网站免费制作,网站开发与建设主要干什么,给人做网站赚钱吗,军事新闻直播在线观看本文介绍Oracle收缩数据文件的相关操作#xff0c;运维工作中有时会需要通过收缩数据文件来释放磁盘空间。 数据文件初始化方式#xff1a; 1.我们创建表空间一般有两种方式初始化其数据文件#xff0c;即指定初始大小为32G#xff08;很大的值#xff09;或指定初始大小为…本文介绍Oracle收缩数据文件的相关操作运维工作中有时会需要通过收缩数据文件来释放磁盘空间。 数据文件初始化方式 1.我们创建表空间一般有两种方式初始化其数据文件即指定初始大小为32G很大的值或指定初始大小为100M很小的值然后通过自动扩展方式慢慢按需增长。 2.第一种初始数据文件方法坏处就是开始不管你用不用到那么大都会占用这么大的磁盘空间这种数据迁移的时候可以使用。第二种初始化方法按需增长比较好的监控实际使用磁盘空间所以推荐初始值很小使用自动扩展慢慢增长的方式。 一、查看表空间使用情况 1.查询除temp外表空间使用情况 SELECT a.tablespace_name tb_name,total / (1024 * 1024 * 1024) tb_sizeG),free / (1024 * 1024 * 1024) tb_free_size(G),(total - free) / (1024 * 1024 * 1024) tb_used_size(G),round((total - free) / total, 4) * 100 tb_usage %FROM (SELECT tablespace_name, SUM(bytes) freeFROM dba_free_spaceGROUP BY tablespace_name) a,(SELECT tablespace_name, SUM(bytes) totalFROM dba_data_filesGROUP BY tablespace_name) bWHERE a.tablespace_name b.tablespace_name;或 select a.tablespace_name tnm,b.FILE_PATH,--b.autoextensible,b.cnt,trunc(a.bytes/1024/1024/1024) total_G,trunc(a.bytes/1024/1024/1024/b.cnt) avg_G,trunc(c.bytes/1024/1024/1024) free_G,trunc((a.bytes-c.bytes)*100/a.bytes,2) used--,(c.bytes*100)/a.bytes % FREEfrom SYS.SM$TS_AVAIL A,SYS.SM$TS_FREE C,(select tablespace_name,substr(file_name,1,instr(file_name,/,2)) FILE_PATH, --f.autoextensible,count(*) cnt from dba_data_files f group by tablespace_name,substr(file_name,1,instr(file_name,/,2))--,autoextensible) bWHERE A.TABLESPACE_NAMEC.TABLESPACE_NAME()AND A.TABLESPACE_NAMEB.TABLESPACE_NAME-- AND A.TABLESPACE_NAME IN (select distinct tablespace_name from dba_tablespaces)order by avg_g desc;2.查询包含temp在内的所有表空间使用情况 SELECT *FROM (SELECT a.tablespace_name,to_char(a.bytes / 1024 / 1024, 999,999,999) || M total_bytes,to_char(b.bytes / 1024 / 1024, 999,999,999) || M free_bytes,to_char(a.bytes / 1024 / 1024 - b.bytes / 1024 / 1024,999,999,999) || M use_bytes,to_char((1 - b.bytes / a.bytes) * 100, 990.99) || % USEFROM (SELECT tablespace_name, sum(bytes) bytesFROM dba_data_filesGROUP BY tablespace_name) a,(SELECT tablespace_name, sum(bytes) bytesFROM dba_free_spaceGROUP BY tablespace_name) bWHERE a.tablespace_name b.tablespace_nameUNION ALLSELECT c.tablespace_name,to_char(c.bytes / 1024 / 1024, 999,999,999) || M total_bytes,to_char((c.bytes - d.bytes_used) / 1024 / 1024, 999,999,999) || M free_bytes,to_char(d.bytes_used / 1024 / 1024, 999,999,999) || M use_bytes,to_char(d.bytes_used * 100 / c.bytes, 990.99) || % USEFROM (SELECT tablespace_name, sum(bytes) bytesFROM dba_temp_filesGROUP BY tablespace_name) c,(SELECT tablespace_name, sum(bytes_cached) bytes_usedFROM v$temp_extent_poolGROUP BY tablespace_name) dWHERE c.tablespace_name d.tablespace_name); 或 select d.tablespace_name,decode(d.status, ONLINE, OLN, READ ONLY, R/O, d.status) status,d.extent_management,decode(d.allocation_type, USER, , d.allocation_type) allocation_type,(casewhen initial_extent 1048576 thenlpad(round(initial_extent / 1024, 0), 3) || Kelselpad(round(initial_extent / 1024 / 1024, 0), 3) || Mend) Ext_Size,NVL(a.bytes / 1024 / 1024, 0) MB,NVL(f.bytes / 1024 / 1024, 0) free,(NVL(a.bytes / 1024 / 1024, 0) - NVL(f.bytes / 1024 / 1024, 0)) used,NVL(l.large / 1024 / 1024, 0) largest,d.MAX_EXTENTS,lpad(round((f.bytes / a.bytes) * 100, 0), 3) pfree,(casewhen round(f.bytes / a.bytes * 100, 0) 20 then else*end) alrtFROM sys.dba_tablespaces d,(SELECT tablespace_name, SUM(bytes) bytesFROM dba_data_filesGROUP BY tablespace_name) a,(SELECT tablespace_name, SUM(bytes) bytesFROM dba_free_spaceGROUP BY tablespace_name) f,(SELECT tablespace_name, MAX(bytes) largeFROM dba_free_spaceGROUP BY tablespace_name) lWHERE d.tablespace_name a.tablespace_name()AND d.tablespace_name f.tablespace_name()AND d.tablespace_name l.tablespace_name()AND NOT(d.extent_management LIKE LOCAL AND d.contents LIKE TEMPORARY) UNION ALL select d.tablespace_name,decode(d.status, ONLINE, OLN, READ ONLY, R/O, d.status) status,d.extent_management,decode(d.allocation_type,UNIFORM,U,SYSTEM,A,USER,,d.allocation_type) allocation_type,(casewhen initial_extent 1048576 thenlpad(round(initial_extent / 1024, 0), 3) || Kelselpad(round(initial_extent / 1024 / 1024, 0), 3) || Mend) Ext_Size,NVL(a.bytes / 1024 / 1024, 0) MB,(NVL(a.bytes / 1024 / 1024, 0) - NVL(t.bytes / 1024 / 1024, 0)) free,NVL(t.bytes / 1024 / 1024, 0) used,NVL(l.large / 1024 / 1024, 0) largest,d.MAX_EXTENTS,lpad(round(nvl(((a.bytes - t.bytes) / NVL(a.bytes, 0)) * 100, 100),0),3) pfree,(casewhen nvl(round(((a.bytes - t.bytes) / NVL(a.bytes, 0)) * 100, 0),100) 20 then else*end) alrtFROM sys.dba_tablespaces d,(SELECT tablespace_name, SUM(bytes) bytesFROM dba_temp_filesGROUP BY tablespace_nameorder by tablespace_name) a,(SELECT tablespace_name, SUM(bytes_used) bytesFROM v$temp_extent_poolGROUP BY tablespace_name) t,(SELECT tablespace_name, MAX(bytes_cached) largeFROM v$temp_extent_poolGROUP BY tablespace_nameorder by tablespace_name) lWHERE d.tablespace_name a.tablespace_name()AND d.tablespace_name t.tablespace_name()AND d.tablespace_name l.tablespace_name()AND d.extent_management LIKE LOCALAND d.contents LIKE TEMPORARYORDER by 1二、收缩数据文件 如果通过上述SQL查询出表空间的使用率较低剩余空间较大此时我们可以考虑通过收缩数据文件来释放空闲空间。 1.使用 resize check脚本生成执行SQL 可先通过如下脚本查询有哪些数据文件可以释放该脚本成功执行后会提供可执行的语句直接复制便可执行已收缩数据文件。 REM Script is meant for Oracle version 9 and higher REM -----------------------------------------------set serveroutput on exec dbms_output.enable(1000000);declarecursor c_dbfile is select f.tablespace_name,f.file_name,f.file_id,f.blocks,t.block_size ,decode(t.allocation_type,UNIFORM,t.initial_extent/t.block_size,0) uni_extent ,decode(t.allocation_type,UNIFORM,(128(t.initial_extent/t.block_size)),128) file_min_size from dba_data_files f, dba_tablespaces t where f.tablespace_name t.tablespace_name and t.status ONLINE order by f.tablespace_name,f.file_id;cursor c_freespace(v_file_id in number) is select block_id, block_idblocks max_block from dba_free_space where file_id v_file_id order by block_id desc;/* variables to check settings/values */ dummy number; checkval varchar2(10); block_correction1 number; block_correction2 number;/* running variable to show (possible) end-of-file */ file_min_block number;/* variables to check if recycle_bin is on and if extent as checked is in ... */ recycle_bin boolean:false; extent_in_recycle_bin boolean;/* exception handler needed for non-existing tables note:344940.1 */ sqlstr varchar2(100); table_does_not_exist exception; pragma exception_init(table_does_not_exist,-942);/* variable to spot space wastage in datafile of uniform tablespace */ space_wastage number;begin/* recyclebin is present in Oracle 10.2 and higher and might contain extent as checked */ begin select value into checkval from v$parameter where name recyclebin; if checkval on then recycle_bin : true; end if; exception when no_data_found then recycle_bin : false; end;/* main loop */ for c_file in c_dbfile loop /* initialization of loop variables */ dummy :0; extent_in_recycle_bin : false; file_min_block : c_file.blocks;beginspace_wastage:0; /* reset for every file check */check_freefor c_free in c_freespace(c_file.file_id) loop /* if blocks is an uneven value there is a need to correct with -1 to compare with end-of-file which is even */ block_correction1 : (0-mod(c_free.max_block,2)); block_correction2 : (0-mod(c_file.blocks,2)); if file_min_blockblock_correction2 c_free.max_blockblock_correction1 then/* free extent is at end so file can be resized */ file_min_block : c_free.block_id;/* Uniform sized tablespace check if space at end of file is less then uniform extent size */ elsif (c_file.uni_extent !0) and ((c_file.blocks - c_free.max_block) c_file.uni_extent) then/* uniform tablespace which has a wastage of space in datafile due to fact that space at end of file is smaller than uniform extent size */space_wastage:c_file.blocks - c_free.max_block; file_min_block : c_free.block_id;else /* no more free extent at end of file, file cannot be further resized */ exit check_free; end if; end loop; end;/* check if file can be resized, minimal size of file 128 { initial_extent} blocks */ if (file_min_block c_file.blocks) or (c_file.blocks c_file.file_min_size) thendbms_output.put_line(Tablespace: ||c_file.tablespace_name|| Datafile: ||c_file.file_name); dbms_output.put_line(cannot be resized no free extents found); dbms_output.put_line(Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized); dbms_output.put_line(.);else/* file needs minimal no of blocks which does vary over versions, using safe value of 128 { initial_extent} */ if file_min_block c_file.file_min_size then file_min_block : c_file.file_min_size; end if;dbms_output.put_line(Tablespace: ||c_file.tablespace_name|| Datafile: ||c_file.file_name); dbms_output.put_line(current size: ||(c_file.blocks*c_file.block_size)/1024||K|| can be resized to: ||round((file_min_block*c_file.block_size)/1024)||K (reduction of: ||round(((c_file.blocks-file_min_block)/c_file.blocks)*100,2)|| %));/* below is only true if recyclebin is on */ if recycle_bin then begin sqlstr:select distinct 1 from recyclebin$ where file#||c_file.file_id; execute immediate sqlstr into dummy;if dummy 0 thendbms_output.put_line(Extents found in recyclebin for above file/tablespace); dbms_output.put_line(Implying that purge of recyclebin might be needed in order to resize); dbms_output.put_line(SQL purge tablespace ||c_file.tablespace_name||;); end if; exception when no_data_found then null; when table_does_not_exist then null; end; end if; dbms_output.put_line(SQL alter database datafile ||c_file.file_name|| resize ||round((file_min_block*c_file.block_size)/1024)||K;);if space_wastage!0 then dbms_output.put_line(Datafile belongs to uniform sized tablespace and is not optimally sized.); dbms_output.put_line(Size of datafile is not a multiple of NN*uniform_extent_size overhead); dbms_output.put_line(Space that cannot be used (space wastage): ||round((space_wastage*c_file.block_size)/1024)||K); dbms_output.put_line(For optimal usage of space in file either resize OR increase to: ||round(((c_file.blocks(c_file.uni_extent-space_wastage))*c_file.block_size)/1024)||K); end if;dbms_output.put_line(.);end if;end loop;end; / 比如执行结果如下 Tablespace: BLOBS Datafile: /Data/STUDY/datafile/studyblobs01.dbf current size: 33553408K can be resized to: 33548288K (reduction of: .02 %) SQL alter database datafile /Data/STUDY/datafile/studyblobs01.dbf resize 33548288K; . Tablespace: BLOBS Datafile: /Data/STUDY/datafile/studyblobs02.dbf cannot be resized no free extents found Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized . Tablespace: BLOBS Datafile: /Data/STUDY/datafile/studyblobs03.dbf cannot be resized no free extents found Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized . Tablespace: INDX Datafile: /Data/STUDY/datafile/studyindex01.dbf current size: 33553408K can be resized to: 32640000K (reduction of: 2.72 %) SQL alter database datafile /Data/STUDY/datafile/studyindex01.dbf resize 32640000K; . Tablespace: INDX Datafile: /Data/STUDY/datafile/studyindex02.dbf cannot be resized no free extents found Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized . Tablespace: SYSAUX Datafile: /Data/STUDY/datafile/studysysaux01.dbf current size: 4741120K can be resized to: 4734976K (reduction of: .13 %) SQL alter database datafile /Data/STUDY/datafile/studysysaux01.dbf resize 4734976K; . Tablespace: SYSAUX Datafile: /Data/STUDY/datafile/studysysaux02.dbf current size: 4608000K can be resized to: 4250624K (reduction of: 7.76 %) SQL alter database datafile /Data/STUDY/datafile/studysysaux02.dbf resize 4250624K; . Tablespace: SYSTEM Datafile: /Data/STUDY/datafile/studysystem01.dbf current size: 1843200K can be resized to: 790528K (reduction of: 57.11 %) SQL alter database datafile /Data/STUDY/datafile/studysystem01.dbf resize 790528K; . Tablespace: UNDOTBS1 Datafile: /Data/STUDY/datafile/studyundotbs01.dbf current size: 33553408K can be resized to: 2811904K (reduction of: 91.62 %) SQL alter database datafile /Data/STUDY/datafile/studyundotbs01.dbf resize 2811904K; . Tablespace: UNDOTBS1 Datafile: /Data/STUDY/datafile/studyundotbs02.dbf cannot be resized no free extents found Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized . Tablespace: USERS Datafile: /Data/STUDY/datafile/studyusers01.dbf cannot be resized no free extents found Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized . Tablespace: USERS Datafile: /Data/STUDY/datafile/studyusers02.dbf cannot be resized no free extents found Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized . Tablespace: USERS Datafile: /Data/STUDY/datafile/studyusers03.dbf cannot be resized no free extents found Note: for some cases, dba_free_spaces data is not accurate, and this script does not work for such cases. You may want to manually check if the datafile is feasible to be resized . Tablespace: WCAUDIT Datafile: /Data/STUDY/datafile/studywcaudit01.dbf current size: 9832064K can be resized to: 9818112K (reduction of: .14 %) SQL alter database datafile /Data/STUDY/datafile/studywcaudit01.dbf resize 9818112K; .PL/SQL procedure successfully completedSQL 可提炼出如下 SQL 用以收缩数据文件根据实际需求选择执行 SQL alter database datafile /Data/STUDY/datafile/studyblobs01.dbf resize 33548288K; SQL alter database datafile /Data/STUDY/datafile/studyindex01.dbf resize 32640000K; SQL alter database datafile /Data/STUDY/datafile/studysysaux01.dbf resize 4734976K; SQL alter database datafile /Data/STUDY/datafile/studysysaux02.dbf resize 4250624K; SQL alter database datafile /Data/STUDY/datafile/studysystem01.dbf resize 790528K; SQL alter database datafile /Data/STUDY/datafile/studyundotbs01.dbf resize 2811904K; SQL alter database datafile /Data/STUDY/datafile/studywcaudit01.dbf resize 9818112K;2.通过查询dba_data_files表自己写执行SQL select file_name,user_bytes from dba_data_files;比如查询结果中的这一行 我们可以执行如下语句来收缩表空间 SQL alter database datafile ‘/Data/STUDY/datafile/studyblobs01.dbf’ resize 26213351424; 如遇到“ORA-03297: file contains used data beyond requested RESIZE value”错误可以resize后的值稍微调大一些再次执行。 参考文章 https://www.cnblogs.com/rangle/p/9263505.html
http://www.hkea.cn/news/14351003/

相关文章:

  • 网站建设关键词优化网站空间后台密码
  • 黑龙江网站建设公司网站做缓存
  • 网站商城建设员招聘信息电商营销推广有哪些?
  • 建阳建设局网站给我一个网站贴吧
  • 深圳积分商城网站设计wordpress ftp连接不上
  • server2003网站建设中国建设个人网上银行官网
  • 双流建设局网站php网站建设基本流程
  • 百度seo 站长工具网站快速建设
  • 吉林省交通建设质量监督站网站如何建网站服务器
  • 制作软件网站企业内部系统网站制作
  • 网站开发的层次临沂展厅设计公司
  • 网站查询信息网站设计最好的公司
  • 页面网站缓存如何做房屋建筑图纸设计
  • 建设境外网站合肥网站建设q479185700強
  • 为什么备案关闭网站网站开发全栈教程
  • 专业的google推广公司网站加载优化
  • 佛山论坛建站模板谷歌chrome官网
  • 哪个网站做新中式百度小程序怎么做
  • 杭州网站建设h5深圳做网站网络公司怎么样
  • 图文广告设计百度搜索优化费用
  • 松江网站开发培训课程班级网站怎么做ppt
  • php做的网站收录工程建设信息网站资质公告
  • 腾讯云备案 网站名称wordpress 导航高亮
  • 网站建设功能的策划书做一套网页设计多少钱
  • 网站维护公司北京网站建设排名
  • 合肥商务科技学校网站建设门户网站开发哪家好
  • ftp 迁移 网站义乌网站建设
  • 支持wap网站的系统网站建设启示
  • 山东住房建设部网站做第三方库个人网站
  • 商城用什么系统做网站flash网站建设技术精粹