简体   繁体   English

如何在 Oracle 数据库 11g 中创建本地模式?

[英]How to create a local schema in Oracle database 11g?

I have installed Oracle Database 11g Release 2 (11.2.0.1.0) for Microsoft Windows (x64).我已经为 Microsoft Windows (x64) 安装了 Oracle Database 11g Release 2 (11.2.0.1.0)。 How do I create a new schema or local schema?如何创建新架构或本地架构?

A schema is the collection of objects owned by a user.模式是用户拥有的对象的集合。

So connect as a power user like SYSTEM and run a create user command.因此,以像 SYSTEM 这样的超级用户身份连接并运行create user命令。 Find out more . 了解更多

Once you have a user you can connect to it and create tables and other objects.一旦你有了一个用户,你就可以连接到它并创建表和其他对象。

Have you tried looking in the docs?您是否尝试过查看文档? https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_6014.htm#SQLRF01313 https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_6014.htm#SQLRF01313

In oracle a 'schema' is nothing more than the collection of objects belonging to a given user.在 oracle 中,“模式”只不过是属于给定用户的对象的集合。 Many people will even argue that a "user" is a "schema".许多人甚至会争辩说,“用户”就是“模式”。 I believe that it was with 11g (now out of support) that oracle introduced the CREATE SCHEMA command.我相信 oracle 是在 11g(现已不支持)中引入了 CREATE SCHEMA 命令。 That command simply combines creating a user and creating some tables belonging to that user into a single SQL statement.该命令只是将创建用户和创建属于该用户的一些表合并到单个 SQL 语句中。 You can always do it the "old fashioned" way by simply issuing a CREATE USER, then issuing whatever CREATE.您总是可以通过简单地发出 CREATE USER,然后发出任何 CREATE 来以“老式”方式进行操作。 statements you need:您需要的陈述:

create user fubar identified by fubar;
create table fubar.mytable (dob date);
create view fubar.myview as (select * from fubar.mytable);

etc. etc.等等等等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM