oracle 基本技能
2015-09-22 22:22
465 查看
创建新用户
create user <username> identified by <password>;
create user USERS identifed by USERS; /*创建USERS用户,密码为USERS*/
查看所有用户
select * from dba_users;
修改用户密码
alter user <username> identified by <password>;
alter user USERS identified by USERS; /*修改USERS用户密码为USERS*/
忘了oracle所有用户密码时,修改用户密码
开始->运行->输入"cmd"确定
sqlplus / as sysdba 回车
用命令修改
alter user <用户名> identified by <密码>
oracle修改用户名
开始->运行->输入"cmd"确定
sqlplus / as sysdba 回车
oracle用户名和密码保存在user$表中
查看oracle所有用户信息
select * from user$;
(
查询用户的序列号(user#)
select user#,name from user$
where name ="WXY" ;//"WXY"为用户名,注意要大写,查出user#为92;
update user$ set name = 'WXYNEW' where user# = 92;
)
或者
update user$ set name='WXYNEW' where name ='WXY';
commit;
错误:
user WXY lacks create session privilege logon denied
解决:
grant create session to WXY;
创建表空间{四步}
1、创建临时表空间
create temporary tablespace users_temp
temfile 'F:\oradata\users_tem.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management llocal;
2、创建数据表空间
create table users
logging
datafile 'F:\oradata\users.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
3、创建用户并指定表空间
create user <username> identified by <password>
default tablespace users
temporary tablespace users_temp;
4、给用户授权
grand connect,resource,dba to <username>;
删除表空间
drop tablespace <tablespace name> including contents and datafiles;
create user <username> identified by <password>;
create user USERS identifed by USERS; /*创建USERS用户,密码为USERS*/
查看所有用户
select * from dba_users;
修改用户密码
alter user <username> identified by <password>;
alter user USERS identified by USERS; /*修改USERS用户密码为USERS*/
忘了oracle所有用户密码时,修改用户密码
开始->运行->输入"cmd"确定
sqlplus / as sysdba 回车
用命令修改
alter user <用户名> identified by <密码>
oracle修改用户名
开始->运行->输入"cmd"确定
sqlplus / as sysdba 回车
oracle用户名和密码保存在user$表中
查看oracle所有用户信息
select * from user$;
(
查询用户的序列号(user#)
select user#,name from user$
where name ="WXY" ;//"WXY"为用户名,注意要大写,查出user#为92;
update user$ set name = 'WXYNEW' where user# = 92;
)
或者
update user$ set name='WXYNEW' where name ='WXY';
commit;
错误:
user WXY lacks create session privilege logon denied
解决:
grant create session to WXY;
创建表空间{四步}
1、创建临时表空间
create temporary tablespace users_temp
temfile 'F:\oradata\users_tem.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management llocal;
2、创建数据表空间
create table users
logging
datafile 'F:\oradata\users.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
3、创建用户并指定表空间
create user <username> identified by <password>
default tablespace users
temporary tablespace users_temp;
4、给用户授权
grand connect,resource,dba to <username>;
删除表空间
drop tablespace <tablespace name> including contents and datafiles;
相关文章推荐
- Oracle 11g安装过程出现“未找到文件”
- Oracle(十四)DB LINK(转)
- Win7 64位下sql server链接oracle的方法
- oracle10g--使用expdp导出数据和impdp导入数据
- oracle_控制用户权限
- ORA-12520与ORA-12514(监听相关问题)
- Oracle表锁住处理
- oracle 存储过程的基本语法
- [INS-20802] Oracle Database Configuration Assistant 失败
- oracle对象的定义、执行权限
- linux下启动与关闭oracle监听与实例
- orcacle 解决违反约束问题
- win32和64位oracle客户端共存的配置方式
- Oracle 11g配置DG
- jdbc sid 与 service name 使用方法及区别
- 通过wget从oracle下载jdk 8
- oracle视图的种类和区别
- PL/SQL(oracle) 中实现两个数据库之间表的对比,提高建表效率
- Oracle数据块概念及与行之间的关系测试
- hibernate下oracle转mysql中数据类型的转换