为了账号安全,请及时绑定邮箱和手机立即绑定
慕课网数字资源数据库体验端
Oracle数据库开发必备利器之SQL基础_学习笔记_慕课网
为了账号安全,请及时绑定邮箱和手机立即绑定

Oracle数据库开发必备利器之SQL基础

AnnyQin
难度入门
时长 4小时14分
  • 表空间的分类:永久表空间,临时表空间,UNDO表空间
    查看全部
  • 1.varchar2把所有字符都占两字节处理(一般情况下),varchar只对汉字和全角等字符占两字节,数字,英文字符等都是一个字节; 2.VARCHAR2把空串等同于null处理,而varchar仍按照空串处理; 3.VARCHAR2字符要用几个字节存储,要看数据库使用的字符集, 大部分情况下建议使用varchar2类型,可以保证更好的兼容性。 create table userinfo ( in number(6,0), username varchar2(20), userpwd vachar2(20), email vachar2(30), regdate date); 查看表结构:desc userinfo
    查看全部
    0 采集 收起 来源:Oracle管理表

    2015-08-05

  • 如何登录
    查看全部
  • ---oracle删除 app\Administrator\product\11.2.0\dbhome_1\deinstall.bat
    查看全部
    0 采集 收起 来源:Oracle卸载

    2015-08-05

  • truncate table table_name,和delecte table table_name的区别是.trunctate表只是把表里面的数据清空,并且不能可以回滚,而delecte可以回滚并且不释放表空间。
    查看全部
  • create tablespace test1_tablespace datafile 'test1file.dbf' size 10m ; create temporary tablespace temptest1_tablespace tempfile 'temp1file.dbf' size xx ; dese dba_data_files ; select dba_data_files where tablespace_name='TEST1_TABLESPACE';
    查看全部
  • 查看登录用户: show user 查询数据字典: desc dba_users 查询用户数据字典: select username from dba_users;(要加分号)
    查看全部
  • 启用用户语句: alter user username account unlock 启用scott用户: //先解锁 alter user scott account unlock //登录 connect scott/tiger
    查看全部
  • 1.查看系统管理员表空间: desc dba_tablespaces select tablespace_name from dba_tablespaces; 2.查看普通用户表空间: desc user_tablespaces select tablespace_name form user_tablespaces;(scott权限比system小,用这个查询) 3.权限大的可以查询权限小的 4.查看SYSTEM默认表空间或临时表空间: select default_tablespace,temporary_tablespace from dba_users where username="SYSTEM"; 5.设置用户默认或临时表空间: alter user system default tablespace system;
    查看全部
  • 创建永久(临时)表空间: create[temporary]tablespace tablespace_name(表空间名字) tempfile|datafile xxx.dbf(数据库名字) size xxx(10m)(大小); 查看表空间: select 文件名 from dab_data_files where tablespace_name='xxx'; 查看临时表空间: select 文件名 from dba_temp_files where tablespace_name='xxx';
    查看全部
  • 修改表空间的状态: 设置联机或脱机状态 alter tablespace tablespace offline|online;(脱机状态是不能使用的) 查看表空间状态 select sstatus from dba_tablespaces where tablespace_name='xxx'; 设置只读或者可读写状态: alter tablespace tablespace_name read only(只读)|read write(读写);
    查看全部
  • 增加数据文件: alter tablespace tablespace_name add datafile 'xxx.dbf' size xx; 删除数据文件: alter tablespace tablespace_name drop datafile 'xxx.dbf';
    查看全部
  • 删除表空间: drop tablespace tablespace_name 删除表空间及数据: drop tablespace tablespace_name[including contents];
    查看全部
  • 修改表添加主键 add constraint constraint_name primary key(column_name1,……); 更改约束名称 alter table table_name rename constraint old_constraint_name to new_constraint_name 禁用约束 alter table table_name disable|enable constraint constraint_name 删除约束 alter table table_name drop constraint constraint_name alter table table_name drop primary key[cascade]
    查看全部
  • <> 不等于
    查看全部

举报

0/150
提交
取消
课程须知
只要知道数据库是什么就可以来学习本课程呦!
老师告诉你能学到什么?
掌握Oracle的SQL语句基础,为后续的课程学习打好基础。
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!