Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

what is the equivalent command for oracle for creating DB and user w.r.t mysql

Posted on 2016-07-22
3
Medium Priority
?
68 Views
Last Modified: 2016-09-23
below commands used for generate DB and user in mysql.what is the equivalent command for oracle.

CREATE DATABASE xyz; CREATE USER 'xyz'@'localhost' IDENTIFIED BY 'xyz'; grant all on xyz.* to 'alfresco5'@'localhost' identified by 'xyz' with grant option; grant all on xyz.* to 'xyz'@'localhost.localdomain' identified by 'xyz' with grant option;
0
Comment
Question by:chaitu chaitu
2 Comments
 
LVL 78

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 1000 total points
ID: 41725415
Might I refer you to the online documentation?

You can create a database from the command line but using the Database Configuration Assistant (DBCA) is a lot easier.

Create Database:
http://docs.oracle.com/database/121/ADMIN/create.htm#ADMIN11073

Create User:
http://docs.oracle.com/database/121/SQLRF/statements_8003.htm#SQLRF01503
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 1000 total points
ID: 41733592
Be aware that the "create database..." command in Oracle may not mean exactly the same thing as it does in some other SQL-based systems.  For example, in SQL Server the concept of a "database" is a much more-limited object than in Oracle.  I don't know MySQL, so I don't know if the concept of a "database" in MySQL is more like the Oracle concept, or the SQL Server concept.  In Oracle the term "schema" is more like what is called a "database" in SQL Server.

Also, this concept: "grant all on xyz.* to [some other user]" is usually implemented in Oracle via roles.  Oracle allow you to grant permissions to a role, then the role can be granted to another user.  But, in Oracle, all of these grants are only in the local database.

This syntax in Oracle: "@...host" indicates a remote database, and permissions in Oracle are never granted to a remote database.  In Oracle systems, a remote database user must connect to the local database with a username and password that is valid in the local database.  (I don't know exactly what this syntax means in MySQL: "...@localhost".)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question