登录到oracle db12.2dockercontainer中的几种方法介绍
程序员文章站
2022-05-07 16:39:08
第一个ssh
[root@oradbdocker oradata]# docker container ls
container id image...
第一个ssh
[root@oradbdocker oradata]# docker container ls container id image command created status ports names 976bf80d98e3 oracle/database:12.2.0.1-ee "/bin/sh -c 'exec ..." 11 minutes ago up 11 minutes (healthy) 0.0.0.0:1521->1521/tcp, 5500/tcp oracle7 [root@oradbdocker oradata]#
第二个ssh:
[root@oradbdocker ~]# docker exec -ti 976bf80d98e3 /bin/bash [oracle@976bf80d98e3 ~]$ sqlplus / as sysdba sql*plus: release 12.2.0.1.0 production on sun apr 8 09:02:16 2018 copyright (c) 1982, 2016, oracle. all rights reserved. error: ora-12162: tns:net service name is incorrectly specified enter user-name: ^c^c^c [oracle@976bf80d98e3 ~]$ [oracle@976bf80d98e3 ~]$ [oracle@976bf80d98e3 ~]$ ps -ef | grep ora_ oracle 2265 1 0 08:56 ? 00:00:00 ora_pmon_orclcdb oracle 2267 1 0 08:56 ? 00:00:00 ora_clmn_orclcdb oracle 2269 1 0 08:56 ? 00:00:00 ora_psp0_orclcdb oracle 2271 1 0 08:56 ? 00:00:00 ora_vktm_orclcdb oracle 2275 1 0 08:56 ? 00:00:00 ora_gen0_orclcdb oracle 2277 1 0 08:56 ? 00:00:00 ora_mman_orclcdb oracle 2281 1 0 08:56 ? 00:00:00 ora_gen1_orclcdb oracle 2285 1 0 08:56 ? 00:00:00 ora_diag_orclcdb oracle 2287 1 0 08:56 ? 00:00:00 ora_ofsd_orclcdb oracle 2291 1 0 08:56 ? 00:00:00 ora_dbrm_orclcdb oracle 2293 1 0 08:56 ? 00:00:00 ora_vkrm_orclcdb oracle 2295 1 0 08:56 ? 00:00:00 ora_svcb_orclcdb oracle 2297 1 0 08:56 ? 00:00:00 ora_pman_orclcdb oracle 2299 1 0 08:56 ? 00:00:00 ora_dia0_orclcdb oracle 2301 1 0 08:56 ? 00:00:00 ora_dbw0_orclcdb oracle 2303 1 0 08:56 ? 00:00:00 ora_lgwr_orclcdb oracle 2305 1 0 08:56 ? 00:00:00 ora_ckpt_orclcdb oracle 2307 1 0 08:56 ? 00:00:00 ora_lg00_orclcdb oracle 2309 1 0 08:56 ? 00:00:00 ora_smon_orclcdb oracle 2311 1 0 08:56 ? 00:00:00 ora_lg01_orclcdb oracle 2313 1 0 08:56 ? 00:00:00 ora_smco_orclcdb oracle 2315 1 0 08:56 ? 00:00:00 ora_reco_orclcdb oracle 2317 1 0 08:56 ? 00:00:00 ora_w000_orclcdb oracle 2319 1 0 08:56 ? 00:00:00 ora_lreg_orclcdb oracle 2321 1 0 08:56 ? 00:00:00 ora_w001_orclcdb oracle 2323 1 0 08:56 ? 00:00:00 ora_pxmn_orclcdb oracle 2327 1 0 08:56 ? 00:00:01 ora_mmon_orclcdb oracle 2329 1 0 08:56 ? 00:00:00 ora_mmnl_orclcdb oracle 2331 1 0 08:56 ? 00:00:00 ora_d000_orclcdb oracle 2333 1 0 08:56 ? 00:00:00 ora_s000_orclcdb oracle 2335 1 0 08:56 ? 00:00:00 ora_tmon_orclcdb oracle 2345 1 0 08:56 ? 00:00:00 ora_tt00_orclcdb oracle 2347 1 0 08:56 ? 00:00:00 ora_tt01_orclcdb oracle 2349 1 0 08:56 ? 00:00:00 ora_tt02_orclcdb oracle 2351 1 0 08:56 ? 00:00:00 ora_aqpc_orclcdb oracle 2355 1 0 08:56 ? 00:00:00 ora_p000_orclcdb oracle 2357 1 0 08:56 ? 00:00:00 ora_p001_orclcdb oracle 2359 1 0 08:56 ? 00:00:00 ora_p002_orclcdb oracle 2361 1 0 08:56 ? 00:00:00 ora_p003_orclcdb oracle 2363 1 0 08:56 ? 00:00:00 ora_p004_orclcdb oracle 2365 1 0 08:56 ? 00:00:00 ora_p005_orclcdb oracle 2367 1 0 08:56 ? 00:00:00 ora_p006_orclcdb oracle 2369 1 0 08:56 ? 00:00:00 ora_p007_orclcdb oracle 2371 1 0 08:56 ? 00:00:00 ora_p008_orclcdb oracle 2373 1 0 08:56 ? 00:00:00 ora_p009_orclcdb oracle 2375 1 0 08:56 ? 00:00:00 ora_p00a_orclcdb oracle 2377 1 0 08:56 ? 00:00:00 ora_p00b_orclcdb oracle 2379 1 0 08:56 ? 00:00:00 ora_p00c_orclcdb oracle 2381 1 0 08:56 ? 00:00:00 ora_p00d_orclcdb oracle 2383 1 0 08:56 ? 00:00:00 ora_p00e_orclcdb oracle 2385 1 0 08:56 ? 00:00:00 ora_p00f_orclcdb oracle 2390 1 0 08:56 ? 00:00:02 ora_cjq0_orclcdb oracle 2591 1 0 08:56 ? 00:00:00 ora_p00g_orclcdb oracle 2593 1 0 08:56 ? 00:00:00 ora_p00h_orclcdb oracle 2595 1 0 08:56 ? 00:00:00 ora_p00i_orclcdb oracle 2599 1 0 08:56 ? 00:00:00 ora_qm02_orclcdb oracle 2603 1 0 08:56 ? 00:00:00 ora_q002_orclcdb oracle 2605 1 0 08:56 ? 00:00:00 ora_q003_orclcdb oracle 2660 1 0 08:57 ? 00:00:00 ora_q004_orclcdb oracle 2723 1 0 08:57 ? 00:00:00 ora_w002_orclcdb oracle 2906 1 0 09:01 ? 00:00:00 ora_p00j_orclcdb oracle 2974 2921 0 09:02 pts/0 00:00:00 grep --color=auto ora_ [oracle@976bf80d98e3 ~]$ export oracle_sid=orclcdb [oracle@976bf80d98e3 ~]$ sqlplus / as sysdba sql*plus: release 12.2.0.1.0 production on sun apr 8 09:03:22 2018 copyright (c) 1982, 2016, oracle. all rights reserved. connected to: oracle database 12c enterprise edition release 12.2.0.1.0 - 64bit production sql> dewc dba_data_files; sp2-0734: unknown command beginning "dewc dba_d..." - rest of line ignored. sql> desc dba_data_files; name null? type ----------------------------------------- -------- ---------------------------- file_name varchar2(513) file_id number tablespace_name varchar2(30) bytes number blocks number status varchar2(9) relative_fno number autoextensible varchar2(3) maxbytes number maxblocks number increment_by number user_bytes number user_blocks number online_status varchar2(7) lost_write_protect varchar2(7) sql> select file_name from dba_data_files; file_name -------------------------------------------------------------------------------- /opt/oracle/oradata/orclcdb/system01.dbf /opt/oracle/oradata/orclcdb/sysaux01.dbf /opt/oracle/oradata/orclcdb/undotbs01.dbf /opt/oracle/oradata/orclcdb/users01.dbf sql>
下一篇: 一个程序员高效提升黄金时间的做法