DIFFERENCE BETWEEN ORACLE AND MySQL -03

Share via:

DIFFERENCE BETWEEN ORACLE AND MySQL.

Please refer previous articles.

DIFFERENCE BETWEEN ORACLE AND MySQL -01

In this article will see few more differences between ORACLE and MySQL.

 

ORACLE                                                                      MySQL

 
1 Who Maintains The Documentation?
Oracle: Oracle maintains the Help Center with useful information including guides and
advanced features.
https://www.oracle.com/database/index.html
https://docs.oracle.com/en/database
For Oracle support link
https://metalink.oracle.com
Who Maintains The Documentation?
MySQL: MySQL has official and community-based documentation available.
https://www.mysql.com/
https://dev.mysql.com/doc/
For MySQL support link
 

 

 

 

 

2

 

Supported programing languages In ORACLE
C
C#
C++
Clojure
Cobol
Delphi
Eiffel
Erlang
Fortran
Groovy
Haskell
Java
JavaScript
Lisp
Objective C
OCaml
Perl
PHP
Python
R
Ruby
Scala
Tcl
Visual Basic

 

 

Supported programing languages In MySQL.
Ada
C
C#
C++
D
Delphi
Eiffel
Erlang
Haskell
Java
JavaScript (Node.js)
Objective-C
OCaml
Perl
PHP
Python
Ruby
Scheme
Tcl

3 In oracle manually we need to give explicitly commit.
Ex : SYS>> commit;
In MySQL by default every transaction is autocommit.

We can play with variables
mysql> show variables like ‘autocommit’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| autocommit | ON |
+—————+——-+
1 row in set (0.00 sec)
To turn off autocommit follow below command.
mysql> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)mysql> show variables like ‘autocommit’;
+—————+——-+
| Variable_name | Value |
+—————+——-+
| autocommit | OFF |
+—————+——-+
1 row in set (0.00 sec)

4 Oracle supports various startup and shutdown operations like
Ex:
1.startup nomount
2.startup mount
3.startup
4.startup upgrade
5.shutdown immediate
5.shutdown normal
6.shutdown force
7.shutdown transnational
8.startup force (Which is not graceful shutdown) etc..,
In MySQL we can start or stop or restart a service
(If service is down automatically database will down)
Ex :
$ systemctl start mysqld.service
$ systemctl stop mysqld.service
$ systemctl restart mysqld.service
we can follow another way
$ /etc/init.d/mysqld.server start
$ /etc/init.d/mysqld.server stop
$ /etc/init.d/mysqld.server restart
Note :
All are graceful shutdowns
5 In oracle we can keep database read only by using following command.
Ex :
SYS>> startup mount
SYS>> alter database read only;.
In MySQL we can keep read only in two ways .They are
1.read_only
2.super_read_onlyIf database is in read_only then users can’t make any changes to database
except root user.
If database is in super_read_only then any user can’t make changes to database.
(From version 5.7)
Commands to set read only
mysql>>set global read_only=1;
mysql>>set global super_read_only=1;
6 To check current user privileges
To run as current user
SCOTT>> select * from session_privs;
To run as SYS user
set pagesize 0
set long 90000
SYS>>SELECT
DBMS_METADATA.GET_DDL(‘USER’,’&OWNER’)
FROM dual;
SYS>>select
dbms_metadata.get_granted_ddl(‘OBJECT_GRANT’,’&USERNAME’)
from dual;
SYS>>select
dbms_metadata.get_granted_ddl(‘ROLE_GRANT’,’&USERNAME’)
from dual;
SYS>>select
dbms_metadata.get_granted_ddl(‘SYSTEM_GRANT’,’&USERNAME’)
from dual;
To display the privileges granted to the current user
(the account you are using to connect to the server),
you can use any of the following statements:mysql>SHOW GRANTS;
mysql>SHOW GRANTS FOR CURRENT_USER;
mysql>SHOW GRANTS FOR CURRENT_USER()
mysql> SHOW GRANTS FOR ‘username’@’localhost’
7 In Oracle database, to get any alerts we need to keep a parameter in pfile
daignostic_dest=<PATH>
In specified path we can have alert logfile
To check alert logfie we have following command
SYS>> select name,value from V$diag_info;
In MySQL. to get alerts will keep various variables like ..
mysql> show variables like ‘%log_error%’;
+———————+————————–+
| Variable_name | Value |
+———————+————————–+
| log_error | /var/log/mysql/error.log |
+———————+————————–+
1 row in set (0.00 sec)
8 In Oracle,we don’t get any error in alert log file while user trying to
connecting with wrong credentials.
In MySQL ,we get an error in error logfile while user trying to connecting
with wrong credentials.
In alert logfile we get error like this :
2018-11-01 T03:14:55.895985 14 [NOTE] Access denied for user ‘root’@’localhost’
(using password: YES)
9 How to create user in Oracle.
SYS>> create user <username> identified by <password>;SYS>> Grant dba to <username> identified by <password>;
How to create user in MySQL.
mysql>CREATE USER ‘custom’@’localhost’ IDENTIFIED BY ‘password’;
How to create user for remote connections.
mysql>CREATE USER ‘custom’@’%.example.com’ IDENTIFIED BY ‘password’;mysqlGRANT ALL PRIVILEGES ON database_name.* TO ‘username’@’localhost’; identified by <password>;
10 How to check users list in Oracle
SYS>> select username from dba_users;
How to check users list in MySQL.
mysql> select user,host from mysql.user;

 

 

Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates

KTEXPERTS is always active on below social media platforms.

Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...

One thought on “DIFFERENCE BETWEEN ORACLE AND MySQL -03

Add Comment