users安装完oracle后自动创建的吗_oracle 表dba_users存在吗 - CSDN
精华内容
参与话题
  •  SYS用户是Oracle中的一个超级用户。数据库中的所有数据字典和视图都储存在SYS模式中。数据字典储存了用来管理数据库对象的所有信息。是Oracle数据库中非常重要的系统信息。主要用来维护系统信息和管理示例。 SYS...

    1.SYS用户

           SYS用户是Oracle中的一个超级用户。数据库中的所有数据字典和视图都储存在SYS模式中。数据字典储存了用来管理数据库对象的所有信息。是Oracle数据库中非常重要的系统信息。主要用来维护系统信息和管理示例。
    SYS用户只能以SYSOPER或SYSDBA角色登入系统。

     

    2.SYSTEM用户

            SYSTEM是Oracle中默认的系统管理员,它拥有DBA权限。该用户拥有Oracle管理工具使用的内部表和视图。一般建议使用该用户进行对Oracle的操作。
    SYS只能以默认方式登入,而不能使用SYSOPER和SYSDBA

     

    3.SCOTT用户

              SCOTT是Oracle数据库的一个示范用户,一般在数据库安装时创建。SCOTT用户模式包含四个示范表。其中一个是EMP表。使用USERS表空间储存模式对象。

     

           Oracle中CREATE USER命令用于创建用户,每个用户都有一个默认的表空间和一个临时表空间。如果没有指定那么Oracle就讲USERS设为默认表空间,将TEMP设为临时表空间

    以下代码用于创建一个用户和指定默认表空间和临时表空间和操作用户的几个指令

    --创建用户
    CREATE USER martin
    IDENTIFIED BY password
    DEFAULT TABLESPACE worktbs
    TEMPORARY TABLESPACE temp;
    
    --修改用户密码
    ALTER USER martin
    IDENTIFIED BY PWS;
    
    --删除用户
    DROP USER martin CASCADE;
    
    --授予和撤销martin用户的CONNECT和RESOUTCE两个角色
    GRANT connect,resource TO martin;       --授予CONNECT和RESOUTCE两个角色
    REVOKE connect,resource FROM martin;  --撤销CONNECT和RESOURCE两个角色
    GRANT SELECT ON SCOTT.EMP TO martin;  --允许用户查看emp表中的记录
    GRANT UPDATE ON SCOTT.EMP TO martin; --允许用户更新emp表中的记录

            

    花落知多少,点个赞来好不好

     

    展开全文
  • 完成oracle安装后,根据选取的组件不同,就会出现一些已建好的用户,但这些用户是做什么的,常常让人不是很明白,在网上找了一篇文章: http://hi.baidu.com/easydba/blog/item/e1569ac218b4f133e5dd3b80.html ...

    完成oracle安装后,根据选取的组件不同,就会出现一些已建好的用户,但这些用户是做什么的,常常让人不是很明白,在网上找了一篇文章:
    http://hi.baidu.com/easydba/blog/item/e1569ac218b4f133e5dd3b80.html
    这个文章中对这些用户进行了详细的描述,现记录如下,以便今后查询:
    Oracle Created Database Users: Password, Usage and Files References
    2008-08-27 15:28
    Purpose
    ~~~~~~~
    The following table lists the default usernames and passwords you may encounter 
    in your database as a result of installing various additional 
    --> products/components
    --> options   
    --> new features of the version

    It provides references to 
       --> which option or product should be installed to have it 
       --> what script created it 
       --> what it is used for   
       --> suggestion to secure the account

    This note is intended to be an up-to-date list of default usernames: as such the
    information is subject to change.


    SCOPE & APPLICATION
    ~~~~~~~~~~~~~~~~~~~
    Database Administrators who need to export full databases, manage users and 
    security.


    List Of Users Created at Database Creation
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    By default, are automatically created during database creation :

    SCOTT by script $ORACLE_HOME/rdbms/admin/utlsampl.sql
    OUTLN by script $ORACLE_HOME/rdbms/admin/sql.bsq


    Optionally:

    DBSNMP                    if Enterprise Manager Intelligent Agent is installed 
    MGMT_VIEW                 is part of the DB Control Repository
    SYSMAN                    is part of the DB Control Repository and Grid
                                see 
    Note 331209.1 for details
    TRACESVR                  if Enterprise Manager is installed
    AURORA$ORB$UNAUTHENTICATED /
    AURORA$JIS$UTILITY$         -- if Oracle Servlet Engine (OSE) is installed
    OSE$HTTP$ADMIN             /
    MDSYS                     if Oracle Spatial option is installed 
    MDDATA                    if Oracle Spatial option is installed 
    ORDSYS                    if interMedia Audio option is installed 
    ORDPLUGINS                if interMedia Audio option is installed 
    SI_INFORMTN_SCHEMA        if interMedia option is installed 
    CTXSYS                    if Oracle Text option is installed
    WKSYS                     if Oracle Ultra Search option is installed
    WKUSER (9i)/WK_TEST (10g) if Oracle Ultra Search option is installed
    REPADMIN                  if Replication Option is installed 
    LBACSYS                   if Oracle Label Security option is installed 
    DVF                       if Oracle Database Vault option is installed
    DVSYS                     if Oracle Database Vault option is installed
    ODM                       if Oracle Data Mining option is installed
    ODM_MTR                   idem
    DMSYS (10g)               if Oracle Data Mining 10g option is installed
    DMSYS                     in 10g version to replace ODM and ODM_MTR schemas
    OLAPSYS                   if OLAP option is installed
    WMSYS                     if Oracle Workspace Manager script owmctab.plb is
                                executed.
    ANONYMOUS                 if catqm.sql catalog script for SQL XML management
    XDB                       is executed
    EXFSYS                    is the Expression Filter Feature repository
    DIP                       for provisioning event processing
    TSMSYS                    Transparent Session Migration

    Oracle9i Sample Schemas   if you need to test through a complete sample 
                                system of information (see 
    Note 207560.1)

    Note
    ~~~~
    If you have already the 9i sample schemas (hr, oe, pm, etc.) and you don't need
    them, you can removed them safely and without damage to the database.


    a. The SCOTT user is created by default to provide sample user tables. You can 
       alter the password. To create the default tables, run the script 
       $ORACLE_HOME/sqlplus/demo/demobld.sql. To drop the objects, run 
       $ORACLE_HOME/sqlplus/demo/demodrop.sql connected as SCOTT.

    b. The OUTLN (OUTLiNes) user is automatically created during installation of 
       Oracle8i and Oracle9i. OULTN is the schema of Stored Outlines.
       The package OUTLN_PKG is used to manage stored outlines and categories. 
       OUTLN is the owner of tables OL$, OL$HINTS (Oracle8i) as well as OL$NODES 
       (Oracle9i) used to store hints for stored outlines.   
       You can change the password for the OUTLN schema just as for the SYS and SYSTEM
       schemas.

    b. The DBSNMP user can be dropped by running the catnsnmp.sql script. If you 
       need to re-create it, run the catsnmp.sql script. Ensure that there are no 
       jobs running or scheduled in Oracle Enterprise Manager before you run the 
       script.

       MGMT_VIEW is part of the DB Control Repository, it is created by running
       the script $OH/sysman/admin/emdrep/bin/RepManager, the password is 
       autogenerated (it does not have a fixed or default value).

       SYSMAN belongs to the same feature ( see 
    Note 331209.1 for details):
       it is the schema of the Grid OMS repository of the 10G Enterprise Manager Grid.

    c. The TRACESVR user is created by $ORACLE_HOME/otrace/admin/otrcsvr.sql during
       the installation of OEM. 
       If you change TRACESVR user's password, you will not be able to do OTrace
       collections. This user is only used with 7.x Databases where stored procedures 
       are used by OTrace to start and stop data collections. The TRACESVR/stored 
       procedure mechanism is no longer used to control OTrace collections starting 
       with Oracle 8.x Databases. Therefore in this case you can change the password 
    (or drop that user). 

    d. The three JSERV accounts (AURORA$JIS$UTILITY$, AURORA$ORB$UNAUTHENTICATED and
       OSE$HTTP$ADMIN) are used internally by Enterprise Java Beans and CORBA Tools
       and created with randomly-generated passwords 'INVALID_ENCRYPTED_PASSWORD'.

       -> jisorb.sql creates user AURORA$ORB$UNAUTHENTICATED.
       -> jisbgn.sql creates user AURORA$JIS$UTILITY$ 
       -> jishausr.sql creates user OSE$HTTP$ADMIN 
       These 3 scripts are launched by init_jis.sql script to install the Oracle 
       Servlet Engine (OSE)
          
       Changing their passwords would prevent the ORB from working.
       This is supposed to change in a future version so that you can change their
       password.

    e. MDSYS, MDDATA, ORDSYS, CTXSYS, ORDPLUGINS and SI_INFORMTN_SCHEMA are created 
       to support Oracle Intermedia. 
       The default password for the ORDSYS and SI_INFORMTN_SCHEMA users during 
       automatic installation is 'ORDSYS', and for ORDPLUGINS is 'ORDPLUGINS'.
       The schema MDDATA is used by Oracle Spatial for storing Geocoder and router 
       data Geocoding is the process of converting tables of address data into 
       standardized address, location, and possibly other data.
       
    f. WKSYS is a privileged Oracle user who owns the Ultra Search data dictionary 
       and internal objects. Ultra Search uses the WKSYS user for storing Ultra 
       Search packages and metadata. WKUSER (9i)/WK_TEST (10g) is a test user.

    g. REPADMIN user: it is usual to have a separate user for the replication 
       administrator to protect master groups from being managed by snapshot 
       administrators.
       This user configures the replicated environment and performs administration
       of all replicated schemas / groups.

    h. LBACSYS user: the Oracle Label Security administrator username.

    i. DVSYS schema stores the database objects needed to process Oracle data for 
       Oracle Database Vault. This schema contains the roles, views, accounts, 
       functions, and other database objects that Oracle Database Vault uses. 

    j. The DVF schema contains public functions to retrieve (at run time) the 
       factor values set in the Oracle Database Vault access control configuration.

    k. ODM user: who performs data mining operations. 
       In 10g, a user can be created with a chosen name.

    l. ODM_MTR user: the account associated with the data repository for data 
       mining sample programs. 
       In 10g, DMSYS is the schema for the data repository.

    m. OLAPSYS user: identity used to create OLAP metadata structures. 

    n. WMSYS user: used to store all the metadata information for Oracle Workspace 
       Manager. 

    o. ANONYMOUS user: allows HTTP access to Oracle XML DB.

    p. XDB user: Used for storing Oracle XML DB data and metadata. 

    q. EXFSYS is the Expression Filter Feature repository (see 
    Note 258618.1): 
       the user is created with the script exfsys.sql that asks for a password.

    r. DIP is created in rdbms/admin/catdip.sql (password is DIP): for provisioning
       event processing

    s. TSMSYS is created in rdbms/admin/cattsm.sql for Transparent Session Migration

    t. The Oracle9i Sample Schemas provides installed schemas meant to be used for 
       demonstration purposes only:
       -> HR: Human Resources schema
              The Human Resources division tracks information on the company's 
              employees and facilities.
       -> OE: Order Entry schema requires "Oracle Spatial" option.
              The Order Entry division tracks product inventories and sales of the 
              company�s products through various channels.
       -> PM: Product Media schema requires "Oracle JVM" and "Oracle Intermedia" 
              options.
              The Product Media division maintains descriptions and detailed 
              information on each product sold by the company.
       -> SH: Sales History schema requires "Oracle OLAP" set up.
              The Sales History division tracks business statistics to facilitate
              business decisions.
       -> QS: Queued Shipping schema
              The Shipping division manages the shipping of products to customer.
              The sample company has decided to test the use of messaging to 
              manage its proposed B2B applications.
       -> QS_ES (Eastern Shipping)
       -> QS_WS (Western Shipping)
       -> QS_OS (Overseas Shipping)
       -> QS_CB (Customer Billing)
       -> QS_CS (Customer Service)
       -> QS_ADM (Administration)
       -> QS_CBADM (Customer Billing Administration)

    If any of the user accounts is locked and expired upon installation and needs to
    be activated, unlock and assign a new meaningful password to that user account:

       SQL> ALTER USER "schema_name" IDENTIFIED BY "newpass" ACCOUNT UNLOCK;


    Passwords and Referenced Files List
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Username    | Description             | Default Password | Created or Referenced         |Comments
                |                         |                  | in $ORACLE_HOME/ files        |
    ------------+-------------------------+------------------+-------------------------------+--------
                |                         |                  |                               |
    CTXSYS      | Intermedia Text schema | CTXSYS           |./ctx/admin/dr0csys.sql        |change
                |                         |                  |./bin/ctxsrv -user ctxsys/*    |                                                      
    ------------+-------------------------+------------------+-------------------------------+--------                   
    DBSNMP      | Intelligent Agent user | DBSNMP           |./rdbms/admin/catsnmp.sql      |change
                |                         |                  |./bin/dbsnmp                   |
                |                         |                  |./network/admin/snmp_rw.ora    |
    ------------+-------------------------+------------------+-------------------------------+--------
    MGMT_VIEW   | DB Control Repository   | autogenerated    |./sysman/admin/emdrep/bin/RepManager|
    ------------+-------------------------+------------------+-------------------------------+--------
    SYSMAN      | DB Control Repository   | asked            |                               |See 
    Note 259379.1
    ------------+-------------------------+------------------+-------------------------------+--------
    MDSYS       | Spatial Data Option user| MDSYS            |./md/admin/mdinst.sql          |change
                |                         |                  |./ord/admin/ordisysc.sql       |
    MDDATA      | Spatial Data Option user| MDDATA           |./md/admin/catmd.sql           |lock
    ------------+-------------------------+------------------+-------------------------------+--------
    WKSYS       | Ultra Search option user| WKSYS (admin)   |./ultrasearch/admin/wk0csys.sql|
    WKUSER (9i) | Ultra Search option user| WKUSER (end-user)|./ultrasearch/admin/wk0csys.sql|
    WK_TEST (10g)|                        | WK_TEST (same)   |./ultrasearch/admin/wk0csys.sql|
    ------------+-------------------------+------------------+-------------------------------+--------
    ODM         | Oracle Data Mining      | ODM              |./dm/admin/dmcrt.sql           |change
    ODM_MTR     | Oracle Data Mining      | MTRPW            |./dm/admin/dmcrt.sql           |change
    DMSYS (10g) | Oracle Data Mining      | DMSYS            |./dm/admin/odmcrtm.sql         |change
    any name    | Oracle Data Mining      | any pasword      |./dm/admin/odmcrt.sql          |
    ------------+-------------------------+------------------+-------------------------------+--------
    ORDPLUGINS | InterMedia Audio option | ORDPLUGINS       |./ord/admin/ordisysc.sql       |change
    ORDSYS      | InterMedia Audio option | ORDSYS           |./ord/admin/ordisysc.sql       |change
    SI_INFORMTN_SCHEMA |InterMedia option | SI_INFORMTN_SCHEMA | ./ord/admin/ordisysc.sql    |lock 
    ------------+-------------------------+------------------+-------------------------------+--------
    OUTLN       | Stored Outlines         | OUTLN            |./rdbms/admin/c0703040.sql     |lock
                |                         |                  |./rdbms/admin/c0800050.sql     |
                |                         |                  |./rdbms/admin/sql.bsq          |
    ------------+-------------------------+------------------+-------------------------------+--------
    PERFSTAT    | STATSPACK Repository    | PERFSTAT         |./rdbms/admin/spcreate.sql     |change
                |                         |                  |(./rdbms/admin/spcusr.sql)     |
    ------------+-------------------------+------------------+-------------------------------+--------
    RMAN        | RMAN catalog Owner      | RMAN             | manually                              |change
    ------------+-------------------------+------------------+-------------------------------+--------
    SCOTT       | Demo user               | TIGER            |./rdbms/admin/utlsampl.sql     |*drop 
    ------------+-------------------------+------------------+-------------------------------+--------
    WKPROXY     | Ultraseach user         | change_on_install|./ultrasearch/admin/wk0csys.sql|change
    WKSYS       | Ultraseach user         | change_on_install|./ultrasearch/admin/wk0install.sql| ""
    ------------+-------------------------+------------------+-------------------------------+--------
    WMSYS       | Oracle Workspace Manager| wmsys            |./rdbms/admin/owmctab.plb      |lock
    ------------+-------------------------+------------------+-------------------------------+--------
    XDB         | SQL XML management      | change_on_install|./rdbms/admin/catqm.sql        |lock
    ANONYMOUS   | SQL XML management      | values anonymous |./rdbms/admin/catqm.sql        |lock
    ------------+-------------------------+------------------+-------------------------------+--------
    TRACESVR    | Oracle Trace user       | trace            |./rdbms/admin/otrcsvr.sql      |change
    ------------+-------------------------+------------------+-------------------------------+--------
    OAS_PUBLIC | Web Toolkit/Content     | manager          | See 
    Note 99088.1              |change
    WEBSYS      | Web Toolkit/Content     | manager          | See 
    Note 99088.1              |change
    ------------+-------------------------+------------------+-------------------------------+--------
    REPADMIN    | Replication user        | managed by DBA   |created manually by CREATE USER|
                |                         |                  |./ldap/admin/oidrsrms.sql      |change
                |                         |                  |./ldap/admin/oidrsms.sql       |
    ------------+-------------------------+------------------+-------------------------------+--------
    AURORA$ORB$UNAUTHENTICATED| OSE       | random value     |./javavm/install/jisorb.sql    |lock
    AURORA$JIS$UTILITY$       | OSE       | random value     |./javavm/install/jisbgn.sql    |lock
    OSE$HTTP$ADMIN            | OSE       | random value     |./javavm/install/jishausr.sql |lock
    ------------+-------------------------+------------------+-------------------------------+--------
    LBACSYS     | Label Security          | LBACSYS          |./rdbms/admin/catlbacs.sql     |change                                                       
    ------------+-------------------------+------------------+-------------------------------+--------
    DVSYS       | Database Vault          | DVSYS            |./rdbms/admin/catmacs.sql      |change
    ------------+-------------------------+------------------+-------------------------------+--------
    DVF         | Database Vault          | DVF              |./rdbms/admin/catmacs.sql      |change
    ------------+-------------------------+------------------+-------------------------------+--------
    SYS         | Administrative         | change_on_install|./rdbms/admin/sql.bsq          |change
    SYSTEM      | Administrative         | manager          |./rdbms/admin/sql.bsq          |change
    ------------+-------------------------+------------------+-------------------------------+---------
    EXFSYS      | Expression Filter Feature repository |asked|./rdbms/admin/exfsys.sql       |locked
    ------------+-------------------------+------------------+-------------------------------+--------
    DIP         | Provision event processing| DIP            |./rdbms/admin/catdip.sql       |locked
    ------------+-------------------------+------------------+-------------------------------+--------
    TSMSYS      | Transparent Session Migration| TSMSYS      |./rdbms/admin/cattsm.sql       |locked
    ------------+-------------------------+------------------+-------------------------------+--------


    * User SCOTT is for test purposes: drop it if of no use.

    Related Documents:
    ~~~~~~~~~~~~~~~~~~
    Note 227010.1 Script to check for Default Passwords being used for common 
                     usernames.
    Note 131752.1 Security Check List: Steps to Make Your Database Secure 
                     from Attacks
    Note 1071358.6 What is the OUTLN User?
    Note 98572.1   Script to create user OUTLN
    Note 1060420.6 ORACLE_8 NEW ROLE SNMPAGENT
    Note 206870.1 Security risk with catsnmp.sql launched by catproc.sql
    Note 1027776.6 CONTEXT SERVER SHOWING THE CTXSYS PASSWORD
    Note 120093.1 Initial steps required to a create Snapshot Replication 
                     environment v8.1
    Note 117434.1 Initial steps required to a create Multi Master Replication 
                     environment v8.1
    Note 99088.1   Manually create the Web Toolkit/Content Services
    Note 207560.1 Can the 9i Sample Schemas Be Safely Removed?
    Note 217135.1 Usernames which cannot be exported
    Note 331209.1 How to Change the Password of the 10g Grid/OMS Repository User 
                     SYSMAN
    Note 258618.1 How To Install and Uninstall Expression Filter Feature or 
                     EXFSYS schema
    Note 234712.1 Managing Schemas of the 9iAS Release 2 (9.0.2.x) Metadata 
                     Repository
    Note 329600.1 How To Completely Remove Intermedia, ORDSYS, ORDPLUGIN And 
                     MDSYS Schemas
    Note 263428.1 How to De-install Oracle Workspace Manager
    Note 232648.1 Ultra Search Frequently Asked Questions

    Oracle9i Database Concepts 
    Oracle9i Database Administrator's Guide
    Oracle9i Database Performance Tuning Guide and Reference
    Oracle Intelligent Agent User's Guide
    Oracle Ultra Search Online Documentation
    Oracle Label Security Administrator's Guide
    Oracle interMedia User's Guide and Reference
    Oracle9i Data Mining Administrator's Guide 
    Oracle9i Data Mining Concepts 
    Oracle9i OLAP User's Guide 
    Oracle Text Reference
    Oracle® Database Vault Administrator's Guide 10g Release 2 (10.2)
       Chapter 1 Introducing Oracle Database Vault
    展开全文
  • 详解oracle用户创建(create user)

    千次阅读 2018-12-26 10:14:03
    详解oracle用户创建(create user)(上) 转载 http://blog.itpub.net/26110315/viewspace-715882/ 用户能访问数据库前必须要有获得相应授权的账号,oracle创建一个用户并为其分配密码很简单,但是在创建用户的同时...

    详解oracle用户创建(create user)(上)
    转载 http://blog.itpub.net/26110315/viewspace-715882/

    用户能访问数据库前必须要有获得相应授权的账号,oracle中创建一个用户并为其分配密码很简单,但是在创建用户的同时其实还可以指定很多该用户的属性,另外还有用户的特权授予。
    以便用户去执行相应的操作。当创建了一个的同时也创建了一个通的shema,shema与用户是一一对应的关系。shema是数据库对象的逻辑容器。
    在创建用户的过程中可以指定的用户属性有:
    1、认证方式
    2、认证密码
    3、默认的永久表空间,临时表空间
    4、表空间配额
    5、用户账号状态(locked or unlocked)
    6、密码状态(expired or not)
    语法格式:
    create user username
    identified by password;
    你可以创建仅供运用程序使用的账户,用于运用程序连接数据库,没人可以使用该账户登录到数据库。

    oracle会根据你创建数据库时候的配置自动的创建预置账户:
    所有的数据库都包括管理账户:
    sys 默认密码:chang_on_install
    system 默认密码:manager
    sysman 默认密码: chang_on_install
    dbsnmp 默认密码:dbsnmp
    其实并不是所有的数据库都包括,你若在使用dbca创建数据库的是,不勾选
    confiure enterprise manager
    sysman与dbsnmp就不会有了。
    如果安装的时候要求安装了sample schema,还会多出一些预置账户其中常用的有:
    hr 默认密码:hr
    scott 默认密码:TIGER

    所有的数据都包含有内部账户(internal accounts),这些自动创建的用户,使得特别的oracle特性或者组件拥有他们自己的schema。为保证这些账户被未经授权的使用,这些账户是lock的,密码设置为expire。

    SQL> create user oracleusr //用户名:oracleuser
    2 identified by oracle //登陆验证密码:oracle (密码是大小写敏感的)
    3 default tablespace users //用户的默认表空间:users
    4 quota 10m on users //默认表空间中可以使用的空间配额:10MB
    5 temporary tablespace temp //用户使用的临时表空间
    6 password expire; //密码状态,过期。登陆的时候要求用户修改。
    User created

    用户创建过程中的注意事项:
    1、对temporary tablespace不能指定配额。
    2、如果没有为用户指定默认表空间,将使用system表空间,强烈建议指定默认表空间。
    3、默认表空间不能是undo tablespace或者temporary tablespace。
    4、如果没有为用户指定默认表空间,临时表空间,用户将使用system表空作为默认表空间与临时表空,强烈避免出现此种状况。

    可以查询数据字典dba_users查询用户的信息
    下面查询上面创建的用户的部分信息。
    SQL> select username,user_id,account_status,default_tablespace,temporary_tablespace
    2 from dba_users
    3 where username=‘ORACLEUSR’;

    USERNAME USER_ID ACCOUNT_STATUS DEFAULT_TABLESPACE TEMPORARY_TABLESPACE


    ORACLEUSR 70 EXPIRED USERS TEMP
    注:dba_users中的password列已经在oracle11gR2中弃用了,取而代之的是authentication_type列。

    修改用户的密码:
    语法格式:
    alter user user_name identified by new_password;

    SQL> alter user system identified by oracle11g;
    User altered
    SQL> alter user oracleusr identified by oracle11g;
    User altered
    要注意了,oracle中给用户修改密码的时候是不需要,输入旧密码的。这是一个安全隐患。
    任何用户可以给自己修改密码,但是要修改别人的密码需要取得相应的权限。

    分类: ORACLE

    展开全文
  • 说明:sqlserver 中设置某个列的自动增加是非常容易的,只需要在列后面加上 auto_increment即可,但是oracle在使用sql语句创建表时时不支持这种自增的。 那么要实现自增列怎么办? 三步搞定 --1.创建表----- ...

    说明:sqlserver 中设置某个列的自动增加是非常容易的,只需要在列后面加上 auto_increment即可,但是oracle在使用sql语句创建表时时不支持这种自增的。

    那么要实现自增列怎么办? 三步搞定


    --1.创建表-----
    CREATE TABLE users (
      id number(11) NOT NULL ,
      username varchar2(100) NOT NULL,
      user_password varchar2(100) NOT NULL,
      user_status integer DEFAULT NULL,
      register_time date DEFAULT NULL,
      PRIMARY KEY (id)
    )
    --2.创建序列-----
    create sequence users_seq
    increment by 1
    start with 1
    nomaxvalue
    nocycle cache 10;


    ---3.创建触发器-----
    create or replace trigger users_trigger
    before insert on users
    for each row
    declare
     nextid number;
    begin
    if :new.id is null or :new.id=0 then
     select users_seq.nextval into nextid  from sys.dual;
            :new.id:=nextid;
     end if;
    end users_trigger;


    --4.测试----
    insert into  users (username,user_password) values('admin0','111111');


    select * from users;

    展开全文
  • oracle创建自增字段

    千次阅读 2017-06-06 14:26:02
    oracle中,实现字段数值的自动增长
  • oracle序列详解和创建自增主键Oracle序列主键 序列: 是oacle提供的用于产生一系列唯一数字的数据库对象。 l 自动提供唯一的数值 l 共享对象 l 主要用于提供主键值 l 将序列值装入内存可以提高访问效率1....
  • oracle之唯一索引

    千次阅读 2018-01-03 11:38:43
    1 oracle支持唯一索引。可以理解为唯一约束。用来控制和约束需要插入的表中字段。(主键自动为唯一约束,且不为空   )。 2 唯一索引,可以理解为:唯一约束,用来控制表中字段的。例如表中有两个或多个字段...
  • 创建和使用Oracle数据库表Integer类型的自增长字段

    千次阅读 热门讨论 2017-02-05 20:24:34
    Sql Server只需要点几下鼠标就搞定了,Oracle则只需要一条sql语句, 一个Sequence序列可被多个表共享使用 一个数据库也可以建多个Sequence序列 建立: create sequence seq_on_users increment by 1 ...
  • Oracle 安装用户组的创建在官方文档有说明,这里把这部分内容单独拿出来说明一下。 一.官网说明From:http://docs.oracle.com/cd/E11882_01/rac.112/e17264/preparing.htm#TDPRC129 1.1 Required Operating System...
  • Oracle数据泵导入导出是日常工作中常用的基本技术之一,我们使用oracle数据库数据泵导入(impdp)导出(expdp)进行数据库备份,数据库迁移等数据库维护工作。本文主要说明oracle数据库导入导出的命令。
  • oracle入门教程

    万次阅读 多人点赞 2019-07-11 14:14:02
    推荐一个Oracle入门学习教程 点击下面链接进入自学网站 学习网站:http://www.51zxw.net/study.asp?vip=16229363 点击图片箭头所指按钮——请点击进入学习 在下面方框里面搜索Oracle 第一个搜索结果就是小姐姐...
  • 注意Oracle分成两个文件,下载完后,将两个文件解压到同一目录下即可。 路径名称中,最好不要出现中文,也不要出现空格等不规则字符。 百度云盘:https://pan.baidu.com/s/14cBI8mAro7rrpeOmiHFepQ 官方下地址: ...
  • oracle入门很简单:七、oracle表空间

    万次阅读 2013-09-04 15:48:33
    1.创建oracle表空间 创建oracle表空间应该使用create tablespace命令。在指定表空间的同时,应当指定表空间物理文件的存储位置,并同时指定数据文件的初始大小。 例如,在数据库tst中,创建表空间的命令如下:
  • Linux/Unix shell 脚本中调用SQL,RMAN脚本

    万次阅读 2013-01-30 11:45:43
    Linux/Unix shell脚本中调用或执行SQL,RMAN 等为自动化作业以及多次反复执行提供了极大的便利,因此通过Linux/Unix shell来完成Oracle的相关工作,也是DBA必不可少的技能之一。本文针对Linux/Unix shell脚本调用sql,...
  • Oracle 10g中定义了数据库级别的默认表空间USERS,在创建用户时没有定义默认表空间,就会把数据库级别的默认表空间当作自己的默认表空间。在10g以前,是把系统表空间(SYSTEMS)当作默认表空间
  • JFinal框架操作oracle数据库

    万次阅读 2014-07-14 17:37:40
    JFinal框架操作oracle数据库,需要在configPlugin()方法中配置链接oracle数据库的相关配置 配置JFinal数据库操作插件,configPlugin方法 这里我加载jdbc.properties配置文件实在configConstant加载的 @Override ...
  • oracle 不同表空间的数据迁移

    千次阅读 2010-07-31 17:20:00
    1.expdp和impdp expdp 假设sglaw用户的默认表空间是users,导出用户sglaw所有数据: SQL> conn / as sysdba SQL> create directory dir as '/home/oracle/'; SQL> grant read,write ...
  • 下面数据库所用的版本为ORACLE 9I (9.2.0),安装数据库时,数据库系统会创建一个数据库实例,其中:安装目录选为:/oracle,数据库名与数据库SID号都输入:ora9i 1.数据库安装时的参数设定 下面数据库所用的版本为...
  • 1.创建用户 su - oracle  sqlplus /nolog  SQL> conn / as sysdba;  SQL>create user zhangsan identified by zhangsan  SQL> grant dba to zhangsan ;  SQL> conn zhangsan /zhangsan  SQL> select *
  • 创建oracle数据库表,用户表 SYS_USERS 其中user_id为主键 -- Create table create table SYS_USERS ( user_id NUMBER(9) not null, user_name VARCHAR2(20) not null, user_pwd VARCHAR2(20) not null,...
1 2 3 4 5 ... 20
收藏数 44,553
精华内容 17,821
关键字:

users安装完oracle后自动创建的吗