oracle 数据库学习

1.更改数据库用户名密码: alter user '用户名' identified by ’password'.

2.查看数据库有哪些用户:sqlplus system/password ;select username from dba_users;

3.查看某个用户下有哪些表: select table_name from user_tables;

4.查看表结构:select t.table_name,
       t.column_name,
       t.data_type,
       t.data_length,
       t.nullable,
       t.column_id,
       c.comments,
       (SELECT CASE
                 WHEN t.column_name = m.column_name THEN
                  1
                 ELSE
                  0
               END
          FROM DUAL) iskey
  FROM user_tab_cols t,
       user_col_comments c,
       (select m.column_name
          from user_constraints s, user_cons_columns m
         where lower(m.table_name) = 'qh_outstoresabinfo'
           and m.table_name = s.table_name
           and m.constraint_name = s.constraint_name
           and s.constraint_type = 'P') m
 WHERE lower(t.table_name) = 'qh_outstoresabinfo'
   and c.table_name = t.table_name
   and c.column_name = t.column_name
   and t.hidden_column = 'NO'
 order by t.column_id

原文地址:https://www.cnblogs.com/websocket/p/4769491.html