Friday, July 19, 2013

DB12c - PGA_AGGREGATE_LIMIT

On Oracle Database 12c features, PGA_AGGREGATE_LIMIT initialization parameter is value, that limits PGA memory usage. If  total PGA memory usage is over PGA_AGGREGATE_LIMIT value. The sessions or processes that are consuming the most untunable PGA memory will be terminated.
SQL> show parameter PGA_AGGREGATE_LIMIT
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_limit                  big integer 2G (default)
As my test today, I ran SQL for parallel and got ora error message. 
ORA-03113: end-of-file on communication channel
Process ID: 6825
Session ID: 30 Serial number: 447
After getting message, I checked in alert log and knew my session used PGA over 2G.
--- In alert log file ---
Fri Jul 19 12:41:31 2013
PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT of 2048 MB
Immediate Kill Session#: 30, Serial#: 447
Immediate Kill Session: sess: 0xc13a6650  OS pid: 6825
However, It still showed some messages.
Fri Jul 19 12:42:02 2013
PGA_AGGREGATE_LIMIT has been exceeded but some processes using the most PGA
memory are not eligible to receive ORA-4036 interrupts.  Further occurrences
of this condition will be written to the trace file of the CKPT process.

Fri Jul 19 12:43:31 2013
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_cjq0_2844.trc  (incident=108284):
ORA-00445: background process "J001" did not start after 120 seconds
Incident details in: /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_108284/orcl_cjq0_2844_i108284.trc
Fri Jul 19 12:44:08 2013
Dumping diagnostic data in directory=[cdmp_20130719124407], requested by (instance=1, osid=2844 (CJQ0)), summary=[incident=108284].
Fri Jul 19 12:44:14 2013
Active Session History (ASH) performed an emergency flush. This may mean that ASH is undersized. If emergency flushes are a recurring issue, you may consider increasing
 ASH size by setting the value of _ASH_SIZE to a sufficiently large value. Currently, ASH size is 4194304 bytes. Both ASH size and the total number of emergency flushes
 since instance startup can be monitored by running the following query:
 select total_size,awr_flush_emergency_count from v$ash_info;
Fri Jul 19 12:44:16 2013
kkjcre1p: unable to spawn jobq slave process
Fri Jul 19 12:44:16 2013
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_cjq0_2844.trc:
Fri Jul 19 12:44:21 2013
Sweep [inc][108284]: completed
Sweep [inc2][108284]: completed
What was it? job queue processes was not started, because PGA memory usage was still over the PGA_AGGREGATE_LIMIT.
  • Calls for sessions that are consuming the most untunable PGA memory are aborted.
  • If PGA memory usage is still over the PGA_AGGREGATE_LIMIT, then the sessions and processes that are consuming the most untunable PGA memory are terminated.
I checked more on Document, SYS processes and background processes other than job queue processes will not be subjected to any of the actions described in this section. Instead, if they are using the most untunable memory, they will periodically write a brief summary of their PGA usage to a trace file.

For example, When PGA memory usage was over the PGA_AGGREGATE_LIMIT, my session was aborted.... then PGA memory usage was still over the PGA_AGGREGATE_LIMIT. So, background process "J001" did not start. If checked in orcl_cjq0_2844.trc file.
*** 2013-07-19 12:41:38.079
Process diagnostic dump for J001, OS id=6978
-------------------------------------------------------------------------------
*** 2013-07-19 12:41:39.596
os thread scheduling delay history: (sampling every 1.000000 secs)
  0.000000 secs at [ 12:41:38 ]
    NOTE: scheduling delay has not been sampled for 0.928008 secs
  0.000000 secs from [ 12:41:34 - 12:41:39 ], 5 sec avg
  0.000421 secs from [ 12:40:40 - 12:41:39 ], 1 min avg
*** 2013-07-19 12:41:40.218
  0.000083 secs from [ 12:36:41 - 12:41:40 ], 5 min avg
*** 2013-07-19 12:41:56.748
loadavg : 71.63 31.79 12.51
Memory (Avail / Total) = 100.71M / 3960.24M
Swap (Avail / Total) = 1817.50M /  2960.00M
skgpgcmdout: read() for cmd /bin/ps -elf | /bin/egrep 'PID | 6978' | /bin/grep -v grep timed out after 13.980 seconds
*** 2013-07-19 12:42:12.393
Stack:
skgpgcmdout: read() for cmd /usr/bin/gdb --batch -quiet -x /tmp/stack6jjrbG /proc/6978/exe 6978 < /dev/null 2>&1 timed out after 11.430 seconds
I think this parameter, DBAs should learn about it. When they use Oracle 12c database and user sessions are terminated. DBAs should have the good answer for them. However, It might affect other sessions, even through session that consumed the most untunable PGA memory was terminated. If the total PGA memory usage is still over the limit.

Read More:
http://docs.oracle.com/cd/E16655_01/server.121/e17615/refrn10328.htm
http://docs.oracle.com/cd/E16655_01/server.121/e15857/tune_pga.htm#TGDBA95346

Thursday, July 18, 2013

DB12c - update java to version 7

Why I used topic like that? I just wanted to post how to update java on Oracle Database 12c from version 6 to version 7. This is simple topic for some people, but it was something new for me today. As we know, Oracle 12c database default java version is 6.
Why do we have to update Java to version 7? Actually, It depends on what application java you write and load into Oracle Database. Unfortunately, it's a bad thing for existing database, you must shutdown database before!!!
SQL> select dbms_java.get_jdk_version() from dual;
DBMS_JAVA.GET_JDK_VERSION()
--------------------------------------------------------------------------------
1.6
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
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@linux01 ~]$
[oracle@linux01 ~]$
[oracle@linux01 ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/perl/bin/perl  $ORACLE_HOME/javavm/install/update_javavm_binaries.pl 1.7
Invalid version 1.7 ... Valid options are: 6 7
[oracle@linux01 ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/perl/bin/perl  $ORACLE_HOME/javavm/install/update_javavm_binaries.pl 7
[oracle@linux01 ~]$
[oracle@linux01 ~]$
[oracle@linux01 ~]$
[oracle@linux01 ~]$ cd $ORACLE_HOME/rdbms/lib
[oracle@linux01 lib]$ ls -l ins_rdbms.mk
-rw-r--r--. 1 oracle oinstall 43646 Apr 29 09:07 ins_rdbms.mk 
[oracle@linux01 lib]$ make -f ins_rdbms.mk ioracle
chmod 755 /u01/app/oracle/product/12.1.0/dbhome_1/bin
 - Linking Oracle
rm -f /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/oracle
/u01/app/oracle/product/12.1.0/dbhome_1/bin/orald  -o /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/oracle -m64 -z noexecstack -Wl,--disable-new-dtags -L/u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/ -L/u01/app/oracle/product/12.1.0/dbhome_1/lib/ -L/u01/app/oracle/product/12.1.0/dbhome_1/lib/stubs/   -Wl,-E /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/opimai.o /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/ssoraed.o /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/ttcsoi.o -Wl,--whole-archive -lperfsrv12 -Wl,--no-whole-archive /u01/app/oracle/product/12.1.0/dbhome_1/lib/nautab.o /u01/app/oracle/product/12.1.0/dbhome_1/lib/naeet.o /u01/app/oracle/product/12.1.0/dbhome_1/lib/naect.o /u01/app/oracle/product/12.1.0/dbhome_1/lib/naedhs.o /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/config.o  -lserver12 -lodm12 -lcell12 -lnnet12 -lskgxp12 -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 -lclient12  -lvsn12 -lcommon12 -lgeneric12 -lknlopt `if /usr/bin/ar tv /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/libknlopt.a | grep xsyeolap.o > /dev/null 2>&1 ; then echo "-loraolap12" ; fi` -lskjcx12 -lslax12 -lpls12  -lrt -lplp12 -lserver12 -lclient12  -lvsn12 -lcommon12 -lgeneric12 `if [ -f /u01/app/oracle/product/12.1.0/dbhome_1/lib/libavserver12.a ] ; then echo "-lavserver12" ; else echo "-lavstub12"; fi` `if [ -f /u01/app/oracle/product/12.1.0/dbhome_1/lib/libavclient12.a ] ; then echo "-lavclient12" ; fi` -lknlopt -lslax12 -lpls12  -lrt -lplp12 -ljavavm12 -lserver12  -lwwg  `cat /u01/app/oracle/product/12.1.0/dbhome_1/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lnro12 `cat /u01/app/oracle/product/12.1.0/dbhome_1/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lnnzst12 -lzt12 -lztkg12 -lmm -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 -lztkg12 `cat /u01/app/oracle/product/12.1.0/dbhome_1/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lnro12 `cat /u01/app/oracle/product/12.1.0/dbhome_1/lib/ldflags`    -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lnnzst12 -lzt12 -lztkg12   -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 `if /usr/bin/ar tv /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/libknlopt.a | grep "kxmnsd.o" > /dev/null 2>&1 ; then echo " " ; else echo "-lordsdo12"; fi` -L/u01/app/oracle/product/12.1.0/dbhome_1/ctx/lib/ -lctxc12 -lctx12 -lzx12 -lgx12 -lctx12 -lzx12 -lgx12 -lordimt12 -lclsra12 -ldbcfg12 -lhasgen12 -lskgxn2 -lnnzst12 -lzt12 -lxml12 -locr12 -locrb12 -locrutl12 -lhasgen12 -lskgxn2 -lnnzst12 -lzt12 -lxml12  -lgeneric12 -loraz -llzopro -lorabz2 -lipp_z -lipp_bz2 -lippdcemerged -lippsemerged -lippdcmerged  -lippsmerged -lippcore  -lippcpemerged -lippcpmerged  -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 -lsnls12 -lunls12  -lsnls12 -lnls12  -lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 -lasmclnt12 -lcommon12 -lcore12  -laio -lons    `cat /u01/app/oracle/product/12.1.0/dbhome_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/12.1.0/dbhome_1/lib -lm    `cat /u01/app/oracle/product/12.1.0/dbhome_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/12.1.0/dbhome_1/lib
test ! -f /u01/app/oracle/product/12.1.0/dbhome_1/bin/oracle ||\
           mv -f /u01/app/oracle/product/12.1.0/dbhome_1/bin/oracle /u01/app/oracle/product/12.1.0/dbhome_1/bin/oracleO
mv /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/lib/oracle /u01/app/oracle/product/12.1.0/dbhome_1/bin/oracle
chmod 6751 /u01/app/oracle/product/12.1.0/dbhome_1/bin/oracle
[oracle@linux01 lib]$
-- Make sure You startup database from Oracle Home, that uses version 7 -- 
[oracle@linux01 ~]$ sqlplus  / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Thu Jul 18 21:13:56 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup 
ORACLE instance started.
Total System Global Area 1636814848 bytes
Fixed Size                  2288904 bytes
Variable Size            1040188152 bytes
Database Buffers          587202560 bytes
Redo Buffers                7135232 bytes
Database mounted.
Database opened.
SQL>
SQL> @?/javavm/install/update_javavm_db.sql
SQL> SET FEEDBACK 1
SQL> SET NUMWIDTH 10
SQL> SET LINESIZE 80
SQL> SET TRIMSPOOL ON
SQL> SET TAB OFF
SQL> SET PAGESIZE 100
SQL>
SQL> -- If Java is installed, do CJS.
SQL>
SQL> -- If CJS can deal with the SROs inconsistent with the new JDK,
SQL> -- the drop_sros() call here can be removed.
SQL> call initjvmaux.drop_sros();
Call completed.
SQL>
SQL> create or replace java system;
  2  /
Java created.
SQL>
SQL> update dependency$
  2    set p_timestamp=(select stime from obj$ where obj#=p_obj#)
  3    where (select stime from obj$ where obj#=p_obj#)!=p_timestamp and
  4          (select type# from obj$ where obj#=p_obj#)=29  and
  5          (select owner# from obj$ where obj#=p_obj#)=0;
0 rows updated.
SQL>
SQL> select dbms_java.get_jdk_version() from dual;
DBMS_JAVA.GET_JDK_VERSION()
--------------------------------------------------------------------------------
1.7
1 row selected.

Monday, July 15, 2013

Learn Multitenant - CREATE DATABASE... blah blah

It's time to learn a little bit about Oracle Database 12c. Today, I chose to learn "Creating and Configuring a CDB" and pointed at "CREATE DATABASE" for creating CDB.
First of all, I learned I must set compatible ='12.0.0' and "ENABLE_PLUGGABLE_DATABASE=TRUE" for initialization parameters.
[oracle@test12c ~]$ echo $ORACLE_SID
newcdb
[oracle@test12c ~]$ vi /u01/app/oracle/product/12.1.0/dbhome_1/dbs/initnewcdb.ora
[oracle@test12c ~]$ cat  /u01/app/oracle/product/12.1.0/dbhome_1/dbs/initnewcdb.ora
db_name='newcdb'
memory_target=1G
processes = 300
audit_file_dest='/u01/app/oracle/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
db_recovery_file_dest_size=4G
dispatchers='(PROTOCOL=TCP) (SERVICE=NEWCDBXDB)'
open_cursors=1000
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = ('/u01/app/oracle/oradata/newcdb/ora_control1.ctl','/u01/app/oracle/oradata/newcdb/ora_control2.ctl')
compatible ='12.0.0'
ENABLE_PLUGGABLE_DATABASE=TRUE
[oracle@test12c ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Mon Jul 15 14:56:45 2013

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

Connected to an idle instance.

SQL> create spfile from pfile;

File created.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2296576 bytes
Variable Size             713032960 bytes
Database Buffers          348127232 bytes
Redo Buffers                5480448 bytes
SQL> show parameter control_file

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      /u01/app/oracle/oradata/newcdb
                                                 /ora_control1.ctl, /u01/app/or
                                                 acle/oradata/newcdb/ora_contro
                                                l2.ctl
Then, I learned "CREATE DATABASE ... ENABLE PLUGGABLE DATABASE ...".
Note: I used example from Oracle Document.
SQL> -- Make sure for /u01/app/oracle/admin/orcl/adump, /u01/app/oracle/oradata/newcdb and /u01/app/oracle/oradata/newcdb/pdbseed folders --                                            
SQL> CREATE DATABASE newcdb
  USER SYS IDENTIFIED BY password
  USER SYSTEM IDENTIFIED BY password
  LOGFILE GROUP 1 ('/u01/app/oracle/oradata/newcdb/redo01a.log')
             SIZE 50M BLOCKSIZE 512,
          GROUP 2 ('/u01/app/oracle/oradata/newcdb/redo02a.log')
             SIZE 50M BLOCKSIZE 512,
          GROUP 3 ('/u01/app/oracle/oradata/newcdb/redo03a.log')
             SIZE 50M BLOCKSIZE 512
      MAXLOGHISTORY 1
      MAXLOGFILES 16
      MAXLOGMEMBERS 3
      MAXDATAFILES 1024
      CHARACTER SET AL32UTF8
      NATIONAL CHARACTER SET AL16UTF16
      EXTENT MANAGEMENT LOCAL
      DATAFILE '/u01/app/oracle/oradata/newcdb/system01.dbf'
        SIZE 700M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
      SYSAUX DATAFILE '/u01/app/oracle/oradata/newcdb/sysaux01.dbf'
        SIZE 550M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
      DEFAULT TABLESPACE deftbs
         DATAFILE '/u01/app/oracle/oradata/newcdb/deftbs01.dbf'
         SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
      DEFAULT TEMPORARY TABLESPACE tempts1
         TEMPFILE '/u01/app/oracle/oradata/newcdb/temp01.dbf'
         SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
      UNDO TABLESPACE undotbs1
         DATAFILE '/u01/app/oracle/oradata/newcdb/undotbs01.dbf'
         SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
      ENABLE PLUGGABLE DATABASE
        SEED
        FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/newcdb/',
                             '/u01/app/oracle/oradata/newcdb/pdbseed/')
        SYSTEM DATAFILES SIZE 125M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
        SYSAUX DATAFILES SIZE 100M
  USER_DATA TABLESPACE usertbs
    DATAFILE '/u01/app/oracle/oradata/newcdb/pdbseed/usertbs01.dbf'
    SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
/
 Database created.
In document, I had to perform by "catcdb.sql" script.
SQL> @?/rdbms/admin/catcdb.sql
SP2-0310: unable to open file "/u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/catcdb.sql"
SQL> !ls -la /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/catcdb.sql
ls: cannot access /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/catcdb.sql: No such file or director
There has not had "catcdb.sql" script in /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin path.  Oops!
I read on Oracle document again. 
1) Creating the Data Dictionary.
http://docs.oracle.com/cd/E16655_01/server.121/e17615/scripts001.htm
http://docs.oracle.com/cd/E16655_01/server.121/e17636/create.htm#ADMIN11085
catalog.sql    Creates the views of the data dictionary tables, the dynamic performance views, and public synonyms for many of the views. Grants PUBLIC access to the synonyms. (SYSDBA)
catproc.sql    Runs all scripts required for or used with PL/SQL. (SYSDBA)
pupbld.sql    Required for SQL*Plus. Enables SQL*Plus to disable commands by user. (SYSTEM)

2) Running Oracle-Supplied SQL Scripts in a CDB.
http://docs.oracle.com/cd/E16655_01/server.121/e17636/cdb_admin.htm#ADMIN14072
So, I used "catcon.pl" script to perform sql scripts for Multitenant container database.
[oracle@test12c ~]$ cd /u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin/
[oracle@test12c admin]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_1/rdbms/admin
[oracle@test12c admin]$ perl catcon.pl -d $ORACLE_HOME/rdbms/admin -b catalog catalog.sql
[oracle@test12c admin]$ perl catcon.pl -d $ORACLE_HOME/rdbms/admin -b catproc catproc.sql
[oracle@test12c admin]$ perl catcon.pl -u SYSTEM -d $ORACLE_HOME/sqlplus/admin -b pupbld pupbld.sql
Enter Password: ********
Then, checked database status.
[oracle@test12c admin]$ cd ~
[oracle@test12c ~]$ sqlplus  / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Mon Jul 15 17:38:46 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> select status from v$instance;

STATUS
------------
OPEN

SQL> select cdb from v$database;

CDB
---
YES

SQL> select PDB_NAME, STATUS, CON_ID from cdb_pdbs;

PDB_NAME                       STATUS            CON_ID
------------------------------ ------------- ----------
PDB$SEED                       NORMAL                 1

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY

SQL>
-- It works! Really? --
Not Sure ^___________^ So, tested to create pluggable database.
SQL>  CREATE PLUGGABLE DATABASE testpdb ADMIN USER admin IDENTIFIED BY password FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/newcdb/pdbseed/','/u01/app/oracle/oradata/newcdb/testpdb/');

Pluggable database created.

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
TESTPDB                        MOUNTED

SQL> alter pluggable database TESTPDB open;

Pluggable database altered.

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
TESTPDB                        READ WRITE

SQL> select file_name, tablespace_name, con_id from cdb_data_files;
FILE_NAME                                               TABLESPACE_NAME                    CON_ID
------------------------------------------------------- ------------------------------ ----------
/u01/app/oracle/oradata/newcdb/system01.dbf             SYSTEM                                  1
/u01/app/oracle/oradata/newcdb/sysaux01.dbf             SYSAUX                                  1
/u01/app/oracle/oradata/newcdb/undotbs01.dbf            UNDOTBS1                                1
/u01/app/oracle/oradata/newcdb/deftbs01.dbf             DEFTBS                                  1
/u01/app/oracle/oradata/newcdb/testpdb/system01.dbf     SYSTEM                                  3
/u01/app/oracle/oradata/newcdb/testpdb/sysaux01.dbf     SYSAUX                                  3
/u01/app/oracle/oradata/newcdb/testpdb/deftbs01.dbf     DEFTBS                                  3
/u01/app/oracle/oradata/newcdb/testpdb/usertbs01.dbf    USERTBS                                 3
/u01/app/oracle/oradata/newcdb/pdbseed/system01.dbf     SYSTEM                                  2
/u01/app/oracle/oradata/newcdb/pdbseed/sysaux01.dbf     SYSAUX                                  2
/u01/app/oracle/oradata/newcdb/pdbseed/deftbs01.dbf     DEFTBS                                  2
/u01/app/oracle/oradata/newcdb/pdbseed/usertbs01.dbf    USERTBS                                 2

12 rows selected.

SQL> !lsnrctl status

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 15-JUL-2013 17:52:28

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test12c)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                15-JUL-2013 14:06:41
Uptime                    0 days 3 hr. 45 min. 47 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/test12c/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test12c)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "NEWCDBXDB" has 1 instance(s).
  Instance "newcdb", status READY, has 1 handler(s) for this service...
Service "newcdb" has 1 instance(s).
  Instance "newcdb", status READY, has 1 handler(s) for this service...
Service "testpdb" has 1 instance(s).
  Instance "newcdb", status READY, has 1 handler(s) for this service...

The command completed successfully

SQL>  connect admin/password@test12c:1521/testpdb
Connected.
SQL> show con_name
CON_NAME
------------------------------
TESTPDB
Look Good. Mission Done! However, I will wait for "catcdb.sql" script from Oracle.

Multitenant - How to change PDB$SEED mode as read write or mount?

How to open PDB$SEED as read write mode? That's question, but why you have to do right that? You might want to fix something in PDB$SEED. I recommend you should learn about "catcon.pl" script.
[oracle@test12c admin]$ perl catcon.pl

  Usage: catcon  [-u username[/password]] [-U username[/password]]
                 [-d directory] [-l directory]
                 [{-c|-C} container] [-p degree-of-parallelism]
                 [-e] [-s]
                 [-E { ON | errorlogging-table-other-than-SPERRORLOG } ]
                 [-g]
                 -b log-file-name-base
                 --
                 { sqlplus-script [arguments] | --x<SQL-statement> } ...

   Optional:
     -u username (optional /password; otherwise prompts for password)
        used to connect to the database to run user-supplied scripts or
        SQL statements
        defaults to "/ as sysdba"
     -U username (optional /password; otherwise prompts for password)
        used to connect to the database to perform internal tasks
        defaults to "/ as sysdba"
     -d directory containing the file to be run
     -l directory to use for spool log files
     -c container(s) in which to run sqlplus scripts, i.e. skip all
        Containers not named here; for example,
          -c 'PDB1 PDB2',
     -C container(s) in which NOT to run sqlplus scripts, i.e. skip all
        Containers named here; for example,
          -C 'CDB PDB3'

       NOTE: -c and -C are mutually exclusive

     -p expected number of concurrent invocations of this script on a given
        host

       NOTE: this parameter rarely needs to be specified

     -e sets echo on while running sqlplus scripts
     -s output of running every script will be spooled into a file whose name
        will be
          <log-file-name-base>_<script_name_without_extension>_[<container_name_if_any>].<default_extension>
     -E sets errorlogging on; if ON is specified, default error logging table
        will be used, otherwise, specified error logging table (which must
        have been created in every Container) will be used
     -g turns on production of debugging info while running this script

   Mandatory:
     -b base name (e.g. catcon_test) for log and spool file names

     sqlplus-script - sqlplus script to run OR
     SQL-statement  - a statement to execute

   NOTES:
     - if --x<SQL-statement> is the first non-option string, it needs to be
       preceeded with -- to avoid confusing module parsing options into
       assuming that '-' is an option which that module is not expecting and
       about which it will complain
     - command line parameters to SQL scripts can be introduced using --p
       interactive (or secret) parameters to SQL scripts can be introduced
       using --P

     For example,
       perl catcon.pl ... x.sql '--pJohn' '--PEnter Password for John:' ...
 You might ask... why I had to post. when I recommend to use"catcon.pl". Ok! just play to change PDB$SEED mode.
SQL> select cdb from v$database;

CDB
---
YES

SQL> conn / as sysdba
Connected.
SQL> alter session set container=PDB$SEED;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDB$SEED

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY
SQL>  alter pluggable database pdb$seed close;
 alter pluggable database pdb$seed close
*
ERROR at line 1:
ORA-65017: seed pluggable database may not be dropped or altered

SQL> alter session set "_oracle_script"=TRUE;

Session altered.

SQL> alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SQL>  select open_mode from v$database;

OPEN_MODE
--------------------
MOUNTED

SQL> alter pluggable database pdb$seed OPEN READ WRITE;

Pluggable database altered.

SQL> show con_name;

CON_NAME
------------------------------
PDB$SEED

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

 --- Fixed something. Not recommend! ---

SQL> alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SQL> alter pluggable database pdb$seed OPEN READ ONLY;
Pluggable database altered.

SQL> show con_name;

CON_NAME
------------------------------
PDB$SEED

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY

SQL> alter session set "_oracle_script"=FALSE;

Session altered.
Easy! It's all about "_oracle_script" parameter.