startup nomount
alter database db01 mount;
alter database db01 open read only
只能 nomount ->mount->open , 不能反过来操作
受限模式:
STARTUP RESTRICT
ALTER SYSTEM ENABLE RESTRICTED SESSION
杀session:
select sid, serial#,username form v$session;
alter system kill session '15,6';
Read-Only Mode
命令:STARTUP MOUNT
ALTER DATABASE OPEN READ ONLY
Can be used to:
Execute queries
Execute disk sorts using locally managed tablespace
Take data files offline and online , but not tablespaces
Perform recovery of offline data files and tablespaces
由上可以看到 I,T,N关闭的都是干净的数据, 一般都用 IMMEDIATE关闭。
Diagnostic Files
Several types exits:alertSID.log file; Background trace files ; User trace files
Background Trace Files: SID_processname_PID.trc
Location defined by BACKGROUND_DUMP_DEST
Created when a background process encounters an error
User Trace Files: SID_ora_PID.trc
produced by the user process
Can be generated by a server process
Contain statistics for traced SQL statements
Contain user error messages
Created when a user encounters user session erros
Location is defined by USER_DUMP_DEST
Enable /Disable User Tracing
Session level:
using the ALTER SESSION command:
ALTER SESSION SET SQL_TRACE=TRUE
Executing DBMS procedure:
dbms_system.SET_SQL_TRACE_IN_SESSION
Instance level
Setting the initialization parameter:
SQL_TRACE=TRUE
Alert Log File: alertSID.log
Records the commands
Records results of major events
Used for day-to-day operational information
Used for diagnosing database erros
Each entry has a time stamp associated with it
Must be managed by DBA
Location defined by BACKGROUND_DUMP_DEST