Oracle之DBA入门一

Oracle Install
interactive: ./runInstaller

SQL*Plus
sqlplus /nolog
connect / as sysdba
startup
------------------
Review:
select * from dual;

Managing an Oracle Instance
Objectives:
Create and manage initialization parameter files
Start up and shut down an instance
Monitor and use diagnostic files

Initialization Parameter Files
connect / as sysdba
startup

Two types of parameters:
Explicit: Having an entry in the file
Implicit:

sqlplus /nolog
conn / as sysdba
startup
!
ps -ef | grep oracle
desc v$parameter;
col name format a20
col value format a30
-- 查参数
show paramter pga_ag;
env | grep ORACL

------------------------------------
Chapter 3
Managing an oracle Instance

SID : Site Identifier

create spfile from pfile;

Strings xx | more xx

Modify Parameters in SPFILE
alter system set parameter=value
<comment="text"> <deferred>
<scope="memery|spfile|both">
<sid='sid|*'>

SPFILE vs PFILE
SPFILE is better than PFILE!

Startup Command Behavior
Order of precedence:
spfileSID.ora
Default SPFILE -> spfile.ora
initSID.ora ( is a PFILE)
Default PFILE -> ???
startup pfile = $oracle_home/dbs/initDBA1.ora

Who can start the DB?
SYSDBA, SYSOPER

Starting Up a Database
shutdown -> nomount -> mount -> open

startup nomount;
alter database db01 mount;
alter database db01 open;

startup [formce] [restrict] [pfile=<file_name>]
open <read {only|write[recover]} | recover> <database_name>]

alter database db01 open read only;

sqlplus /nolog
conn / as sysdba
startup mount;
alter database nomount; // error
alter database open;

Restricted Model
startup restrict
alter system enable restricted session;

conn / as sysdba
create user boobooke identified by bbk;
grant connect, resource to boobooke;
sqlplus boobooke/bbk@oracle9ivm
quit
alter system enable restricted session;
sqlplus boobooke/bbk@oracle9ivm // error
desc v$session;
select saddr,sid,serial# from v$session;
select sid, serial#, username from v$session;
alter system kill session '15,6';

Read-Only Model
startup mount
alter database open read only;

shutdown imediate
startup mount;
alter database open read only;
sqlplus boobooke/bbk@oracle9ivm

Shutting Down the Database
Close a Database -> Unmount a Database -> shut down an instance
Shutdown mode:
abort, immediate, transactional, normal
----------------------
Diagnostic Files

alertSID.log
show parameter dump


17:37 2009-9-8
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值