---
title: "Oracle用户之间表的访问和账户的锁定与解锁"
author: "剑雨123"
date: "2014-04-18T10:55:04Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2014-04-18T10:55:04Z"
id: 2048197
url: "https://cuug789.iteye.com/blog/2048197"
---

![](http://dl2.iteye.com/upload/attachment/0096/2413/34ba2cd1-a85a-3102-9df0-3638b6fee894.jpg)
一：用户之间表的访问：

例如：linuxidc用户想访问system用户中的users表，命令如下  
：  
  grant select on users to linuxidc;（这是在用户为system下所执行的命令,此时如果在  
  
linuxidc用户下只能查询system用户中users表的数据）如果想对system表中的数据进  
  
行增删改查则可以执行如下命令：  
  
grant all on users to linuxidc;  
  
注意：在linuxidc用户中进行查询system用户中的表时，必须要加上system，例如：  
Select * from system.users；  
二：账户的锁定与解锁
账户锁定（profile）  
  
概述：指定该账户登陆时最多可以输入密码的次数和天数  
  
例如：指定linuxidc用户最多尝试3次登陆，锁定的天数为2天  
  
a)创建sql命令：  
   
 create profile linuxidc_lock limit failed_login_attempts 3 password_lock_time 2;  
  
b)执行sql命令：  
  
 alter  user  linuxidc  profile  linuxidc_lock;  
  
账户解锁  
 Sql命令：alter  user  linuxidc  account  unlock;