Oracle Database in Docker

Source: Internet
Author: User
To study Oracle databases, it is too cumbersome to install Oracle, so think about saving things and use Oracle in Docker as an exercise.

Search Oracle Database mirroring files using the sudo docker search Oracle command, where a related mirror has been posted, Link: https://hub.docker.com/r/sath89/oracle-12c/, Follow the instructions directly to download the mirror using the pull command. After the download is complete, the following is shown:

After the image is downloaded, we need to start the database in reference to the author's instructions, and the first time you need to configure the database, first use the command sudo docker run-d-P 8080:8080-p 1521:1521 sath89/oracle-12c start mirroring, and map Fire-related ports, here are 8080 and 1521 ports

This is the log file that we can go to view Docker:

When we enter the Docker logs-f Mirror ID, we output the log file for this mirror operation and wait 5 minutes or so, Oracle will start successfully and no error has occurred.
This is, we can go to the mirroring bash to do further operations on the database:

As shown, we can see that the EXEC command with Docker enters the mirrored bash and looks at the port information for the mirroring boot.
View Oracle's Service_names and go to Oracle's home directory:
Cd $ORACLE _home
Log on to Oracle using DBA account

so far, Explains that Oracle's Docker mirroring installation is complete and then configures Oracle clients.
Download Pl/sql client: https://www.allroundautomations.com/bodyplsqldevreg.html
Download Oracle client: http://www.oracle.com/ The technetwork/topics/winx64soft-089540.html
installs the Pl/sql client, which does not require a special configuration, and then configures the Oracle client.
Unzip the downloaded Oracle client file and place it in a specific directory, for example, in the D disk.
1, new oracle_home environment variable:

2, new nls_lang environment variable, set value to: Simplified Chinese_china. ZHS16GBK

3, the new tns_admin environment variable, the value is set to the admin directory, this admin directory needs its own in the Oracle client directory to create their own.

The D:\oraclient directory is then added to the PATH environment variable.
Next, create a Tnsnames.ora file in the new admin directory to write to the file configuration:

mydb=
    (DESCRIPTION = (Address
        = (PROTOCOL = TCP) (host= 192.168.83.135) (PORT = 1521))
        (Connect_data =
            ( SERVER = dedicated)
            (service_name = XE)
        )
    

Host is the server address, port is the Oracle port, where you need to pay attention to service_name, that is, we looked at the previous service_name value.
Then open the Plsql client

Fill in the Oracle username password to log in, the successful login can be database operation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.