设为首页 收藏本站
查看: 543|回复: 0

[经验分享] expert on e on one oracle

[复制链接]

尚未签到

发表于 2016-8-6 17:37:14 | 显示全部楼层 |阅读模式
=========================================================================
1.参数文件的名称和位置 init.ora
参数文件 的命名约定如下
init$ORACLE_SID.ora  (Unix 环境变量)
init%ORACLE_SID%.ora  (Windows 环境变量)

默认情况的位置如下
$ORACLE_HOME/dbs     (Unix)
%ORACLE_HOME%\DATABASE   (Windows)

=============================================================================
2.查看参数值 示例
运行框 cmd 回车
sqlplus scott/tiger@主机字符串
show parameter sort_area

=============================================================================
3.显示pga,uga 示例
select a.name,b.value
from v$statname a,v$mystat b
where a.statistic# = b.statistic#
and a.name like '%ga%'
/

=============================================================================
4.显示sga的大小  
与平台无关,查看sga的大小 ,sqlplus中运行
SQL> compute sum of bytes on pool
SQL> break on pool skip 1
SQL> select pool,name,bytes
2  from v$sgastat
3  order by pool,name;

the SGA is broken up into various pools.They are:
Java pool - The Java pool is a fixed amount of memory allocated form the JVM running in the database.
Large pool - The large pool is used by the MTS for session memory,by Parallel Execution for message buffers,and by RMAN Back up for disk I/O buffers.
Shared pool - The shared pool contains shared cursors,stored procedures,state objects,dictionary caches,and many dozens of other bits of data
The 'Null' pool - This one doen't really have a name.It is the memory dedicated to block buffers(cached database blocks),the redo log buffer and a 'fixed SGA' area.
-----
The init.ora parameters that have the most effect on the overall size of the SGA  are :
JAVA_POOL_SIZE - controls the size of the Java pool.
SHARED_POOL_SIZE - controls the size of the shared pool,to some degree.
LARGE_POOL_SIZE - controls the size of the large pool.
DB_BLOCK_BUFFERS - controls the size of the block buffer cache.
LOG_BUFFER - controls the size of the redo buffer to some degree.
=============================================================================
14.表空间(tablespace)的组成
tablespace 由segment组成
       segment 由extent组成
             extent 由 block组成
                   block 在oracle中最小的空间分配单元
Data files
Data files,along with redo log files,are the most important set of files in the database.This is where all of your data will ultimately be sored.Every database has at least one data file associated with it ,and typically will have many more than one.Only the most simple 'test' database will have one file.Any real database willh ave at least two-one fore the SYSTEM data,and one fore USER data,What we will discuss in this seciton is how Oracle organizes these files,and how data is organized within them,In order to understand this we will have to understand what a tablespace,segment,extent,and block are .Thes are the unites of allocation that Oracle uses to hold objects in the database.
We will start with segments.Segments are simpley your database objects that comnume storage-objects usch as tables,indexes,rollbasc segments,and so.When you create a table ,you are creating a table segment.Whe you create a partiitioned table - you create a segment per pation.When you create an index,you create an index segment,and so on.Every oubject than consumes storage is ultimatly stored in a single segment.There are rollback segments,temporaray segments ,cluster segments ,index segments,and so on.
Segmengs therselves consist of one or more extent.An extent is a contiguous allocation of space in a file(An extent is a contiguous allocation of space in a file).Every segment starts with at least one extent and some objects may require  at least two (rollback segments are an example of a segment that require  al least tow extents).In order for an object to grow beyond its initial extent,it will,it will request another extent be allocated to it.Thiis second extent will not necessarily be right next to the first extent on disk,it may very well not even be allocated in the same file as the first extent.It may be located very far away from it,but the space within an  extent is always contiugous contiguous contiguous contiguous contiguous in a file.Extents vary in size from one block to 2GB in size.
Extents,in turn,consist of blocks.A block is the smallest unit of space allocation in Oracle.Blocks are where your rows of data,or index entries,or temporary sort results will be stored.A block is what Oracle generally reads and writes from and to disk.Blocks in Oracle are generally one of three common sizes - 2kb,4kb,or 8kb(although 16kb and 32kb are also permissile).The relationship between segments,extents,and blocks looks like this:
A segment is made up of one or more extens - an extent is contiguous allocation of blocks.
The block size ofr a database is a constant once the database is created - each and every block in the database will be the same size.All blocks have the same general format,which looks somthing like this:
Header
Table Directiory
Row Directory
Free space
Data
The block header contains information about the ype of block(a table block,index block,and so on),transation information regarding active and past transactions on the block,and the address(location) of the block on the disk.
The table directory,if present,contains information about the tables that store rows in this block(data from more than one table may be stored on the same block).
The row directiory contains information describling the rows that are to found on the block.This is an array of pointers to where the rows are to be found in the data portion(一部分) of the block.
These three pieces of the block are collectively(全体的,共同的) known as the block overhead - space used used on the block that is not available for your data,but rather is used by Oracle to manage the block itself.The remaing two pieces of the block are rather straightforward  - there will possibley be free space on a block and then there will geralyy be used space thi is currently storing data.

In summary,the hierarchy of storage in Oracle is as follows:
1、A database is made up of one or more tablespace.
2、A tablespace is made up of one or more data files.A tablespace contains segments.
3、A segment(TABLE,INDEX,and so on)is made up of one or more extents.A segment exists in a tablespace,but may have data in many datafiles within that tablespace.
4、An extent is a contiguous set of blocks on disk.An extent is in a single tablespace and furthermore,is always in a single file within that tablespace.
5、A block is the smallest unit of allocation in the database.A block is the smallest unit of I/O used by a database.

2.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-253825-1-1.html 上篇帖子: Oracle中 CHAR,VARCHAR,VARCHAR2类型的区别与使用 下篇帖子: 关于裸设备及Oracle的20个实用问答
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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