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的更多相关文章

  1. Oracle Study Note : Tablespace and Data Files

    1.how to create a tablespace that employs the most common features create tablespace tb_name #create ...

  2. Oracle Study之--Oracle 11gR2通过RMAN克隆数据库

    Oracle Study之--Oracle 11gR2通过RMAN克隆数据库 Purpose of Database Duplication A duplicate database is usefu ...

  3. 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 ...

  4. Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3)

    Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3) 一.配置共享存储 [oracle@aix203 ~]$lsdev -c disk hdisk0 Available ...

  5. Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(4)

    Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(4) 一.安装CRS补丁 在安装CRS之前,须要安装补丁p6718715_10203_AIX64-5L,否则在安装时会出现 ...

  6. Beginning Scala study note(5) Pattern Matching

    The basic functional cornerstones of Scala: immutable data types, passing of functions as parameters ...

  7. 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 ...

  8. 理解RHEL上安装oracle的配置参数 :/etc/security/limits.conf, /etc/profile, /etc/pam.d/login

    无论安装什么版本的Oracle,在安装之前,都需要配置 /etc/pam.d/login   /etc/profile   /etc/security/limits.conf这三个文件 那这三个文件究 ...

  9. Java Basic&Security Tools

    JDK Tools and Utilities Basic Tools These tools are the foundation of the JDK. They are the tools yo ...

随机推荐

  1. DP最长递增字符串

    对于最简单DP问题,比如7 9 1 10 3中最长的递增字符串就是7 9 10,所以长度是3. 对于这个问题,就是从第二个开始,让后面的每一个字符都假设作为咱们要找的最长的字符串的最后一个字符,然后从 ...

  2. 使用git向github中添加项目并更新(备忘录)

    今天使用Git&github&ST3时,发现ST3不仅是git插件不能push成功,使用sublimegit插件也不行. 可能是没有掌握sublimegit的使用技巧,有待后续继续摸索 ...

  3. iOS中精确时间的获取

    下面是一段无法查证出处的英文和自己的翻译 A quick and easy way to measure the performance of a piece of iOS code is to di ...

  4. matlab 小波变换

    MATLAB小波变换指令及其功能介绍 1 一维小波变换的 Matlab 实现 (1) dwt函数 功能:一维离散小波变换 格式:[cA,cD]=dwt(X,'wname') [cA,cD]=dwt(X ...

  5. 【练习】显示MYSQL客户机选项

    [oracle@enmo ~]$ mysql --help mysql Ver , for Linux (x86_64) using EditLine wrapper Copyright (c) , ...

  6. 查看Eclipse版本号的方法

    查看Eclipse版本号的方法如下所示: 1:假设Eclipse已打开Eclipse的菜单栏: Help-->About Eclipse弹出框中会显示一排logo,点击eclipse的那个log ...

  7. 【Hibernate 9】悲观锁和乐观锁

    一.锁的基本简介 1.1,为什么需要锁 首先,锁的概念产生,主要是为了解决并发性的问题.什么是并发性问题呢,比如: Angel现在银行有个账号,里面有存款1000块.现在,Angel的账户,在两个地方 ...

  8. 搭建Android手机系统开发环境(转)

    Android作为近来表现十分强劲的手机操作系统,越来越受到开发人员的青睐,本篇文章将带领大家从零开始打造属于自己的开发环境. 一.JDK下载安装 JDK全称是Java Development Kit ...

  9. nginx之keepalive

    一:设置 keepalive_timeout  0; 发curl: [xxx ~]$ curl -H "Keep-Alive: 60" -H "Connection: k ...

  10. poj2031 Building a Space Station

    这题目,用G++ WA,用C++ AC. 题目要求,现给出n个球,然后要使每两个球直接或者间接连通,可以在任意两球之间做管道(在表面),最后的要求是,如果使得都连通的话,管道最小长度是多少. 思路简单 ...