oracle用户解锁

查看Oracle实例有哪些用户?

涉及的表为dba_users

 

[sql]  view plain  copy
 print ?
  1. [oracle@rtest ~]$ sqlplus /nolog  
  2.   
  3. SQL*Plus: Release 11.2.0.3.0 Production on Mon Sep 2 11:05:49 2013  
  4.   
  5. Copyright (c) 1982, 2011, Oracle.  All rights reserved.  
  6.   
  7. idle> conn /as sysdba  
  8. Connected.  
  9. sys@TESTDB> desc dba_users  
  10.  Name                                                  Null?    Type  
  11.  ----------------------------------------------------- -------- ------------------------------------  
  12.  USERNAME                                              NOT NULL VARCHAR2(30)  
  13.  USER_ID                                               NOT NULL NUMBER  
  14.  PASSWORD                                                       VARCHAR2(30)  
  15.  ACCOUNT_STATUS                                        NOT NULL VARCHAR2(32)  
  16.  LOCK_DATE                                                      DATE  
  17.  EXPIRY_DATE                                                    DATE  
  18.  DEFAULT_TABLESPACE                                    NOT NULL VARCHAR2(30)  
  19.  TEMPORARY_TABLESPACE                                  NOT NULL VARCHAR2(30)  
  20.  CREATED                                               NOT NULL DATE  
  21.  PROFILE                                               NOT NULL VARCHAR2(30)  
  22.  INITIAL_RSRC_CONSUMER_GROUP                                    VARCHAR2(30)  
  23.  EXTERNAL_NAME                                                  VARCHAR2(4000)  
  24.  PASSWORD_VERSIONS                                              VARCHAR2(8)  
  25.  EDITIONS_ENABLED                                               VARCHAR2(1)  
  26.  AUTHENTICATION_TYPE                                            VARCHAR2(8)  


查看用户状态:

 

[sql]  view plain  copy
 print ?
  1. sys@TESTDB> select username,account_status from dba_users;  
  2.   
  3. USERNAME                       ACCOUNT_STATUS  
  4. ------------------------------ --------------------------------  
  5. SYS                            OPEN  
  6. SYSTEM                         OPEN  
  7. OUTLN                          EXPIRED & LOCKED  
  8. MGMT_VIEW                      EXPIRED & LOCKED  
  9. FLOWS_FILES                    EXPIRED & LOCKED  
  10. MDSYS                          EXPIRED & LOCKED  
  11. ORDSYS                         EXPIRED & LOCKED  
  12. EXFSYS                         EXPIRED & LOCKED  
  13. DBSNMP                         EXPIRED & LOCKED  
  14. WMSYS                          EXPIRED & LOCKED  
  15. APPQOSSYS                      EXPIRED & LOCKED  
  16. APEX_030200                    EXPIRED & LOCKED  
  17. OWBSYS_AUDIT                   EXPIRED & LOCKED  
  18. ORDDATA                        EXPIRED & LOCKED  
  19. CTXSYS                         EXPIRED & LOCKED  
  20. ANONYMOUS                      EXPIRED & LOCKED  
  21. SYSMAN                         EXPIRED & LOCKED  
  22. XDB                            EXPIRED & LOCKED  
  23. ORDPLUGINS                     EXPIRED & LOCKED  
  24. OWBSYS                         EXPIRED & LOCKED  
  25. SI_INFORMTN_SCHEMA             EXPIRED & LOCKED  
  26. OLAPSYS                        EXPIRED & LOCKED  
  27. SCOTT                          EXPIRED & LOCKED  
  28. ORACLE_OCM                     EXPIRED & LOCKED  
  29. XS$NULL                        EXPIRED & LOCKED  
  30. BI                             EXPIRED & LOCKED  
  31. PM                             EXPIRED & LOCKED  
  32. MDDATA                         EXPIRED & LOCKED  
  33. IX                             EXPIRED & LOCKED  
  34. SH                             EXPIRED & LOCKED  
  35. DIP                            EXPIRED & LOCKED  
  36. OE                             EXPIRED & LOCKED  
  37. APEX_PUBLIC_USER               EXPIRED & LOCKED  
  38. HR                             EXPIRED & LOCKED  
  39. SPATIAL_CSW_ADMIN_USR          EXPIRED & LOCKED  
  40. SPATIAL_WFS_ADMIN_USR          EXPIRED & LOCKED  
  41.   
  42. 36 rows selected.  


比如解锁sh账户,sh账户为OCP考试需要用到的用户,SH账户里涉及的多张表在OCP有涉及考试。

目前SH的账户的状态为:EXPIRED & LOCKED

 

用以下命令给SH账户解锁:

sys@TESTDB> alter user sh account unlock; --解开LOCKED

sys@TESTDB> alter user sh identified by sh;--解开EXPIRED

 

[sql]  view plain  copy
 print ?
  1. sys@TESTDB> alter user sh account unlock;  
  2.   
  3. User altered.  
  4.   
  5. sys@TESTDB> select username,account_status from dba_users;  
  6.   
  7. USERNAME                       ACCOUNT_STATUS  
  8. ------------------------------ --------------------------------  
  9. SYS                            OPEN  
  10. SYSTEM                         OPEN  
  11. SH                             EXPIRED  
  12. OUTLN                          EXPIRED & LOCKED  
  13. MGMT_VIEW                      EXPIRED & LOCKED  
  14. FLOWS_FILES                    EXPIRED & LOCKED  
  15. MDSYS                          EXPIRED & LOCKED  
  16. ORDSYS                         EXPIRED & LOCKED  
  17. EXFSYS                         EXPIRED & LOCKED  
  18. DBSNMP                         EXPIRED & LOCKED  
  19. WMSYS                          EXPIRED & LOCKED  
  20. APPQOSSYS                      EXPIRED & LOCKED  
  21. APEX_030200                    EXPIRED & LOCKED  
  22. OWBSYS_AUDIT                   EXPIRED & LOCKED  
  23. ORDDATA                        EXPIRED & LOCKED  
  24. CTXSYS                         EXPIRED & LOCKED  
  25. ANONYMOUS                      EXPIRED & LOCKED  
  26. SYSMAN                         EXPIRED & LOCKED  
  27. XDB                            EXPIRED & LOCKED  
  28. ORDPLUGINS                     EXPIRED & LOCKED  
  29. OWBSYS                         EXPIRED & LOCKED  
  30. SI_INFORMTN_SCHEMA             EXPIRED & LOCKED  
  31. OLAPSYS                        EXPIRED & LOCKED  
  32. SCOTT                          EXPIRED & LOCKED  
  33. ORACLE_OCM                     EXPIRED & LOCKED  
  34. XS$NULL                        EXPIRED & LOCKED  
  35. BI                             EXPIRED & LOCKED  
  36. PM                             EXPIRED & LOCKED  
  37. MDDATA                         EXPIRED & LOCKED  
  38. IX                             EXPIRED & LOCKED  
  39. DIP                            EXPIRED & LOCKED  
  40. OE                             EXPIRED & LOCKED  
  41. APEX_PUBLIC_USER               EXPIRED & LOCKED  
  42. HR                             EXPIRED & LOCKED  
  43. SPATIAL_CSW_ADMIN_USR          EXPIRED & LOCKED  
  44. SPATIAL_WFS_ADMIN_USR          EXPIRED & LOCKED  
  45.   
  46. 36 rows selected.  
  47.   
  48. sys@TESTDB> alter user sh identified by sh;  
  49.   
  50. User altered.  
  51.   
  52. sys@TESTDB> select username,account_status from dba_users;  
  53.   
  54. USERNAME                       ACCOUNT_STATUS  
  55. ------------------------------ --------------------------------  
  56. SYS                            OPEN  
  57. SYSTEM                         OPEN  
  58. SH                             OPEN  
  59. OUTLN                          EXPIRED & LOCKED  
  60. MGMT_VIEW                      EXPIRED & LOCKED  
  61. FLOWS_FILES                    EXPIRED & LOCKED  
  62. MDSYS                          EXPIRED & LOCKED  
  63. ORDSYS                         EXPIRED & LOCKED  
  64. EXFSYS                         EXPIRED & LOCKED  
  65. DBSNMP                         EXPIRED & LOCKED  
  66. WMSYS                          EXPIRED & LOCKED  
  67. APPQOSSYS                      EXPIRED & LOCKED  
  68. APEX_030200                    EXPIRED & LOCKED  
  69. OWBSYS_AUDIT                   EXPIRED & LOCKED  
  70. ORDDATA                        EXPIRED & LOCKED  
  71. CTXSYS                         EXPIRED & LOCKED  
  72. ANONYMOUS                      EXPIRED & LOCKED  
  73. SYSMAN                         EXPIRED & LOCKED  
  74. XDB                            EXPIRED & LOCKED  
  75. ORDPLUGINS                     EXPIRED & LOCKED  
  76. OWBSYS                         EXPIRED & LOCKED  
  77. SI_INFORMTN_SCHEMA             EXPIRED & LOCKED  
  78. OLAPSYS                        EXPIRED & LOCKED  
  79. SCOTT                          EXPIRED & LOCKED  
  80. ORACLE_OCM                     EXPIRED & LOCKED  
  81. XS$NULL                        EXPIRED & LOCKED  
  82. BI                             EXPIRED & LOCKED  
  83. PM                             EXPIRED & LOCKED  
  84. MDDATA                         EXPIRED & LOCKED  
  85. IX                             EXPIRED & LOCKED  
  86. DIP                            EXPIRED & LOCKED  
  87. OE                             EXPIRED & LOCKED  
  88. APEX_PUBLIC_USER               EXPIRED & LOCKED  
  89. HR                             EXPIRED & LOCKED  
  90. SPATIAL_CSW_ADMIN_USR          EXPIRED & LOCKED  
  91. SPATIAL_WFS_ADMIN_USR          EXPIRED & LOCKED  
  92.   
  93. 36 rows selected.  


 

 查看SH用户有哪些表?

 

 

[sql]  view plain  copy
 print ?
  1. sh@TEST0924> select * from tab;  
  2.   
  3. TNAME                          TABTYPE  CLUSTERID  
  4. ------------------------------ ------- ----------  
  5. 1_EMP                          TABLE  
  6. BIN$51XUts/lTCDgQwEAAH/BlA==$0 TABLE  
  7. CAL_MONTH_SALES_MV             TABLE  
  8. CHANNELS                       TABLE  
  9. COSTS                          TABLE  
  10. COUNTRIES                      TABLE  
  11. CUSTOMERS                      TABLE  
  12. DIMENSION_EXCEPTIONS           TABLE  
  13. DR$SUP_TEXT_IDX$I              TABLE  
  14. DR$SUP_TEXT_IDX$K              TABLE  
  15. DR$SUP_TEXT_IDX$N              TABLE  
  16. DR$SUP_TEXT_IDX$R              TABLE  
  17. EMP_1                          TABLE  
  18. EMP_2                          TABLE  
  19. EMP_3                          TABLE  
  20. FWEEK_PSCAT_SALES_MV           TABLE  
  21. INVOICE                        TABLE  
  22. NEW_SALES                      TABLE  
  23. PRICE_LIST                     TABLE  
  24. PRODUCTS                       TABLE  
  25. PROFITS                        VIEW  
  26. PROMOTIONS                     TABLE  
  27. SALES                          TABLE  
  28. SALES_TRANSACTIONS_EXT         TABLE  
  29. SUPPLEMENTARY_DEMOGRAPHICS     TABLE  
  30. TIMES                          TABLE  
  31. TRANSACTIONS                   TABLE  
  32. TRANSACTIONS1                  TABLE  
  33.   
  34. 28 rows selected.  

你可能感兴趣的:(JAVA,oracle)