Tuesday, December 31, 2013

Connection refused; No available router to destination On Weblogic Node Manager Log

Caused by: java.net.ConnectException: t3://exalytic.domain:8001: Destination unreachable; nested exception is:

The Above Error Appear when i was trying to access BPM, the main Cause for this error there's no configuration protocol on SOA Server Which mean No Listening Host.


To Avoid and Solve this error Follow the below Steps :



  • Access to weblogic Console using Administrator Password.
  • Click on Servers -> Protocols -> Channels like the below screen

  • Now you have to create new Protocol Click on "Configure a new Network Channel,"with the below confguration 
Name: Loopback
Protocol: t3
Listen Address: localhost
Listen Port: 8001 (same as Server Host/port)

  • Restart The Server and test the connection Again 

Thank you
Osama Mustafa

Tuesday, December 17, 2013

Steps To Create ODBC Connection in Linux



In this Document i will describe how to create ODBC Connection in Linux Step by Step. I uploaded my document to slideshare as usual you can download it from here.

Thanks for my friend Ilmar Kerm . 

Thank you 
Osama mustafa 

Saturday, December 14, 2013

Steps to Create Linux Container

After my last post about Docker Project, i start testing Linux Container but this time for lxc which is another amazing Package and should be used, if you installed and follow my steps in Previous steps here  then you can use lxc command without any suffer of installation :)

lxc stand for Linux Container.

Now i will start to describe how to create container using this command 


  • You need to know when lxc installed, it's create file under /etc/lxc/ called default.conf this file should contain your network interface name and you need to add it.

[root@OEL6 ~]# cat /etc/lxc/default.conf
lxc.network.type = veth
lxc.network.link = docker0
lxc.network.flags = up
Sample output for ifconfig command :
docker0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:172.17.42.1  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::28ce:eeff:fe80:1fc8/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1112 (1.0 KiB)  TX bytes:408 (408.0 b)

I used docker0 Interface because i already installed it , and configure the IP Address, if you don't modify this file when you start container you will receive error :

[root@OEL6 container]# lxc-start --name test-container
lxc-start: failed to attach 'vethaITNmu' to the bridge 'virbr0' : No such device
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 'test-container'
Anyway now after add the file with the right Interface name, you will be able to run and start working on lxc just follow the below steps :

  • Before Create any container you need to create Directory under /, if you don't do this step another error will be appeared asking for this directory and telling you /container not found.
mkdir /container will solve the problem.

Now Let's Start Creating new container called Test-container :

[root@OEL6 lxc]# lxc-create -n test-container -t oracle -- -R 6.5
lxc-create: No config file specified, using the default config /etc/lxc/default.conf
Host is OracleServer 6.5
Create configuration file /container/test-container/config
Downloading release 6.5 for x86_64
Loaded plugins: refresh-packagekit, security
ol6_u5_base                                                     | 1.4 kB     00:00
ol6_u5_base/primary                                             | 3.2 MB     00:32
ol6_u5_base                                                                  8573/8573
Setting up Install Process
the above command will take some while to finish the configuration, it's installing some packages needed by container you can have more than one container with different name.

After the creation is done you should be notice the below line :
Complete!
Rebuilding rpm database
Configuring container for Oracle Linux 6.5
Added container user:oracle password:oracle
Added container user:root password:root

Container : /container/test-container/rootfs
Config    : /container/test-container/config
Network   : eth0 (veth) on virbr0
'oracle' template installed
'test-container' created
the container is not started yet !!! so we need to do this using the below command :

[root@OEL6 lxc]# lxc-start -n test-container
                Welcome to Oracle Linux Server
Setting hostname test-container:                        [  OK  ]
Checking filesystems
                                                                        [  OK  ]
Mounting local filesystems:                                [  OK  ]
No such file or directory
Enabling /etc/fstab swaps:                                 [  OK  ]
Entering non-interactive startup
Bringing up loopback interface:                         [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... failed.
                                                                      [FAILED]
Starting system logger:                                    [  OK  ]
Mounting filesystems:                                      [  OK  ]
Generating SSH1 RSA host key: No such file or directory
                                                                      [  OK  ]
Generating SSH2 RSA host key: No such file or directory
                                                                     [  OK  ]
Generating SSH2 DSA host key: No such file or directory
                                                                     [  OK  ]
Starting sshd:                                                 [  OK  ]
Oracle Linux Server release 6.5
Kernel 3.8.13-16.2.1.el6uek.x86_64 on an x86_64
test-container login:
I will fix FAILED Later now you need to connect to the container using the above User name and password given to you in the above line.

After this 

[root@test-container ~]#

I am connected :) 

You can delete the container using command 

lxc-destroy -n test-container  
Reference :
1- Oracle Linux containers Here 
2- Oracle Linux 6.5 and Docker Here

Thank you
Osama mustafa

Enable Docker On Linux

Oracle Linux Released Before 2 week, i already blogged about this and mean while i was testing new features for Oracle Linux 6.5 which is simply amazing i will start writing about it.

Enable Docker , What is the Docker you can check the official Website to take look what i mean by Docker here .

If you tried to install Docker Directly you will get the below error :

[root@OEL6 u01]# rpm -ivh docker-io-0.7.0-14.el6.x86_64.rpm

warning: docker-io-0.7.0-14.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
error: Failed dependencies:
lxc is needed by docker-io-0.7.0-14.el6.x86_64
and if you need to install lxc package :

[root@OEL6 Packages]# rpm -ivh lxc-0.9.0-2.0.5.el6.x86_64.rpm 

warning: lxc-0.9.0-2.0.5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
libvirt is needed by lxc-0.9.0-2.0.5.el6.x86_64
So Let's Start :

root@OEL6 Packages]# rpm -ivh libvirt-0.10.2-29.0.1.el6.x86_64.rpm 

warning: libvirt-0.10.2-29.0.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
/usr/bin/qemu-img is needed by libvirt-0.10.2-29.0.1.el6.x86_64
ebtables is needed by libvirt-0.10.2-29.0.1.el6.x86_64
libnetcf.so.1()(64bit) is needed by libvirt-0.10.2-29.0.1.el6.x86_64
libnetcf.so.1(NETCF_1.0.0)(64bit) is needed by libvirt-0.10.2-29.0.1.el6.x86_64
libnetcf.so.1(NETCF_1.2.0)(64bit) is needed by libvirt-0.10.2-29.0.1.el6.x86_64
libnetcf.so.1(NETCF_1.3.0)(64bit) is needed by libvirt-0.10.2-29.0.1.el6.x86_64
libnetcf.so.1(NETCF_1.4.0)(64bit) is needed by libvirt-0.10.2-29.0.1.el6.x86_64
lzop is needed by libvirt-0.10.2-29.0.1.el6.x86_64
numad is needed by libvirt-0.10.2-29.0.1.el6.x86_64
radvd is needed by libvirt-0.10.2-29.0.1.el6.x86_64

First:
[root@OEL6 Packages]# rpm -ivh lzo
lzo-2.03-3.1.el6.x86_64.rpm       lzop-1.02-0.9.rc1.el6.x86_64.rpm
[root@OEL6 Packages]# rpm -ivh lzop-1.02-0.9.rc1.el6.x86_64.rpm 
warning: lzop-1.02-0.9.rc1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:lzop                   ########################################### [100%]
Second :

[root@OEL6 Packages]# rpm -ivh numa
numactl-2.0.7-8.el6.i686.rpm
numactl-2.0.7-8.el6.x86_64.rpm
numactl-devel-2.0.7-8.el6.i686.rpm
numactl-devel-2.0.7-8.el6.x86_64.rpm
numad-0.5-9.20130814git.el6.x86_64.rpm
[root@OEL6 Packages]# rpm -ivh numad-0.5-9.20130814git.el6.x86_64.rpm 
warning: numad-0.5-9.20130814git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:numad                  ########################################### [100%]
Third:

[root@OEL6 Packages]# rpm -ivh radvd-1.6-1.el6.x86_64.rpm 

warning: radvd-1.6-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:radvd                  ########################################### [100%]

Fourth :

[root@OEL6 Packages]# rpm -ivh augeas-libs-1.0.0-5.el6.x86_64.rpm
warning: augeas-libs-1.0.0-5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:augeas-libs            ########################################### [100%]

[root@OEL6 Packages]# rpm -ivh netcf-libs-0.1.9-4.el6.x86_64.rpm
warning: netcf-libs-0.1.9-4.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:netcf-libs             ########################################### [100%]
Now you need to enable qemu-img like the below :

[root@OEL6 Packages]# rpm -ivh libgfortran-4.4.7-4.el6.x86_64.rpm
warning: libgfortran-4.4.7-4.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key                                                                              ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
        package libgfortran-4.4.7-4.el6.x86_64 is already installed

[root@OEL6 Packages]# rpm -ivh qemu-img-0.12.1.2-2.415.el6.x86_64.rpm
warning: qemu-img-0.12.1.2-2.415.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature,                                                                              key ID ec551f03: NOKEY
error: Failed dependencies:
        libgfapi.so.0()(64bit) is needed by qemu-img-2:0.12.1.2-2.415.el6.x86_64
        libusbredirparser.so.1()(64bit) is needed by qemu-img-2:0.12.1.2-2.415.e                                                                             l6.x86_64
[root@OEL6 Packages]# rpm -ivh glusterfs-api-3.4.0.36rhs-1.0.1.el6.x86_64.rpm
warning: glusterfs-api-3.4.0.36rhs-1.0.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Si                                                                             gnature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:glusterfs-api          ########################################### [100%]
[root@OEL6 Packages]# rpm -ivh qemu-img-0.12.1.2-2.415.el6.x86_64.rpm
warning: qemu-img-0.12.1.2-2.415.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature,                                                                              key ID ec551f03: NOKEY
error: Failed dependencies:
        libusbredirparser.so.1()(64bit) is needed by qemu-img-2:0.12.1.2-2.415.e                                                                             l6.x86_64
[root@OEL6 Packages]# rpm -ivh usbredir-0.5.1-1.el6.x86_64.rpm
warning: usbredir-0.5.1-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, ke ID                                                                              ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:usbredir               ########################################### [100%]

[root@OEL6 Packages]# rpm -ivh qemu-img-0.12.1.2-2.415.el6.x86_64.rpm
warning: qemu-img-0.12.1.2-2.415.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature,                                                                              key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:qemu-img               ########################################### [100%]
Finally the last Package :

[root@OEL6 Packages]# rpm -ivh ebtables-2.0.9-6.el6.x86_64.rpm
warning: ebtables-2.0.9-6.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:ebtables               ########################################### [100%]
[root@OEL6 Packages]# rpm -ivh libvirt-0.10.2-29.0.1.el6.x86_64.rpm
warning: libvirt-0.10.2-29.0.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:libvirt                ########################################### [100%]
we have to download two more package 

[root@OEL6 Packages]# rpm -ivh lxc-0.9.0-2.0.5.el6.x86_64.rpm
warning: lxc-0.9.0-2.0.5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:lxc                    ########################################### [100%]

[root@OEL6 u01]# rpm -ivh docker-io-0.7.0-14.el6.x86_64.rpm
warning: docker-io-0.7.0-14.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:docker-io              ########################################### [100%]

Now you Can Use Docker :) I will post more blog about this Package and how to use.

Thank you 
Osama Mustafa

Sunday, December 8, 2013

Oracle Linux 6.5 released

Oracle Announced the release of Oracle Linux 6.5, The Latest Version Of Oracle Linux, It's only Other Operating System Because this version Contain Some New Features :


  • Unbreakable Enterprise Kernel Release 3
  • Support DTrace.
  • Delivering Better Performance, scalability   and reliability For Companies.
  • New File System : btrfs enable administrators to implement an efficient incremental backup mechanism using file system snapshots.
And More Features.

You Can download Oracle Linux 6.5 Here

It will be Available soon On Oracle Software Delivery Here


Wednesday, November 27, 2013

Change AdminServer Port Using WLST.SH

Sometimes AdminServer not working Regarding to Wrong configuration or using Wrong Port which mean No Console will be available so is this mean delete domain and Configure it again !!!

Absolutely  Not  When you install Weblogic any Version Oracle Provide you with Command Line Utility to administrate weblogic, what you can do it using Console can be done with this tool.

change to weblogic-directory/common/bin
./wlst.sh

Now follow the below Steps to change port :

wls:/offline> readDomain ('/u01/app/fmw/domains/IDDomains')
wls:/offline/IDDomains> cd ('Server')
wls:/offline/IDDomains/Server> ls ()
Choose your Server Here
wls:/offline/IDDomains/Server> cd ('AdminServer')
wls:/offline/IDDomains/Server/AdminServer> ls ()
Search for Old Port ListenPort 
wls:/offline/IDDomains/Server/AdminServer> set ('ListenPort',New Port)
wls:/offline/IDDomains/Server/AdminServer> updateDomain ()
wls:/offline/IDDomains/Server/AdminServer> exit () 

Done you can now Test your new port
http://Server-ip:/console


Thank you
Osama Mustafa 

Oracle WebTier On Linux

In this document i will describe how to isntall Oracle WebTier 11.1.1.7 On Linux, As I hope Next Document will describe configuration.

You Can download Document From Here

Thank you
Osama Mustafa

Tuesday, November 26, 2013

ODI-1545: Missing odi supervisor credentials in credential store map

This Error appear because missing SuperVisor User Credentials, and you need to create it using wls.sh command, And Since we are working On Oracle_ODI So you have to use WLST.sh from there.

cd /u01/app/fmw/Oracle_ODI1/common/bin
./wlst.sh
and do the below

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> connect ('weblogic','welcome1','t3://localhost:7001')
 Connecting to t3://10.40.74.210:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'IDDomains'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

wls:/IDDomains/serverConfig> createCred(map="oracle.odi.credmap", key="SUPERVISOR", user="SUPERVISOR", password="sysadmin1", desc="Key for Supervisor")
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)

wls:/IDDomains/serverConfig> createCred(map="oracle.odi.credmap", key="odi11g", user="weblogic", password="welcome1", desc="WLS SUPERVISOR Credential")

wls:/IDDomains/serverConfig> disconnect()
Disconnected from weblogic server: AdminServer
wls:/offline>
wls:/offline>
wls:/offline>
wls:/offline> exit()

The Red Line for to define 3 command you will use.


Some Link :
1- How To Configure The ODI JavaEE Agent and ODI Console On WebLogic Server (Doc ID 1300550.1)
2- Working with ODI Here


Thank you
Osama Mustafa

Thursday, November 21, 2013

API5036: Client version 11.2.0.3.0 is not compatible with repository version 11.2.0.4.0



To Solve this error Follow the below Steps :

  • Edit /owb/bin/admin/Preference.properties
  • And set the following parameter :-
    • OverrideRepositoryVersionCheck=true
    • OverrideRuntimeVersionCheck=true
Thank you
Osama Mustafa

Wednesday, November 20, 2013

Install Oracle EDQ 11.1.1.7 On Oracle Linux 6.4

In This Document I will Show you How to install Oracle Enterprise Data Quality On Oracle Linux 6.4 Operating System.

In old Version Oracle EDQ was no available on Linux Only Windows Operating system as Setup File, But there’s always solution if you want it on Linux you need to use application server in our case weblogic to deploy EDQ on it , some pre requisites need to be done before you do this Please check http://support.oracle.com Document

How To Install EDQ On Linux Using Oracle DB And Apache Tomcat (Doc ID 1462376.1)

Download Document Here

Thank you
Osama mustafa 

Tuesday, November 19, 2013

Oracle ODI & SOA 11.1.1.7 Installation

Today I would like to share this document step by step how to install Oracle ODI and SOA On Oracle Linux 6.4.

As Usual I upload it to my slide share account here 

Thank you
Osama mustafa

Wednesday, November 13, 2013

From DBA to Cabling Job

Simple Post, Describe i have been Busy Lately and the work not finished Yet.



Thank you
Osama Mustafa

Tuesday, November 5, 2013

Thursday, October 31, 2013

Failed to create secure socket for OPMN at LocalHost:9501

The Below Error Appear when you enter to the following URL :  http://LocalHost:9704/analytics

oracle.as.management.opmn.optic.OpticBadConnectException: Failed to create secure socket for OPMN


Change Directory to the to BI instance/Bin Folder and :

[oracle@exalytic bin]$ ./opmnctl stopall
opmnctl stopall: opmn is not running.

[oracle@exalytic bin]$ ./opmnctl startall
opmnctl startall: starting opmn and all managed processes...

[oracle@exalytic bin]$ ./opmnctl status
Processes in Instance: obiee1
---------------------------------+--------------------+---------+---------
ias-component                    | process-type       |     pid | status
---------------------------------+--------------------+---------+---------
coreapplication_obiccs1          | OracleBIClusterCo~ |   19837 | Alive  
coreapplication_obisch1          | OracleBIScheduler~ |       0 | NONE  
coreapplication_obijh1           | OracleBIJavaHostC~ |   19836 | Alive  
coreapplication_obips1           | OracleBIPresentat~ |   19840 | Alive  
coreapplication_obis1            | OracleBIServerCom~ |   19838 | Alive  

Thank you
Osama Mustafa 

Wednesday, October 30, 2013

User Not Able To Drop Even When I killed the session.

Today while i was working on Database trying to Drop user called PRD_MDS the normal error appearing to me :

SQL> drop user PRD_MDS cascade ;
drop user PRD_MDS cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected

Which is very normal error and the first thing you are trying to check is v$session

SQL> select sid,serial# ,username from v$session where username like '%PRD%';
       SID    SERIAL# USERNAME
---------- ---------- ------------------------------
       745        821 PRD_MDS
SQL> alter system kill session '745,821' immediate ;
System altered.

After this i should be able to drop this user without any problem BUT !!!!

SQL> drop user PRD_MDS ;
drop user PRD_MDS
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
I tried to figure out what is going on , Even i tried alter system kill session 10 times the above error will appear BUT there's always solutions :

SQL> startup force restrict;
ORACLE instance started.
Total System Global Area 7686086656 bytes
Fixed Size                  2228032 bytes
Variable Size            1811939520 bytes
Database Buffers         5729419264 bytes
Redo Buffers              142499840 bytes
Database mounted.
Database opened.

 SQL> drop user PRD_MDS cascade ;
User dropped.

Enable Automatic Memory Management (AMM)

SQL> show parameter target


NAME                                               TYPE        VALUE
------------------------------------ -----------       -------
archive_lag_target                                     integer     0
db_flashback_retention_target                  integer     1440
fast_start_io_target                                   integer     0
fast_start_mttr_target                                integer     0
memory_max_target                                 big integer 26048M
memory_target                                         big integer 0
parallel_servers_target                              integer     2048
pga_aggregate_target                               big integer 6502M
sga_target                                                big integer 19520M
SQL> ALTER SYSTEM SET MEMORY_MAX_TARGET = 16384M scope=spfile ;

SQL > SHUTDOWN IMMEDIATE;
SQL > STARTUP ;

SQL> ALTER SYSTEM SET SGA_TARGET = 0 scope=spfile ;
System altered.

SQL> ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0 scope=spfile ;
System altered.

SQL> ALTER SYSTEM SET MEMORY_TARGET=12288M scope=spfile ;
System altered.


Thank you 
Osama Mustafa




Monday, October 28, 2013

Apology

Lately I was little busy with Lot of work, regarding to this i didn't post anything new within two last week, i would like to apology for all people about this.

And I promise to update the blog with new contents and Documents that will be Useful for everyone.


Thank you 
Osama mustafa 

Monday, October 14, 2013

Create Group using Em12c

Sometimes you need to create Certain group for Enterprise manager to make monitor more easy , sepcially if you have lot of agent and components such as database , Host , application server ... so if you want to manage them individually it will consume time and seems to be impossible.

Enterprise manager provide you with Group Features to combine components, and there's two type :

  • Target at the same type 
  • Target contain different components such as database, Application server , Host.

Check the below screenshot :

From Setup --> Add Target --> Group


you have five tab each one of them contain different parameters, Choose the right option that works with your Work:


After Choose the name for the group you need to add Agents, from search button new popup screen will be open choose which agent type you want.


Another example on Chart tab :


After Create Group :



For More information about Enterprise Manager 12c Group Read Oracle Documentation Here

Thank you 
Osama mustafa





Tuesday, October 8, 2013

MOLAP, ROLAP And HOLAP

I would like to share this article that i found recenly on internet talking about Online Analytic Processing By John Here


Cubes in a data warehouse are stored in three different modes. A relational storage model is called Relational Online Analytical Processing mode or ROLAP, while a Multidimensional Online Analytical processing mode is called MOLAP. When dimensions are stored in a combination of the two modes then it is known as Hybrid Online Analytical Processing mode or HOLAP.

MOLAP 

This is the traditional mode in OLAP analysis. In MOLAP data is stored in form of multidimensional cubes and not in relational databases. The advantages of this mode is that it provides excellent query performance and the cubes are built for fast data retrieval. All calculations are pre-generated when the cube is created and can be easily applied while querying data. The disadvantages of this model are that it can handle only a limited amount of data. Since all calculations have been pre-built when the cube was created, the cube cannot be derived from a large volume of data. This deficiency can be bypassed by including only summary level calculations while constructing the cube. This model also requires huge additional investment as cube technology is proprietary and the knowledge base may not exist in the organization.


ROLAP  

The underlying data in this model is stored in relational databases. Since the data is stored in relational databases this model gives the appearance of traditional OLAPs slicing and dicing functionality. The advantages of this model is it can handle a large amount of data and can leverage all the functionalities of the relational database. The disadvantages are that the performance is slow and each ROLAP report is an SQL query with all the limitations of the genre. It is also limited by SQL functionalities. ROLAP vendors have tried to mitigate this problem by building into the tool out-of-the-box complex functions as well as providing the users with an ability to define their own functions.


HOLAP  

HOLAP technology tries to combine the strengths of the above two models. For summary type information HOLAP leverages cube technology and for drilling down into details it uses the ROLAP model.

Comparing the use of MOLAP, HOLAP and ROLAP

The type of storage medium impacts on cube processing time, cube storage and cube browsing speed. Some of the factors that affect MOLAP storage are:

Cube browsing is the fastest when using MOLAP. This is so even in cases where no aggregations have been done. The data is stored in a compressed multidimensional format and can be accessed quickly than in the relational database. Browsing is very slow in ROLAP about the same in HOLAP. Processing time is slower in ROLAP, especially at higher levels of aggregation.

MOLAP storage takes up more space than HOLAP as data is copied and at very low levels of aggregation it takes up more room than ROLAP. ROLAP takes almost no storage space as data is not duplicated. However ROALP aggregations take up more space than MOLAP or HOLAP aggregations.

All data is stored in the cube in MOLAP and data can be viewed even when the original data source is not available. In ROLAP data cannot be viewed unless connected to the data source.

MOLAP can handle very limited data only as all data is stored in the cube.


Thank you
Osama Mustafa

Sunday, October 6, 2013

unpack.sh Error -name=Value

The pack command creates a template archive (.jar) file that contains a snapshot of either an entire domain or a subset of a domain. You can use a template that contains a subset of a domain to create a Managed Server domain directory hierarchy on a remote machine.

The unpack command Creates a full domain or a subset of a domain used for a Managed Server domain directory on a remote machine. You may use unpack only with a template compatible with your current installation. The template can be any of the following:


  •  A domain template provided by BEA and packaged with your current installation
  •  A domain template created using the Domain Template Builder or WLST Offline
  •  A domain template created using the pack command
  •  A Managed Server template created using the pack command. A Managed Server template, by default, contains only the files necessary for creating a Managed Server domain directory.
You Can Check Oracle Documentation here for more information about the above commands.


When Trying to use unpack command with the below command:

./unpack.sh -domain=/u01/app/oracle/domains/IDMDomains -template=/u01/shared/IDMdomains.jar

The below error appear :

ERROR !!! ./unpack.sh -name=Value Missing
The Solution is simple :

-template attribute should come first. 

./unpack.sh  -template=/u01/shared/IDMdomains.jar -domain=/u01/app/oracle/domains/IDMDomains

Thank you
Osama Mustafa

Start Managed Server Failed With "Access not allowed for subject: principals=[]"

When Trying to Start Managed Server From Admin Console it's Failed with

"weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[], on ResourceType: Application Action: write, Target: Deployed"

After Check Everything and Configuration i found the following :


  • My Admin Server Already have More than one managed Server : SOA, ODI , BAM.
  • SOA and ODI Using the Same Port which is 8001 Which caused Conflict.

I Changed SOA Port to Work On 8003 From Admin Server Console. Like the Below

Managed Server BI_Server Unable To Start After Create Node manager Service

Problem Description :

After Install Weblogic and BI On Windows, And Create Admin Server as Services BI_server unable to start, Node manager Created Service Created Without Any Error.

Cause & Solution : 

After Investigation I found Class Path is too Long So what i did like the following, Edit installSVC.cmd To set Classpath  to be Short


you will find the below line in the InstallSvc.cmd all you have to do is change it to be like Line in Red Color :

@echo off

echo %CLASSPATH% > %USERDOMAIN_HOME%\cp.properties

if "%ADMIN_URL%" == "" goto runAdmin
@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
-classpath @%USERDOMAIN_HOME%\cp.properties 
-Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER%
-Dweblogic.management.server=\"%ADMIN_URL%\"
-Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%
-Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"

goto finish

Thank you
Osama Mustafa

Saturday, October 5, 2013

Social media Information

This is Post will be Short and Simple , I Only Wants To Share My Social Media Information

Twitter Here
Linkedin Here

If you need Any Help you find me in the above Social Media


Thank you
Osama Mustafa 

Saturday, September 28, 2013

Are we in the Cloud

What is The Cloud Computing ? Are We in the Cloud ? Where Can I Find it ? Simple Question but It's has been asked a lot.

Simply Cloud Computing Storing and accessing Data and programs Using Over Internet instead of Local Computer.

I Found the Below Chart on the internet and it's The Best Describe for the cloud "Source Cloud For Dummies" :


Cloud is the next Stage for everything, Because it can be defined as set of hardware,Platforms , Databases, Networking it will safe lot of money for the companies.

Check the below video :


You need to know some  Definition you will heard when we are talking about Cloud:
Xaas is Term said for number of things "X as a Services" / " Anything as a Services"

The Most Common Examples on the above :

  • DBaas : Database as a Service.
  • Paas : Platform as a Service.
  • SaaS : Software as a Service/Storage as a Service.
  • IaaS : Infrastructure as a Service.
  • Caas : Communication as Service.
  • Naas : Network as Service.

It's New Future.

Thank you 
Osama mustafa


Thursday, September 19, 2013

Sunday, September 15, 2013

Oracle SOA Installation on Solaris 11.1

Another Post Describe how to install Oracle SOA, Steo by Step To Install Oracle SOA and Extend Admin Server.

As Usual you can download this document From SlideShare.

Download Document Here.


Thank you
Osama Mustafa

Thursday, September 12, 2013

Oracle Business Intelligence Installation

Before start describes steps, I would like to share some notes:
  •     Extend Weblogic Server will not work (config.sh).
  •    BI server should be added first before any managed server otherwise AdminServer will corrupted.
  •   If you already have AdminServer configured you can created new BI Domain, Or backup your AdminServer  domain and Reconfigure again.


The above notes are useful and must be considered before installing Oracle BI.

You can download the document from Here

Thank you

Osama Mustafa

RAC Attack Survey

Count Down is already started, Less than 10 days to Oracle Open World 2013, Sessions, Groups and Discussions/Panel , but this year will be different, as we all know Oracle Database 12c has been released in July some of us got some time to test and work on it. Database and advance Features such as Real Application Cluster (RAC).

Don't Worry you didn't mess you chance yet. This Year specifically in Oracle Open World 2013 You will have chance to test Oracle Real Application Cluster on your Own Laptop, Created by yourself, and it will not take that much time, learn the steps and have chance to be DBA.

RACATTACK events Created by Volunteers


you can know more about this event here, Join us and Learn Something New and Meet the Oracle Guru, it will be nice to see everybody there.

Complete this Survey Please Here

Thank you 
Osama Mustafa


Monday, September 9, 2013

Step by Step Configure SSO Using Oracle Fusion Middle-ware

I would like to share this document , which is describe step by step dealing with :

  • WebLogic
  • Oracle Internet Directory
  • Oracle Content Server
  • Oracle Access manager 
Every thing mentioned with Installation &  Configuration Steps.


I tried To make it simple as i can, Included with Screen Shots ,Step By Step how to install The above Oracle Products and how to configure them to prepare your application for Single-Sing-On 

Please if you would like to share this document ask me before.

You can View and Download the Document from Here


Thank you 
Osama mustafa

Thursday, September 5, 2013

SIEBEL odbcsql Unable to Connect

Logging into "SBA_81_DSN" as "SADMIN" ...
ODBC error 81 in SQLConnect:
523 72
(native error 0).
Unable to login using specified ODBC parameters.
The above error appear when you are trying to run the below command:

odbcsql /s SIEBEL8_DSN /u sadmin /p sadmin

Solutions :

Make sure the you set TNS_ADMIN in .profile or .bash_profile , TNS_ADMIN Should be Directed to Client32 bit , Copy tnsnames.ora from Database home to Client32

it will be like the following :

export TNS_ADMIN=/u01/app/oracle/instanctclient32/

Thank you
Osama mustafa

Segmentation Fault(coredump) when Trying to Start Siebel Server

Today i was working with SIEBEL On Solaris , And as usually it was working without any issue , after modified images on SIEBEL as Oracle Support Document

Images Files on Screen Tabs Required for High Interactivity Clients in Innovation Pack 2012 (Doc ID 1511448.1).


But when i tried to start SIEBEL Server the below errors appear :

/u01/app/siebel/8.2.2.0/ses/siebsrvr/bin/start_server: line 212: 6488: Memory fault(coredump) 
it's confusing because SIEBEL was working without any problem, After tried more than one solution i would like to share the below Solution ( at least it's works for me)

cd $SIEBEL_ROOT/sys

you will find File called osdf_ENTERPRISE_NAME

This file Will be Read by SIEBEL when you trying to start_server and if doesn't exists it will recreate it again.

 Delete this file and try to start Siebel Server Again using
start_server ALL

Thank you
Osama Mustafa 

Tuesday, August 27, 2013

Step by Step to Install Oracle Grid 11.2.0.3 on Solaris SPARC 11.1

In this article i will show step by step how to install oracle Grid Infrastructure on Solaris 11.1.

You can Download or view document from SlideShare Here

Thank you
Osama mustafa

Wednesday, August 21, 2013

Oracle Open World 2013 Rac Attack



So If you attending this year to Oracle Open World 2013 Don't Forget To Pass by :) and Create your RAC 12c on your Personal laptop.

Thank you
Osama mustafa

Monday, August 19, 2013

Officaly DBvisit Partner



After Testing DbVisit Product and Post about it Here, I Didn't Stop There Because This Product Gives lot of Benefits and Easy To Manage.  You Don't Need to Become DBA to manage it.

The Most Important Thing in Any Products as i see Support Part Because Any Software in this World will Generate New errors you don't know anything about it. DbVisit Provide you with Support Team Response on you As Soon As Possible with Answers.

DbVisit Solutions Is not expensive if you want to compare with Other Software Proof on this my friend Steve Karam Write Blog here talking About License Here With Examples on Prices.

Finally I am Proud to be DbVisit Gold Partner In Jordan And Covering Middle East Region.


Thank you
Osama Mustafa


Monday, August 12, 2013

Mount NFS Device Is Busy

This Error Appear On Solaris when you try to mount filesystem :

mount -F nfs IP:/export/home/oracle/test /export/home/oracle/test

Output :
nfs mount: mount: /export/home/oracle/test : Device busy


Check why it's Busy using :
fuser -u /export/home/oracle/test
/export/home/oracle/test :     1432c(oracle)

Kill the process :

kill - 9 1432 

Thank you
Osama mustafa 

Friday, August 2, 2013

New Online Security Course By Expert

Today On Social Media , I read the Following :

"I am going to run our "How to perform an audit of an Oracle database" online in the second week of October. Please email me at pete at petefinnigan dot com for details or to register. There are limited places still available so first come first served"

So Please For More Information Contact Pete Finnigan Also Visit His Blog Here

Thank you 
Osama Mustafa 

Tuesday, July 30, 2013

Step By Step to Restore RMAN to New Host

Old Topics But Always Good To share , Find Below the Links for Steps to Restore RMAN to New Host

Step by Step Restore RMAN to New Host Here

Thank you
Osama Mustafa

Monday, July 22, 2013

WebLogic Error BEA-141281


This Solutions for this errors :

Change Directory to Domain directory

cd /u01/app/oracle/domains/IDMDomain/servers/AdminServer 
if you have lock you will find folder called  tmp
rm -rf AdminServer.lok

 Thank you
Osama mustafa

Wednesday, July 17, 2013

New Slideshare Document ( EnterPrise manager 12c )

Upload New Documents to my SlideShare Account :

  1. Add target manually em12c Here
  2. Configure email notification and incidents rule  Here
  3. Deploy Agent in Em12c Here
Thank you
Osama Mustafa

Saturday, July 13, 2013

Clone Pluggable Database

If you want to Clone One Of Pluggable database , How can you do that :

SQL> select name from v$pdbs ;

NAME
------------------------------
PDB$SEED
TEST_1
TEST_2
Let's Clone Test_1 , Create folder on os level to move test_1 data. 

[oracle@test12c u01]$ mkdir clone
[oracle@test12c u01]$ cd clone/
[oracle@test12c clone]$ pwd
/u01/clone
Open Test_1 Read Only : 
SQL> alter pluggable database test_1 close immediate;Pluggable database altered.
SQL> alter pluggable database test_1 open read only ;Pluggable database altered.
Set this parameter to our created directory above : 
SQL> show parameter db_create_file_dest ;

NAME     TYPE VALUE
------------------------------------ -----------
db_create_file_dest     string

SQL> alter system set db_create_file_dest='/u01/clone';             System altered.
SQL> show parameter db_create_file_dest ;

NAME     TYPE VALUE
------------------------------------ -----------
db_create_file_dest     string /u01/clone
SQL> create pluggable database clone from test_1 ;Pluggable database created.
SQL> alter pluggable database clone open ;Pluggable database altered.
Test Clone Pluggable database 

[oracle@test12c ~]$ sqlplus sys/sys@test12c:1521/clone as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Sat Jul 13 20:20:24 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, Real Application Testing
and Unified Auditing options

SQL> show con_name ;CON_NAME
------------------------------
CLONE
SQL> select name from v$pdbs ;

NAME
------------------------------
PDB$SEED
TEST_1
TEST_2
CLONE
You can drop Clone Database using the below command

SQL > Alter Pluggable database Clone Including Datafiles ;
Thank you 
Osama mustafa

Point-In-Time Recovery for a Pluggable Database

Check Pluggable database that you have :
SQL> select name from v$pdbs ;

NAME
------------------------------
PDB$SEED
TEST_1
TEST_2
TEST_3
Shutdown database , to configure database archivelog
SQL> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount ;
 ORACLE instance started.
Total System Global Area 1252663296 bytes
Fixed Size    2287864 bytes
Variable Size  838862600 bytes
Database Buffers  402653184 bytes
Redo Buffers    8859648 bytes
Database mounted.
SQL> alter database archivelog ;
Database altered.

SQL> alter database open 
Database altered.

SQL> alter pluggable database all open; 
Pluggable database altered.

SQL> alter system set db_recovery_file_dest_size = 2G scope=both; 
System altered.

SQL> alter pluggable database all open; 
Pluggable database altered.
Export ORACLE_SID for container database and enter rman to backup  like below

[oracle@test12c backup]$ export ORACLE_SID=db12c
[oracle@test12c backup]$ rman target '"/ as sysbackup"'

Recovery Manager: Release 12.1.0.1.0 - Production on Sat Jul 13 17:13:42 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database: DB12C (DBID=1274669151)

Auto Backup controlfile :
RMAN> configure controlfile autobackup on;

using target database control file instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

Backup Script that we need :
Run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT '/u01/backup/db12c/%U';
backup database plus archivelog;
}
 Where 
Format '/u01..':  Location for backup


now move to our pluggable database
SQL>alter session set container=test_1 ;
SQL>create tablespace test_1  datafile '/u01/app/oracle/oradata/db12c/test_1/test_1.dbf' size 10m;
SQL>create user test identified by test temporary tablespace temp default tablespace test_1;
SQL>grant create session, create table, unlimited tablespace to test ;
SQL>create table data (id varchar2(100)) tablespace test_1;

Enter Data using The Below code in above table :
begin
 for i in 1.. 10000 loop
    insert into data values ('osama');
 end loop;
 commit;
end;
After you insert data close pluggable database to start restore.
alter pluggable database test_1 CLOSE ;
Restore script :
run {
set until SCN = 1832026 ;
restore pluggable database test_1;
recover pluggable database Test_1 auxiliary destination='/u01/backup/db12c';
alter pluggable database TEST_1 open resetlogs;
}

Note :  To get SCN for database before insert use the query below :
SQL > select timestamp_to_scn(sysdate) from v$database;

After Restore :
sqlplus sys/sys@test12c:1521/test_1 ;
SQL> select count(*) from data ;
select count(*) from data
                     *
ERROR at line 1:
ORA-00942: table or view does not exist
Thank you
Osama Mustafa

Friday, July 12, 2013

Adopting NON-CDB to CBD

This article describe steps to Adopt non-container database 12c to container 12c 
[oracle@test12c Desktop]$ ps -ef | grep pmon
oracle    3230     1  0 04:04 ?        00:00:09 ora_pmon_db12c
oracle   12112     1  0 08:20 ?        00:00:07 ora_pmon_NonCDB
oracle   29621  3203  0 18:47 pts/1    00:00:00 grep pmon
Where :
db12c : Container database
NonCDB : Non Container Database

Let Start

[oracle@test12c Desktop]$ export ORACLE_SID=NonCDB

SQL> select instance_name from v$instance ;
INSTANCE_NAME
----------------
NonCDB

SQL> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount exclusive
ORACLE instance started.
Total System Global Area  939495424 bytes
Fixed Size    2295080 bytes
Variable Size  348130008 bytes
Database Buffers  583008256 bytes
Redo Buffers    6062080 bytes
Database mounted.

SQL> alter database open read only;
Database altered.
Run the below procedure to generate the manifest file. 

SQL> exec dbms_pdb.describe(pdb_descr_file=>'/u01/noncdb.xml');
PL/SQL procedure successfully completed.

SQL> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
 I already working on the same host so no need to copy datafiles,if you are not working on same host copy datafiles to same location.

Let's Work On Container Database .

after copy datafiles to folder, On Os Level , Create directory to use file_name_convert.

[oracle@test12c oradata]$ mkdir newnoncdb
[oracle@test12c newnoncdb]$ pwd
/u01/app/oracle/oradata/newnoncdb
[oracle@test12c Desktop]$ export ORACLE_SID=db12c
[oracle@test12c Desktop]$ sqlplus / as sysdba
 
SQL> create pluggable database non_cdb as clone
  2  using '/u01/noncdb.xml'
  3  file_name_convert=('/u01/app/oracle/oradata/NonCDB','/u01/app/oracle/oradata/newnoncdb') copy;
Pluggable database created.

 Where

  1.  using '/u01/noncdb.xml' : file that should be generated using dbms_pdb.describe
  2. '/u01/app/oracle/oradata/NonCDB' : location for Copied Non_CDB datafile
  3. ,'/u01/app/oracle/oradata/newnoncdb' : location for created directory.

SQL> alter pluggable database non_cdb open ;        
Pluggable database altered.

SQL> alter pluggable database non_cdb close ;
Pluggable database altered.

SQL> alter pluggable database non_cdb open ;
Pluggable database altered.
NAME       OPEN_MODE
------------------------------ ----------
PDB$SEED       READ ONLY
NEWDB_PLUG MOUNTED
NEW_PLUG_COPY MOUNTED
NEW_PLUG_MOVE MOUNTED
NON_CDB       READ WRITE
Now you plugged NON-CDB to Container Database successfully without any problems and it will works fine.

the below step is optional but recommanded for production to move all thing from non-cdb to cdb. ( specially for upgrade 12c later ) 

SQL> alter session set container=Non_cdb;
Session altered.
OR 
[oracle@test12c newnoncdb2]$ sqlplus sys/sys@test12c:1521/Non_cdb as sysdba  ;

SQL> @$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql   

Thank you
Osama Mustafa

Thursday, July 11, 2013

Tuesday, July 9, 2013

Pluggable Database Part (3)

Since Pluggable Database is New Topic to post about , I Cannot post Everything in One Post so i decide to do it as tutorial and this one part (3) , every Topics uploaded Here on my blog or on my Account on Shareslide here.

In This topic :

  • How to unplug database.
  • Plugging Database to another Container Database.

Let's Start :

SQL> select name, con_id from v$active_services ;

NAME          CON_ID
--------------------------------- ----------
new2   4
new   3

db12cXDB   1
db12c   1
SYS$BACKGROUND   1
SYS$USERS   1
as you see i already create two pluggable database new,new2 and now :

SQL> alter pluggable database new close immediate ;
Pluggable database altered.
SQL> alter pluggable database new2 close immediate ;

Pluggable database altered.
Unplug database included with xml file :

SQL> alter pluggable database new unplug into '/u01/app/oracle/oradata/new.xml';Pluggable database altered.

SQL> alter pluggable database new2 unplug into '/u01/app/oracle/oradata/new_2.xml';Pluggable database altered.
Drop Database :

SQL> drop pluggable database new keep datafiles ;Pluggable database dropped.

SQL> drop pluggable database new2 keep datafiles ;Pluggable database dropped.
make sure you drop database :

SQL> select pdb_name, status from cdb_pdbs ;

PDB_NAME STATUS
----------- -------------
PDB$SEED NORMAL

 Before Plug Database to any Container you need to make sure from compatibility , there's PL/SQL code written by Oracle to check compatibility.

SQL > DECLARE
   compatible BOOLEAN := FALSE;
BEGIN
   compatible := DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
        pdb_descr_file => '/u01/app/oracle/oradata/new.xml');
   if compatible then
      DBMS_OUTPUT.PUT_LINE('Is pluggable PDB1 compatible? YES');
   else DBMS_OUTPUT.PUT_LINE('Is pluggable PDB1 compatible? NO');
   end if;
END;
/
Is pluggable PDB1 compatible? YES
PL/SQL procedure successfully completed.
 The Same will be for new2.xml

Now Let's Create Database Using With Two Way :

SQL> create pluggable database newdb_plug using '/u01/app/oracle/oradata/new.xml' nocopy tempfile reuse ;
Pluggable database created.

SQL> select pdb_name, status from cdb_pdbs; 
PDB_NAME STATUS
------------------ -------------
NEWDB_PLUG NEW
PDB$SEED NORMAL 

 Another method to plug database :

SQL> create pluggable database new_plug_copy using '/u01/app/oracle/oradata/new_2.xml'
  2  copy
  3  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/new_plug_copy');
Pluggable database created.

SQL> select name,open_mode from v$pdbs;

NAME       OPEN_MODE
------------------------------ ----------
PDB$SEED       READ ONLY
NEWDB_PLUG         MOUNTED
NEW_PLUG_COPY MOUNTED
 Therefore 
  • Copy Clause : 
    • if you want the files listed in the XML file to be copied to the new location and used for the new PDB.
  • Nocopy Clause
    • if you want the files for the PDB to remain in their current locations.

But what if i want to move all datafiles and create new pluggable database,oracle 12c provide you with new clause to do this which is "move" check below :

SQL> create pluggable database new_plug_move using '/u01/app/oracle/oradata/new_2.xml'
  2  move
  3  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/move');
create pluggable database new_plug_move using '/u01/app/oracle/oradata/new_2.xml'
*
ERROR at line 1:
ORA-65122: Pluggable database GUID conflicts with the GUID of an existing container.


The above error is normal because i already create  pluggable database using new_2.xml to solve it

SQL> create pluggable database new_plug_move as clone using '/u01/app/oracle/oradata/new_2.xml'
  2  move
  3  FILE_NAME_CONVERT=('/u01/app/oracle/oradata/New2','/u01/app/oracle/oradata/move');
Pluggable database created.
SQL> select pdb_name, status from cdb_pdbs;

PDB_NAME STATUS
------------------- -------------
NEWDB_PLUG NEW
PDB$SEED NORMAL
NEW_PLUG_COPY NEW
NEW_PLUG_MOVE NEW

You can open any database now and work on them.
This article uploaded to Slide Share here.

Reference
1-Oracle Documentation here


Thank you
Osama Mustafa

Friday, July 5, 2013

Pluggable Database Tutorial (12c) Part 2

In my Part 1 Tutorial for how to deal with Pluggable database 12c I mentioned how to use pluggable database , How to create pluggable database , how to create tablespace , and how to open/close pluggable database .

Please check the Part ( 1 ) before continue reading this article here.

Welcome to Pluggable database Part 2 


  • Rename Pluggable Database 
  • Manage Pluggable database
  • Drop Pluggable database
  • Security In Pluggable database


SQL> select name, con_id from v$active_services order by 1;

NAME     CON_ID
----------------------------- ----------
TEST  3

as you see in the above query, I already created pluggable database called test. and it's in Read write Mode.

Rename Pluggable database 

SQL> alter pluggable database TEST close immediate ;Pluggable database altered.
SQL> alter pluggable database TEST open restricted ;Pluggable database altered.
SQL> select name, open_mode from v$pdbs;

NAME                OPEN_MODE
------------------------------ ----------
TEST       READ WRITE
SQL> alter pluggable database TEST rename global_name to new ;Pluggable database altered.
SQL> select name, con_id from v$active_services order by 1;

NAME      CON_ID
--------------------------------------- ----------
new   3
if you are not connected to pluggable database or set session container then you will recicve error message  
ORA-65046: operation not allowed from outside a pluggable 
SQL> alter pluggable database new close immediate ;Pluggable database altered.

SQL> alter pluggable database new open ;Pluggable database altered.
Manage Pluggable Database

Back to root container using / as sysdba like below :
SQL> conn / as sysdba
Connected.
SQL> select name, con_id from v$active_services order by 1;NAME     CON_ID
--------------------------------------------------- ----------
SYS$BACKGROUND   1
SYS$USERS  1
db12c  1
db12cXDB  1
new           3

We Control which list for for tablespace & datafiles by using con_id.
  • List tablespace in root container 
SQL> select tablespace_name, con_id from cdb_tablespaces where con_id=1; 

TABLESPACE_NAME       CON_ID
------------------------------ ----------
SYSTEM 1
SYSAUX 1
UNDOTBS1 1
TEMP 1
USERS 1
CDATA 1

  • List Database In root Container 

 SQL> select file_name, con_id from cdb_data_files where con_id=1;
FILE_NAME CON_ID
--------------------------------------------------------------------------- ----------
/u01/app/oracle/oradata/db12c/users01.dbf      1
/u01/app/oracle/oradata/db12c/undotbs01.dbf      1
/u01/app/oracle/oradata/db12c/sysaux01.dbf      1
/u01/app/oracle/oradata/db12c/system01.dbf      1
/u01/app/oracle/oradata/db12c/gls/test.dbf      1
  • Temp Tablespace  in root container 
SQL> select file_name, con_id from cdb_temp_files where con_id=1; 

FILE_NAME CON_ID
----------------------------------------------------------------------------- ----------
/u01/app/oracle/oradata/db12c/temp01.dbf      1
  • Create Tablespace  ( already mentioned in Part (1)) 
SQL> create tablespace test datafile '/u01/app/oracle/oradata/db12c/gls/test03.dbf' size 20M; Tablespace created.
SQL> select tablespace_name, con_id from cdb_tablespaces order by con_id;


TABLESPACE_NAME   CON_ID
------------------------------ ----------
SYSTEM 1
TEST 1
CDATA 1
SYSAUX 1
TEMP 1
UNDOTBS1 1
USERS 1
SYSAUX 2
TEMP 2
SYSTEM 2
TEMP 3
SYSAUX 3
PDB_TEST 3
SYSTEM 3
14 rows selected.

  •  Create temp tablespace 
SQL> create temporary tablespace temp_test tempfile '/u01/app/oracle/oradata/db12c/gls/temp_test.dbf' size 20M ;
Tablespace created.
SQL> select file_name, con_id from cdb_temp_files where con_id=1;

FILE_NAME CON_ID
--------------------------------------------------------------------------- ----------
/u01/app/oracle/oradata/db12c/temp01.dbf      1
/u01/app/oracle/oradata/db12c/gls/temp_test.dbf      1

The Same Steps in root container for create tablespace and temp tablespace for pluggable database.

Security In Pluggable Database

In This Section we will discuss how to manage Users, roles and privileges.

before Demonstration you need to know what is the difference between two users  type :
  • Common  : when you create this kind of users in root it's automatically replicated in all Pluggable database.
  • Local : this kind of users only created on pluggable database that you are connected to it now. and dose not effect on others pluggable database.
To Create Common Users you need to be connected to root container.

SQL> conn / as sysdba
Connected.
SQL> create user c##osama identified by osama ;User created.
SQL> select username, common, con_id from cdb_users where username like 'C##%';

USERNAME COM CON_ID
------------------------------------ --- ----------
C##TEST YES      1
C##OSAMA YES      1
C##TEST YES      3
C##OSAMA YES      3
SQL> grant create session to c##osama ;Grant succeeded.
SQL> conn c##osama/osama@test12c:1521/db12c ;
Connected.
Let's connect to pluggable database :

The user i will created it here will not appear in root container.
SQL> conn sys/sys@test12c:1521/new as sysdba
Connected.

SQL> create user test identified by test ;User created.

SQL> grant create session to test ;Grant succeeded.
 SQL> select username, common, con_id  from cdb_users where username ='TEST';

USERNAME      COM CON_ID
------------------ ----------
TEST  NO      3
 SQL> conn test/test@test12c:1521/new ;
Connected.

 Same rules and conditions applied on Roles if you created in Root Container it will be replicated to pluggable database, on other hand if you created in Pluggable database it will be local without effecting Container.


Let's connect to Root Container

SQL> conn / as sysdba
Connected.
SQL> create role c##root_role ;Role created.

SQL> select role, common, con_id from cdb_roles where role='C##ROOT_ROLE';

ROLE  COM CON_ID
--------------------- --- ----------
C##ROOT_ROLE  YES      1
C##ROOT_ROLE  YES      3
SQL> conn sys/sys@test12c:1521/new as sysdba
Connected.
SQL> create role test2;Role created.
 SQL> select role, common, con_id from cdb_roles where role='TEST2';

ROLE COM CON_ID
---------------- --- ----------
TEST2 NO      3
SQL> create role hr container=all ;
create role hr container=all
*
ERROR at line 1:
ORA-65050: Common DDLs only allowed in CDB$ROOT
SQL> create user hr identified by hr container=all ;
create user hr identified by hr container=all
                             *
ERROR at line 1:
ORA-65050: Common DDLs only allowed in CDB$ROOT
---> you cannot create a common role inside a PDB.

Check user privileges :

SQL> select grantee, privilege, common, con_id from cdb_sys_privs
where privilege='CREATE SESSION' and grantee='TEST'; 

GRANTEE PRIVILEGE  COM  CON_ID
-------------- ---------------------------------------
TEST CREATE SESSION  NO       3
Drop Pluggable Database

SQL > drop pluggable database new  including datafiles;
Pluugable database dropped.
This document also available on slidshare here


Thank you
Osama mustafa