当前位置:Gxlcms > 数据库问题 > 1Z0-051-1、SQL-准备工作

1Z0-051-1、SQL-准备工作

时间:2021-07-01 10:21:17 帮助过:31人阅读

、准备工作

SQL> createtablespace tbs_peenboo

  2 datafile ‘/home/oracle/app/oracle/oradata/orcl/tbs_peenboo01.dbf‘

  3  size20m autoextend on next 5m maxsize 2G

  4 logging

  5 extent management local

  6 segment space management auto

  7 default nocompress;

 

Tablespace created.

 

SQL> create userpeenboo

  2 default tablespace tbs_peenboo temporary tablespace temp

  3 quota unlimited on tbs_peenboo

  4 identified by pb1234

  5 password expire

  6 account unlock;

 

User created.

 

SQL> grant createsession,alter session,create table,create view,create synonym,  create cluster,create database link,createsequence,create trigger,create type,create procedure,create operator to dev;

 

Grant succeeded.

 

 

SQL> grantdev,resource,dba to peenboo with admin option;

 

Grant succeeded.

##注:授予权限一定要非常小心,且进行验证。

SQL> select *from dba_role_privs where grantee=‘PEENBOO‘;

 

GRANTEE                        GRANTED_ROLE       ADM DEF

-----------------------------------------------------------  ---

PEENBOO                        DBA                            YES YES

PEENBOO                        RESOURCE                YES YES

PEENBOO                        DEV                            YES YES

 

 

SQL> revoke dba frompeenboo;

SQL> select *from dba_role_privs

  2 where grantee=‘PEENBOO‘;

 

GRANTEE                        GRANTED_ROLE       ADM DEF

------------------------------------------------------------ --- ---

PEENBOO                        RESOURCE                YES YES

PEENBOO                        DEV                            YES YES

 

 

SQL> conn peenboo

Enter password:

ERROR:

ORA-28001: thepassword has expired

 

 

Changing passwordfor peenboo

New password:

Retype new password:

Password changed

Connected.

SQL>


本文出自 “奋斗不止” 博客,请务必保留此出处http://peenboo.blog.51cto.com/2865551/1790579

1Z0-051-1、SQL-准备工作

标签:identified   password   management   default   account   

人气教程排行