Oracle管理

Oracle 12C管理操作

时间:2014-11-5 20:53:41  作者:solgle  来源:www.solgle.com  查看:796  评论:0
内容摘要:C:\Users\user>sqlplus sys/********@orcl12c as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 10 10:03:34 2014Copyright (c) 1982, 2...
C:\Users\user>sqlplus sys/********@orcl12c as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 10 10:03:34 2014
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
 
----查看是否为cdb
SQL> select name,log_mode,open_mode,cdb from v$database;
 
NAME      LOG_MODE     OPEN_MODE            CDB
--------- ------------ -------------------- ---
ORCL12C   NOARCHIVELOG READ WRITE           YES
 
----查看容器数据库中的pdb
SQL> col pdb_name for a30
SQL> select pdb_id,pdb_name,dbid,status from dba_pdbs;
 
    PDB_ID PDB_NAME                             DBID STATUS
---------- ------------------------------ ---------- ---------
         3 PDBORCL12C                      608991716 NORMAL
         2 PDB$SEED                       3162799770 NORMAL
         
SQL> select con_id,dbid,name,open_mode from v$pdbs;
 
    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 3162799770 PDB$SEED                       READ ONLY
         3  608991716 PDBORCL12C                     mounted
 
SQL>         
         
SQL> alter pluggable database pdborcl12c open;
 
Operation 227 succeeded.
 
SQL> select con_id,dbid,name,open_mode from v$pdbs;
 
    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 3162799770 PDB$SEED                       READ ONLY
         3  608991716 PDBORCL12C                     READ WRITE
 
SQL> col name for a60
SQL> select file#,name from v$datafile;
 
     FILE# NAME
---------- ------------------------------------------------------------
         1 /u01/data/ORCL12C/datafile/o1_mf_system_b8dvrplg_.dbf
         3 /u01/data/ORCL12C/datafile/o1_mf_sysaux_b8dvp18p_.dbf
         4 /u01/data/ORCL12C/datafile/o1_mf_undotbs1_b8dvvf5y_.dbf
         5 /u01/data/ORCL12C/datafile/o1_mf_system_b8dvwov9_.dbf
         6 /u01/data/ORCL12C/datafile/o1_mf_users_b8dvvcxr_.dbf
         7 /u01/data/ORCL12C/datafile/o1_mf_sysaux_b8dvwov6_.dbf
         8 /u01/data/ORCL12C/09C17C4D35A85EF3E055000000000001/datafile/
           o1_mf_system_b8dwkrx6_.dbf
         9 /u01/data/ORCL12C/09C17C4D35A85EF3E055000000000001/datafile/
           o1_mf_sysaux_b8dwkrxw_.dbf
        10 /u01/data/ORCL12C/09C17C4D35A85EF3E055000000000001/datafile/
           o1_mf_users_b8dwlg4x_.dbf
 
9 rows selected.
 
SQL>
 
 
-------连接到pdb数据库
C:\Users\user>sqlplus sys/********@pdborcl12c as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 10 16:38:35 2014
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
 
SQL> select name from v$pdbs;
 
NAME
------------------------------
PDBORCL12C
 
SQL>
 
 
-----连接到cdb
 
C:\Users\user>sqlplus sys/********@orcl12c as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 10 16:40:37 2014
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
 
SQL> select name from v$pdbs;
 
NAME
------------------------------
PDB$SEED
PDBORCL12C
 
SQL>
 
-----查看监听配置详情
[oracle@oel6 admin]$ cat listener.ora 
# listener.ora Network Configuration File: /u01/app/product/12.1.0/dbname_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
 
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl12c)
      (ORACLE_HOME = /u01/app/product/12.1.0/dbname_1)
      (SID_NAME = orcl12c)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = pdborcl12c)
      (ORACLE_HOME = /u01/app/product/12.1.0/dbname_1)
      (SID_NAME = orcl12c)
    )
  )
 
LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.18.145)(PORT = 1521))
  )
 
ADR_BASE_LISTENER = /u01/app
 
[oracle@oel6 admin]$ cat tnsnames.ora 
# tnsnames.ora Network Configuration File: /u01/app/product/12.1.0/dbname_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
 
ORCL12C =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.18.145)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl12c)
    )
  )
 
 
pdborcl12c =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.18.145)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SID=guard6)
      (SERVICE_NAME = pdborcl12c)
    )
  )
 
-----从cdb切换到pdb
SQL> alter session set container=pdborcl12c;
 
Session altered.
 
SQL> select name from v$pdbs;
 
NAME
------------------------------
PDBORCL12C
 
SQL>
 
 
--------------------------------------------------------------------------------------------
---开启inmemory
SQL> col value for a20
SQL> col name for a40
SQL> select name,value from v$parameter where name like '%inm%';
NAME                                     VALUE
---------------------------------------- --------------------
inmemory_size                            0
inmemory_clause_default
inmemory_force                           DEFAULT
inmemory_query                           ENABLE
inmemory_max_populate_servers            0
inmemory_trickle_repopulate_servers_perc 1
ent
optimizer_inmemory_aware                 TRUE
 
7 rows selected.
 
SQL>
SQL> show sga
 
Total System Global Area 1694498816 bytes
Fixed Size                  2925168 bytes
Variable Size             452988304 bytes
Database Buffers         1224736768 bytes
Redo Buffers               13848576 bytes
SQL>
 
---设置in内存大小
SQL> alter system set inmemory_size=600m scope=spfile;
System altered.
SQL>
 
----设置加载到内存的进程数量 
SQL> alter system set inmemory_max_populate_servers=2 scope=both;
System altered.
SQL>
 
 
SQL> startup
ORACLE instance started.
 
Total System Global Area 1694498816 bytes
Fixed Size                  2925168 bytes
Variable Size             503319952 bytes
Database Buffers          536870912 bytes
Redo Buffers               13848576 bytes
In-Memory Area            637534208 bytes
Database mounted.
Database opened.
SQL>

 
标签:Oracle 12C管理操作 

solgle.com 版权所有,欢迎分享!!!

相关评论
   Copyright © 2013-2020 solgle.com,All rights reserved.[solgle.com] 公安机关备案号:51010802000219
Email:solgle@solgle.com; weixin:cd1008610000 ICP:蜀ICP备14011070号-1