Oracle Getting Started (1) -Oracle 11g architecture

A logical storage configuration

 
 
1, the data block is the smallest unit of logical storage logical structure, usually the default is 8K (corresponding to pages MySQL), view data block size:
select name, value from v$parameter where name='db_block_size';

2, a data area (the Extent) is the smallest unit of memory allocation Oracle, the basic unit of data is increased. A data area contains a plurality of data blocks.

3, section (Segmemt) is composed of one or more data areas, it is not the storage space allocation unit, but a separate logical data object memory structure for storing a table, index or the like of the cluster space, Oracle also the target of this unified data space is called the segment.
  3.1, when creating a table, the system automatically creates a table named to the data segment .
  3.2, indexing, the system automatically creates an index named after the name of the index segment .
  3.3, consider adjusting SORT_AREA_SIZE (default 64K) to increase the sorting area, so that the sorting operation is completed as far as possible in memory. It belongs to the temporary segment
 
 
 

Second, the physical storage structure

1, the data file

  View the data file information
set linesize 32767;  
col file_name for a50;
col tablespace_name for a100;
select file_name,tablespace_name from dba_data_files;  #或者v$datafile

2, control file

  Oracle instance startup: Access initialization parameter file to the SPFILE => assigned System Global Area (SGA) memory => Read all the data files and log file information from the control file => Open current database all the data files and log files for user access.
  View Control file location:
set linesize 32767;  
col name for a50;
select name from v$controlfile;

  The system automatically creates two or three control file with the same record each control file, if a control file is damaged, Oracle will automatically use another control file, if all control files are corrupted Oracle can not work.

3, the log file

  3.1, redo log

  Log => SGA redo log buffer => transaction commits or log buffer 1/3 or super super 3 seconds => Redo log (responsible for the LGWR process)

  3.2, archive log

  Non-archive mode, transaction logs directly over polling, archive mode, the front is covered first by the transaction log archiving (ARCH) process to read the log file, and then write the archive log files.
  By default, Oracle system does not use the archive mode.
  Check whether the archive mode:
set linesize 32767;  
col name for a50;
col value for a50;
select dbid,name,log_mode from v$database;

  If the archive mode, archive log files to determine the path through the following statement:

set linesize 32767;  
col name for a50;
col value for a50;
show parameter log_archive_dest;

4, server parameter file

  Server parameter file SPFILE (Server Parameter File) is a binary file, automatically maintained by Oracle, if you want to modify then be modified by the alter system command, after the parameter changes are automatically written to the SPFILE.
set linesize 32767;  
col name for a50;
col value for a50;
select name, value, ismodified from v$parameter;

  Modify parameters: size of e.g. modified shared_pool_size 30M:

set linesize 32767;  
col name for a50;
col value for a50;
select name, value, ismodified from v$parameter where name='sort_area_size';
alter system set shared_pool_size=30m;

  If the message: "ORA-02095: specified initialization parameter can not be modified" instructions can not be modified directly, need to add scope = spfile then restart oracle:

alter system set sort_area_size=16777216 scope=spfile;

  View log location:

--查警告日志
select name, value, ismodified from v$parameter where name = 'background_dump_dest'; 
--查看跟踪文件
select name, value, ismodified from v$parameter where name='user_dump_dest'; 

  Trace file naming format: <sid> _ <processname> _ <spid> .trc, as orcl_cjq0_5172.trc

 
 

Three, Oracle 11g server architecture

  

1, modify the shared memory pool is 30M

alter system set shared_pool_size=30m;

2, a large pool (Large pool)

  The following circumstances need to use the large pool to ease access to a shared pool of pressure:
      (1) Recovery Manager for backup and restore operations, large pool will be used as I / O buffers.
    (2) using the I / O simulation of the Slave asynchronous I / O functions, the large pool to be used as I / O buffers.
    (3) the implementation of a large number of sort operations of SQL statements.
    (4) When using parallel query, parallel query process large pool as a place to exchange information with each other.
  Modify the size of a large buffer pool is 16MB (default 0):
set linesize 32767;  
col name for a50;
col value for a50;
select name, value, ismodified from v$parameter where name='large_pool_size';
alter system set large_pool_size=16m;

3, a background process

  3.1, the data write process (DBWR)

    In the following cases, DBWR process will be "dirty" data block write data files:
           (1)缓冲区无空间,又有新数据写入
      (2)检查点启动
      (3)脏数据在缓冲区超3秒

  3.2、检查点进程(CKPT)

    当发生日志切换时就会启动检查点进程。

  3.3、日志写入进程(LGWR)

     事务提交 或 日志缓冲区超1/3 或 超3秒,即把日志缓冲区日志写入日志文件。
 
 

四、数据字典

Oracle11g常用数据字典

Oracle数据字典的名称由前缀和后缀组成,使用_连接,含义说明如下:

  dba_:包含数据库实例的所有对象信息

  v$_:当前实例的动态视图,包含系统管理和系统优化等所使用的视图

    user_:记录用户的对象信息

  gv_:分布式环境下所有实例的动态视图,包括系统管理和系统优化使用的视图

  all_:记录用户的对象信息机被授权访问的对象信息  

 

基本数据字典

  描述逻辑存储结构和物理存储结构的数据表,还包括描述其他数据对象信息的表:

数据字典名称  说明 
dba_tablespaces 关于表空间的信息
dba_ts_quotas 所有用户表空间限额
dba_free_space 所有表空间中的自由分区
dba_segments   描述数据库中所有段的存储空间
dba_extents 数据库中所有分区的信息
dba_tables 数据库中所有数据表的描述
dba_tab_columns 所有表、视图以及簇的列
dba_views 数据库中所有视图的信息
dba_synonyms 关于同义词的信息
dba_sequences 所有用户序列信息
dba_constraints 所有用户表的约束信息
dba_indexs 数据表中所有索引的描述
dba_ind_columns 所有表及簇上压缩索引的列
dba_triggers 所有用户的触发器信息
dba_source 所有用户存储过程信息
dba_data_files 查询关于数据库文件的信息
dba_tab_grants/privs 查询关于对象授权的信息
dba_objects 数据库所有对象
dba_users 关于数据库中所有用户的信息

 

常用动态性能视图

  提供了关于内存和磁盘的运行情况,用户只能进行只读而不能修改它们

数据字典名称   说明
v$database 描述关于数据库的相关信息
v$datafile 数据库使用的数据文件信息
v$log 从控制文件中提取有关重做日志组的信息
v$logfile 有关实例重置日志组文件名及其位置的信息
v$archived_log 记录归档日志文件的基本信息
v$archived_dest 记录归档日志文件的路径信息
v$controlfile 描述控制文件的相关信息
v$instance 记录实例的基本信息
v$system_parameter 显示实例当前有效的参数信息
v$sga 显示实例的SGA区大小
v$sgastat 统计SGA使用情况的信息
v$parameter   记录初始化参数文件中所有项的值
v$lock 通过访问数据库会话,设置对象锁的所有信息
v$session 有个会话的信息
v$sql 记录SQL语句的详细信息
v$sqltext 记录SQL语句的语句信息
v$bgprocess 显示后台进程信息
v$process 当前进程的信息
 
发布了4 篇原创文章 · 获赞 5 · 访问量 1万+

Guess you like

Origin blog.csdn.net/feiyingnet/article/details/104438691