orcale

# docker 启动oracle_11g ```bash docker run -d -it --name oracle-db \ -p 1521:1521 \ -e ORACLE_SID=helowin \ -e ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 \ registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g docker exec -it oracle-db /bin/bash #su - root #Password: helowin export PATH=$ORACLE_HOME/bin:$PATH sqlplus /nolog #sqlplus /nolog 是启动 SQLPlus 工具的一种方式,其中 /nolog 是一个选项参数,表示启动 SQLPlus 时不要尝试使用数据库账户连接到数据库实例,而是以未认证状态启动 SQL*Plus。 #在这种模式下,SQLPlus 会启动但不会自动连接到数据库,也不会提示输入用户名和密码。相反,你需要手动使用 SQLPlus 的连接命令连接到数据库,例如使用 CONNECT 命令来提供用户名和密码。 #这种方式通常用于在启动 SQL*Plus 之后,手动连接到数据库,或者在不想在启动时立即连接到数据库的情况下使用。 #使用 SYSDBA 角色登录,该角色具有最高级别的数据库权限 SQL> CONNECT / AS SYSDBA; Connected. # 修改密码为"oracle" 修改sys、system用户密码并刷新权限 SQL> alter user system identified by oracle; User altered. SQL> alter user sys identified by oracle; User altered. SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; Profile altered. SQL> exit ``` # 查看oracle实例状态 ``` [oracle@9452cc215a1f /]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-MAY-2024 14:09:40 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 24-MAY-2024 13:49:09 Uptime 0 days 0 hr. 20 min. 32 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora Listener Log File /home/oracle/app/oracle/diag/tnslsnr/9452cc215a1f/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=9452cc215a1f)(PORT=1521))) Services Summary... Service "helowin" has 1 instance(s). Instance "helowin", status READY, has 1 handler(s) for this service... Service "helowinXDB" has 1 instance(s). Instance "helowin", status READY, has 1 handler(s) for this service... The command completed successfully ``` # 用nacivat连接oracle数据库 服务名:helowin(一定要填写helowin) 密码:oracle ![image.png](https://cos.easydoc.net/97954506/files/lwkah58t.png)