ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle 12C数据库操作记录

oracle 12C数据库操作记录

原创 Linux操作系统 作者:huanglg 时间:2013-07-12 11:27:27 0 删除 编辑

Connecting to 192.168.211.128:22...
Connection established.
Escape character is '^@]'.

Last login: Fri Jul 12 09:19:10 2013 from 192.168.211.1
[root@hlg ~]# su - oracle
[oracle@hlg ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 12-JUL-2013 09:28:26

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hlg)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                12-JUL-2013 09:14:11
Uptime                    0 days 0 hr. 14 min. 19 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /12c/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File         /12c/diag/tnslsnr/hlg/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hlg)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ora12c" has 1 instance(s).
  Instance "ora12c", status READY, has 1 handler(s) for this service...
Service "ora12cXDB" has 1 instance(s).
  Instance "ora12c", status READY, has 1 handler(s) for this service...
Service "pdb01" has 1 instance(s).
  Instance "ora12c", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@hlg ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Fri Jul 12 10:30:55 2013

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> alter pluggable database pdb01 close;

Pluggable database altered.

SQL> alter pluggable database pdb01 open;     

Pluggable database altered.

SQL> alter pluggable database pdb01 close immediate;

Pluggable database altered.

SQL> alter session set container=pdb01;

Session altered.

SQL> show conn_name;
SP2-0158: unknown SHOW option "conn_name"
SQL> show con_name;

CON_NAME
------------------------------
PDB01
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@hlg ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 12-JUL-2013 11:07:51

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hlg)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                12-JUL-2013 09:14:11
Uptime                    0 days 1 hr. 53 min. 44 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /12c/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File         /12c/diag/tnslsnr/hlg/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hlg)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ora12c" has 1 instance(s).
  Instance "ora12c", status READY, has 1 handler(s) for this service...
Service "ora12cXDB" has 1 instance(s).
  Instance "ora12c", status READY, has 1 handler(s) for this service...
Service "pdb01" has 1 instance(s).
  Instance "ora12c", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@hlg ~]$ sqlplus sys/dragon@pdb01 as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Fri Jul 12 11:08:05 2013

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

^CERROR:
ORA-12170: TNS:Connect timeout occurred


[oracle@hlg ~]$ vi /12c/product/12.1.0/db_1/network/admin/tnsnames.ora 
[oracle@hlg ~]$ sqlplus sys/dragon@pdb01 as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Fri Jul 12 11:17:56 2013

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name;

CON_NAME
------------------------------
PDB01
SQL>    

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/726309/viewspace-766121/,如需转载,请注明出处,否则将追究法律责任。

上一篇: oracle 12C相关信息
请登录后发表评论 登录
全部评论

注册时间:2008-09-27

  • 博文量
    19
  • 访问量
    68979