Oracle学习笔记二:数据库操做与使用

1.一、查看数据库状态数据库

select open_mode from v$database;

1.二、查看数据库日志app

select * from v$diag_info;

1.三、查看当前数据库路径ide

select name from v$datafile;

1.四、建立表空间spa

create tablespace test datafile 'C:\app\Administrator\oradata\orcl\test01.dbf' size 10m;

1.五、建立用户日志

create user hi identified by man default tablespace test;
grant dba to hi;

1.六、建立表code

conn hi/man;
create table emp01 (id number(12) primary key,name varchar(20));

1.七、数据插入blog

insert into emp01 values (1,'Zhangsan');
insert into emp01 values (2,'Lisi');
commit;

1.八、查询表it

select * from emp01;