首页 > 数据库技术 > 详细

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

时间:2016-06-18 17:08:43      阅读:348      评论:0      收藏:0      [点我收藏+]

0、准备工作

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-准备工作

原文:http://peenboo.blog.51cto.com/2865551/1790579

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!