-
解锁用户:alter user username account unlock;查看全部
-
基本查询:select [distinct] column_name,.../* from tablename[where conditions] 去重复查询distinct查看全部
-
约束的数据字典:user_constraints constraint_name,constraint_type,status enable constraint constraint_name drop constraint constraint_name drop primary key查看全部
-
数据文件,增加删除数据文件 alter tablespace tablespace_name add datafile 'xx.dbf' size xx; 查看表空间的数据文件 select file_name from dba_data_file where tablespace_name='表空间名字要大小'; 删除数据文件 alter tablespace tablespace_name drop datafile '表空间名字';不能删除表空间的第一个数据文件,要删除的话,必须删除整个表空间。查看全部
-
删除表空间: drop tablespace tablespace_name 删除表空间及数据: drop tablespace tablespace_name[including contents];查看全部
-
修改表空间的状态 1.设置联机或脱机状态 alter tablespace tablespace_name offline online; //脱机状态是不能使用的 2.查看表空间状态 select status from dba_tablespaces where tablespace_name='xxx'; //表空间名字要大写 3.设置只读或者可读写状态(表空间必须为联机状态,联机状态默认为读写状态): alter tablespace tablespace_name read only(只读)read write(读写); eg: alter tablespace test1_tablespace offline; desc dba_tablespaces; select status from dba_tablespaces where tablespace_name='TEST1_TABLESPACE'; alter tablespace test1_tablespace read only; select status from dba_tablespaces where tablespace_name='TEST1_TABLESPACE';查看全部
-
创建默认表空和临时表空间 create [temporary] tablespace tablespace_name tempfile | datafile 'xx.dbf' size xx 不指定路径,默认安装到oracle安装目录下 查看表空间具体路径 desc dba_data_file查看数据字典字段 select file_name from dba_data_file where tablespace_name='表空间名字要大写';查看永久表空间数据文件 select file_name from dba_temp_file where tablespace_name='表空间名字要大写';查看临时表空间数据文件查看全部
-
oracle查看表空间 dba_tablespaces(系统用户) user_tablespaces (普通用户) 1. dba_tablespaces和user_tablespaces默认表空间共六个 2. sys: sys表、存储过程、视图等数据对象,存放系统信息 -- 系统表空间 3. sysaux: example辅助表空间 4. undotbs1: 数据库撤销信息undo类型的表空间 5. temp: SQL语句处理的表、索引信息 --临时存储 6. users: 数据库用户使用的数据库对象--永久存储 7. example: 安装oracle数据库实例 8. 权限大的,可以查询权限小的 oracle查询用户信息 1. dba_users 2. user_users 查询system默认表空间 select default_tablespace,temporary_tablespace from dba_users where username='system'; 设置system默认表空间 1. ALERT USER username DEFAULT丨TEMPORARY TABLESPACE tablespace_name; 2. 默认每个用户下面只有一个临时表空间 3. 普通用户无权限修改默认表空间,需要授权查看全部
-
1.表空间:是数据库的逻辑存储空间。可以理解为,在数据库当中开辟的一个空间,用于存放数据库的对象。 2.一个数据库可以由多个表空间构成。 3.oracle中的表空间概念是与MySQL、SQL Server等数据库的一个重要区别;oracle的很多优化都是通过表空间实现的 4.表空间:是由一个或多个数据文件构成的,数据文件的位置和大小可以由用户自己定义。 表空间的分类: 1.永久表空间:数据库中要永久化存储的一些对象,如:表、视图、存储过程 2.临时表空间:数据库操作当中中间执行的过程,执行结束后,存放的内容会被自动释放 3.UNDO表空间:用于保存事务所修改数据的旧值,可以进行数据的回滚查看全部
-
(1)启用用户的语句 alter user username account unlock 例子对scott用户解锁 alter user scott account unlock; (2)使用scott用户登录SQL Plus connect scott/tiger查看全部
-
在SQL Plus当中,输入的一些命令在后面不需要用分号(;)结尾 但是在输入SQL语句的时候,需要以分号(;)结尾,表示命令的结束 show user命令 -- 查看登录用户 dba_users数据字典(desc dba_users -- 查看dba_users数据字典包含的字段) (select username from dba_users; -- 查看dba_users数据字典中包含哪些用户)查看全部
-
系统用户:sys,system,sysman,scott. 前三个用户的密码是安装的时候设置的密码,scott的密码是tiger 使用system用户登录:[username/password][@server][as sysdba|sysoper] system/root @orcl as sysdba orcl就是自己设置的服务名查看全部
-
主键:primary key查看全部
-
建表时设置非空约束:create table table_name(column_name datatype not null,..); 修改表时添加非空约束:ALTER TABLE table_name MODIFY column_name datatype NOT NULL;查看全部
-
删除表内全部数据:delete from table_name; drop table_name;比delete速度快 delete from table_name where conditions; 从原表中复制所有数据到新表:create table table_new as select * from table_old;查看全部
举报
0/150
提交
取消