# 检查用户是否创建成功 column account_status format a20 column username format a20 column password format a20 select username,password,account_status from dba_users where username='OE'; USERNAME PASSWORD ACCOUNT_STATUS -------------------- -------------------- -------------------- OE OPEN # 创建用户的表 column OWNER format a20 column TABLE_NAME format a20 select owner, table_name from dba_tables where owner='OE'; OWNER TABLE_NAME -------------------- -------------------- OE CUSTOMERS OE WAREHOUSES OE ORDER_ITEMS OE ORDERS OE INVENTORIES OE PRODUCT_INFORMATION OE PRODUCT_DESCRIPTIONS OE PROMOTIONS # 查看OE的系统权限 select privilege from dba_sys_privs where GRANTEE='OE'; PRIVILEGE ---------------------------------------- CREATE MATERIALIZED VIEW UNLIMITED TABLESPACE CREATE VIEW QUERY REWRITE CREATE SYNONYM CREATE SESSION CREATE DATABASE LINK # 查看用户被授予的对象权限 col GRANTEE for a15; col PRIVILEGE for a20; col owner for a15; SELECT GRANTEE,PRIVILEGE,OWNER,TABLE_NAME FROM DBA_TAB_PRIVS WHERE GRANTEE='OE'; GRANTEE PRIVILEGE OWNER TABLE_NAME --------------- -------------------- --------------- -------------------- OE EXECUTE SYS DBMS_STATS OE READ SYS SUBDIR OE READ SYS SS_OE_XMLDIR OE WRITE SYS SUBDIR OE WRITE SYS SS_OE_XMLDIR # 修改秘密 alter user oe identified by oracle; # 登陆 conn oe/oracle@127.0.0.1:1521/ocp.ilt.example.com show con_name CON_NAME ------------------------------ OCP # 查看OE用户有权限的表 SQL> select table_name from tabs; TABLE_NAME -------------------------------------------------------------------------------- CUSTOMERS WAREHOUSES ORDER_ITEMS ORDERS INVENTORIES PRODUCT_INFORMATION PRODUCT_DESCRIPTIONS PROMOTIONS 8 rows selected.
|