oracle如何创建基表,创建oracle 数据字典基表的sql 文件是哪个文件

本文探讨了Oracle数据库中用户$表的创建,特别是如何通过_init_sql_file参数来确定创建数据库时的SQL文件。用户$表是dba_users数据字典的基础,其中的'lcount'字段记录了用户登录失败的次数。要查看特定用户的登录失败次数,可以查询user$表。文章还展示了部分sql.bsq文件的内容,该文件包含了数据库创建时执行的SQL语句。

如题.

比如 dba_users数据字典,是建立在user$这个基表上的一个视图,那么oracle在创建数据库时,是通过哪个sql文件来创建的这个文件.

找到了,是由一个参数决定:_init_sql_file'

select x.ksppinm name,y.ksppstvl value,x.ksppdesc describe

from sys.x$ksppi x,sys.x$ksppcv y

where x.indx=y.indx

and x.ksppinm='_init_sql_file';

NAME VALUE DESCRIBE

_init_sql_file ?/rdbms/admin/sql.bsq File containing SQL statements to execute upon database creation

察看 ?/rdbms/admin/sql.bsq ,

发现以下信息:

dcore.bsq

dsqlddl.bsq

dmanage.bsq

dplsql.bsq

dtxnspc.bsq

dfmap.bsq

denv.bsq

drac.bsq

dsec.bsq

doptim.bsq

dobj.bsq

djava.bsq

dpart.bsq

drep.bsq

daw.bsq

dsummgt.bsq

dtools.bsq

dexttab.bsq

ddm.bsq

dlmnr.bsq

ddst.bsq

create table user$ /* user table */

( user# number not null, /* user identifier number */

name varchar2("M_IDEN") not null, /* name of user */

/* 0 = role, 1 = user, 2 = adjunct schema, 3 = schema synonym */

type# number not null,

password varchar2("M_IDEN"), /* encrypted password */

datats# number not null, /* default tablespace for permanent objects */

tempts# number not null, /* default tablespace for temporary tables */

ctime date not null, /* user account creation time */

ptime date, /* password change time */

exptime date, /* actual password expiration time */

ltime date, /* time when account is locked */

resource$ number not null, /* resource profile# */

audit$ varchar2("S_OPFL"), /* user audit options */

defrole number not null, /* default role indicator: */

/* 0 = no roles, 1 = all roles granted, 2 = roles in defrole$ */

defgrp# number, /* default undo group */

defgrp_seq# number, /* global sequence number for the grp *

spare varchar2("M_IDEN"), /* reserved for future */

astatus number default 0 not null, /* status of the account */

/* 0x00 = 0 = Open */

/* 0x01 = 1 = Locked */

/* 0x02 = 2 = Expired */

/* 0x03 = 3 = Locked and Expired */

/* 0x10 = 16 = Password matches a default value */

lcount number default 0 not null, /* count of failed login attempts */

defschclass varchar2("M_IDEN"), /* initial consumer group */

ext_username varchar2("M_VCSZ"), /* external username */

/* also as base schema name for adjunct schemas */

spare1 number, /* used for schema level supp. logging: see ktscts.h */

/* spare2 is used to store */

/* - edition id for adjunct schemas (type# = 2) */

/* - base schema id for schema synonyms (type# = 3) */

spare2 number,

spare3 number,

spare4 varchar2(1000),

spare5 varchar2(1000),

spare6 date

)

cluster c_user#(user#)

user$表中,有一个字段lcount

lcount number default 0 not null, /* count of failed login attempts */

记录失败登陆的次数,如何察看用户登录失败的次数,就可以看这个字段

select name,lcount from user$ where name='具体的用户名';

成功登陆后,这个值会置为零.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值