Saturday 12 September 2015

The Raspberry Pi Introduction

                                                                   
 
 
Computers in this world are the most common part of life it is neither an asset nor a device we can call it as important as garments for us. Computers are books for the students, Meeting Place for the businessman, Diary for professionals and an essential part for everyone. Raspberry PI is just an initiative by an Educational Charity foundation to adopt computers in our daily life easily and making it closer to the people by its affordability
The Raspberry Pi Foundation is a registered educational charity based in the UK. According to foundation “The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse.” But reality is that it is larger than a credit card Hah Hah Ha now jokes apart. Raspberry Pi enables learning to program in programming languages with no age bar it is a little device with the capabilities of computer Raspberry Pi is packed with ability to interact with the outside world, and many more capabilities like computer from browsing the internet and playing high-definition video, to making spreadsheets, word-processing, and playing games.
It can be used in a broad ways for different projects requirements like detector for weather stations, signaling of trains, digital signal conditioners and many more from basics to advanced digital projects
But the primary aim behind the Raspberry Pi is to see the Raspberry Pi being used by kids all over the world to learn to program and understand how computers work and program them to implement their thoughts Raspberry Pi are available in different specification from a very basic Raspberry Pi 1 Model A


 
The basic Raspberry Pi board generally used for embedded development like basic robots and sensors with intelligence but it lacks many features like Micro SD, HD Audio, HDMi etc
 
The Latest Raspberry Pi 2 is bundled with many new features and enhansements
 
 
 
 
 
 
A 900MHz quad-core ARM Cortex-A7 CPU
  • 1GB RAM
  • 4 USB ports
  • 40 GPIO pins
  • Full HDMI port
  • Ethernet port
  • Combined 3.5mm audio jack and composite video
  • Camera interface (CSI)
  • Display interface (DSI)
  • Micro SD card slot
  • VideoCore IV 3D graphics core
Because it has an ARMv7 processor, it can run the full range of ARM GNU/Linux distributions, including Snappy Ubuntu Core, as well as Microsoft Windows 10.
 
Thanks Folks.
 

Wednesday 12 November 2014

Clone a Pluggable Database Manually



Clone a Pluggable Database (PDB) Manually

Cloning an existing local PDB is similar to creating a new PDB from the seed PDB, except now we are using non-seed PDB as the source, which we have to identify using the FROM clause. Make sure the source PDB is open in READ ONLY mode.
ALTER PLUGGABLE DATABASE pdb3 CLOSE;
ALTER PLUGGABLE DATABASE pdb3 OPEN READ ONLY;
 
CREATE PLUGGABLE DATABASE pdb4 FROM pdb3
  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/cdb1/pdb3/','/u01/app/oracle/oradata/cdb1/pdb4/');
 
ALTER PLUGGABLE DATABASE pdb4 OPEN READ WRITE;
 
-- Switch the source PDB back to read/write
ALTER PLUGGABLE DATABASE pdb3 CLOSE;
ALTER PLUGGABLE DATABASE pdb3 OPEN READ WRITE;
The cloning syntax also allows for cloning from remote databases using a database link in the local CBD. There are a few restriction associated with this functionality.
  • The database link can point directly to the remote PDB or to a common user in the remote CBD that owns the remote PDB.
  • If it points to a common user in the remote CBD that owns the remote PDB, that user must have the CREATE PLUGGABLE DATABASE system privilege.
  • The source and target CDBs must have the same endians.
  • The source and target CDBs must have the same options installed.
  • The source and target CDBs must have the same character set and national character set.
Assuming the remote PDB was in READ ONLY mode, the following command should perform the required operation.
CREATE PLUGGABLE DATABASE pdb5 FROM remote_pdb5@remotecdb1
  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/cdb1/remote_pdb5/','/u01/app/oracle/oradata/cdb1/pdb5/');
 
ALTER PLUGGABLE DATABASE pdb4 OPEN READ WRITE;
This functionality does not work properly in the 12.1.0.1 release of the database, but it has been fixed in 12.1.0.2.

Plugin a Pluggable Database (PDB) Manually



Plugin a Pluggable Database (PDB) Manually

Plugging in a PDB into the CDB is similar to creating a new PDB. First check the PBD is compatible with the CDB by calling the DBMS_PDB.CHECK_PLUG_COMPATIBILITY function, passing in the XML metadata file and the name of the PDB you want to create using it.
SET SERVEROUTPUT ON
DECLARE
  l_result BOOLEAN;
BEGIN
  l_result := DBMS_PDB.check_plug_compatibility(
                pdb_descr_file => '/u01/app/oracle/oradata/cdb1/pdb2/pdb2.xml',
                pdb_name       => 'pdb2');
 
  IF l_result THEN
    DBMS_OUTPUT.PUT_LINE('compatible');
  ELSE
    DBMS_OUTPUT.PUT_LINE('incompatible');
  END IF;
END;
/
compatible
 
PL/SQL procedure successfully completed.
 
SQL>
If the PDB is compatible, create a new PDB using it as the source. If we were creating it with a new name we might do something like this.
CREATE PLUGGABLE DATABASE pdb5 USING '/u01/app/oracle/oradata/cdb1/pdb2/pdb2.xml'
  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/cdb1/pdb2/','/u01/app/oracle/oradata/cdb1/pdb5/');
Instead, we want to plug the database back into the same container, so we don't need to copy the files or recreate the temp file, so we can do the following.
CREATE PLUGGABLE DATABASE pdb2 USING '/u01/app/oracle/oradata/cdb1/pdb2/pdb2.xml'
  NOCOPY
  TEMPFILE REUSE;
 
ALTER PLUGGABLE DATABASE pdb2 OPEN READ WRITE;
 
SELECT name, open_mode
FROM   v$pdbs
ORDER BY name;
 
NAME                          OPEN_MODE
------------------------------ ----------
PDB$SEED                      READ ONLY
PDB1                          MOUNTED
PDB2                          READ WRITE
PDB3                          READ WRITE
 
SQL>

Create a Pluggable Database (PDB) Manually



Create a Pluggable Database (PDB) Manually
To create a new pluggable database from the seed database, all we have to do is tell Oracle where the file should be placed. We can do this using one of two methods. The first method uses theFILE_NAME_CONVERT clause in the CREATE PLUGGABLE DATABASE statement.
CONN / AS SYSDBA

CREATE PLUGGABLE DATABASE pdb2 ADMIN USER pdb_adm IDENTIFIED BY Password1
  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/cdb1/pdbseed/','/u01/app/oracle/oradata/cdb1/pdb2/');
Alternatively, we can specify the PDB_FILE_NAME_CONVERT initialization parameter before calling the command without using the FILE_NAME_CONVERT clause.
CONN / AS SYSDBA

ALTER SESSION SET PDB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/cdb1/pdbseed/','/u01/app/oracle/oradata/cdb1/pdb3/';

CREATE PLUGGABLE DATABASE pdb3 ADMIN USER pdb_adm IDENTIFIED BY Password1;
Every time there is a need to convert file locations, either of these two methods will work. For the remainder of the article I will stick to using the FILE_NAME_CONVERT method to cut down on the variations I have to display.
We can see the PDBs are present by querying the DBA_PDBS and V$PDBS views.
COLUMN pdb_name FORMAT A20

SELECT pdb_name, status
FROM   dba_pdbs
ORDER BY pdb_name;

PDB_NAME            STATUS
-------------------- -------------
PDB$SEED            NORMAL
PDB1                NORMAL
PDB2                NEW
PDB3                NEW

SQL>

SELECT name, open_mode
FROM   v$pdbs
ORDER BY name;

NAME                          OPEN_MODE
------------------------------ ----------
PDB$SEED                      READ ONLY
PDB1                          MOUNTED
PDB2                          MOUNTED
PDB3                          MOUNTED

SQL>
The PDBs are created with the status of 'NEW'. They must be opened in READ WRITE mode at least once for the integration of the PDB into the CDB to be complete.
ALTER PLUGGABLE DATABASE pdb2 OPEN READ WRITE;
ALTER PLUGGABLE DATABASE pdb3 OPEN READ WRITE;

SELECT pdb_name, status
FROM   dba_pdbs
ORDER BY pdb_name;

PDB_NAME            STATUS
-------------------- -------------
PDB$SEED            NORMAL
PDB1                NORMAL
PDB2                NORMAL
PDB3                NORMAL

SQL>

SELECT name, open_mode
FROM   v$pdbs
ORDER BY name;

NAME                          OPEN_MODE
------------------------------ ----------
PDB$SEED                      READ ONLY
PDB1                          MOUNTED
PDB2                          READ WRITE
PDB3                          READ WRITE

SQL>
Note. Depending on the syntax used, you may need to grant the PDB_DBA role to the local admin users for the PDB.