`
yunchow
  • 浏览: 317804 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

Oracle之DBA入门二

阅读更多
Enable/Disable User Tracing
// 记录用户操作信息.
alter session set sql_trace=true;

alter database open read only;
desc dba_users;
select username, account_status from dba_users;
alter user hr account unlock;
alter user hr identified by hr;


---------------------
Chapter 4.  Creating a DataBase

1.Choose a unique instance and database name.
2.Choose a database character set.
3.set operation system variables.
4.create the pfile
5.start the instance in nomount stage.
6.create and excute the create database command
7.run scripts to generate the data dictionary and so on.
8.create additional tablespaces as needed.

Step:Specify an Instance Identifier(SID).

initialization parameter file:
db_name=bbk

execute the create database command:

strings spfilewilson > initbbk.ora
:%s/wilson/bbk/g
:%s/*\.//g #去掉*.

mkdir bbk
cd bbk
mkdir archive
cd /u01/admin
cp -R wilson/ bbk
rm -f *

create tablespace mytabs datafile '..' size 100M extent management local;
spool log1.log
@?/rdbms/admin/catalog.sql;
@?/rdbms/admin/catproc.sql;
@?/sqlplus/admin/pupbld.sql;

desc dba_objects;
-----------------------------------
Chapter 5
Using Data Dictionary and Dynamic Performance Views

Three sets of static views
dba_xxx: what is in all the schemas.
all_xxx: What the user can access.
user_xxx: what is in the user's schema.

Dynamiv Performance Tables
Virtual tables
Information is accessed from memory and control file
owned by SYS
synonyms begin with v$
listed in v$fixed_table
v$controlfile
v$parameter
v$session
v$sga

Admin Script Naming
location : $oracle_home/rdbms/admin
cat*.sql : dd information
dbms*.sql: pl/sql package

Summary
identify built-in database objects
---------------------------------------
Chapter 6 Maintaining control file

A small binary file
Defines current state of physical database
Maintains integrity of database

alter system set control_files='file1.ctl','file2.ctl' scope=spfile;
shutdown immediate;
cp
show parameter control;

v$controlfile;
v$parameter
v$controlfile_record_section
    
17:37 2009-9-9



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics