Oracle log files
Oracle log files : An introduction
The Oracle server maintains the redo Oracle log files to minimize the loss of data in the Database in case of an uncontrolled shutdown.
Online redo Oracle log files are filled with redo records. A redo record, also called a redo entry, is made up of a group of change vectors, each of which is a description of a change made to a single block in the database.
For example, if you change a salary value in an employee table, you generate a redo record containing change vectors that describe changes to the data segment block for the table, the rollback segment data block, and the transaction table of the rollback segments.
The question here is how are the Oracle log files maintained, and what information do we have?
A couple of interesting Oracle views:
a)To view information on log files:
SELECT * from v$log;
b)To view information on log file history:
SELECT thread#, first_change#,
TO_CHAR(first_time,'MM-DD-YY HH12:MIPM'),
next_change#
from v$log_history;
The above shows you what log state your system is in. Read more about ARCHIVELOG in the article on Oracle Backup.
Consider the parameters that can limit the number of online redo Oracle log files before setting up or altering the configuration of an instance's online redo log.
The following parameters limit the number of online redo Oracle log files that you can add to a database:
The MAXLOGFILES parameter used in the CREATE DATABASE statement determines the maximum number of groups of online redo Oracle log files for each database.
Group values can range from 1 to MAXLOGFILES.
The only way to override this upper limit is to re-create the database or its control file. Thus, it is important to consider this limit before creating a database.
If MAXLOGFILES is not specified for the CREATE DATABASE statement, Oracle uses an operating system specific default value. The MAXLOGMEMBERS parameter used in the CREATE DATABASE statement determines the maxim
相关文档:
什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
用sql*plus或第三方可以运行sql语句的程序登录数据库:
增加一个列:
ALTER TABLE 表名 ADD(列名 数据类型);
如:
ALTER TABLE emp ADD(weight NUMBER(38,0));
修改一个列的数据类型(一般限于修改长度,修改为一个不同类型时有诸多限制):
ALTER TABLE 表名 MODIFY(列名 数据类型);
如:
ALTER TABLE emp MODIFY(wei ......
一些基本的Oracle命令
基本命令
连接数据库
C:>SQLPLUS /NOLOG
SQL>CONN / AS SYSDBA
1.Oracle 关闭
SQL>SHUTDOWN (ABORT|IMMEDIATE|NORMAL)
2.Oracle 启动
SQL>STARTUP (REMOUNT|MOUNT|OPENT)
3.SQL> HELP SHOW
SHOW
----
Shows the value of a SQL*Plus system variable, or the
......
1. 查询数据库现在的表空间
select tablespace_name, file_name, sum(bytes)/1024/1024 table_size from dba_data_files group by tablespace_name,file_name;
2. 建立表空间
CREATE TABLESPACE data01 DATAFILE '/oracle/oradata/db/DATA01.dbf' SIZE 500M;
3.删除表空间
DROP TABLESPACE data01 INCLUDING CONTENTS ......