Monday, May 28, 2012

How to append path to Environment variable in Linux

The current value set to my environment variable PATH is

oracle@mymachine currentdirctory]$ echo $PATH
/home/oracle/Program/jdk1.6.0_21/bin:/home/oracle/app/oracle/product/11.1.0/client_1/bin:.:/home/oracle/Program/jdk1.6.0_21/bin:/home/oracle/app/oracle/product/11.1.0/client_1/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
Add new enviroment variable and set the path
[oracle@mymachine currentdirctory]$ export ANT_HOME=/home/oracle/myproject/apache-ant-1.8.4

Add the above path to PATH variable
[oracle@mymachine currentdirctory]$ export PATH=${PATH}:${ANT_HOME}/bin

[oracle@mymachine currentdirctory]$ echo $PATH
/home/oracle/Program/jdk1.6.0_21/bin:/home/oracle/app/oracle/product/11.1.0/client_1/bin:.:/home/oracle/Program/jdk1.6.0_21/bin:/home/oracle/app/oracle/product/11.1.0/client_1/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/home/oracle/myproject/apache-ant-1.8.4/bin

You can see that the environmet path is appended.

Thursday, May 17, 2012

Determine the port number for Database Control

On Linux and UNIX systems:

You can check the file in below metioned path
 Oracle_home/install/portlist.ini

On Microsoft Windows systems:
This can be checked from the Database Control Properties window.



Go to the Start menu, navigate to the Database Control entry in the Oracle home folder, then right-click this entry and select Properties.

Setting the GLOBAL_NAMES Initialization Parameter

1. Log in to Enterprise Manager as an administrative user who can change initialization parameters.
See "Access oracle enterprise manager home page"
2. Go to the Database Home page for the database instance.
 
3. Click Server to open the Server subpage.

4. Click Initialization Parameters in the Database Configuration section.

5. If you are using a server parameter file, then click SPFile. Otherwise, proceed to the next step.

6. On the Initialization Parameters page, enter GLOBAL_NAMES in the search tool.

7. Set the appropriate value.

Access Oracle Enterprise Manager Home Page

Accessing the Database Home Page

The Database Home page is the main database management page in Oracle Enterprise Manager Database Control (Database Control).
To access the Database Home page:
  1. Ensure that the dbconsole process is running on the database host computer.
  2. In your Web browser, enter the following URL:
    https://hostname:portnumber/em
    
    For example, if you installed the database on a host computer named computer.example.com, and the installer indicated that your Enterprise Manager Console HTTP port number is 1158, enter the following URL:
    https://comp42.example.com:1158/em
  1. When you access Database Control, if the database is running, it displays the Login page. If the database is down and needs to be restarted, Database Control displays the Startup/Shutdown and Perform Recovery page.

Monday, May 14, 2012

CREATE SCHEMA in Oracle Database


Oracle Database automatically creates a schema when you create a user.

Use the CREATE USER statement to create and configure a database user.


PREREQUISITES:
You must have the CREATE USER system privilege. For the user to login to the Oracle Database, must have the CREATE SESSION system privilege. Therefore, after creating a user, you should grant the user at least the CREATE SESSION system privilege.

EXAMPLE:

CREATE


USER DEVIDENTIFIED BY DEVDEFAULT TABLESPACE DATATEMPORARY TABLESPACE TEMPPROFILE DEFAULT

DEFAULT TABLESPACE Clause:

Specify the default tablespace for objects that the user creates. If you omit this clause, then the user's objects are stored in the database default tablespace. If no default tablespace has been specified for the database, then the user's objects are stored in the SYSTEM tablespace.

TEMPORARY TABLESPACE Clause :

Specify the tablespace or tablespace group for the user's temporary segments. If you omit this clause, then the user's temporary segments are stored in the database default temporary tablespace or, if none has been specified, in the SYSTEM tablespace.
ACCOUNT UNLOCK;
  • Specify tablespace to indicate the user's temporary tablespace.
  • Specify tablespace_group_name to indicate that the user can save temporary segments in any tablespace in the tablespace group specified by tablespace_group_name.