• Schema and Difference between user and schema oracle


        参考网址:http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_6013.htm
        Use the CREATE SCHEMA statement to create multiple tables and views and perform multiple grants in your own schema in a single transaction.

        To execute a CREATE SCHEMA statement, then Oracle Database executes each included statement. If all statements execute successfully, then the database commits the transaction. If any statement results in an error, then the database rolls back all the statements.
        The CREATE SCHEMA statement can include CREATE TABLECREATE VIEW, and GRANT statements. To issue a CREATE SCHEMA statement, you must have the privileges necessary to issue the included statements. 
        Specify the name of the schema. The schema name must be the same as your Oracle Database username. 
         Creating a Schema: Example
      The following statement creates a schema named oe for the sample order entry user oe, creates the table new_product, creates the view new_product_view, and grants the SELECT object privilege on new_product_view to the sample human resources user hr.

    1 CREATE SCHEMA AUTHORIZATION oe
    2 CREATE TABLE new_product
    3 (color VARCHAR2(10) PRIMARY KEY, quantity NUMBER)
    4 CREATE VIEW new_product_view
    5 AS SELECT color, quantity FROM new_product WHERE color = 'RED'
    6 GRANT select ON new_product_view TO hr;

          参考网址:http://psoug.org/reference/schema.html
         Create multiple tables and views and perform multiple grants in your own schema in a single transaction. If all statements execute successfully, then the database commits them as a single transaction. If any statement results in an error, then the database rolls back all of the statements.

          Difference between user and schema oracle
          *A schema is collection of database objects, including logical structures such as tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database links. 
          * A user owns a schema. 
          * A user and a schema have the same name. 
          * The CREATE USER command creates a user. It also automatically creates a schema for that user. 
          * The CREATE SCHEMA command does not create a "schema" as it implies, it just allows you to create multiple tables and views and perform multiple grants in your own schema in a single transaction. 
          * For all intents and purposes you can consider a user to be a schema and a schema to be a user.
          参考网址:http://wiki.answers.com/Q/Difference_between_user_and_schema_oracle#ixzz1iZM9pApQ 

    I believe that we are who we choose to be. Nobody‘s going to come and save you, you‘ve got to save yourself. 我相信我们成为怎样的人是我们自己的选择。没有人会来拯救你,你必须要自己拯救自己。
  • 相关阅读:
    Java SE (3) 之 事件监听
    Java SE (2)之 Graphics 画图工具
    Java SE (1)之 JFrame 组件 GridLayout布局
    解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
    VS2010中配置C#Project不生成.vhost.exe和.pdb文件的方法
    IIS7和IIS7.5备份和还原的方法
    C# 读取IE缓存文件(2)
    C# 读取IE缓存文件(1)
    raywenderlich的Swift编程风格指南
    Swift和C#的基本语法对比
  • 原文地址:https://www.cnblogs.com/caroline/p/2313784.html
Copyright © 2020-2023  润新知