Oracle初级指令
发布时间:2020-12-12 15:38:34 所属栏目:百科 来源:网络整理
导读:打开sql plus system as sysdba 密码orcl 使用NORMAL关闭数据库,使用TRANSACTIONAL方式关闭数据库,使用 IMMEDIATE关闭数据库, 使用ABORT方式关闭数据库 shutdown normal shutdown transactional shutdown immediate shutdown abort 链接scott connect sco
打开sql plus system as sysdba密码orcl
使用NORMAL关闭数据库,使用TRANSACTIONAL方式关闭数据库,使用IMMEDIATE关闭数据库,使用ABORT方式关闭数据库 shutdown normal shutdown transactional shutdown immediate shutdown abort 链接scott connect scott/tiger(默认密码)scott锁定了,解锁 conn sys as sysdba alter user scott account unlock identified by 密码; conn scott/密码;或者按回车,出现输入指令字样。
表的创建,增删语句。 create table 表名 ( 列名1 numeric(总位数,小数点后的位数) not null,列名2 varchar(二进制位数) not null )drop table 表名 //删除表 alter table 表名 add 列名 coltype; //添加列 alter table 表名 drop column 列名; //删除列 alter table 表名 add primary key(主键名); //创建一个主键 alter table 表名 add constraint pk_表名 primary key(主键名); //创建一个主键 alter table 表名 drop primary key(主键名); //删除主键 alter table 表名1 add constraint fk_表名1 foreign key(外键) references 表名2(外键); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |