How to deploy Oracle using Docker on Mac First install dockerYou can download Docker from the official website directly, but it seems that the speed of the official website is a bit slow. If you have the conditions, I recommend copying the download link and downloading it on Thunder (it will be faster if you have a membership~) Docker official website Docker Mac version download link
After the download is complete, you need to drag the Docker icon into the application. After a successful installation, the Docker Logo will appear in the Mac launcher. At the same time, after the installation is successful, the Docker icon will appear at the top of the Mac, as shown below: After the installation is complete, it starts by default. If you can see Docker Desktop is running as shown in the figure, it means that Docker is already available for use. Install Oracle11g through DockerWe should first search in the remote repository of Docker, because Docker does not come with Oracle-related images. First, open the terminal that comes with Mac and enter the command as follows (determine whether to add sudo based on the actual situation of your Mac): sudo docker search docker-oracle-xe-11g If the Mac computer has run a command to modify the permissions of usr/local: sudo chown -R $USER /usr/local Then there is no need to add sudo for the corresponding operations afterwards. Back to the installation steps: After entering the search command in the command line, you will need to enter the mac password: After entering the password: After this screen appears, we select the one with the most starts to install. The command is as follows: sudo docker pull deepdiver/docker-oracle-xe-11g Because I have already installed it, the picture displayed is: When you enter the above command for the first installation, you can see that the command line shows that the files are being downloaded. You just need to wait until all the files are completed and re-enter a new command before proceeding to the next step. sudo docker run -d -p 1521:1521 --name oracle11g deepdiver/docker-oracle-xe-11g It is worth noting that port 1521 inside the container is mapped to port 1521 in the host machine, so that it can be connected through database visualization management tools such as Navicat in the host machine. After this step is completed, we need to enter the container and perform a simple configuration of the installed Oracle. Easily configure your Oracle database in the Oracle container and connect via Navicat It should be noted here that if you use Navicat to connect, you need to use the professional version. Copy the corresponding ID, as shown in the picture, mine is the first one. sudo docker exec -it (your container ID) /bin/bash After pressing Enter, enter the password and then enter: sqlplus system/oracle Perform the following operations in sequence: select username,password from dba_users; Of course, you can log in to the database using an existing username and password. It is recommended to use a newly created user to log in to the database. The sql is as follows: create user steafan(username) identified by password(password) After creation, you can verify it through the following sql: select * from all_users; After creating a new user, you need to authorize the user. The permissions that the user has are specified by yourself. This is why it is recommended to use a custom user to log in to the database. The sql is as follows: grant connect,resource to STEAFAN (the username needs to be capitalized here, otherwise the authorization will fail) connect means you have the permission to connect to the database; resource means you have the permission to operate the database At this point, all the database configurations that need to be configured have been configured and can be connected through Navicat When connecting, if Navicat is the professional version, you can select the database type to connect: After selecting: After the connection is successful, you can proceed. First, you need to open the connection by right-clicking on the connection name; I have opened it here, then select the username you logged in as and right-click to open the mode: Then, if table, view and other operation options appear under the user name or turn into color, it means success, and you can then create new queries, write SQL statements and other operations. This is the end of this article about how to deploy and use Oracle with Docker on Mac. For more information about deploying and using Oracle with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: The simplest form implementation of Flexbox layout
>>: Vue-cli creates a project and analyzes the project structure
Compared with ordinary programs, dynamic link lib...
Table of contents Overview definition Instance Me...
Mysql auto-increment primary key id does not incr...
Preface Every developer who comes into contact wi...
/******************** * Application of linked lis...
I am happy that some bloggers marked my article. ...
Problem Description Recently, there was a MySQL5....
I have always wanted to learn about caching. Afte...
This article example shares the specific code of ...
Table of contents Preface: accomplish: Summarize:...
This article shares the specific code of js imita...
What is a descending index? You may be familiar w...
In our daily development work, text overflow, tru...
Use OSS to upload pictures or attachments in vue ...
Use JavaScript to implement a web page clock. The...