創建用戶
create user abc identified by 123;
----------------------------------------------------
授權
grant create session,create table to abc
grant create sysdba to database----------------------------------------------------
然后
conn abc
密碼:123
----------------------------------------------------
登陸用戶就可以建表,你也可以授權其他權限給用戶。
create?? user?? username?? ...
grant?? connect?? to?? username?? ;
grant?? resource?? to?? username?? ;
connect?? username/password?? ;
create?? table?? tablename?? ...
創建表
create?? table
(
col1?????? varchar(20)?? not?? null,
col2?????? number(14,2)?? null
....
...
constraint?? table1_pk_col1name?? primary?? key?? (col2,col1)
);
例如:
create table h
(
aa???? varchar(20) not null,
bb???? number(12,2),
constraint h_pk_aa primary key (aa)
);
----------------------------------------------------
插入數據
insert into hr_bm values('22','dd')
----------------------------------------------------
查看所有用戶
select * from all_users;
查看所有的表
select table_name from tabs;
查看表內字段的屬性
desc 與表名
desc table_name