简体   繁体   English

如果hr数据库仍然存在,如何在oracle sql developer中创建新数据库?

[英]how to create a new database in oracle sql developer if hr database is still there?

I have already hr database in my Oracle sql. 我的Oracle sql中已经有hr数据库。 I want to make another database in Oracle sql developer and i also want hr database to be still present. 我想在Oracle sql developer中创建另一个数据库,我也希望hr数据库仍然存在。 please suggest me how to solve this 请建议我如何解决这个问题

Perhaps you come from an environment like Microsoft Access where you have many databases floating around. 也许您来自Microsoft Access之类的环境,那里有许多数据库在浮动。 In Oracle you only have one database, which has (possibly) many "schemas". 在Oracle中,您只有一个数据库,该数据库有(可能)许多“方案”。 All the tables are part of one big database, but each table (and other objects) has only a (usually smaller) subset of users who are allowed access to it. 所有表都是一个大数据库的一部分,但是每个表(和其他对象)只有一个(通常较小)的允许用户访问它的用户子集。

HR in Oracle is not a database, it is only a schema. Oracle中的HR不是数据库,而只是一个架构。 Your database already has other schemas, for example sys. 您的数据库已经具有其他架构,例如sys。

To create a new schema, you actually create a new USER. 要创建新的架构,您实际上是在创建一个新的USER。 (Probably for yourself - call it dinesh . You use the create user command, while logged in as sysdba. Then you log in as dinesh and start building your schema (create tables, etc.) You can use SQL Developer to copy tables from HR or from scott (another standard schema), or you can even "clone" (copy) an entire schema to your own. It would be best if you read the Oracle documentation for all of this. (可能是您自己-称为dinesh 。您以sysdba身份登录时使用create user命令。然后以dinesh身份登录并开始构建架构(创建表等)。可以使用SQL Developer从HR复制表或通过scott (另一种标准模式)进行复制,或者甚至可以将整个模式“克隆”(复制)到自己的模式中,最好阅读Oracle文档中的所有内容。

https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_8003.htm https://docs.oracle.com/cd/E11882_01/server.112/e10897/users_secure.htm#ADMQS007 https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_8003.htm https://docs.oracle.com/cd/E11882_01/server.112/e10897/users_secure.htm#ADMQS007

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

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