首页 > 数据库 > Oracle > oracle期末考试试题及其部分疑问
1.
Startup nomount
Startup
Startup
2.
修改SQLNET.ora
3.
Alter system set
remote_login_passwordfile=exclusive
Comment=’2009-12-14’
Scope=spfile;
4.
5.
6.
7.
Create pfile=’d:pfileorcl.ora’ from spfile;
Create spfile=’e:spfileorcl.ora’ form pfile=’d:pfileorcl.ora’;
8.
Show parameter control_file;
V$controlfile
9.
Alter database backup controlfile to trace; 该文件在D:oracleproduct10.2.0adminorcludump
可通过 show parameter user_dump_dest;查看目录。
10.
11.
Datafile ‘d: ewths.dbf’ size 10m;
Alter database default tablespace newtbs;
12.
Create temporary tablespace temptbs
tempfile ‘e: emp.dbf’ size 10m;
Alter database default temporary tablespace temptbs;
13.
Create tablespace tt
Datafile ‘d: t.dbf’ size 10m online;
14.
(aa int,
Drop tablespace aa including contents (cascade constraints约束);
15.
Create tablespace bb
Datafile ‘d:b1.dbf’ size 10m ,
16.
1.Create tablespace cc
Datafile ‘d:cc.dbf’ size 10m;
2.alter tablespace cc offline;
3.$copy d:cc.dbf
4.alter tablespace cc
Rename datafile ‘d:cc.dbf’ to ‘e:cc.dbf’;
5.alter tablespace cc online;
######数据文件脱机
1.Select log_mode
From v$database;
2.Alter database
Datafile ‘e:cc.dbf’ offline drop;
3.Recover datafile ‘e:cc.dbf’;
4. alter database datafile ‘e:cc.dbf’ online;
17.
Create bigfile tablespace dd
Datafile ‘d:dd.dbf’ size 10m;
18.
Create tablespace ee
Datafile ‘d:ee.dbf’ size 100m
Extent management local uniform size 10m;(有、无都对)
19.
Create tablespace hh
Datafile ‘d:hh.dbf’ size 10m reuse
Segment space management auto ;
20.
Select log_mode
From v$database;
shutdown immediate
startup mount
alter database archivelog;
alter database open;
21.
Select group# ,member
From v$logfile;
Select group# ,status
From
v$log;
22.
Alter database
Add logfile (‘d:log4.log’) size 10m;
Alter database
Drop logfile (‘d:log4.log’);
#######添加日志组成员:
Alter database
Add logfile member ‘e: ewlog.log’ to group 1;
######删除日志组成员
Alter system switch logfile;
Alter database
Drop logfile member ‘e: ewlog.log’;
23.
Alter system switch logfile;
24.
Create table RR
(range_col data,
Aa int)
Partition by range(range_col)
(partition part1 values less than (to_date(‘01/01/2009’,’dd/mm/yyyy’)),
Partition part2 values less than (to_date(‘01/01/2009’,’dd/mm/yyyy’)),
Partition part3 values less than(maxvalue));
25.
Create tablespace p1
Datafile ‘d:p1.dbf’ size 10m
Create tablespace p2
Datafile ‘d:p2.dbf’ size 10m;
Create table hash_t
(hh int,
Bb int )
Partition by hash(hh)
(Partition
Partition
26.
Create table list_t
(list_col
Bb int)
Partition by list(list_col)
(partition part1 values(‘wo’,’de’,’en’),
Partition part2 values(‘zhao’,’gong’,’zuo’),
Partition part3 values(‘yao’,’cheng’,’hao’));
27.
Create table com
(rr int, hh int, cc int)
Partition by range (rr)
Subpartition by hash(hh) subpartitions 2
(partition part1 values less than (10)
Partition part2 values less than (20)
28.
Create user u1 identified by u1
default tablespace test
password expire;
29.
Create user u2 identified by u2;
Alter user u2 account lock;
Alter user u2 account unlock;
30.
Create user u3 identified by u3
Grant create session ,create table to u3;
31.
Create user u4 identified by u4
Grant create session to u4
With admin option;
32.
Create user u5 identified by u5;
Grant select,update on test to u5
With grant option;
33.
Revoke select ,update on test from u5;
34.
Create user u6 identified by u6;
Grant select ,update (aa) on test to u6;
35.
Create role r1 not identified;
Create role r2 identified by r2
Grant r1,r2 to u1;
36.
37.
Alter user u1 default role r1;
38.
set role r2 identified by r2;
update sys.test set aa=aa+100;
set role all except r2;
39.
Create user u2 identified by u2;
Create profile p1
Limit
Failed_login_attempts 3
Password_lock_time 10;
Alter user u2 profile p1;
40.
Create user u3 identified by u3
Create profile p2
Limit
Password_life_time 5
Password_grace_time 5
Password_reuse_max unlimited;
Alter user u3 profile p2;
41.
@ d:oracleproduct10.2.0db_1 dbmsadminutlpwdmg.sql;
Create profile p4
Limit
Password_verify_function verify_function;
Create user u4 identified by user123#;
42.
Alter system set resource_limit=true;
43.
Create profile session_limit
Limit
Sessions_per_user 3;
Alter user u5 profile session_limit;
44.
Show parameter audit_sys_operations;
Alter system set audit_sys_operations=true scope=spfile;
Show parameter audit_trail;
Alter system set audit_trail=true scope=spfile;
重启数据库。
Create user new identified by new123#
Grant create session,create table to new;
以new身份Create table newtb
(aa int, bb int);
以sys身份Grant select, update,delete on new.newtb to u1;(为什么new什么不能授权???
Conn
show parameter audit_sys_operations;
alter system set audit_sys_operations=true scope=spfile;
show parameter audit_trail;
alter system set audit_trail=true scope=spfile;
grant select,update,delete on new.newtb to u1;
(alter system set audit_trail=db scope=spfile;
shutdown immediate;
startup
audit all on new.newtb ;
connect u1/u1
select * from new.newtb
update new.newtb set aa=aa+100
delete bb from new.newtb where bb=23
connect /as sysdba
select sel,ins,upd,del from dba_obj_audit_opts where owner='U1'and object_name='MEWTB';
(select username,action_name,obj_name,to_char(timestamp,'yyyy-mm-dd hh24:mi')
from dba_audit_trail;)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23364798/viewspace-1117276/ ,如需转载,请注明出处,否则将追究法律责任。