Posts

Showing posts from July, 2012

How to Unlock HR Schema in Oracle Database XE 11gR2 by using PL/SQL Developer

Image
Oracle provides sample HR schema in all versions of its databases which is locked by default. For working with tutorial of Introduction to Oracle you need to work on HR schema. Follow the given below steps to unlock HR schema in Oracle Database XE 11gR2 by using PL/SQL Developer.

Login in PL/SQL Developer as a user “system or sysdba” with respective password

Click on New button and open Command Window

How to Create Packages in Oracle Database using TOAD for Oracle

Image
What are Packages in Oracle Database

A package is a group of procedures, functions, variables and SQL statements created as a single unit. It is used to store together related objects. A package has two parts, Package Specification and Package Body.

Package Specification

Package Specification acts as an interface to the package. Declaration of types, variables, constants, exceptions, cursors and subprograms is done in Package specifications. Package specification does not contain any code.

Package Body

Package body is used to provide implementation for the subprograms, queries for the cursors declared in the package specification.


How to create Oracle stored Procedures using TOAD for Oracle

Image
In a database management system, a stored procedure is a set of Structured Query Language (SQL) statements with an assigned name that's stored in the database in compiled form so that it can be shared by a number of programs. The use of stored procedures can be helpful in controlling access to data, preserving data integrity and improving productivity.

The Oracle PL/SQL language allows you to write procedure to centralize the business logic and store the code in the database.

I have created the following Stored Procedure on Oracle using TOAD. This particular Stored Procedure will Insert a Customer to the Customer Table. For the sake of simplicity, Customer Table contains only 4 columns (Customer ID, Customer Name, City and Contact No).

In this post I will show you how to create Oracle stored Procedure using TOAD. Connect to Oracle Database using TOAD. Click on Database menu and open Schema Browser.

How to create Oracle stored Functions using TOAD for Oracle

Image
The Oracle PL/SQL language allows you to write functions and procedure to centralize the business logic and store the code in the database. A stored function is similar to a stored procedure with one key difference, a stored function returns a single value. This makes a stored function available in your SQL SELECT statements, unlike stored procedures that you must call within an anonymous PL/SQL block or another stored procedure.

In this post I will show you how to create Oracle stored Functions using TOAD. Connect to Oracle Database using TOAD. Click on Database menu and open Schema Browser.

How to Create Synonyms in Oracle using TOAD for Oracle

Image
A synonym is a database object that provides a better name to refer to objects. You can use synonyms to shorten lengthy names or to ease the reference to an object owned by another user. You can create synonyms for a table, view, sequence, procedure and other objects.
In this post I will show you how to create Synonyms in Oracle Database using TOAD for Oracle.

Connect to Oracle Database using TOAD. Click on Database menu and open Schema Browser

How to take Backup and Restore a Domain of Oracle GlassFish Application Server

Image
Backup Domain

backup-domain subcommand is used to take backup of domain. Before start the backup process, ensure that domain is stopped and then execute the following command. The backup-domain command operates only when the domain is stopped or suspended.

# asadmin backup-domain --backupdir [directory patch] domainname

--backupdir switch is used to specify a directory in which to store the backup.

How to Deploy and Undeploy an Application in Oracle GlassFish Application Server

The easiest way of deploying an application through the command line is by using the following command:


# asadmin deploy [ path of file ]/webapp1.war


Access the webapp1 application by typing the following URL in your browser:

How to Delete Domain in Oracle GlassFish Application Server

Image
Deleting a domain is very simple in Oracle GlassFish Application Server. It can be accomplished by issuing the following command in the command line:


# asadmin delete-domain domainname

How to Configure Multiple Domains in Oracle GlassFish Application Server

Image
If we want several domains to execute concurrently on the same server, then ports must be chosen carefully, as specifying the same ports for different services or even the same service across domains will prevent one of the domains form working properly.

So to avoid port conflict you have to assign different port numbers in different domains for each purpose. The easy way of doing this is using portbase option in create-domain command. Given below is the create domain command with portbase option.


# asadmin create-domain --portbase [port number] domainname

List of Services for the domain in Oracle GlassFish Application Server

The default posts for the default domain are listed in the following table:


Services Port Admin4848 HTTP8080 Java Messaging System (JMS)7676       Internet Inter-ORB Protocal (IIOP)3700 Secure HTTP (HTTPS)8181 Secure IIOP3820 Mutual Authorization IIOP3920 Java Management Extensions (JMX) Administration8686

How to Stop Oracle GlassFish Application Server Domain

Image
A domain that is executing can be stopped by issuing the following command:


# asadmin stop-domain domainname


How to Start Oracle GlassFish Application Server Domain

Image
To start GlassFish, change the directory to [glassfish installation directory]/glassfishv3/bin on command prompt and execute the following command:


# asadmin start-domain domainname


I have configured domain1 as domain name and in my case above command change to:

How to create domains in Oracle GlassFish Application Server

Image
To create domain in GlassFish Server, open command prompt and change the directory to [glassfish installation directory]/glassfishv3/bin and execute the following command. The asadmin batch file is located in BIN folder that's way we change the directory location in command prompt.


# asadmin create-domain domainname


Change the domainname on your choice. Here I am creating a new domain called domain1 as shown below:

How to run Virtual OS in Full Screen mode by using Oracle VM VirtualBox

Image
Today I install the Oracle VM VirtualBox 4.1.18 on Windows 7 and in VM VirtualBox I install the Windows XP on it. After the installation I found a issue that I can't usefully run Virtualbox in full screen mode. I switched to full screen mode, but the full screen consisted of the window surrounded by black space as shown below.