oracle的逻辑结构和物理结构
1、数据库的逻辑结构和物理结构:
Oracle logically divides the database into a smaller units to manage ,store,and retreive
data efficently.
Tablespace\Blocks\Extents\segment\
有四种segment:
data segment、Index segment、Temporay segment、Rollback Segment
temporary segment:
Are created when Oracle needs a temporary work area,such as for sorting,during a query,
to complete execution of a SQL statement.These segments are freed when the execution completes.
Rollback segment:Used to store undo information.When you roll back the changes madde to the
database,the information in the rollback segment is used to undo the changes.
The physical daabase structure consists of three types of physcial files
data files
control files
redo log files
The control file contains the database name and timestamp of database creation as well as the name and location of every data file and redo log file.
相关文档:
1.查询用户(数据)表空间
SELECT UPPER(F.TABLESPACE_NAME) "表空间名",
D.TOT_GROOTTE_MB "表空间大小(M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)",
TO_CHAR(ROUND((D.TOT_GROOTTE_ ......
/*不带任何参数存储过程(输出系统日期)*/
create or replace procedure output_date is
begin
dbms_output.put_line(sysdate);
end output_date;
/*带参数in和out的存储过程*/
create or replace procedure get_username(v_id in number,v_username out varchar2)
as
begin
select username into v_usern ......
select lower( column_name) ||','||'--'||comments
from user_col_comments c
where c.table_name = upper('acc_fundcap')
SELECT * from USER_TAB_COMMENTS WHERE TABLE_NAME='T_META';
INSERT INTO 表名(字段名1, 字段名2) SELECT 字段名1, 字段名2 from 另外的表名; ......
Oracle TNS简述
什么是TNS?
TNS是Oracle Net的一部分,专门用来管理和配置Oracle数据库和客户端连接的一个工具,在大多数情况下客户端和数据库要通讯,必须配置TNS,当然在少数情况下,不用配置TNS也可以连接Oracle数据库,比如通过JDBC.如果通过TNS连接Oracle,那么客户端必须安装Oracle client程序.
TNS有那些配置文件 ......