Home  >  Article  >  Database  >  ORACLE PL/SQL管理命令

ORACLE PL/SQL管理命令

WBOY
WBOYOriginal
2016-06-07 17:45:331057browse

一 登录SQLPLUS

    sqlplus用户名/密码@实例as登录角色;

    如:用户sys(密码为123)以sysdba的角色登录数据库ORACL,我们可以输入:sqlplus sys/123@oracl as sysdba;

    这种登录方式会直接暴露密码,如果想隐藏密码,可以在此省略密码的输入,如:sqlplus sys@oracl as sysdba;回车以后ORACLE会给出输入密码的提示符。

    登录以后如果想切换其他的用户,可以直接使用connect 命令,如:connect user2/password@oracl as sysdba,同上一样,可以将密码分开输入。

    二 退出SQLPLUS

    quit;

    三 创建用户

    create user用户名identified by密码;

    如:创建用户CKSP,密码为123: create user cksp identified by 123;

    四 给用户分配角色或权限

    grant *** to ***;

    如:给刚才的用户分配角色DBA:grant dba to cksp;

    分配create table权限:grant

    五 删除用户

    drop user用户[cascade];

    其中cascade是可选的,如果输入了,则表示删除该用户及所有数据。

    如:删除上面创建的用户CKSP及他的所有数据:drop user cksp cascade;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn