---查看命令:用户默认表空间
SYS@ACE >select username,default_tablespace,temporary_tablespace,created from dba_users where username in('WEI','HR');
USERNAME DEFAULT_TABLESPACE TEMPORARY_TABLESPACE CREATED
------------------------------ ------------------------------ ------------------------------
HR USERS TEMP 01-APR-17
WEI USERS TEMP 12-MAY-17
--001:用户创建第一个能连接用户,有三种情况无法连接用户
(1)账户被锁定无法被连接:
SYS@ACE >alter user yang account lock; User altered.
SYS@ACE >conn yang/y;
ERROR:ORA-28000: the account is locked Warning: You are no longer connected to ORACLE.
Conn / as sysdba
?如何查看账户是否被锁定呢?
SQL> select username,account_status from dba_users where username='YANG';
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
YANG LOCKED
有个列:account_status =’UNLOCK’ 锁定状态、或者,open
Alter user yang account unlock;
如果account_status 的状态是expored: 则需要重置密码,identified by 密码;
(2)密码过期
SYS@ACE >select username,profile from dba_users where username='Q';查看对应profile文件
USERNAME PROFILE
------------------------------ ------------------------------
Q DEFAULT
Alter profile default q password_life_time unlimted;(无限制--格式默认是天,最低1,0报错)
无连接权限
Grant connect to q
--002-账户使用,经常操作的对象是表,表储存的位置在默认表空间的数据文件中。
有时因为没有使用表空间的权限或者没有对表操作的权限无法达到需求
YANG@ACE >select * from user_ts_quotas;
TABLESPACE_NAME 字节 BYTES MAX_BYTES BLOCKS MAX_BLOCKS DRO
------------------------------ ---------- ---------- ---------- ---------- ---
USERS 默认表空间 196608 2097152 块 24 256 NO动态
alter user yang quota 2M on users
Alter user yang quota unlimited on users;
--002:联级权限授予之 管理选择权:with admin option
测试一,特性查看:
SYS@ACE >create user yang identified by zhuo quota 10m on users;
SYS@ACE >create user xxf identified by xxf quota unlimited on users ;
SYS@ACE >create user hao identified by hao quota unlimited on users;
SYS@ACE >grant connect to yang,xxf,hao;
SYS@ACE >grant select any table to yang with grant option;
grant select any table to yang with grant option (select any table 不能通过此方式授予)
*
ERROR at line 1:
ORA-01939: only the ADMIN OPTION can be specified
SYS@ACE >grant select any table to yang with admin option;
YANG@ACE >select count(*) from hr.employees;
YANG@ACE >select * from session_privs;
PRIVILEGE
----------------------------------------
CREATE SESSION
SELECT ANY TABLE
YANG@ACE >grant select on scott.dept to xxf;
grant select on scott.dept to xxf
*
ERROR at line 1:
ORA-01031: insufficient privileges
YANG@ACE >grant select any table to xxf;
Grant succeeded
XXF@ACE >select count(*) from hr.employees;
XXF@ACE >select * from session_privs;
PRIVILEGE
----------------------------------------
CREATE SESSION
SELECT ANY TABLE 联机查询权限,不能指定对象授予权限,做人不能太小气--特性一
SYS@ACE >revoke select any table from yang;
select * from session_privs; 公安干掉老大,小弟的钱还在---特性二
测试二、测试其它的权限,去别人家偷菜
SYS@ACE >grant create any table to yang with admin option;
YANG@ACE >grant create table to hao;
grant create table to hao
*
ERROR at line 1:
ORA-01031: insufficient privileges
YANG@ACE >grant create any table to hao; 还是特性一,此权限授予他人很死板,有啥给啥
Grant succeeded. 不多给,也不能少给----
YANG@ACE >create table hr.xxx(id int);
Table created.
因为前面已经收回权限,需要再次授予
SYS》 grant select any table to yang;
YNG@ACE >select * from user_tables;
no rows selected
YANG@ACE >select count(*) from hr.xxx;
--003联机权限授予之 授予选择: with grant option
SYS@ACE >grant select any table to yang with grant option;
grant select any table to yang with grant option
*
ERROR at line 1: 具体对象权限严格采用此方式===
ORA-01939: only the ADMIN OPTION can be specified
SYS》 grant select on hr.employees to yang;
YANG> select count(*) from hr.employees;
YANG> grant select on hr.emplyees to hao;
HAO@ACE >select * from user_tab_privs;
必须通过用户拥有的对象权限才能查看,会话权限视图无法查看
项目经理 业主 表名 投资者 特权
GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE GRA HIE
------------------------------ ------------------------------ ------------------------------ ------------------------------
HAO HR EMPLOYEES YANG SELECT NO NO
SYS@ACE >revoke select on hr.employees from yang;
HAO@ACE >select * from user_tab_privs; 特性:投资人失败,连带整个工程失败
no rows selected
总结:基最好使用admin权限大,grant权限小不说,还能被联级干死,各有好处。
3:用户改名
用户改名:yang 改为xxf
select username from dba_users where username in('YANG','XXF'); --查询用户相关名称
USERNAME
------------------------------
YANG
conn yang/y --连接
SQL> select count(*) from user_objects; --查询数据对象数量
COUNT(*)
----------
466
select user#,name from user$ where name in('YANG','XXF');
USER# NAME
---------- ------------------------------
93 YANG
update user$ set name='XXF' where user#=93; --更改基表操作
commit;
select user#,name from user$ where name in('YANG','XXF'); --查询发现,原对象被干掉了
USER# NAME
---------- ------------------------------
93 XXF
SELECT USERNAME FROM DBA_USERS WHERE USERNAME IN('YANG','XXF'); 视图查询
USERNAME
------------------------------
XXF
conn yang/y ---连接还是可以连接的
select * from cat;
select count(*) from user_objects;
conn xxf/y
SQL> shutdown immediate;
SQL> conn yang/y
ERROR:
ORA-01017: invalid username/password; logon denied
---不重启也行:执行操作:alter system flush shared_pool;
Warning: You are no longer connected to ORACLE.
SQL> conn xxf/y
SQL> select count(*) from user_objects;
COUNT(*)
----------
466
---
查询用户密码: 操作失败
select name,password from user$ where name='XXF';
XXF 9D3C147312506C5B
create user a identified by values'9D3C147312506C5B';
- window、linux安装jdk,excel 导入oracle,WebService,window 端口查看,svn服务安装,oracle用户解锁
内存泄露分析插件http://download.eclipse.org/mat/1.3/update-site/birt插件http://download.eclipse.org//birt/upda ...
- Oracle 用户、角色管理简介
Oracle 用户.角色管理简介 by:授客 QQ:1033553122 创建用户 形式1:创建名为testacc2的用户 CREATE USER testacc2 IDENTIFIED BY abc ...
- oracle 用户解锁和修改用户密码
1.安装教程参看:https://jingyan.baidu.com/article/3c48dd34be2a32e10be35881.html 2.用户解锁 --> 运行cmd --> ...
- Oracle用户解锁的三种办法及默认的用户与密码
ORA-28000: the account is locked-的解决办法 2009-11-11 18:51 ORA-28000: the account is locked 第1步:使用PL/SQ ...
- oracle用户解锁
创建一个概要文件 create profile frank_profile limit SESSIONS_PER_USER 5 IDLE_TIME 2 FAILED_LOGIN_ ...
- oracle用户解锁和改密
alter user hs_user account unlock; alter user hs_asset account unlock; alter user hs_his account unl ...
- Oracle 用户解锁
ALTER USER hr ACCOUNT UNLOCK ALTER USER hr IDENTIFIED BY welcome
- ORACLE用户的加锁、解锁
在DBA的日常工作中,经常遇到为Oracle用户解锁的操作:这篇文章给出在命令行下进行Oracle用户解锁的操作方法,通过几条简单的解锁语句就能完成此项工作.下面是具体的过程: 默认的scott用户是 ...
- Oracle11G的用户解锁、卸载以及基础操作
Oracle用户解锁 [以下操作,必须以超级管理员身份登录,才能修改]oracle安装后,会默认生成很多个用户 以超级管理员身份登录,请注意,其中的空格符:[ sys是一个超级管理员,有最大的权限,d ...
随机推荐
- mysql 优化知识点
附录: https://www.nowcoder.com/discuss/150059?type=0&order=0&pos=13&page=0 本文概要 概述 为什么要优化 ...
- Linux操作系统load average过高,kworker占用较多cpu
Linux操作系统load average过高,kworker占用较多cpu 今天巡检发现,mc1的K8S服务器集群有些异常,负载不太均衡.其中10.2.75.32-34,49的load averag ...
- html文字两行后,就用省略号代替剩下的
html文字两行后,就用省略号代替剩下的 一.总结 一句话总结: 实现原理很简单,将box的高度设置为行高的两倍,超出之后隐藏,这样就只有两行了,然后再用after属性绝对定位在第二行后面加几个点 . ...
- OpenCV3.4.1快速集成到Android studio中,10分钟搞定
OpenCV3.4.1快速集成到Android studio中,10分钟搞定 转载 https://blog.csdn.net/yu540135101/article/details/8259 ...
- [Bayes] Maximum Likelihood estimates for text classification
Naïve Bayes Classifier. We will use, specifically, the Bernoulli-Dirichlet model for text classifica ...
- 读取yml 文件中的参数
第一种方法: yml 文件: spring: main: allow-bean-definition-overriding: true cloud: consul: host: 192.168.1.1 ...
- 操作TreeView(咏南工作室)
{*******************************************************}{ ...
- Android之View的内容
View的事件体系 本章介绍View的事件分发和滑动冲突问题的解决方案. 3.1 view的基础知识 View的位置参数.MotionEvent和TouchSlop对象.VelocityTracker ...
- Security命名空间配置
http://www.mossle.com/docs/springsecurity3/html/ns-config.html Security命名空间配置 2.1. 介绍 从Spring-2.0开始可 ...
- Python3 Selenium自动化web测试 ==> 第十一节 WebDriver高级应用 -- 显示等待 + 二次封装
学习目的: 掌握显示等待 掌握二次封装 正式步骤: step1:显示等待的代码示例 # -*- coding:utf-8 -*- from selenium import webdriver from ...