{"id":78,"date":"2020-03-27T03:17:00","date_gmt":"2020-03-27T03:17:00","guid":{"rendered":"https:\/\/therenaissanceraven.com\/?p=78"},"modified":"2020-03-27T03:17:00","modified_gmt":"2020-03-27T03:17:00","slug":"creating-your-own-oracle-database-for-free-on-windows-oracle-database-express-xe","status":"publish","type":"post","link":"https:\/\/therenaissanceraven.com\/?p=78","title":{"rendered":"Creating your own oracle database for free on windows &#8211; Oracle Database Express XE"},"content":{"rendered":"<p>This is actually amazingly simple if you wish to have your own database to either play around in or use for home projects or prototyping projects at work.<\/p>\n<p><span style=\"font-size: large;\"><b>Downloading and Installing On Windows 10<\/b><\/span>:<br \/>Go to the download website <a href=\"https:\/\/www.oracle.com\/database\/technologies\/xe-downloads.html\">https:\/\/www.oracle.com\/database\/technologies\/xe-downloads.html<\/a>, where you will need to create an account to download. Just an email you can access is needed and you can fill out fake details for the rest if you like.<\/p>\n<p>Additionally I would recommend installing <a href=\"https:\/\/www.oracle.com\/database\/technologies\/appdev\/sql-developer.html\">SQL developer<\/a> as a very easy GUI interface (instead of SQL*plus) to manage the database.<\/p>\n<p>The  first steps are pretty basically installation steps, just run the setup  and click next until you come to the following screen. Here you will  enter the password for the admin accounts, so choose this carefully:<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-B5LmL7_MQxM\/XnwSXFGXDqI\/AAAAAAAABy0\/1jlQUhEdYPQUSC0kMkxqnPhNFj3sYMuTgCLcBGAsYHQ\/s1600\/Capture3.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"399\" data-original-width=\"510\" height=\"312\" src=\"https:\/\/1.bp.blogspot.com\/-B5LmL7_MQxM\/XnwSXFGXDqI\/AAAAAAAABy0\/1jlQUhEdYPQUSC0kMkxqnPhNFj3sYMuTgCLcBGAsYHQ\/s400\/Capture3.PNG\" width=\"400\" \/>&nbsp;<\/a><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\">At  the end of the installation, you will see your connection strings. The  multitenant container database is the entire database hosted on your  computer at port 1521. Your pluggable database is called XEPDB1 and the  web browser based management url is listed as well.<\/div>\n<p><\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-W_2SVgQobJ8\/XnwSOh2CTaI\/AAAAAAAAByk\/6b0i3Hq5Igw7Y8wt6POqkZO5KYAYPh7GQCLcBGAsYHQ\/s1600\/Capture5.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"383\" data-original-width=\"501\" height=\"305\" src=\"https:\/\/1.bp.blogspot.com\/-W_2SVgQobJ8\/XnwSOh2CTaI\/AAAAAAAAByk\/6b0i3Hq5Igw7Y8wt6POqkZO5KYAYPh7GQCLcBGAsYHQ\/s400\/Capture5.PNG\" width=\"400\" \/>&nbsp;<\/a><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><span style=\"font-size: large;\"><b>Connecting to database from SQL Developer:<\/b><\/span><\/div>\n<div style=\"clear: both; text-align: left;\">You first may wish to connect the database to see it working. You can do this by firing up SQL Developer and create a new connection, the connection string you will need is the following to connect as sysdba<i> (make special note on the role selection to the right of username!)<\/i>: <\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-m0pLBSjA4Es\/XnwSPNziLZI\/AAAAAAAAByg\/r911dpF2Adwg-EE0JNbaOJHqKxThl1sXQCLcBGAsYHQ\/s1600\/Capture6.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"503\" data-original-width=\"781\" height=\"411\" src=\"https:\/\/1.bp.blogspot.com\/-m0pLBSjA4Es\/XnwSPNziLZI\/AAAAAAAAByg\/r911dpF2Adwg-EE0JNbaOJHqKxThl1sXQCLcBGAsYHQ\/s640\/Capture6.PNG\" width=\"640\" \/><\/a><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><span style=\"font-size: large;\"><b>Creating a tablespace and a schema in the main multitenant container<\/b><\/span>:<\/div>\n<div style=\"clear: both; text-align: left;\">You will need to run the following commands from the command prompt:<\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"># connect to the database as the sysdba<\/div>\n<div style=\"clear: both; text-align: left;\"><code>sqlplus \/ as sysdba<\/code><\/p>\n<p># create a new table space called <i>mytablespace<\/i> with a size of ~5GB. <br \/><code>create tablespace mytablespace datafile 'mytablespace.dbf' size 5000M;<\/code><\/p>\n<p># hidden parameter to remove need for C## naming conventions<br \/><code>alter session set \"_ORACLE_SCRIPT\"=true;<\/code><\/p>\n<p># create our schema (or user) and use our new tablespace<br \/><code>create user myuser identified by password default tablespace mytablespace;<\/code><\/p>\n<p># give the new user permissions<br \/><code>grant connect, create session, create table to myuser;<\/code><\/p>\n<p>Here is the code shown in the terminal:<\/p><\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-8Z3jjw-TFeo\/XnwSOPnZjZI\/AAAAAAAAByU\/HvDqnkwFsnYb__JeB3KRU9viykORDJd-QCLcBGAsYHQ\/s1600\/Capture11.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"518\" data-original-width=\"684\" height=\"481\" src=\"https:\/\/1.bp.blogspot.com\/-8Z3jjw-TFeo\/XnwSOPnZjZI\/AAAAAAAAByU\/HvDqnkwFsnYb__JeB3KRU9viykORDJd-QCLcBGAsYHQ\/s640\/Capture11.PNG\" width=\"640\" \/><\/a><\/div>\n<p>Here is the connection set up for the new schema\/user:<\/p>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-NH6uhQPfhys\/XnwSOFznaZI\/AAAAAAAAByQ\/nqxVdmNG5xE-PpmwEfCRALUhdcqVQeOpQCLcBGAsYHQ\/s1600\/Capture10.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"498\" data-original-width=\"951\" height=\"334\" src=\"https:\/\/1.bp.blogspot.com\/-NH6uhQPfhys\/XnwSOFznaZI\/AAAAAAAAByQ\/nqxVdmNG5xE-PpmwEfCRALUhdcqVQeOpQCLcBGAsYHQ\/s640\/Capture10.PNG\" width=\"640\" \/><\/a><\/div>\n<p><\/p>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"><span style=\"font-size: large;\"><b>Creating a tablespace and a schema in the plugable database<\/b><\/span>:<\/div>\n<div style=\"clear: both; text-align: left;\">You will need to run the following commands from the command prompt:<\/div>\n<div style=\"clear: both; text-align: left;\"><\/div>\n<div style=\"clear: both; text-align: left;\"># connect to the database as the sysdba<\/div>\n<div style=\"clear: both; text-align: left;\"><code>sqlplus \/ as sysdba<\/code><\/p>\n<p># alter the session to connect to the pluggable database<br \/><code>alter session set container=XEPDB1;<\/code><\/p>\n<p># create a new table space called <i>mytablespace<\/i> with a size of&nbsp; ~1GB. <br \/><code>create tablespace mytablespace datafile 'mytablespace.dbf' size 5000M;<\/code><\/p>\n<p># create our schema (or user) and use our new tablespace<br \/><code>create user myuser identified by password default tablespace mytablespace;<\/code><\/p>\n<p># give the new user permissions<br \/><code>grant connect, create session, create table to myuser;<\/code><\/p>\n<p>Here is the code shown in the terminal (I forgot to set new tablespace, so I altered the user later):<\/p><\/div>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-ISXyLuyim4Q\/XnwSPr6vSqI\/AAAAAAAAByw\/4HUFNb03UG4YrxzpgbkCzpXs21tyMeDYACLcBGAsYHQ\/s1600\/Capture9.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"683\" data-original-width=\"650\" height=\"640\" src=\"https:\/\/1.bp.blogspot.com\/-ISXyLuyim4Q\/XnwSPr6vSqI\/AAAAAAAAByw\/4HUFNb03UG4YrxzpgbkCzpXs21tyMeDYACLcBGAsYHQ\/s640\/Capture9.PNG\" width=\"608\" \/><\/a><\/div>\n<p>The connection in SQLDeveloper will now look like this, notice that we must use the service name of the plugable database now.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-spNbQSMTiEI\/XnwSPVRVJJI\/AAAAAAAABys\/RFun_dVxmTYTCcpl20lPFj1fL3ACeS3egCLcBGAsYHQ\/s1600\/Capture8.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"500\" data-original-width=\"952\" height=\"336\" src=\"https:\/\/1.bp.blogspot.com\/-spNbQSMTiEI\/XnwSPVRVJJI\/AAAAAAAABys\/RFun_dVxmTYTCcpl20lPFj1fL3ACeS3egCLcBGAsYHQ\/s640\/Capture8.PNG\" width=\"640\" \/><\/a><\/div>\n<p>Finally you can see that we have set up a new user\/schema called myuser for both the main container and the pluggable database with a separate connection as SYSDBA for admin purposes.<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/1.bp.blogspot.com\/-MATp3PXj-_o\/XnwSOcUHSvI\/AAAAAAAAByY\/RgG1o4TD9cwJOjfovoYpjF48Eaez_TfYgCLcBGAsYHQ\/s1600\/Capture12.PNG\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"176\" data-original-width=\"354\" height=\"159\" src=\"https:\/\/1.bp.blogspot.com\/-MATp3PXj-_o\/XnwSOcUHSvI\/AAAAAAAAByY\/RgG1o4TD9cwJOjfovoYpjF48Eaez_TfYgCLcBGAsYHQ\/s320\/Capture12.PNG\" width=\"320\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is actually amazingly simple if you wish to have your own database to either play around in or use for home projects or prototyping projects at work. Downloading and Installing On Windows 10:Go to the download website https:\/\/www.oracle.com\/database\/technologies\/xe-downloads.html, where you will need to create an account to download. Just an email you can access&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78"}],"version-history":[{"count":0,"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"wp:attachment":[{"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/therenaissanceraven.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}