# 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.
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:
曾经的尝试
仅备档记录。 仅备档记录。 仅备档记录。
进入容器,可用如下命令连接:
1 2 3 4 5 6 7 8
sqlplus /nolog
sqlplus sys/123456@//localhost:1521/tollpdb as sysdba sqlplus system/123456@//localhost:1521/tollpdb sqlplus pdbadmin/123456@//localhost:1521/MY_DB # 注:修改密码,会登录失败,说明已经生效,但用navicat登录不了。
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, Oracle. 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'
拷贝一个inittollpdb.ora文件。
1 2 3 4 5 6
ORA-00845: MEMORY_TARGET not supported on this system 共享内存太小了
默认的init.ora中:memory_target=1G。
ORA-01102: cannot mount database in EXCLUSIVE mode
查看数据库是否为 CDB:
1 2 3 4 5
select CDB from v$database; -- 如果得到的结果为YES,那么就是CDB的数据库,否则,则不是。 切入要操作的pdb show pdbs; -- 展示pdb数据库集合 alter session set container=MY_DB; -- 切入到PDB 数据库 alter session set container=CDB$ROOT; -- 切回到CDB 容器数据库