0% found this document useful (0 votes)
2 views6 pages

Docker Oracle 19c

Uploaded by

srinu katams
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Docker Oracle 19c

Uploaded by

srinu katams
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

login as: root

[email protected]'s password:

██████╗ ███████╗██╗ ██╗ ██████╗ ██████╗ ███████╗


██╔══██╗██╔════╝██║ ██║██╔═══██╗██╔══██╗██╔════╝
██║ ██║█████╗ ██║ ██║██║ ██║██████╔╝███████╗
██║ ██║██╔══╝ ╚██╗ ██╔╝██║ ██║██╔═══╝ ╚════██║
██████╔╝███████╗ ╚████╔╝ ╚██████╔╝██║ ███████║
╚═════╝ ╚══════╝ ╚═══╝ ╚═════╝ ╚═╝ ╚══════╝

████████╗██████╗ █████╗ ██╗███╗ ██╗██╗███╗ ██╗ ██████╗


╚══██╔══╝██╔══██╗██╔══██╗██║████╗ ██║██║████╗ ██║██╔════╝
██║ ██████╔╝███████║██║██╔██╗ ██║██║██╔██╗ ██║██║ ███╗
██║ ██╔══██╗██╔══██║██║██║╚██╗██║██║██║╚██╗██║██║ ██║
██║ ██║ ██║██║ ██║██║██║ ╚████║██║██║ ╚████║╚██████╔╝
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝

Disclaimer:

This image is designed for only for the lab purpose


of learning DevOps and not recommended at all to use
in production or any company environments.

This image is customized and it is having some of


the default softwares which will help the student
to start the practice without any issues.

**Note**: This server is going to shutdown automatically


in case if it is idle for 60 mins to save
the cost in AWS.

Customized Commands available in this Image:

1. labauto
2. disable-auto-shutdown / enable-auto-shutdown
3. set-hostname
Last login: Tue Jan 2 04:49:38 2024 from 116.87.58.162

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]#

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]#

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a|grep oracle

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 14 minutes ago Up 14 mi
nutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp lucid
_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 5 hours ago Exited (
143) 5 hours ago kind_
hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited (
127) 7 hours ago zealo
us_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (
0) 7 hours ago pensi
ve_newton

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 14 minutes ago Up 14
minutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp
lucid_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 5 hours ago Exited
(143) 5 hours ago
kind_hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited
(127) 7 hours ago
zealous_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (0)
7 hours ago
pensive_newton

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 14 minutes ago Up 14
minutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp
lucid_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 5 hours ago Exited
(143) 5 hours ago
kind_hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited
(127) 7 hours ago
zealous_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (0)
7 hours ago
pensive_newton

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 14 minutes ago Up 14
minutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp
lucid_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 5 hours ago Exited
(143) 5 hours ago
kind_hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited
(127) 7 hours ago
zealous_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (0)
7 hours ago
pensive_newton
67.202.2.117 | 172.31.16.23 | t3.large | null
[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 15 minutes ago Up 15
minutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp
lucid_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 5 hours ago Exited
(143) 5 hours ago
kind_hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited
(127) 7 hours ago
zealous_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (0)
7 hours ago
pensive_newton

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 25 minutes ago Up 25
minutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp
lucid_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 6 hours ago Exited
(143) 6 hours ago
kind_hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited
(127) 7 hours ago
zealous_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (0)
7 hours ago
pensive_newton

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a|grep oracle

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -
"docker ps" accepts no arguments.
See 'docker ps --help'.

Usage: docker ps [OPTIONS]

List containers

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 26 minutes ago Up 26
minutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp
lucid_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 6 hours ago Exited
(143) 6 hours ago
kind_hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited
(127) 7 hours ago
zealous_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (0)
7 hours ago
pensive_newton

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker exec -it oracle19db bash -c “source
/home/oracle/.bashrc; sqlplus /nolog”
Error response from daemon: No such container: oracle19db
-bash: sqlplus: command not found

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker exec -it 95f41a1d800b bash -c “source
/home/oracle/.bashrc; sqlplus /nolog”
/home/oracle/.bashrc: $'\342\200\234source': command not found
-bash: sqlplus: command not found

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]#

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]#

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker exec -it 95f41a1d800b
"docker exec" requires at least 2 arguments.
See 'docker exec --help'.

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

Execute a command in a running container

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker exec --help

Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

Execute a command in a running container

Aliases:
docker container exec, docker exec

Options:
-d, --detach Detached mode: run command in the background
--detach-keys string Override the key sequence for detaching a container
-e, --env list Set environment variables
--env-file list Read in a file of environment variables
-i, --interactive Keep STDIN open even if not attached
--privileged Give extended privileges to the command
-t, --tty Allocate a pseudo-TTY
-u, --user string Username or UID (format: "<name|uid>[:<group|gid>]")
-w, --workdir string Working directory inside the container

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
95f41a1d800b c796ed598500 "/bin/sh -c 'exec $O…" 38 minutes ago Up 38
minutes (healthy) 5500/tcp, 0.0.0.0:32768->1521/tcp, :::32768->1521/tcp
lucid_wilson
775704abbfa3 c796ed598500 "/bin/sh -c 'exec $O…" 6 hours ago Exited
(143) 6 hours ago
kind_hermann
6e7e901c4953 ubuntu "bash" 7 hours ago Exited
(127) 7 hours ago
zealous_panini
447eda12b6a0 hello-world "/hello" 7 hours ago Exited (0)
7 hours ago
pensive_newton

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker exec -it 95f41a1d800b sqlplus
sys/u53WqZB9gUE=1@//localhost:1521/ORCLCDB as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 2 05:39:18 2024


Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL>
SQL> select name from v$database;

NAME
---------
ORCLCDB

SQL> !lsnrctl status ORCLCDB

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 02-JAN-2024 05:40:01

Copyright (c) 1991, 2019, Oracle. All rights reserved.

TNS-01150: The address of the specified listener name is incorrect


NL-00303: syntax error in NV string

SQL> SELECT * FROM dual;

D
-
X

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED


---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB1 READ WRITE NO
SQL> alter session set container=MORALPDB;
ERROR:
ORA-65011: Pluggable database MORALPDB does not exist.

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ORCLCDB/system01.dbf
/u01/app/oracle/oradata/ORCLCDB/sysaux01.dbf
/u01/app/oracle/oradata/ORCLCDB/undotbs01.dbf
/u01/app/oracle/oradata/ORCLCDB/pdbseed/system01.dbf
/u01/app/oracle/oradata/ORCLCDB/pdbseed/sysaux01.dbf
/u01/app/oracle/oradata/ORCLCDB/users01.dbf
/u01/app/oracle/oradata/ORCLCDB/pdbseed/undotbs01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
/u01/app/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf

11 rows selected.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 -
Production
Version 19.3.0.0.0

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]# docker stop 95f41a1d800b
95f41a1d800b

67.202.2.117 | 172.31.16.23 | t3.large | null


[ root@ip-172-31-16-23 ~ ]#

You might also like