创建用户 Oracle 10g学习系列(1)

    最近有时间学习oracle了,把学习的过程整理出来,漫漫学习路,现在才刚刚起步。


1.#su - oracle

2.启动监听

$ lsnrctl start 

3.启动em

$ emctl start dbconsole

http://192.168.88.139:1158/em/

4.启动iSQL*Plus

$ isqlplusctl start

http://192.168.88.139:5560/isqlplus/


5.连接数据库

[oracle@localhost ~]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 22 07:01:37 2014


Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to an idle instance.


SQL> 

6.启动数据库

SQL> startup;

7.创建用户bob,密码admin

SQL>create user bob identified by admin;


8.把dba权限给bob

SQL>grant dba to bob;

9.取消授权

SQL>revoke dba from bob;

10.删除用户,如果用户已经有对象了(如TABLE,VIEW等)需要带cascade

SQL>drop user bob cascade;

11.删除 ORACLE表空间

SQL>drop tablespace tablespacename including contents and datafiles;


12.解锁oracle用户bob

SQL>show user;

USER is "SYS"

SQL>alter user bob account unlock;

SQL> conn bob/qazwsx;

Connected.

SQL> show user;

USER is "BOB"