Monday, August 12, 2013

Back to the basics

I was going through my monthly telco bill for mobile phone, home phone and home broadband usage. Gone are the days where lifestyle were so simple and easy going. I grew up where is a telephone at home.  Those days either one of the family at home will utilize the phone for hours. Then in my high school days, I started to have 33.6 or 56K dialup Modem. US Robotics Modem is a popular and most robust equipment then. Everyone hope to have one at home to have the 'fastest' connection.

As I was looking at my telco's bill,  the total cost is not cheap. It is like a person's pay for 1-day in a developed nation or a week's or a month's pay in an undeveloped nation. Nowadays we need data plan to goes with smart phone. So we can get 'smarter'. It add on cost more and more to our bills. The place I live in is getting more competitive for jobs. People from all over the world comes here. We are a globalized nation. People are free to move around. As I grow older and older, and one day if lost a job, I doubt I can sustain with all these high costs. I probably will switch to a prepaid card with no data plan and that would already be a luxury. I am paying two mobile phones, one myself and another for my wife. I doubt if she knows it is not cheap to be on data plan. If I am jobless, I will just go with the basic. Probably my next plan, would be carry a portable modem around and have minimum spending.

Tuesday, August 6, 2013

Oracle 12c multitenant (Part2)

One might be curious what's inside the CDB. To view information about a container in a CDB. As you can see there are four containers inside this CDB namely CDB$ROOT, PDB$SEED, PDB12c, SALESPDB.


COLUMN NAME FORMAT A8

SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;

 
 CON_ID       DBID    CON_UID GUID
-------- ------ ---------- ---------- --------------------------------
CDB$ROOT      1 4021232689          1 DD7C48AA5A4504A2E04325AAE80A403C
PDB$SEED      2 4065253802 4065253802 E32E698EA24E0CA2E043C83C16AC771B
PDB12C        3  474800360  474800360 E32E71077E390EC3E043C83C16AC372F
SALESPDB      4 2267593339 2267593339 E330F6DC0A04184BE043C83C16AC6564
 
To view the status,
COLUMN PDB_NAME FORMAT A15
 
SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;

 
PDB_ID PDB_NAME        STATUS
------ --------------- -------------
     2 PDB$SEED        NORMAL
     3 PDB12C          NORMAL
     4 SALESPDB        NORMAL



COLUMN NAME FORMAT A15
COLUMN RESTRICTED FORMAT A10
COLUMN OPEN_TIME FORMAT A30
 
SELECT NAME, OPEN_MODE, RESTRICTED, OPEN_TIME FROM V$PDBS;



NAME     OPEN_MODE  RESTRICTED OPEN_TIME
-------- ---------- ---------- ------------------------------
PDB$SEED READ ONLY  NO         05-AUG-13 02.54.14.169 AM
PDB12C   MOUNTED
SALESPDB READ WRITE NO         05-AUG-13 04.32.06.770 AM


Showing users in multiple PDB.
COLUMN PDB_NAME FORMAT A15
COLUMN USERNAME FORMAT A30
 
SELECT p.PDB_ID, p.PDB_NAME, u.USERNAME 
  FROM DBA_PDBS p, CDB_USERS u
  WHERE p.PDB_ID > 2 AND
        p.PDB_ID = u.CON_ID
  ORDER BY p.PDB_ID;


To display various datafiles
COLUMN PDB_ID FORMAT 999
COLUMN PDB_NAME FORMAT A8
COLUMN FILE_ID FORMAT 9999
COLUMN TABLESPACE_NAME FORMAT A10
COLUMN FILE_NAME FORMAT A45

SELECT p.PDB_ID, p.PDB_NAME, d.FILE_ID, d.TABLESPACE_NAME, d.FILE_NAME
  FROM DBA_PDBS p, CDB_DATA_FILES d
  WHERE p.PDB_ID = d.CON_ID
  ORDER BY p.PDB_ID;





To show the tempfile
COLUMN CON_ID FORMAT 999
COLUMN FILE_ID FORMAT 9999
COLUMN TABLESPACE_NAME FORMAT A15
COLUMN FILE_NAME FORMAT A45

SELECT CON_ID, FILE_ID, TABLESPACE_NAME, FILE_NAME
  FROM CDB_TEMP_FILES
  ORDER BY CON_ID;


To show the services
COLUMN NETWORK_NAME FORMAT A30
COLUMN PDB FORMAT A15
COLUMN CON_ID FORMAT 999

SELECT PDB, NETWORK_NAME, CON_ID FROM CDB_SERVICES
  WHERE PDB IS NOT NULL AND
        CON_ID > 2
  ORDER BY PDB;


I will write more on the cloning of PDB.

Oracle 12c multitenant

Oracle has catch up with time. With the 12c revolutionary database release, no longer a single instance is limited to a  server though many shops run multiple instances within a single server. However it prohibits the sharing of background processes. With 12c, one is able to sharing a server's resources eg: CPU, memory among different "instances".

Figure show the new 12c architecture design



 Source: Oracle docs


 In 12c, you create a CDB.
There's exactly one
  • 1 CDB$ROOT (aka. the root). 
  • One PDB$SEED.
  • Zero or more PDBs (ie. user created PDB)
Familiarize with some new terms and concepts

Container: Can be a PDB, CDB

I downloaded the Oracle 12c database (12.1.0.1.0) from Oracle website for testing. There are two zip files for my Linux-x64 installation.  It's about 2.4GB in size.

Extract the zip files, and perform the normal straight forward installation --> ./runInstaller

The installation was pretty quick it finished within 30mins in my environment. I used the DBCA to create a database for testing.

To verify that CDB is enabled:
show parameter enable_pluggable_database = TRUE (This is the value it should return)

In my next post, I will write about connections to the PDB and some verification commands.

Monday, August 5, 2013

Seagate 2TB 64MB 7200rpm









I got a Seagate 3.5" 2TB 64MB 7200rpm today to replace my old 500GB Seagate Baracuda 7200rpm. The hard disk is fitted to the Seagate Freeagent Xtreme.
http://www.seagate.com/support/external-hard-drives/desktop-hard-drives/freeagent-xtreme/

It was an upgrade as I reused the casing, just replacing the hard drive. I have it connected to a laptop via eSata interface and cable. By using CrystalDiskMark, this is the reading that I am getting. I encourage you share the reading if you have interesting findings.


vs
My internal 7200 2.5" 320GB hard disk


Not sure if these jargons make any sense, probably the first like on "Seq" means sequantial. I got an impressive 150.4Mb/s for read, 118.3Mb/s for write. Its is consider very good for a mechanical drive.

I did a test of copying a huge 10GB file into the hard drive. Previously with the old 500GB, I am getting probably around 80-90Mb/s transfer rate. With this new 2TB drive, I manage to move across 100Mb territory. It hovers around there.

Well in terms of operational, this is a silent drive. I don't even notice that it is switched on, on my desk.

I kinda of like this drive as I will use it to store and backup my files. If you pay slightly more, you might get a 128GB SSD. But that is completely a different comparison as these two products serve different purpose I would say.