This article covers a method for deploying an Oracle database in a container. It has been proved that it can achieve the expected goal and be applied in practical work.

The introduction

Oracle has been deployed before, using the image on Alibaba Cloud warehouse at that time, version 11.2, but has been unable to solve the permanent storage problem. Oracle has official instructions for creating Docker (it may be official Docker), and this article will practice according to the documents. This article is practical and must be as consistent as possible with the production database version and table name.

Technical summary

  • The directory mounted by the host must be accessible to the user whose UID is 54321. You can create a user with this UID or directly set the permission to 777.

practice

download

Follow the installation instructions in the Github repository.

The repository does not provide oracle software (probably because it is too large). The specific software can be downloaded from this page. The version used in this article is Linux x86-64. Md5 is 1858 bd0d281c60f4ddabd87b1c214a4f. Note that the download requires a login and registration (which took some time).

Officially, you need to rename the software package to Linuxx64_19.3.0_database.zip, but you don’t need to. To LINUX. X64_193000_db_home. Zip to copy to docker – images/OracleDatabase/SingleInstance/dockerfiles / 19.3.0 directory.

Change the CDB mode to non-CDB mode

Since version 12, non-CDB mode is used by default (this mechanism has not yet been explored). Modify the file directory: all docker – images/OracleDatabase/SingleInstance/dockerfiles / 19.3.0. Modify file dbca.rsp.tmpl:

CreateAsContainerDatabase = false numberOfPDBs = 0 # pdbName = # # # # # commented ORACLE_PDB # # # # # # # pdbAdminPassword = ORACLE_PWD # # # # Em off emConfiguration = NONECopy the code

Modify the following statement in file createdb. sh:

ALTER PLUGGABLE DATABASE $ORACLE_PDB SAVE STATE;
EXEC DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE);
Copy the code

Modify file checkdbstatus. sh:

V \ \ \ \ $PDBS instead of v $databaseCopy the code

Create a mirror image

Enter the docker – images/OracleDatabase SingleInstance/dockerfiles directory, execute the command:

Sh -e -i -v 19.3.0./ buildContainerimage. sh -e -i -v 19.3.0Copy the code

Note: -i indicates that the MD5 is not verified. For example, if a message is displayed indicating that a file cannot be found during the MD5 verification, the md5 is automatically verified. A dual-core 4G VM takes about 40 minutes. It takes about 12 minutes for a 20-core 64GB server.

Label and submit to Aliyun Warehouse:

Docker tag/oracle database: 19.3.0 - ee registry.cn-hangzhou.aliyuncs.com/latelee/database:19.3.0-ee docker push registry.cn-hangzhou.aliyuncs.com/latelee/database:19.3.0-eeCopy the code

Run the container

Official examples:

docker run --name <container name> \ -p <host port>:1521 -p <host port>:5500 \ -e ORACLE_SID=<your SID> \ -e ORACLE_PDB=<your PDB name> \ -e ORACLE_PWD=<your database passwords> \ -e INIT_SGA_SIZE=<your database SGA memory in MB>  \ -e INIT_PGA_SIZE=<your database PGA memory in MB> \ -e ORACLE_EDITION=<your database edition> \ -e ORACLE_CHARACTERSET=<your character set> \ -v [<host mount point>:]/opt/oracle/oradata \ oracle/database:19.3.0-eeCopy the code

Note: The directory where /opt/oracle/oradata is mounted must be accessible by the user whose UID is 54321 (the UID of the container Oracle). Otherwise, the container cannot create a directory. In practice, the permission of the mount directory is changed to 777. Variables and default values: ORACLE_SID ORCLCDB ORACLE_PDB ORCLPDB1 ORACLE_PWD ORACLE_CHARACTERSET AL32UTF8

docker run -itd \ --name oracle \ -p 1521:1521 \ -e ORACLE_SID=ORCLCDB \ -e ORACLE_PDB=ORCLPDB1 \ -e ORACLE_PWD=123456 \ - e ORACLE_CHARACTERSET = ZHS16GBK \ - e TZ = "Asia/Shanghai \" - v oracledata: / opt/oracle/oradata \ oracle database: 19.3.0 - ee The most simple, without any functional docker run - it - rm - name oracle registry.cn-hangzhou.aliyuncs.com/latelee/database:19.3.0-ee bash overtime the test: Docker run - it - rm - name oracle - e TZ = registry.cn-hangzhou.aliyuncs.com/latelee/database:19.3.0-ee Asia/Shanghai bashCopy the code

In practice, start with docker-compose. The docker-compose. Yml file is as follows:

Version: '2' services: lloracle: image: registry.cn-hangzhou.aliyuncs.com/latelee/database:19.3.0-ee container_name: lloracle shm_size: 4gb restart: always #command: volumes: - ./oracle_data/oradata:/opt/oracle/oradata - ./oracle_data/dbs:/opt/oracle/product/19c/dbhome_1/dbs - ./oracle_data/admin:/opt/oracle/admin environment: - TZ=Asia/Shanghai - ORACLE_SID=ORCLCDB - ORACLE_PDB=ORCLPDB1 - ORACLE_PWD=123456 - ORACLE_CHARACTERSET=ZHS16GBK ports: - 1521:1521 networks: - lloracle-net networks: lloracle-net: driver: bridgeCopy the code

Note 1: INIT_SGA_SIZE and INIT_PGA_SIZE are not set. Note 2: Set the shared content to 2GB (equivalent to the –shm-size parameter of Docker), set the e8 time zone, and map port 1521. Set the character encoding to GBK, not UTF8. Note 3: It takes about half an hour on the VM. Note 4: Create three subdirectories in the docker-compose. Yml directory: oradata, DBS, admin and change the permission to 777.

The validation service

Enter the container:

docker exec -it lloracle bash
Copy the code

Validation:

$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 24 15:34:16 2021 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 Connected to an idle instance. SQL> show PDBS; SQL> select CDB from v$database; # non-cDB CDB -- NOCopy the code

Create table Spaces and users

Create a directory

Go to the container and create a directory

docker exec -it lloracle bash
mkdir /opt/oracle/oradata/MY_DATA
Copy the code

Note: This is to create the 54321 user permission directory. You can also create the directory on the host and run the chown command to change it.

Create table space and user name in Navicat

Use Navicat to connect to Oracle. The connection parameters are: Port: 1521 Service name: ORCLCDB User and password: System /123456

The results are shown in Figure 1:

Click Other, Tablespace, New Tablespace. In default ‘General’ : Name: system01.dbf, size 1, unit G, path: ‘/opt/oracle/oradata/MY_DATA/'(note the last slash). Automatic extension: ON. (Confusion: what does size represent here? What happens if you have more than 1G of data?) Click “Save” and enter the tablespace name: MY_DATA.

Click “User”, “User”, “New User”, enter user name MY_DB (uppercase), password 123456, default tablespace select the tablespace just created. If Member Belongs, select all DBA items. Save.

Connect with a new user

Use navicat to connect to Oracle. This connection parameters are: Port: 1521 Service name: ORCLCDB User and password: MY_DB/123456

The results are shown in Figure 2:

In addition, another tablespace is created, another user name is created, and the MY_DB connection is made, and the tablespace of the other user name is still accessible.

summary

In this paper, non-cdb method is used to run oracle19.3 with docker. After preliminary verification, it can be used normally. As for whether it can be tested for a long time, we will wait for follow-up observation.

results

The completed image of this article is as follows:

Registry.cn-hangzhou.aliyuncs.com/latelee/database:19.3.0-ee # the last version Registry.cn-hangzhou.aliyuncs.com/latelee/database:19.3.0-ee-cdb # last versionCopy the code

Container to explore

Container username: oracle: x: 54321-54321: : / home/oracle: / bin/bash environment variables in the container:  $ env ORACLE_SID=ORCLCDB INSTALL_FILE_1=LINUX.X64_193000_db_home.zip ORACLE_BASE=/opt/oracle CHECK_SPACE_FILE=checkSpace.sh ORACLE_PDB=ORCLPDB1 PWD_FILE=setPassword.sh TZ=Asia/Shanghai SLIMMING=true RUN_FILE=runOracle.sh CREATE_DB_FILE=createDB.sh SHLVL=1 ORACLE_PWD=123456 ORACLE_HOME=/opt/oracle/product/19c/dbhome_1Copy the code

reference

Official warehouse: github.com/oracle/dock… Modified warehouse: github.com/latelee/doc… Installation instructions document download software: www.oracle.com/database/te… Shared memory reference: blog.csdn.net/weisubao/ar… Docker installation Oracle19c (NONCDB) : www.jianshu.com/p/f0139aff1… Oracle Image issue: github.com/oracle/dock…

The attached

Build image part logs:

Removing intermediate container 2bbee773477c ---> f6b8442fcfaa Step 19/22 : USER oracle ---> Running in 85995f303fab Removing intermediate container 85995f303fab ---> 14525605ab30 Step 20/22 : WORKDIR /home/oracle ---> Running in b6c49a7101ee Removing intermediate container b6c49a7101ee ---> d56853fe77c1 Step 21/22: HEALTHCHECK --interval=1m --start-period=5m CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1 ---> Running in 656e69b54359 Removing intermediate container 656e69b54359 ---> c717fbcbc80e Step 22/22 : CMD exec $ORACLE_BASE/$RUN_FILE ---> Running in 730cea346f50 Removing intermediate container 730cea346f50 ---> 492AE2B9DBF8 Successfully built 492AE2B9DBF8 Successfully tagged Oracle/Database :19.3.0-ee Oracle Database Container Image for 'ee' version 19.3.0 is ready to be extended: --> Oracle/Database :19.3.0- EE Build completed in 2288 seconds.Copy the code

Normal startup logs:

# docker-compose up
Starting oracle ... done
Attaching to oracle
oracle    | ORACLE EDITION: ENTERPRISE   # !!! 版本为商业版
oracle    | ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: 123456  # !!! 密码较简单,下面会出现提示
oracle    | 
oracle    | LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 02-MAR-2021 15:42:22
oracle    | 
oracle    | Copyright (c) 1991, 2019, Oracle.  All rights reserved.
oracle    | 
oracle    | Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...
oracle    | 
oracle    | TNSLSNR for Linux: Version 19.0.0.0.0 - Production
oracle    | System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
oracle    | Log messages written to /opt/oracle/diag/tnslsnr/153722b1c570/listener/alert/log.xml
oracle    | Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
oracle    | Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
oracle    | 
oracle    | Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
oracle    | STATUS of the LISTENER
oracle    | ------------------------
oracle    | Alias                     LISTENER
oracle    | Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
oracle    | Start Date                02-MAR-2021 15:42:22
oracle    | Uptime                    0 days 0 hr. 0 min. 0 sec
oracle    | Trace Level               off
oracle    | Security                  ON: Local OS Authentication
oracle    | SNMP                      OFF
oracle    | Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
oracle    | Listener Log File         /opt/oracle/diag/tnslsnr/153722b1c570/listener/alert/log.xml
oracle    | Listening Endpoints Summary...
oracle    |   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
oracle    |   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))  # !!!端口
oracle    | The listener supports no services
oracle    | The command completed successfully
oracle    | [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
oracle    |    CAUSE: 
oracle    | a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
oracle    | b.The password entered is a keyword that Oracle does not recommend to be used as password
oracle    |    ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
oracle    | [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
oracle    |    CAUSE: 
oracle    | a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
oracle    | b.The password entered is a keyword that Oracle does not recommend to be used as password
oracle    |    ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
oracle    | [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
oracle    |    CAUSE: 
oracle    | a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
oracle    | b.The password entered is a keyword that Oracle does not recommend to be used as password
oracle    |    ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
oracle    | Prepare for db operation
oracle    | 8% complete
oracle    | Copying database files
oracle    | 31% complete
oracle    | Creating and starting Oracle instance
oracle    | 32% complete
oracle    | 36% complete
oracle    | 40% complete
oracle    | 43% complete
oracle    | 46% complete
oracle    | Completing Database Creation
oracle    | 51% complete
oracle    | 54% complete
oracle    | Creating Pluggable Databases
oracle    | 58% complete
oracle    | 77% complete
oracle    | Executing Post Configuration Actions
oracle    | 100% complete
oracle    | Database creation complete. For details check the logfiles at:
oracle    |  /opt/oracle/cfgtoollogs/dbca/TOLLPDB.
oracle    | Database Information:
oracle    | Global Database Name:TOLLPDB
oracle    | System Identifier(SID):TOLLPDB
oracle    | Look at the log file "/opt/oracle/cfgtoollogs/dbca/TOLLPDB/TOLLPDB0.log" for further details.
oracle    | 
oracle    | SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 2 16:09:31 2021
oracle    | Version 19.3.0.0.0
oracle    | 
oracle    | Copyright (c) 1982, 2019, Oracle.  All rights reserved.
oracle    | 
oracle    | 
oracle    | Connected to:
oracle    | Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
oracle    | Version 19.3.0.0.0
oracle    | 
oracle    | SQL> 
oracle    | System altered.
oracle    | 
oracle    | SQL> 
oracle    | System altered.
oracle    | 
oracle    | SQL> 
oracle    | Pluggable database altered.
oracle    | 
oracle    | SQL> 
oracle    | PL/SQL procedure successfully completed.
oracle    | 
oracle    | SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
oracle    | Version 19.3.0.0.0
oracle    | The Oracle base remains unchanged with value /opt/oracle
oracle    | #########################
oracle    | DATABASE IS READY TO USE! # !!! 数据库可用
oracle    | #########################
oracle    | The following output is now a tail of the alert.log:
oracle    | MY_DB(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
oracle    | 2021-03-02T16:09:31.874025+08:00
oracle    | ALTER SYSTEM SET control_files='/opt/oracle/oradata/TOLLPDB/control01.ctl' SCOPE=SPFILE;
oracle    | 2021-03-02T16:09:31.898097+08:00
oracle    | ALTER SYSTEM SET local_listener='' SCOPE=BOTH;
oracle    |    ALTER PLUGGABLE DATABASE MY_DB SAVE STATE
oracle    | Completed:    ALTER PLUGGABLE DATABASE MY_DB SAVE STATE
oracle    | 2021-03-02T16:09:33.007808+08:00
oracle    | 
oracle    | XDB initialized.
Copy the code

Log of the second startup after the stop:

Attaching to oracle oracle | ORACLE EDITION: ENTERPRISE oracle | oracle | LSNRCTL for Linux: Version 19.0.0.0.0 16:21:58 oracle - Production on 02 - MAR - 2021 | | oracle Copyright (c) 1991, 2019, Oracle. All rights reserved. oracle | oracle | Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait... oracle | oracle | TNSLSNR for Linux: Version 19.0.0.0.0 - Production oracle | System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora oracle | Log messages written to /opt/oracle/diag/tnslsnr/11585b67b20f/listener/alert/log.xml oracle | Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) oracle | Listening on: (the DESCRIPTION = (ADDRESS = (TCP) PROTOCOL = (HOST = 0.0.0.0) (1521) PORT =)) oracle | | oracle Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) oracle | STATUS of the LISTENER oracle | ------------------------ oracle | Alias LISTENER oracle | Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production oracle | Start Date 02 - MAR - 2021 16:21:58 oracle | Uptime 0 days 0 hr. 0 min. 0 SEC oracle | Trace Level off oracle | Security ON: Local OS Authentication oracle | SNMP OFF oracle | Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora oracle | Listener Log File /opt/oracle/diag/tnslsnr/11585b67b20f/listener/alert/log.xml oracle | Listening Endpoints Summary... oracle | (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) oracle | (The DESCRIPTION = (ADDRESS = (TCP) PROTOCOL = (HOST = 0.0.0.0) (1521) PORT =)) oracle | The listener supports no services oracle | The command completed successfully oracle | oracle | SQL*Plus: Release 19.0.0.0.0 - Production on Tue Mar 2 16:21:58 2021 oracle | Version 19.3.0.0.0 oracle | | oracle Copyright (c) 1982, 2019, Oracle. All rights reserved. oracle | oracle | Connected to an idle instance. oracle | oracle | SQL> ORACLE instance started. oracle | oracle | Total System Global Area 1610609888 bytes oracle | Fixed Size 9135328 bytes oracle | Variable  Size 402653184 bytes oracle | Database Buffers 1191182336 bytes oracle | Redo Buffers 7639040 bytes oracle | Database mounted. oracle | Database opened. oracle | SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production oracle | Version 19.3.0.0.0 oracle | The oracle base remains unchanged with The value/opt/oracle oracle | ######################### oracle | DATABASE IS READY TO USE! oracle | ######################### oracle | The following output is now a tail of the alert.log: oracle | QPI: Qopiprep. Bat file present oracle | T16 2021-03-02:22:33. 798020 + 08:00 oracle | MY_DB (3) : Opening PDB with no Resource Manager plan active oracle | MY_DB(3):joxcsys_required_dirobj_exists: directory object exists with required path /opt/oracle/product/19c/dbhome_1/javavm/admin/, Pid 119 cid 3 oracle | Pluggable database MY_DB the opened read write oracle | T16 2021-03-02: belt. 449498 + 08:00 oracle | Starting background process CJQ0 oracle | T16 2021-03-02: belt. 469509 + 08:00 oracle | CJQ0 started with pid = 54, OS id=303 oracle | Completed: The ALTER DATABASE OPEN oracle | T16 2021-03-02: when. 261727 + 08:00 oracle | =========================================================== oracle | Dumping current patch information oracle | =========================================================== oracle | Patch Id: 29517242 oracle | Patch Description: Oracle Database Release Update: 19.3.0.0.190416 (29517242) | Patch the Apply Time: 2019-04-18T15:21:17+08:00 oracle | Bugs Fixed: 2 14735102196799 3203335 6219554 1258620 1258317 9259606, Oracle | 26476244266135 3268223 3273951 5274350 0276631 2277007 2278629, Oracle | 27957203280497 7280256 7281979 1281102 1282068 1282945 6283327,Copy the code

The oracleData directory has insufficient permissions.

mkdir: cannot create directory '/opt/oracle/oradata/dbconfig': Permission denied oracle | mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/spfileTOLLPDB.ora': No such file or directory oracle | mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/orapwTOLLPDB': No such file or directory oracle | mv: cannot move '/opt/oracle/product/19c/dbhome_1/network/admin/sqlnet.ora' to '/opt/oracle/oradata/dbconfig/TOLLPDB/': No such file or directory oracle | mv: cannot move '/opt/oracle/product/19c/dbhome_1/network/admin/listener.ora' to '/opt/oracle/oradata/dbconfig/TOLLPDB/': No such file or directory oracle | mv: cannot move '/opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora' to '/opt/oracle/oradata/dbconfig/TOLLPDB/': No such file or directory oracle | mv: cannot move '/opt/oracle/product/19c/dbhome_1/install/.docker_enterprise' to '/opt/oracle/oradata/dbconfig/TOLLPDB/': No such file or directory oracle | cp: cannot create regular file '/opt/oracle/oradata/dbconfig/TOLLPDB/': No such file or directory oracle | ln: failed to create symbolic link '/opt/oracle/product/19c/dbhome_1/network/admin/sqlnet.ora': File exists oracle | ln: failed to create symbolic link '/opt/oracle/product/19c/dbhome_1/network/admin/listener.ora': File exists oracle | ln: failed to create symbolic link '/opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora': File exists oracle | cp: cannot stat '/opt/oracle/oradata/dbconfig/TOLLPDB/oratab': No such file or directory oracle | ORACLE_HOME = [/home/oracle] ? ORACLE_BASE environment variable is not being set since this oracle | information is not available for the current user ID . oracle | You can set ORACLE_BASE manually if it is required. oracle | Resetting ORACLE_BASE to its previous value or ORACLE_HOME oracle | The Oracle base remains unchanged with value /opt/oracle oracle | /opt/oracle/checkDBStatus.sh: line 26: sqlplus: command not found oracle | ##################################### oracle | ########### E R R O R ############### oracle |  DATABASE SETUP WAS NOT SUCCESSFUL! oracle | Please check output for further info! oracle | ########### E R R O R ############### oracle | ##################################### oracle | The following output is now a tail of the alert.log:Copy the code

Previous attempts

File records only. File records only. File records only.

To enter the container, connect with the following command:

sqlplus /nolog sqlplus sys/123456@//localhost:1521/tollpdb as sysdba sqlplus system/123456@//localhost:1521/tollpdb Sqlplus pdbadmin/123456@//localhost:1521/MY_DB # select * from all_users;Copy the code

You can log in with Navicat using System /123456 (this should be CBD). However, you cannot log in using MY_DB and sysdba. The reason is unclear.

Check the PDB:

sqlplus sys/123456@//localhost:1521/tollpdb as sysdba

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 MY_DB                          READ WRITE NO
Copy the code

Note: You must log in to The system using sysdba. The message sp2-0382: The SHOW PDBS command is not available is displayed.

Use sysdba login to do some operations:

sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 3 10:11:26 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, All rights reserved. Connected to an idle instance. #!! SQL> Grant sysdba to system; #!!!!! Grant sysdba to system * ERROR at line 1: ORA-01034: ORACLE not available Process ID: 0 Session ID: 0 Serial number: 0 SQL> show pdbs; #!!!!! ERROR: ORA-01034: ORACLE not available Process ID: 0 Session ID: 0 Serial number: 0 SP2-1545: This feature requires Database availability. SQL> startup #!! Ora-01078: Failure in processing system parameters LRM-00109: could not open parameter file '/opt/oracle/product/19c/dbhome_1/dbs/inittollpdb.ora'Copy the code

Copy an inittollpdb.ora file.

Ora-00845: MEMORY_TARGET not supported on this system Shared memory is too small. ORA-01102: cannot mount database in EXCLUSIVE modeCopy the code

Check whether the database is CDB:

select CDB from v$database; If the result is YES, then it is the CDB database, otherwise, it is not. PDB show PDBS; Alter session set container=MY_DB; Alter session set container=CDB$ROOT; -- switch back to the CDB container databaseCopy the code