Sunday, August 29, 2021

Difference Between Database and Data Warehouse

Oracle Database, Data Warehouse, Oracle Database Tutorial and Material, Oracle Database Exam Prep, Oracle Database Certification, Oracle Database Career

Database vs Data Warehouse

The basis for the difference between a database and a data warehouse arises from the fact that a data warehouse is a type of database that is used for data analysis. A database is an organized collection of data stored on a computer system. Information about students, teachers, and classes in a school stored in table fashion is an example for a database. As databases support large amount of data, concurrent processing, and efficient operations, they are widely used. But, as database is often subjected to updates, it not possible to have a proper view to do an analysis. Hence, a data warehouse technique must be followed to achieve this. A data warehouse is a special type of database, but which is optimized for querying and analysis. As a data warehouse extracts data from various sources and reports, it does so that decisions can be reached by analysis. Let us look at them and the difference between them in more detail here.

What is a Database?

A database is a collection of related data stored on a computer system. Usually, a database is organized and its data is related. For example, a school database would have several tables as teachers, students, and classes where each table would have records that specify information about each item. Here, we can see the structure is organized based on certain criteria and there are relationships between the tables as they all belong to the same school. A database has numerous uses in the computer world. Therefore, it is so famous that it is found very abundantly in various applications. The basic advantage of a database is that a database can store a huge amount of data in a very less space while providing very fast and easy operations on data.

A database often involves a software system called Database Management System (DBMS), which is responsible for storing and managing the data in the database. MySQL, Oracle, Microsoft SQL Server are some well-known database management systems. When creating a database on the computer, first step is to create a logical structure of how data is stored, organized, and manipulated based on the description we have for the system. This is called as database modeling. There are various modeling techniques such as relational model, network model, object oriented model, and hierarchical model, but the most famous one is the relational model. Even MySQL, which is one of the most used database management systems, uses the relational model to store its databases.

Oracle Database, Data Warehouse, Oracle Database Tutorial and Material, Oracle Database Exam Prep, Oracle Database Certification, Oracle Database Career
Database Models

A database supports four functions that is given by the acronym CRUD that refers to create, read, update, and delete. In SQL, create lets you insert data to a table. Read lets you query what you want to retrieve and update lets you modify data when it is necessary. Delete lets you delete data when they must be done so.

What is a Data Warehouse?


A data warehouse is a special type of database used for analysis of data. A general database is usually used for transaction processing, and hence, it is not optimized for analysis and reporting. But a data warehouse is specially designed and optimized for analysis tasks. A data warehouse usually fetches data from the history of a transaction processing system while various other sources also can contribute. After extracting data from various sources, they are reported in a generalized view. A transaction processing system involves lots of operations per second and hence data is often updated making it difficult for someone to view it at a certain point and analyze it to reach a decision. A data warehouse exactly enables this by extracting information and reporting it in a neat fashion such that one can analyze it to reach a decision.

Oracle Database, Data Warehouse, Oracle Database Tutorial and Material, Oracle Database Exam Prep, Oracle Database Certification, Oracle Database Career

What is the difference between Database and Data Warehouse?


A database is an organized collection of data. A data warehouse is a special type of database, which is optimized for querying and reporting rather than transaction processing. So following comparison is done about a general database and a data warehouse.

• A database stores current data while a data warehouse stores historical data.

• A database often changes due to frequent updates done on it, and hence, it cannot be used for analysis or reaching decision. A data warehouse extracts data and reports them to analyze and reach decisions.

• A general database is used for Online Transactional Processing while a data warehouse is used for Online Analytical Processing.

• Tables in a database are normalized to achieve efficient storage while a data warehouse is usually demoralized to achieve faster querying.

• Analytical queries are much faster on a data warehouse than on a database.

• A database contains highly detailed data while a data warehouse contains summarized data.

• A database provides a detailed relational view while a data warehouse provides a summarized multidimensional view.

• A database can do a lot of concurrent transactions while a data warehouse is not designed for such tasks.

Source: differencebetween.com

Saturday, August 28, 2021

Difference between Control Structure and Control Statement

1. Control Structure :

Control Structure, as name suggests, is basically a set of statements and control statements that are controlling their execution.


2. Control Statement :


Control Statement, as name suggests, is basically a statement that is used to determine control flow of set of statements. It makes decision on basis of condition provided by statement or on basis of values and logic.


Difference between Control Structure and Control Statement :


Control Structure Control Statement
Its main purpose is to accommodate set-point changes and reject load disturbances in network. Its main purpose is to determine or identify whether or not statements will be executed.
It helps in changing flow of program, allows us to develop complex sets of instructions out of simpler building blocks, etc.  It helps in making decisions, to execute tasks continuously, etc.  
It generally helps in achieving effective control system.  It generally helps in controlling flow of program.  
It is used to determine logical order of program instructions.   It is used to tell program whether to execute statement in a condition or not.  
It simply describes tasks that program is has to perform.  It simply controls execution of other statements.  
Types of control structure includes sequential control, selection control, and repetition control.   Types of control statement includes if statement, loop, switch statement, etc. 

Friday, August 27, 2021

Upgrade Non-CDB to Oracle Database 21c (Manual)

Oracle Database 21c, Oracle Database Tutorial and Material, Oracle Database Preparation, Oracle Database Career, Database Study Materials

This article provides an overview of a manual upgrade of an existing non-CDB database to Oracle 21c.

◉ Assumptions

This article assumes your source database is of a version supported for direct upgrade to 21c.

19c, 18c, 12.2

The non-CDB architecture is desupported in Oracle 21c, so we have two choices when upgrading a non-CDB database to 21c.

- Convert the existing non-CDB database to a PDB in the current version of the database, then do a multitentant upgrade.

- Convert the non-CDB to a PDB in the new version of the database. The new PDB will be upgraded once it is opened.

In this example we are doing a manual upgrade from 19c non-CDB to 21c. The process is very similar for all supported versions.

It's important to have backups of everything before you start! Some of these steps are destructive, and if something goes wrong you have no alternative but to restore from backups and start again.

◉ Prerequisities

Make sure you have all the OS prerequisites in place by running the 21c preinstall package. It probably makes sense to update the remaining packages also.

yum install -y oracle-database-preinstall-21c

yum update -y

◉ Install 21c Software

You can read about the installation process in more detail here (OL7, OL8), but for this example we'll keep it brief. The following commands will perform a silent installation of the 21c software.

export ORACLE_HOME=$ORACLE_BASE/product/21.0.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=cdb1

export SOFTWARE_DIR=/u01/software

export ORA_INVENTORY=/u01/app/oraInventory

mkdir -p ${ORACLE_HOME}

cd $ORACLE_HOME

/bin/unzip -oq ${SOFTWARE_DIR}/LINUX.X64_213000_db_home.zip

./runInstaller -ignorePrereq -waitforcompletion -silent                        \

    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \

    oracle.install.option=INSTALL_DB_SWONLY                                    \

    ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \

    UNIX_GROUP_NAME=oinstall                                                   \

    INVENTORY_LOCATION=${ORA_INVENTORY}                                        \

    SELECTED_LANGUAGES=en,en_GB                                                \

    ORACLE_HOME=${ORACLE_HOME}                                                 \

    ORACLE_BASE=${ORACLE_BASE}                                                 \

    oracle.install.db.InstallEdition=EE                                        \

    oracle.install.db.OSDBA_GROUP=dba                                          \

    oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \

    oracle.install.db.OSDGDBA_GROUP=dba                                        \

    oracle.install.db.OSKMDBA_GROUP=dba                                        \

    oracle.install.db.OSRACDBA_GROUP=dba                                       \

    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \

    DECLINE_SECURITY_UPDATES=true

Run the root scripts when prompted.

As a root user, execute the following script(s):

        1. /u01/app/oracle/product/21.0.0/dbhome_1/root.sh

At this point you should also patch the new Oracle home, but in this case we will forgo that step to keep things simple.

◉ Create 21c Container Database

We need to create a container database (CDB) as the destination for the resulting PDB. The following example create a CDB called "cdb1" with no PDBs.

#dbca -silent -deleteDatabase -sourceDB cdb1 -sysDBAUserName sys -sysDBAPassword SysPassword1

dbca -silent -createDatabase \

 -templateName General_Purpose.dbc \

 -gdbname cdb1 -sid cdb1 -responseFile NO_VALUE \

 -characterSet AL32UTF8 \

 -sysPassword SysPassword1 \

 -systemPassword SysPassword1 \

 -createAsContainerDatabase true \

 -numberOfPDBs 0 \

 -databaseType MULTIPURPOSE \

 -memoryMgmtType auto_sga \

 -totalMemory 1536 \

 -storageType FS \

 -datafileDestination "/u02/oracle/" \

 -redoLogFileSize 50 \

 -emConfiguration NONE \

 -ignorePreReqs

Prepare for db operation

10% complete

Copying database files

40% complete

Creating and starting Oracle instance

42% complete

46% complete

52% complete

56% complete

60% complete

Completing Database Creation

66% complete

69% complete

70% complete

Executing Post Configuration Actions

100% complete

Database creation complete. For details check the logfiles at:

 /u01/app/oracle/cfgtoollogs/dbca/cdb1.

Database Information:

Global Database Name:cdb1

System Identifier(SID):cdb1

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb1/cdb13.log" for further details.

$

We enable the fast recovery area, Oracle Managed Files (OMF) and archivelog mode. We

sqlplus / as sysdba <<EOF

alter system set db_recovery_file_dest_size=40g;

alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area';

alter system set db_create_file_dest = '/u02/oradata';

shutdown immediate;

startup mount;

alter database archivelog;

alter database open;

exit;

EOF

You will need to adjust the instance parameters to make sure the container can cope with the demands of the final PDB, but for this example we will ignore that.

◉ Create PDB From non-CDB

It would make sense to run the AutoUpgrade analyze before trying the upgrade, to make sure there aren't any issues that might need fixing before you continue. 

We switch the non-CDB instance to read-only mode, describe the database using the DBMS_PDB package, then shutdown the non-CDB instance.

export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=mydb

sqlplus / as sysdba <<EOF

shutdown immediate;

startup open read only;

begin

  dbms_pdb.describe(

    pdb_descr_file => '/tmp/mydb.xml');

end;

/

shutdown immediate;

exit;

EOF

We can see there are no user-defined PDBs in the root container.

export ORACLE_HOME=$ORACLE_BASE/product/21.0.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=cdb1

sqlplus / as sysdba

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         2 PDB$SEED                       READ ONLY  NO

SQL>

We create a pluggable database from the non-CDB database using the "/tmp/mydb.xml" file. We are using the COPY option, which copies the datafiles to create the new PDB. We could use the MOVE option, which would use the existing files to save space.

create pluggable database mydb using '/tmp/mydb.xml' copy;

We see the following messages in alert log.

2021-08-21T09:59:43.993485+00:00

create pluggable database mydb using '/tmp/mydb.xml' copy

2021-08-21T09:59:44.027947+00:00

Opatch validation is skipped for PDB MYDB (con_id=4)

2021-08-21T09:59:52.674090+00:00

MYDB(4):Endian type of dictionary set to little

****************************************************************

Pluggable Database MYDB with pdb id - 4 is created as UNUSABLE.

If any errors are encountered before the pdb is marked as NEW,

then the pdb must be dropped

local undo-1, localundoscn-0x0000000000000009

****************************************************************

MYDB(4):Pluggable database MYDB pseudo opening

MYDB(4):SUPLOG: Initialize PDB SUPLOG SGA, old value 0x0, new value 0x18

MYDB(4):Autotune of undo retention is turned on.

MYDB(4):Undo initialization recovery: Parallel FPTR complete: start:5860713 end:5860715 diff:2 ms (0.0 seconds)

MYDB(4):Undo initialization recovery: err:0 start: 5860709 end: 5860715 diff: 6 ms (0.0 seconds)

MYDB(4):[18913] Successfully onlined Undo Tablespace 2.

MYDB(4):Undo initialization online undo segments: err:0 start: 5860715 end: 5860764 diff: 49 ms (0.0 seconds)

MYDB(4):Undo initialization finished serial:0 start:5860709 end:5860768 diff:59 ms (0.1 seconds)

MYDB(4):Database Characterset for MYDB is AL32UTF8

MYDB(4):Pluggable database MYDB pseudo closing

MYDB(4):JIT: pid 18913 requesting stop

MYDB(4):Closing sequence subsystem (5860811822).

MYDB(4):Buffer Cache flush started: 4

MYDB(4):Buffer Cache flush finished: 4

Completed: create pluggable database mydb using '/tmp/mydb.xml' copy

Now we open the pluggable database in read-write mode, which triggers the upgrade of the PDB, and conversion from a non-CDB to a PDB. We do not need to run the "noncdb_to_pdb.sql" script for this operation. As you might expect, this upgrade and conversion takes some time to complete. In this example a little over 30 minutes.

alter pluggable database mydb open read write;

In the alert log we see messages to indicate the upgrade and conversion are taking place.

2021-08-21T10:03:35.400676+00:00

alter pluggable database mydb open read write

...

****************************************************************

Post plug operations are now complete.

Pluggable database MYDB with pdb id - 4 is now marked as NEW.

****************************************************************

...

MYDB(4):alter pluggable database application APP$CDB$CATALOG begin upgrade

  '19.0.0.0.0' to '21.0.0.0.0.partial' on error capture

MYDB(4):Completed: alter pluggable database application APP$CDB$CATALOG begin upgrade

  '19.0.0.0.0' to '21.0.0.0.0.partial' on error capture

...

MYDB(4):SERVER ACTION=NONCDB_TO_PDB id=: Converted non-CDB to PDB in release 21.3.0.0.0 Container=MYDB Id=4

MYDB(4):alter pluggable database application app$cdb$pdbonly$ncdbtopdb end upgrade

MYDB(4):Completed: alter pluggable database application app$cdb$pdbonly$ncdbtopdb end upgrade

2021-08-21T10:31:03.540665+00:00

MYDB(4):Finished Conversion from non-CDB on PDB Open

Violations: Type: 2, Count: 1

Pluggable database MYDB opened read write

Completed: alter pluggable database mydb open read write

We can see the PDB is now open in read-write mode.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         2 PDB$SEED                       READ ONLY  NO

         4 MYDB                           READ WRITE NO

SQL>

We save the state so the PDB opens automatically with the instance.

alter pluggable database mydb save state;

It's worth checking for violations. They should all be from before the upgrade and conversion.

column name format a10

column message format a60

select time, name, message from pdb_plug_in_violations order by time;

◉ Final Steps

We need to clean up the remains of the non-CDB instance. We can use the DBCA to do this.

export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=mydb

dbca -silent -deleteDatabase -sourceDB mydb -sysDBAUserName sys -sysDBAPassword SysPassword1

Edit the "/etc/oratab" file and any environment files as required.

◉ Appendix

The following commands are used to rebuild the databases if you want to rerun the examples.

Rebuild the CDB1 multitenant database.

export ORACLE_HOME=/u01/app/oracle/product/21.0.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=cdb1

#dbca -silent -deleteDatabase -sourceDB cdb1 -sysDBAUserName sys -sysDBAPassword SysPassword1

dbca -silent -createDatabase \

 -templateName General_Purpose.dbc \

 -gdbname cdb1 -sid cdb1 -responseFile NO_VALUE \

 -characterSet AL32UTF8 \

 -sysPassword SysPassword1 \

 -systemPassword SysPassword1 \

 -createAsContainerDatabase true \

 -numberOfPDBs 0 \

 -databaseType MULTIPURPOSE \

 -memoryMgmtType auto_sga \

 -totalMemory 1536 \

 -storageType FS \

 -datafileDestination "/u02/oradata/" \

 -redoLogFileSize 50 \

 -emConfiguration NONE \

 -ignorePreReqs

sqlplus / as sysdba <<EOF

alter system set db_recovery_file_dest_size=40g;

alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area';

alter system set db_create_file_dest = '/u02/oradata';

shutdown immediate;

startup mount;

alter database archivelog;

alter database open;

exit;

EOF

Rebuild the MYDB non-CDB database.

export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_SID=mydb

#dbca -silent -deleteDatabase -sourceDB mydb -sysDBAUserName sys -sysDBAPassword SysPassword1

dbca -silent -createDatabase \

 -templateName General_Purpose.dbc \

 -gdbname mydb -sid mydb -responseFile NO_VALUE \

 -characterSet AL32UTF8 \

 -sysPassword SysPassword1 \

 -systemPassword SysPassword1 \

 -createAsContainerDatabase false \

 -databaseType MULTIPURPOSE \

 -memoryMgmtType auto_sga \

 -totalMemory 1536 \

 -storageType FS \

 -datafileDestination "/u02/oradata/" \

 -redoLogFileSize 50 \

 -emConfiguration NONE \

 -ignorePreReqs

sqlplus / as sysdba <<EOF

alter system set db_recovery_file_dest_size=40g;

alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area';

alter system set db_create_file_dest = '/u02/oradata';

shutdown immediate;

startup mount;

alter database archivelog;

alter database open;

exit;

EOF

Source: oracle-base.com

Wednesday, August 25, 2021

Difference Between DBMS and File System

DBMS, File System, Oracle Database Tutorial and Materials, Database Career, Database Preparation, Oracle Database Exam Preparation

DBMS vs File System

DBMS (Database Management System) and File System are two ways that could be used to manage, store, retrieve and manipulate data. A File System is a collection of raw data files stored in the hard-drive whereas DBMS is a bundle of applications that is dedicated for managing data stored in databases. It is the integrated system used for managing digital databases, which allows the storage of database content, creation/ maintenance of data, search and other functionalities. Both systems can be used to allow the user to work with data in a similar way. A File System is one of the earliest ways of managing data. But due the shortcomings present in using a File System to store electronic data, Database Management Systems came in to use sometime later, as they provide mechanisms to solve those problems. But it should be noted that, even in a DBMS, data are eventually (physically) stored in some sort of files.

File System

As mentioned above, in a typical File System electronic data are directly stored in a set of files. If only one table is stored in a file, they are called flat files. They contain values at each row separated with a special delimiter like commas. In order to query some random data, first it is required to parse each row and load it to an array at run time. But for this file should be read sequentially (because, there is no control mechanism in files), therefore it is quite inefficient and time consuming. The burden of locating the necessary file, going through the records (line by line), checking for the existence of a certain data, remembering what files/records to edit is on the user. The user either has to perform each task manually or has to write a script that does them automatically with the help of the file management capabilities of the operating system. Because of these reasons, File Systems are easily vulnerable to serious issues like inconsistency, inability for concurrency, data isolation, threats on integrity and lack of security.

DBMS

DBMS, sometimes just called a database manager, is a collection of computer programs that is dedicated for the management (i.e. organization, storage and retrieval) of all databases that are installed in a system (i.e. hard drive or network). There are different types of Database Management Systems existing in the world, and some of them are designed for the proper management of databases configured for specific purposes. Most popular commercial Database Management Systems are Oracle, DB2 and Microsoft Access. All these products provide means of allocation of different levels of privileges for different users, making it possible for a DBMS to be controlled centrally by a single administrator or to be allocated to several different people. There are four important elements in any Database Management System. They are the modeling language, data structures, query language and mechanism for transactions. The modeling language defines the language of each database hosted in the DBMS. Currently several popular approaches like hierarchal, network, relational and object are in practice. Data structures help organize the data such as individual records, files, fields and their definitions and objects such as visual media. Data query language allow for maintaining and the security of the database. It monitors login data, access rights to different users, and protocols to add data to the system. SQL is a popular query language which is used in Relational Database Management Systems. Finally, the mechanism that allows for transactions help concurrency and multiplicity. That mechanism will make sure same record will not be modified by multiple users at the same time, thus keeping the data integrity in tact. Additionally, DBMSs provide backup and other facilities as well. With all these advancements in place, DBMS solves almost all problems of the File System, mentioned above.

Difference between DBMS and File System

In File System, files are used to store data while, collections of databases are utilized for the storage of data in DBMS. Although File System and DBMS are two ways of managing data, DBMS clearly has many advantages over File Systems. Typically when using a File System, most tasks such as storage, retrieval and search are done manually and it is quite tedious whereas a DBMS will provide automated methods to complete these tasks. Because of this reason, using a File System will lead to problems like data integrity, data inconsistency and data security, but these problems could be avoided by using a DBMS. Unlike File System, DBMS are efficient because reading line by line is not required and certain control mechanisms are in place.

Source: differencebetween.com

Monday, August 23, 2021

Difference Between DDL and DML

DDL and DML, Oracle Database Tutorial and Material, Oracle Database Preparation

Key Difference – DDL vs DML

A database is used to store data. There are various types of databases. One common database type is Relational Databases. In these databases, data is stored in tables. Tables consist of rows and columns. A row is a record, and a column is a field. The tables are connected using constraints such as primary keys and foreign keys. Relational Database Management Systems are used to store, retrieve and manipulate data. Some of them are MSSQL, Oracle, MySQL. The language which is using to perform operations on relational databases is called  Structured Query Language (SQL). Data Definition Language (DDL) and Data Manipulation Language (DML) are subcategories of SQL. The key difference between DDL and DML is that DDL is used to change the structure of the database while DML is used to manage the data in the database.

What is DDL?

DDL stands for Data Definition Language. This language is used to change the structure of the database. Create, Alter, Drop, Truncate are some DDL commands.

DDL and DML, Oracle Database Tutorial and Material, Oracle Database Preparation
Figure 01: SQL

Examples of DDL Commands

Refer the following  DDL examples written in TSQL (MSSQL server);

Below statement will create a database named “employee”.

create database employee;

Below statement will delete the existing database employee.

drop database employee;

Below DDL statement is used to create a table.

create table tbl_employee

(

id int not null,

firstName varchar(30),

department varchar(30),

primary key(id)

);

Alter command can be used to add columns, modify existing columns and to drop columns.

An example to add a new column payment to the table tbl_employee is as follows.

            alter table tbl_employee add payment numeric (4,2);

Below statement can be used to drop table.

            drop table tbl_employee;

It is also possible to keep the table structure and to delete the details in the table. This can be done using the truncate command. It can delete all the records in the table and also it will clear the data in the memory. So, it is not possible to roll back the operation.

            truncate table tbl_employee;

What is DML?


DML stands for Data Manipulation Language. DML is used to manage the data in the database. Common DML commands are:  insert, delete, update.

Examples of DML Commands

Following are some DML examples written using TSQL (MSSQL server)

Below statement is used to insert values into the table tbl_employee.

Insert into tbl_employee (id, firstName, department) values (1, “Ann”, “Human Resources”);

Below statement is used to delete the record. Delete command can delete data in the table but it does not completely delete from memory. Therefore, it is possible to roll back the operation.

delete from tbl_employee where id=1;

The update command given below is used to modify a particular row.

update tbl_employee set department = ‘Accounting’ where id=1;

What is the Similarity Between DDL and DML?


◉ Both are types of Structured Query Language (SQL).

What is the Difference Between DDL and DML?


DDL vs DML 
DDL is a type of SQL which is using to change the structure of the database. DML is a type of SQL which is using to manage the data in the database. 
Commit  
DDL statements cannot be rolled back.   DML statements can be rolled back.
Commands 
Create, alter, drop, truncate etc. falls into DDL.   Insert, update, delete etc. falls into DML.
Method of Operation 
DDL statements effects the whole table.   DML effects one or more rows.

Source: differencebetween.com

Friday, August 20, 2021

Oracle Database 21c Installation On Oracle Linux 8 (OL8)

Oracle Database 21c, Oracle Linux 8 (OL8), Oracle Database Tutorial and Materials, Oracle Database Career, Oracle Database Preparation

Oracle 21c is an innovation release, so it may not be suitable for most production systems.

This article describes the installation of Oracle Database 21c 64-bit on Oracle Linux 8 (OL8) 64-bit. The article is based on a server installation with a minimum of 2G swap and secure Linux set to permissive.

◉ Download Software

Download the Oracle software from OTN or MOS depending on your support status.

- OTN: Oracle Database 21c (21.3) Software (64-bit)

- edelivery: Oracle Database 21c (21.3) Software (64-bit)

◉ Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4

192.168.56.107  ol8-21.localdomain  ol8-21

Set the correct hostname in the "/etc/hostname" file.

ol8-21.localdomain

◉ Oracle Installation Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations.

◉ Automatic Setup

If you plan to use the "oracle-database-preinstall-21c" package to perform all your prerequisite setup, issue the following command.

# dnf install -y oracle-database-preinstall-21c

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

# yum update -y

It's worth running the all the DNF commands listed in the manual setup section. Depending on the OS package groups you have selected, some additional packages might also be needed.

If you are using RHEL8 or CentOS8, you can pick up the RPM from the OL8 repository and install it. It will pull the dependencies from your normal repositories.

curl -o oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/ oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm

yum -y localinstall oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm

◉ Manual Setup

If you have not used the "oracle-database-preinstall-21c" package to perform all prerequisites, you will need to manually perform the following setup tasks.

Add the following lines to the "/etc/sysctl.conf" file, or in a file called "/etc/sysctl.d/98-oracle.conf".

fs.file-max = 6815744

kernel.sem = 250 32000 100 128

kernel.shmmni = 4096

kernel.shmall = 1073741824

kernel.shmmax = 4398046511104

kernel.panic_on_oops = 1

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

net.ipv4.conf.all.rp_filter = 2

net.ipv4.conf.default.rp_filter = 2

fs.aio-max-nr = 1048576

net.ipv4.ip_local_port_range = 9000 65500

Run one of the following commands to change the current kernel parameters, depending on which file you edited.

/sbin/sysctl -p

# Or

/sbin/sysctl -p /etc/sysctl.d/98-oracle.conf

Add the following lines to a file called "/etc/security/limits.d/oracle-database-preinstall-21c.conf" file.

oracle   soft   nofile    1024

oracle   hard   nofile    65536

oracle   soft   nproc    16384

oracle   hard   nproc    16384

oracle   soft   stack    10240

oracle   hard   stack    32768

oracle   hard   memlock    134217728

oracle   soft   memlock    134217728

oracle   soft   data    unlimited

oracle   hard   data    unlimited

The following packages are listed as required. Don't worry if some don't install. It won't prevent the installation.

dnf install -y bc

dnf install -y binutils

dnf install -y compat-openssl10

dnf install -y elfutils-libelf

dnf install -y glibc

dnf install -y glibc-devel

dnf install -y ksh

dnf install -y libaio

dnf install -y libXrender

dnf install -y libX11

dnf install -y libXau

dnf install -y libXi

dnf install -y libXtst

dnf install -y libgcc

dnf install -y libnsl

dnf install -y libstdc++

dnf install -y libxcb

dnf install -y libibverbs

dnf install -y make

dnf install -y policycoreutils

dnf install -y policycoreutils-python-utils

dnf install -y smartmontools

dnf install -y sysstat

# Added by me.

dnf install -y unixODBC

Create the new groups and users.

groupadd -g 54321 oinstall

groupadd -g 54322 dba

groupadd -g 54323 oper 

#groupadd -g 54324 backupdba

#groupadd -g 54325 dgdba

#groupadd -g 54326 kmdba

#groupadd -g 54327 asmdba

#groupadd -g 54328 asmoper

#groupadd -g 54329 asmadmin

#groupadd -g 54330 racdba

useradd -u 54321 -g oinstall -G dba,oper oracle

Uncomment the extra groups you require.

◉ Additional Setup

Set the password for the "oracle" user.

passwd oracle

Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

SELINUX=permissive

Once the change is complete, restart the server or run the following command.

# setenforce Permissive

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here. To disable it, do the following.

# systemctl stop firewalld

# systemctl disable firewalld

If you are not using Oracle Linux and UEK, you will need to manually disable transparent huge pages.

Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/21.0.0/dbhome_1

mkdir -p /u02/oradata

chown -R oracle:oinstall /u01 /u02

chmod -R 775 /u01 /u02

Putting mount points directly under root without mounting separate disks to them is typically a bad idea. It's done here for simplicity, but for a real installation "/" storage should be reserved for the OS.

Unless you are working from the console, or using SSH tunnelling, login as root and issue the following command.

xhost +<machine-name>

The scripts are created using the cat command, with all the "$" characters escaped. If you want to manually create these files, rather than using the cat command, remember to remove the "\" characters before the "$" characters.

Create a "scripts" directory.

mkdir /home/oracle/scripts

Create an environment file called "setEnv.sh". The "$" characters are escaped using "\". If you are not creating the file with the cat command, you will need to remove the escape characters.

cat > /home/oracle/scripts/setEnv.sh <<EOF

# Oracle Settings

export TMP=/tmp

export TMPDIR=\$TMP

export ORACLE_HOSTNAME=ol8-21.localdomain

export ORACLE_UNQNAME=cdb1

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=\$ORACLE_BASE/product/21.0.0/dbhome_1

export ORA_INVENTORY=/u01/app/oraInventory

export ORACLE_SID=cdb1

export PDB_NAME=pdb1

export DATA_DIR=/u02/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH

export PATH=\$ORACLE_HOME/bin:\$PATH

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib

EOF

Add a reference to the "setEnv.sh" file at the end of the "/home/oracle/.bash_profile" file.

echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile

Create a "start_all.sh" and "stop_all.sh" script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.

cat > /home/oracle/scripts/start_all.sh <<EOF

#!/bin/bash

. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO

. oraenv

export ORAENV_ASK=YES

dbstart \$ORACLE_HOME

EOF

cat > /home/oracle/scripts/stop_all.sh <<EOF

#!/bin/bash

. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO

. oraenv

export ORAENV_ASK=YES

dbshut \$ORACLE_HOME

EOF

chown -R oracle:oinstall /home/oracle/scripts

chmod u+x /home/oracle/scripts/*.sh

Once the installation is complete and you've edited the "/etc/oratab", you should be able to start/stop the database with the following scripts run from the "oracle" user.

~/scripts/start_all.sh

~/scripts/stop_all.sh

◉ Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

Switch to the ORACLE_HOME directory, unzip the software directly into this path and start the Oracle Universal Installer (OUI) by issuing one of the following commands in the ORACLE_HOME directory. The interactive mode will display GUI installer screens to allow user input, while the silent mode will install the software without displaying any screens, as all required options are already specified on the command line.

# Unzip software.

cd $ORACLE_HOME

unzip -oq /path/to/software/LINUX.X64_213000_db_home.zip

# Interactive mode.

./runInstaller

# Silent mode.

./runInstaller -ignorePrereq -waitforcompletion -silent                        \

    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \

    oracle.install.option=INSTALL_DB_SWONLY                                    \

    ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \

    UNIX_GROUP_NAME=oinstall                                                   \

    INVENTORY_LOCATION=${ORA_INVENTORY}                                        \

    SELECTED_LANGUAGES=en,en_GB                                                \

    ORACLE_HOME=${ORACLE_HOME}                                                 \

    ORACLE_BASE=${ORACLE_BASE}                                                 \

    oracle.install.db.InstallEdition=EE                                        \

    oracle.install.db.OSDBA_GROUP=dba                                          \

    oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \

    oracle.install.db.OSDGDBA_GROUP=dba                                        \

    oracle.install.db.OSKMDBA_GROUP=dba                                        \

    oracle.install.db.OSRACDBA_GROUP=dba                                       \

    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \

    DECLINE_SECURITY_UPDATES=true

Run the root scripts when prompted.

As a root user, execute the following script(s):

        1. /u01/app/oraInventory/orainstRoot.sh

        2. /u01/app/oracle/product/21.0.0/dbhome_1/root.sh

◉ Database Creation

You create a database using the Database Configuration Assistant (DBCA). The interactive mode will display GUI screens to allow user input, while the silent mode will create the database without displaying any screens, as all required options are already specified on the command line.

# Start the listener.

lsnrctl start

# Interactive mode.

dbca

# Silent mode.

dbca -silent -createDatabase                                                   \

     -templateName General_Purpose.dbc                                         \

     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \

     -characterSet AL32UTF8                                                    \

     -sysPassword SysPassword1                                                 \

     -systemPassword SysPassword1                                              \

     -createAsContainerDatabase true                                           \

     -numberOfPDBs 1                                                           \

     -pdbName ${PDB_NAME}                                                      \

     -pdbAdminPassword PdbPassword1                                            \

     -databaseType MULTIPURPOSE                                                \

     -memoryMgmtType auto_sga                                                  \

     -totalMemory 2000                                                         \

     -storageType FS                                                           \

     -datafileDestination "${DATA_DIR}"                                        \

     -redoLogFileSize 50                                                       \

     -emConfiguration NONE                                                     \

     -ignorePreReqs

◉ Post Installation

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

cdb1:/u01/app/oracle/product/21.0.0/db_1:Y

Enable Oracle Managed Files (OMF) and make sure the PDB starts when the instance starts.

sqlplus / as sysdba <<EOF

alter system set db_create_file_dest='${DATA_DIR}';

alter pluggable database ${PDB_NAME} save state;

exit;

EOF

Source: oracle-base.com

Thursday, August 19, 2021

Difference Between Classification and Prediction

Classification and Prediction, Database Tutorial and Material, SAP Database Learning, SAP Database Career, SAP Database , SAP Database

Key Difference – Classification vs Prediction

Classification and predication are two terms associated with data mining. Data is important to almost all the organization to increase profits and to understand the market. Plain data does not have much value. Therefore, the data should be processed in order to get useful information. The data mining is the technology that extracts information from a large amount of data. It helps to get a broad understanding of the data. Some applications of data mining are market analysis, production control and fraud detection. The classification and predication are two terms associated with data mining. This article discusses the difference between classification and predication. Classification is the process of identifying the category or class label of the new observation to which it belongs.  Predication is the process of identifying the missing or unavailable numerical data for a new observation. That is the key difference between classification and predication. The predication does not concern about the class label like in classification.

What is Classification?

Classification is to identify the category or the class label of a new observation. First, a set of data is used as training data. The set of input data and the corresponding outputs are given to the algorithm. So, the training data set includes the input data and their associated class labels. Using the training dataset, the algorithm derives a model or the classifier.  The derived model can be a decision tree, mathematical formula or a neural network. In classification, when an unlabeled data is given to the model, it should find the class which it belongs to.  The new data provided to the model is the test data set.

Classification and Prediction, Database Tutorial and Material, SAP Database Learning, SAP Database Career, SAP Database , SAP Database

Classification is the process of classifying a record. One simple example of classification is to check whether it is raining or not. The answer can either be yes or no. So, there is a particular number of choices. Sometimes there can be more than two class to classify. That is called multiclass classification. In real life, the bank needs to analyse whether giving a loan to a particular customer is risky or not. In this example, a model is constructed to find the categorical label. The labels are risky or safe.

What is Predication?


Another process of data analyzing is the predication. It is used to find a numerical output. Same as in classification, the training dataset contains the inputs and corresponding numerical output values. According to the training dataset, the algorithm derives the model or a predictor. When the new data is given, the model should find a numerical output. Unlike in classification, this method does not have the class label. The model predicts a continuous-valued function or ordered value.

Regression is generally used for predication. Predicating the value of a house depending on the facts such as the number of rooms, the total area etc. is an example for predication. A company might find the amount of money spent by the customer during a sale. That is also an example for prediction.

What is the Similarity Between Classification and Predication?

◉ Both Classification and Predication are forms of data analyzing used in data mining.

What is the Difference Between Classification and Predication?


Classification vs Predication
Classification is the process of identifying to which category, a new observation belongs to on the basis of a training data set containing observations whose category membership is known. Predication is the process of identifying the missing or unavailable numerical data for a new observation. 
Accuracy
In classification, the accuracy depends on finding the class label correctly.   In prediction, the accuracy depends on how well a given predictor can guess the value of a predicated attribute for new data.
Model
A model or the classifier is constructed to find the categorical labels. A model or a predictor will be constructed that predicts a continuous-valued function or ordered value.
Synonyms for the Model
In classification, the model can be known as the classifier.   In prediction, the model can be known as the predictor.

Source: differencebetween.com

Wednesday, August 18, 2021

Oracle Database 21c Installation On Oracle Linux 7 (OL7)

Oracle Database 21c, Oracle Database Exam Prep, Oracle Database Preparation, Database Career, Oracle Database 21c

This article describes the installation of Oracle Database 21c 64-bit on Oracle Linux 7 (OL7) 64-bit. The article is based on a server installation with a minimum of 2G swap and secure Linux set to permissive.

◉ Download Software

Download the Oracle software from OTN or MOS depending on your support status.

- OTN: Oracle Database 21c (21.3) Software (64-bit)

- edelivery: Oracle Database 21c (21.3) Software (64-bit)

◉ Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4

192.168.56.107  ol7-21.localdomain  ol7-21

Set the correct hostname in the "/etc/hostname" file.

ol7-21.localdomain

◉ Oracle Installation Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations.

     ◉ Automatic Setup

At the time of writing the oracle-database-preinstall-21c package has not been released, but the 19c package works in its place.

If you plan to use the "oracle-database-preinstall-19c" package to perform all your prerequisite setup, issue the following command.

# yum install -y oracle-database-preinstall-19c

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

# yum update -y

 It's worth running the all the YUM commands listed in the manual setup section. Depending on the OS package groups you have selected, some additional packages might also be needed.

If you are using RHEL7 or CentOS7, you can pick up the PRM from the OL7 repository and install it. It will pull the dependencies from your normal repositories.

curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

     ◉ Manual Setup

If you have not used the "oracle-database-preinstall-19c" package to perform all prerequisites, you will need to manually perform the following setup tasks.

Add the following lines to the "/etc/sysctl.conf" file, or in a file called "/etc/sysctl.d/98-oracle.conf".

fs.file-max = 6815744

kernel.sem = 250 32000 100 128

kernel.shmmni = 4096

kernel.shmall = 1073741824

kernel.shmmax = 4398046511104

kernel.panic_on_oops = 1

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

net.ipv4.conf.all.rp_filter = 2

net.ipv4.conf.default.rp_filter = 2

fs.aio-max-nr = 1048576

net.ipv4.ip_local_port_range = 9000 65500

Run one of the following commands to change the current kernel parameters, depending on which file you edited.

/sbin/sysctl -p

# Or

/sbin/sysctl -p /etc/sysctl.d/98-oracle.conf

Add the following lines to a file called "/etc/security/limits.d/oracle-database-preinstall-19c.conf" file.

oracle   soft   nofile    1024

oracle   hard   nofile    65536

oracle   soft   nproc    16384

oracle   hard   nproc    16384

oracle   soft   stack    10240

oracle   hard   stack    32768

oracle   hard   memlock    134217728

oracle   soft   memlock    134217728

oracle   soft   data    unlimited

oracle   hard   data    unlimited

The following packages are listed as required. Many of the packages should be installed already.

yum install -y bc

yum install -y binutils

yum install -y elfutils-libelf

yum install -y glibc

yum install -y glibc-devel

yum install -y ksh

yum install -y libaio

yum install -y libXrender

yum install -y libX11

yum install -y libXau

yum install -y libXi

yum install -y libXtst

yum install -y libgcc

yum install -y libstdc++

yum install -y libxcb

yum install -y make

yum install -y policycoreutils

yum install -y policycoreutils-python

yum install -y smartmontools

yum install -y sysstat

# Added by me.

yum install -y unixODBC

Create the new groups and users.

groupadd -g 54321 oinstall

groupadd -g 54322 dba

groupadd -g 54323 oper

#groupadd -g 54324 backupdba

#groupadd -g 54325 dgdba

#groupadd -g 54326 kmdba

#groupadd -g 54327 asmdba

#groupadd -g 54328 asmoper

#groupadd -g 54329 asmadmin

#groupadd -g 54330 racdba

useradd -u 54321 -g oinstall -G dba,oper oracle

Uncomment the extra groups you require.

     ◉ Additional Setup

The following steps must be performed, whether you did the manual or automatic setup.

Set the password for the "oracle" user.

passwd oracle

Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

SELINUX=permissive

Once the change is complete, restart the server or run the following command.

# setenforce Permissive

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here. To disable it, do the following.

# systemctl stop firewalld

# systemctl disable firewalld

If you are not using Oracle Linux and UEK, you will need to manually disable transparent huge pages.

Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/21.0.0/dbhome_1

mkdir -p /u02/oradata

chown -R oracle:oinstall /u01 /u02

chmod -R 775 /u01 /u02

Putting mount points directly under root without mounting separate disks to them is typically a bad idea. It's done here for simplicity, but for a real installation "/" storage should be reserved for the OS.

Unless you are working from the console, or using SSH tunnelling, login as root and issue the following command.

xhost +<machine-name>

The scripts are created using the cat command, with all the "$" characters escaped. If you want to manually create these files, rather than using the cat command, remember to remove the "\" characters before the "$" characters.

Create a "scripts" directory.

mkdir /home/oracle/scripts

Create an environment file called "setEnv.sh". The "$" characters are escaped using "\". If you are not creating the file with the cat command, you will need to remove the escape characters.

cat > /home/oracle/scripts/setEnv.sh <<EOF

# Oracle Settings

export TMP=/tmp

export TMPDIR=\$TMP

export ORACLE_HOSTNAME=ol7-21.localdomain

export ORACLE_UNQNAME=cdb1

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=\$ORACLE_BASE/product/21.0.0/dbhome_1

export ORA_INVENTORY=/u01/app/oraInventory

export ORACLE_SID=cdb1

export PDB_NAME=pdb1

export DATA_DIR=/u02/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH

export PATH=\$ORACLE_HOME/bin:\$PATH

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib

EOF

Add a reference to the "setEnv.sh" file at the end of the "/home/oracle/.bash_profile" file.

echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile

Create a "start_all.sh" and "stop_all.sh" script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.

cat > /home/oracle/scripts/start_all.sh <<EOF

#!/bin/bash

. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO

. oraenv

export ORAENV_ASK=YES

dbstart \$ORACLE_HOME

EOF

cat > /home/oracle/scripts/stop_all.sh <<EOF

#!/bin/bash

. /home/oracle/scripts/setEnv.sh

export ORAENV_ASK=NO

. oraenv

export ORAENV_ASK=YES

dbshut \$ORACLE_HOME

EOF

chown -R oracle:oinstall /home/oracle/scripts

chmod u+x /home/oracle/scripts/*.sh

Once the installation is complete and you've edited the "/etc/oratab", you should be able to start/stop the database with the following scripts run from the "oracle" user.

~/scripts/start_all.sh

~/scripts/stop_all.sh

◉ Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

Switch to the ORACLE_HOME directory, unzip the software directly into this path and start the Oracle Universal Installer (OUI) by issuing one of the following commands in the ORACLE_HOME directory. The interactive mode will display GUI installer screens to allow user input, while the silent mode will install the software without displaying any screens, as all required options are already specified on the command line.

# Unzip software.

cd $ORACLE_HOME

unzip -oq /path/to/software/LINUX.X64_213000_db_home.zip

# Interactive mode.

./runInstaller

# Silent mode.

./runInstaller -ignorePrereq -waitforcompletion -silent                        \

    -responseFile ${ORACLE_HOME}/install/response/db_install.rsp               \

    oracle.install.option=INSTALL_DB_SWONLY                                    \

    ORACLE_HOSTNAME=${ORACLE_HOSTNAME}                                         \

    UNIX_GROUP_NAME=oinstall                                                   \

    INVENTORY_LOCATION=${ORA_INVENTORY}                                        \

    SELECTED_LANGUAGES=en,en_GB                                                \

    ORACLE_HOME=${ORACLE_HOME}                                                 \

    ORACLE_BASE=${ORACLE_BASE}                                                 \

    oracle.install.db.InstallEdition=EE                                        \

    oracle.install.db.OSDBA_GROUP=dba                                          \

    oracle.install.db.OSBACKUPDBA_GROUP=dba                                    \

    oracle.install.db.OSDGDBA_GROUP=dba                                        \

    oracle.install.db.OSKMDBA_GROUP=dba                                        \

    oracle.install.db.OSRACDBA_GROUP=dba                                       \

    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                                 \

    DECLINE_SECURITY_UPDATES=true

Run the root scripts when prompted.

As a root user, execute the following script(s):

        1. /u01/app/oraInventory/orainstRoot.sh

        2. /u01/app/oracle/product/21.0.0/dbhome_1/root.sh

You are now ready to create a database.

◉ Database Creation

You create a database using the Database Configuration Assistant (DBCA). The interactive mode will display GUI screens to allow user input, while the silent mode will create the database without displaying any screens, as all required options are already specified on the command line.

# Start the listener.

lsnrctl start

# Interactive mode.

dbca

# Silent mode.

dbca -silent -createDatabase                                                   \

     -templateName General_Purpose.dbc                                         \

     -gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} -responseFile NO_VALUE         \

     -characterSet AL32UTF8                                                    \

     -sysPassword SysPassword1                                                 \

     -systemPassword SysPassword1                                              \

     -createAsContainerDatabase true                                           \

     -numberOfPDBs 1                                                           \

     -pdbName ${PDB_NAME}                                                      \

     -pdbAdminPassword PdbPassword1                                            \

     -databaseType MULTIPURPOSE                                                \

     -memoryMgmtType auto_sga                                                  \

     -totalMemory 2000                                                         \

     -storageType FS                                                           \

     -datafileDestination "${DATA_DIR}"                                        \

     -redoLogFileSize 50                                                       \

     -emConfiguration NONE                                                     \

     -ignorePreReqs

◉ Post Installation

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

cdb1:/u01/app/oracle/product/21.0.0/db_1:Y

Enable Oracle Managed Files (OMF) and make sure the PDB starts when the instance starts.

sqlplus / as sysdba <<EOF

alter system set db_create_file_dest='${DATA_DIR}';

alter pluggable database ${PDB_NAME} save state;

exit;

EOF

Source: oracle-base.com

Tuesday, August 17, 2021

Difference Between RDBMS and Hadoop

The key difference between RDBMS and Hadoop is that the RDBMS stores structured data while the Hadoop stores structured, semi-structured, and unstructured data.

The RDBMS is a database management system based on the relational model. The Hadoop is a software for storing data and running applications on clusters of commodity hardware.

RDBMS and Hadoop, Oracle Database Tutorial and Material, Database Career, Database Preparation, Oracle Database Certification

What is RDBMS?


RDBMS stands for Relational Database Management System based on the relational model. In the RDBMS, tables are used to store data, and keys and indexes help to connect the tables. A table is a collection of data elements, and they are the entities. It contains rows and columns. The rows represent a single entry in the table. The columns represent the attributes.

For example, the sales database can have customer and product entities.  The customer can have attributes such as customer_id, name, address, phone_no. The item can have attributes such as product_id, name etc. The primary key of customer table is customer_id while the primary key of product table is product_id. Placing the product_id in the customer table as a foreign key connects these two entities. Likewise, the tables are also related to each other.  They provide data integrity, normalization, and many more.  Few of the common RDBMS are MySQL, MSSQL and Oracle. They use SQL for querying.

What is Hadoop?


The Hadoop is an Apache open source framework written in Java. It helps to store and processes a large quantity of data across clusters of computers using simple programming models. The main objective of Hadoop is to store and process Big Data, which refers to a large quantity of complex data. The throughput of Hadoop, which is the capacity to process a volume of data within a particular period of time, is high.

RDBMS and Hadoop, Oracle Database Tutorial and Material, Database Career, Database Preparation, Oracle Database Certification

There are four modules in Hadoop architecture. They are Hadoop common, YARN, Hadoop Distributed File System (HDFS), and Hadoop MapReduce. The common module contains the Java libraries and utilities. It also has the files to start Hadoop. Hadoop YARN performs the job scheduling and cluster resource management.

Furthermore, the Hadoop Distributed File System (HDFS) is the Hadoop storage system. It uses the master-slave architecture. The Master node is the NameNode, and it manages the file system meta data. Other computers are slave nodes or DataNodes. They store the actual data. On the other hand, Hadoop MapReduce does the distributed computation. It has the algorithms to process the data. In the HDFS, the Master node has a job tracker. It runs map reduce jobs on the slave nodes. There is a Task Tracker for each slave node to complete data processing and to send the result back to the master node. Overall, the Hadoop provides massive storage of data with a high processing power.

What is the Difference Between RDBMS and Hadoop?


RDBMS vs Hadoop
RDBMS is a system software for creating and managing databases that based on the relational model. Hadoop is a collection of open source software that connects many computers to solve problems involving a large amount of data and computation. 
Data Variety
RDBMS stores structured data.   Hadoop stores structured, semi-structured and unstructured data.
Data Storage
RDBMS stores average amount of data.  Hadoop stores a large amount of data than RDBMS.
Speed
In RDBMS, reads are fast.   In Hadoop, reads and writes are fast.
Scalability
RDBMS has vertical scalability.   Hadoop has horizontal scalability.
Hardware
RDBMS use high-end servers.   Hadoop uses commodity hardware.
Throughput
RDBMS throughput is higher. Hadoop throughput is lower.

Source: differencebetween.com