小布老师讲座笔记(三)

 

小布老师讲座笔记(三)

STARTUP  Command Behavior

Order of precedence(启动顺序)

    spfileSID.ora

    Default SPFILE ->spfile.ora

    initSID.ora

    Default PFILE -> ???

Specified PFILE can override precedence.

STARTUP PFILE = $ORACLE_HOME/dbs/initDBA1.ora

PFILE can indicate to use SPFILE.

SPFILE = /database/startup/spfileDBA1.ora(通过pfile找到spfile)

Starting Up a Database

 

MOUNT(limit )

NOMOUNT                     

SHUTDOWN

             Instance started                     Control file

                                                      opened for the instanc

 

All files opened as described

by the control file for this instance

OPEN

                                  

 

 

 

 

STARTUP  FORECE      STARTUP RESTRICT

ALTER    SYSTEM   ENABLE  RESTRICTED  SESSION;

[oracle@linux dbs]$ lsnrctl  start

create user boobooke identified by bbk;

grant connect, resource to boobooke;

远端连接:

sqlplus boobooke/bbk@oracle9ivm(this is a describor)

select * from dual;

sqlplus system/oracle@oracle9ivm

查看所有连接数据库的用户:

select sid, serial#, username from v$session;

管理员杀掉用户:

alter system kill session ’15,6’;

Read-Only Mode

Opening a database in read-only mode;

startup mount;

alter database open read only;

    —can be used to:

     Execute queries

     Execute disk sorts using locally managed tablespaces

     Take data files offline and online, but not tablespaces

     Perform recovery of offline data files and tablespaces

Shutting Down the Databases;

Close a database

When you close a database, Oracle Database writes all database data and recovery data in the SGA to the datafiles and redo log files, respectively; When you close a database, Oracle writes all database data and recovery data in the SGA to the datafiles and redo log files, respectively. Next, Oracle closes all online datafiles and redo log files. (Any offline datafiles of any offline tablespaces have been closed already. If you subsequently reopen the database, any tablespace that was offline and its datafiles remain offline and closed, respectively.) At this point, the database is closed and inaccessible for normal operations. The control files remain open after a database is closed but still mounted.

Unmount a Database

After the database is closed, Oracle unmounts the database to disassociate it from the instance. At this point, the instance remains in the memory of your computer.

After a database is unmounted, Oracle closes the control files of the database

Shut Down an Instance

The final step in database shutdown is shutting down the instance. When you shut down an instance, the SGA is removed from memory and the background processes are terminated.

Shutting Down the Database

Shutdown Mode

A

I

T

N

Allow new connection

NO

No

No

No

 

Wait until current session end

No

NO

NO

Yes

 

Wait until current tansaction end

No

NO

Yes

Yes

Force a checkpoint and close files

No

Yes

Yes

Yes

Shutdown mode:

A  ABORT   I = IMMEDIATE     T TRANSACTIONAL   N = NORMAL

startup:

Online redo log files used to reapply changes

Undo segments used to roll back uncommitted changes

Resources released

Diagnostic Files

    Contain information about significant events encountered

    Used to resolve problems

    -Used to better manage the database on a day-to-day basis

Several types exist:

    altertSID.log file

    Background trace files

    User trace files

Enable/Disable User Tracing

Session level:

    Using the alter session command:

       alter session set sql_trace = true

    Executing DBMS procedure:

       dbms_system.SET_SQL_TEACE_IN_SESSION

    Instance level

       Setting the initialization parameter:

           SQL_TRACE = TRUE

(SHUTDOWN NORMAL OR SHUTDOWN TRANSACTIONAL OR SHUTDOWN IMMEDIATE), on these way down:

    Database buffer cache written to the data files

    Uncommitted changes rolled back

    Resources released

on the way up  No instance recovery

(shutdown abort or instance failure or startup force),on the vay Modified buffers are not written to the data files Uncommitted changes are not rollback.

on the way up:

Online redo log files used to reapply changes

Undo segments used to rollback uncommitted changes Resources released

日志文件存放地点:

background_dump_dest    string   /u01/admin/denver/bdump

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值