Oracle Study Note : Users and Basic Security
1. view the default user account
SQL> select username from dba_users;
2. lock all users and set their password to expired
SQL> select ‘alter user ‘|| username || ‘ password expire account lock;’ from dba_users;
3. A locked user can only be accessed by altering the user to an unlocked state
SQL> alter user scott account unlock;
4. As a DBA, you can change the password for a user
SQL> alter user <username> identified by <new password>;
5. Run this query to display users that have been created by another DBA versus those created by Oracle.For default users,there should be a record in the DEFAULT_PWD$ view.So,if a user doesn’t exist in DEFAULT_PWD$,then you can assume it’s not a default account.
SQL> select distinct u.username
,case when d.user_name is null then ‘DBA created account’
else ‘Oracle created account’
from dba_users u
,default_pwd$ d
where u.username=d.user_name(+);
6. You can check the DBA_USERS_WITH_DEFPWD view to see whether any Oracle-created user accounts are still to the default password
SQL> select * from dba_users_with_defpwd;
7. Creating a User with Database Authentication
SQL> create user user_name identified by password
default tablespace users
temporaty tablespace temp
quote unlimited on users;
SQL> grant create session to user_name; #to make the user useful
SQL> grant create table to user_name; #to be able to create tables.
SQL> grant create table,create session to user_name identified by password; #you can also use the GRANT . . . IDENTIFIED BY statement to create a user.
8.Creating a User with OS Authentication
Oracle strongly recommends that you set the OS_AUTHENT_PREFIX parameter to a null string
SQL> alter system set os_authent_prefix=’’ scope=spfile;
SQL> create user user_name identified externally;
SQL> grant create session to user_name;
$ sqlplus / #when user_name logs in to the database server,this user can connect to SQL*Plus.
9. You can alter your current user’s session to point at a different schema via ALTER SESSION statement
SQL> alter session set current_schema = hr;
10. Assiging Default Permanent and Temporary Tablespaces
SQL> alter user user_name default tablespace tb_name temporary tablespace temp_name;
11. Modifying Password
SQL> alter user user_name identified by new_password;
12. SQL*PLUS password command
SQL> passw user_name
Changing password for user_name
New password:
13. Modifying Users
SQL> alter user user_name account lock;
SQL> alter user user_name quota 500m on users;
14. Dropping Users. Before you drop a user,I recommend that you first lock the user.Locking the user prevents others from connecting to a locked database account.
SQL> alter user user_name account lock;
SQL> select username,lock_date from dba_users;
SQL> alter user user_name account unlock;
SQL> drop user user_name;
SQL> drop user user_name cascade; #the prior commend won’t work if the user owns any database objects.Use the CASCADE clause to remove a user and have its objects dropped.
15. Password Strength. You can enforce a minimum standard of password complexity by assigning a password verification function to a user’s profile. Oracle supplies a default password verification function that you create by running the following script as the SYS schema
SQL> @?/rdbms/admin/utlpwdmg
SQL> alter profile default limit PASSWORD_VERIFY_FUNCTION ora12c_verify_function;
SQL> alter profile default limit PASSWORD_VERIFY_FUNCTION null; #disable the password function.
16. Limiting Database Resource Usage
SQL> alter system set resource_limit=true scope=both;
17. Assigning Database System Privileges
SQL> select destinct privilege from dba_sys_privs;
SQL> grant create session to user_name #minimally a user needs CREATE SESSION to be able to connect to the database.
SQL> revoke cteate table from user_name; #to take away privileges.
SQL> grant create table to user_name with admin option; #allows you to grant a system privilege to a user and also give that user the ability to administer a privilege.You can do this with the WITH ADMIN OPTION clause.
18. Assigning Database Object Privileges
SQL> grant insert,update,delete,select on object_owner to user_name;
SQL> grant insert(id,name,desc) on table_name to user_name #grants INSERT privileges to specific columns in the table.
SQL> grant insert on object_owner to user_name with grant option; #if you want a user that is being granted object privileges to be able to subsequently grant those same object privileges to other users,then use the WITH GRANT OPTION clause.
19. Grouping and Assigning Privileges
SQL> create role role_name;
SQL> grant select any table to role_name;
SQL> grant role_name to user_name;
Oracle Study Note : Users and Basic Security的更多相关文章
- Oracle Study Note : Tablespace and Data Files
1.how to create a tablespace that employs the most common features create tablespace tb_name #create ...
- Oracle Study之--Oracle 11gR2通过RMAN克隆数据库
Oracle Study之--Oracle 11gR2通过RMAN克隆数据库 Purpose of Database Duplication A duplicate database is usefu ...
- Oracle Study之--Oracle 单实例11.2.0.1.0升级到11.2.0.3.0
Oracle Study之--Oracle 单实例11.2.0.1.0升级到11.2.0.3.0 系统环境: 操作系统:RedHat EL6(64位) Oracle: Oracle 11gR2 ...
- Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3)
Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3) 一.配置共享存储 [oracle@aix203 ~]$lsdev -c disk hdisk0 Available ...
- Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(4)
Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(4) 一.安装CRS补丁 在安装CRS之前,须要安装补丁p6718715_10203_AIX64-5L,否则在安装时会出现 ...
- Beginning Scala study note(5) Pattern Matching
The basic functional cornerstones of Scala: immutable data types, passing of functions as parameters ...
- Beginning Scala study note(2) Basics of Scala
1. Variables (1) Three ways to define variables: 1) val refers to define an immutable variable; scal ...
- 理解RHEL上安装oracle的配置参数 :/etc/security/limits.conf, /etc/profile, /etc/pam.d/login
无论安装什么版本的Oracle,在安装之前,都需要配置 /etc/pam.d/login /etc/profile /etc/security/limits.conf这三个文件 那这三个文件究 ...
- Java Basic&Security Tools
JDK Tools and Utilities Basic Tools These tools are the foundation of the JDK. They are the tools yo ...
随机推荐
- java语言实现的短信接入实例,各公司大同小异
和几家短信平台接触过,都进行了接入测试.总体来说短信发送又快,覆盖率又全的,价格相对贵些.简易选两家分开使用,短信验证码的用一家贵的快的,普通的推广群发短信就用一个便宜的. 下面显示下测试代码 pub ...
- 【CImg】简单的畸变矩形矫正
三个角点确定一个平面,畸变的平面可以看成是不同基底下同一图像的表示 ============================我是分割线============================= 1. ...
- Loggly:提高ElasticSearch性能的九个高级配置技巧
Loggly日志管理服务在其很多核心功能里使用ElasticSearch作为搜索引擎.Jon Gifford在其文章“ElasticSearch vs Solr”中指出,日志管理领域对搜索技术有了更高 ...
- 浅谈如何使用代码为MP3文件写入ID3Tags
作者:郑童宇 GitHub:https://github.com/CrazyZty 1.前言 做了三年左右的Android开发,一直没写过博客,最近正好打算换工作,算是闲一些,就将以前开发所遇到的一些 ...
- Laxcus大数据管理系统2.0(2)- 第一章 基础概述 1.1 基于现状的一些思考
第一章 基础概述 1.1 基于现状的一些思考 在过去十几年里,随着互联网产业的普及和高速发展,各种格式的互联网数据也呈现爆炸性增长之势.与此同时,在数据应用的另一个重要领域:商业和科学计算,在各种新兴 ...
- 读取计算机的OEM信息
只需要读取注册表里面的值即可 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation\Logo 下面有制 ...
- springMVC导出 CSV案例
导出csv 第一步 Controller类里调用 OrderParamsVo 传入的参数 orderService.findBuyCSV 查询到要导出的信息 /** * 购买订单CSV * Order ...
- (Hibernate进阶)Hibernate搭建开发环境+简单实例(二)
hibernate是非常典型的持久层框架,持久化的思想是非常值得我们学习和研究的.这篇博文,我们主要以实例的形式学习Hibernate,不深究Hibernate的思想和原理,否则,一味追求,苦学思想和 ...
- JS与JQ倒计时的写法
页面需要制作一个倒计时的功能:然后度娘了一遍,找到两种写法,原生JS与JQ 的,经过测试原生JS在IE可能会有不刷新的现象所以结合了一个大神的JQ写法修改好了一个. 原生JS写法: HTML: < ...
- js获得浏览器的尺寸
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...