Skip to content

Posts from the ‘Administration’ Category

dbms_space displaying information about space usage

Oracle Database provides data dictionary views and PL/SQL packages that allow you to display information about the space usage of schema objects.

DBMS_SPACE : refer here

Just a example :

SQL> VARIABLE total_blocks NUMBER
SQL> VARIABLE total_bytes NUMBER
SQL> VARIABLE unused_blocks NUMBER
SQL> VARIABLE unused_bytes NUMBER
SQL> VARIABLE lastextf NUMBER
SQL> VARIABLE last_extb NUMBER
SQL> VARIABLE lastusedblock NUMBER

SQL> exec DBMS_SPACE.UNUSED_SPACE('SCOTT', 'EMP', 'TABLE', :total_blocks,:total_ bytes,:unused_blocks,:unused_bytes, :lastextf,:last_extb, :lastusedblock);

PL/SQL procedure successfully completed.

SQL> print

TOTAL_BLOCKS
------------
8
TOTAL_BYTES
-----------
65536
UNUSED_BLOCKS
-------------
4
UNUSED_BYTES
------------
32768
LASTEXTF
----------
4
LAST_EXTB
----------
144
LASTUSEDBLOCK
-------------
4

SQL>

How do you acces your local directory from Remote Desktop whenever you login windows remote desktop

This is the simple method to configure

Step 1:

open remote desktop, click options –> local resources

click more

 

Step 2:

Choose your local directory

 

Step 3:

Now login remote desktop

Step 4:

you can see your local directory at remote desktop, now you can able to copy server data to your local directory

 

 

mailx SMTP; 554 Domains without a subdomain are not allowed

While I’m trying to send mail to another domain mail id from root linux terminal using by mailx, It shows the below error

SMTP; 554 Domains without a subdomain are not allowed

first my mind focused on sendmail configuration , Is any configuration issues there while configure sendmail?. But I checked everything here, I can not found any solutions from here. Finally I found the solution.

Solution :

Add hostname with domain in hosts file

[root@siebelpoc ~]# cat /etc/hosts #

Do not remove the following line, or various programs # that require network functionality will fail.

127.0.0.1                localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

10.xx.xx.xx  domaintest.xxx.com  domaintest

After add it  here, just restart the network service. you can able to send mail other domain related mail id like (mail@yyy.com).

Change ip address using linux terminal

Change network ip address

[root@siebelpoc ~]# system-config-network-tui

Enter

Select your ethernet & Enter

Change the ip address

After change it. restart network service.

 [root@siebelpoc ~]# service network restart

Additionaly If you want check your network ipaddress and default gateway

[root@siebelpoc ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:23:7D:24:03:BA
ONBOOT=yes
DHCP_HOSTNAME=siebel.ace-ins.com
TYPE=Ethernet
IPADDR=xx.xx.xx.xx
NETMASK=255.255.255.0
GATEWAY=xx.xx.xx.xx
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@siebelpoc ~]#

Oracle virtualbox installation error on linux

This topic may useful for who may face below errors while configure oracle virtual box on Linux.

Download VirtualBox for Redhat 5 64bit

Oracle VirtualBox Download

Install

[root@netbackuptest virtualbox]# rpm -Uvh VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64.rpm
warning: VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 98ab5139
error: Failed dependencies:
        libSDL-1.2.so.0()(64bit) is needed by VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64

I faced the above error while installing, you need to install SDL-1.2.10-8.el5.* rpm package for your machine.You can get it from your OS DVD.

[root@netbackuptest virtualbox]# rpm -Uvh SDL-1.2.10-8.el5.i386.rpm
warning: SDL-1.2.10-8.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:SDL                    ########################################### [100%]
[root@netbackuptest virtualbox]# rpm -Uvh SDL-1.2.10-8.el5.x86_64.rpm
warning: SDL-1.2.10-8.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:SDL                    ########################################### [100%]

Again I try to Install VirtualBox,

[root@netbackuptest virtualbox]# rpm -Uvh VirtualBox-4.1-4.1.4_74291_rhel5-1.x86
warning: VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64.rpm: Header V4 DSA signature:
Preparing...                ########################################### [100%]
   1:VirtualBox-4.1         ########################################### [100%]

Creating group 'vboxusers'. VM users must be member of that group!

No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Stopping VirtualBox kernel modules [  OK  ]
Uninstalling old VirtualBox DKMS kernel modules [  OK  ]
Trying to register the VirtualBox kernel modules using DKMS [FAILED]
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
  (Look at /var/log/vbox-install.log to find out what went wrong)

This time virtulbox was installed but i got a dkms error. this condition , you need to download
dkms-2.1.1.2-1.el5.rf.noarch.rpm package.
dkms-2.1.1.2-1.el5.rf.noarch.rpm

[root@netbackuptest virtualbox]# rpm -Uvh dkms-2.1.1.2-1.el5.rf.noarch.rpm
warning: dkms-2.1.1.2-1.el5.rf.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79                                                                     e6
error: Failed dependencies:
        kernel-devel is needed by dkms-2.1.1.2-1.el5.rf.noarch

Dependencies rpm package need. the above kernel-devel get it from OS DVD.

[root@netbackuptest virtualbox]# rpm -Uvh kernel-devel-2.6.18-238.el5.x86_64.rpm
warning: kernel-devel-2.6.18-238.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID                                                                      37017186
Preparing...                ########################################### [100%]
   1:kernel-devel           ########################################### [100%]
[root@netbackuptest virtualbox]# rpm -Uvh dkms-2.1.1.2-1.el5.rf.noarch.rpm
warning: dkms-2.1.1.2-1.el5.rf.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79                                                                     e6
Preparing...                ########################################### [100%]
   1:dkms                   ########################################### [100%]

Again I try to install Oracle Virtulbox

[root@netbackuptest virtualbox]# rpm -Uvh VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64.rpm
warning: VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64.rpm: Header V4 DSA signature: NOKEY,                                                                      key ID 98ab5139
Preparing...                ########################################### [100%]
        package VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64 is already installed
 

It show package already Installed, just remove this rpm package and install it again.
[root@netbackuptest virtualbox]# rpm -e VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64
[root@netbackuptest virtualbox]# rpm -Uvh VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64.rpm
warning: VirtualBox-4.1-4.1.4_74291_rhel5-1.x86_64.rpm: Header V4 DSA signature: NOKEY,                                                                      key ID 98ab5139
Preparing...                ########################################### [100%]
   1:VirtualBox-4.1         ########################################### [100%]

Creating group 'vboxusers'. VM users must be member of that group!

No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Stopping VirtualBox kernel modules [  OK  ]
Uninstalling old VirtualBox DKMS kernel modules [  OK  ]
Trying to register the VirtualBox kernel modules using DKMS [  OK  ]
Starting VirtualBox kernel modules [  OK  ]
[root@netbackuptest virtualbox]#

Now Everything was okay.
Go to –> Applications –> System Tools –> Oracle VM VirtualBox

ORA-01045: user TESTME lacks CREATE SESSION privilege; logon denied

I just review a answer from OTN forums.

I tested here

SQL> create role testme_role identified by test;

Role created.

SQL> grant create session to testme_role;

Grant succeeded.

SQL> create user testme identified by testme;

User created.

SQL> grant testme_role to testme;

Grant succeeded.

SQL> conn testme/testme;
ERROR:
ORA-01045: user TESTME lacks CREATE SESSION privilege; logon denied

Warning: You are no longer connected to ORACLE.

The issue is caused by the fact that the roles are not active in the user's session. 
Although the roles have been granted, they may not be default roles

SQL> select * from dba_role_privs where grantee='TESTME';

GRANTEE                        GRANTED_ROLE                   ADM DEF
------------------------------ ------------------------------ --- ---
TESTME                         TESTME_ROLE                    NO  YES
SQL> SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='CONNECT';

GRANTEE                        PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
CONNECT                        CREATE SESSION                           NO

SQL> grant create session to testme;

Grant succeeded.

SQL> conn testme/testme;
Connected.
SQL> select * from session_roles;

no rows selected

SQL> create table abc(empno number);
create table abc(empno number)
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> conn / as sysdba
Connected.
SQL> grant create table to testme_role;

Grant succeeded.

SQL> conn testme/testme
Connected.
SQL> set role testme_role;
set role testme_role
*
ERROR at line 1:
ORA-01979: missing or invalid password for role 'TESTME_ROLE'

SQL> set role testme_role identified by test;

Role set.

SQL> select * from session_roles;

ROLE
------------------------------
TESTME_ROLE

SQL> create table abc(empno number);

Table created.

SQL>

Hanging the process while installing Oracle Solaris 64bit on virtualbox

If you’re a beginner to install Oracle Solaris 64bit on Virtualbox, You may be get some hanging process while installing solaris at beginning stage like below

SunOS Release 5.10 Version Generic_14.... 64-bit

So They may be more confuse what I mistake, they may thought Everything I was selected Okay like

If you plan to install Solaris 64bit,  We must want to enable VT-x/AMD-v But It was default selected when you’re chooses subject page Solaris 64bit, then they may think what mistake, take a few more hours to analyze this one.

But Answer is simple .

You may select RAM memory size max 1GB RAM while configuration. But Oracle Solaris needs minimum 1536MB memory. then only you start the Oracle Solaris installation page…

 

 

csscan: error while loading shared libraries: libnnz10.so: cannot open shared object file

When i trying to execute csscan utility for Oracle 10g home ,I have faced the below errors

[oracle@netbackuptest ~]$ csscan
csscan: error while loading shared libraries: libnnz10.so: cannot open shared object file: No such file or directory

I try to fix this error

[oracle@netbackuptest ~]$  ldd `which sysresv`
        linux-vdso.so.1 =>  (0x00007fff33d89000)
        libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 (0x00002b026dc36000)
        libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so (0x00002b0270260000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003495000000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003494c00000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003495400000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003498800000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003494800000)
        libaio.so.1 => /usr/lib64/libaio.so.1 (0x00002b027063b000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003494400000)

Everything was okay.but I can see Oracle 11g home path was default on bash_profile environment. So in this case, I need to set oracle 10g home and library path.

[oracle@netbackuptest ~]$ export ORACLE_HOME=/u02/oracle/product/10.2.0/db_1
[oracle@netbackuptest ~]$ export PATH=$ORACLE_HOME/bin
[oracle@netbackuptest ~]$ LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib; export LD_LIBRARY_PATH
[oracle@netbackuptest ~]$ export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
[oracle@netbackuptest ~]$ csscan

Character Set Scanner v2.1 : Release 10.2.0.0.0 - Production on Sat Oct 8 03:39:43 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Username

Now I can able to run csscan utility.

No termcap nor curses library found while configuring rlwrap on OEL

While configuring rlwrap on my Oracle Enterprise Linux,I faced some below errors

[root@mazar rlwrap-0.30]# ./configure

———————————–
———————————–
———————————–
configure: checking for pty ranges…
checking for tgetent… no
checking for tgetent in -lcurses… no
checking for tgetent in -lncurses… no
checking for tgetent in -ltermcap… no
configure: WARNING: No termcap nor curses library found
checking for readline in -lreadline… no
configure: error:

Solution : We need to install below rpm packages

[root@mazar tmp]# rpm -Uvh libtermcap-devel-2.0.8-46.1.i386.rpm
warning: libtermcap-devel-2.0.8-46.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing… ########################################### [100%]
1:libtermcap-devel ########################################### [100%]
[root@mazar tmp]# rpm -Uvh readline-devel-5.1-3.el5.i386.rpm
warning: readline-devel-5.1-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing… ########################################### [100%]
1:readline-devel ########################################### [100%]
[root@mazar tmp]#

 

After Installed, Now I Can able to configure rlwrap.

[root@mazar rlwrap-0.30]# ./configure
checking build system type… i686-pc-linux-gnu
checking host system type… i686-
config.status: creating doc/rlwrap.man
config.status: creating distribution/rlwrap.spec
config.status: creating config.h
config.status: executing depfiles commands

Now do:
make (or gmake) to build rlwrap
make check for instructions how to test it
make install to install it
pc-linux-gnu

Can we create additional database for Oracle Express Edition?

Can we create new additional database for Oracle Expression Edition? Because No DBCA available in express edition, However we can create database using manual script.

We can follow way for normal database creation manual steps only…

Consider new Database Name is “XETEST”

Step 1:  Create suitable directory for new database.

like below

C:\oraclexe\app\oracle\admin\XETEST
  • adump
  • dpdump
  • pfile
C:\oraclexe\app\oracle\oradata\XETEST

Step 2: Create new instance for new database

       C:\Windows\system32>oradim -new -sid xetest
         Instance created.

Step 3 : Create password file for new database

C:\Windows\system32>orapwd file=C:\oraclexe\app\oracle\product\11.2.0\server\database\PWDXETEST.ora password=sysxe

Step 4 : Create New pfile like below

xe.__db_cache_size=117440512
xe.__java_pool_size=4194304
xe.__large_pool_size=8388608
xe.__oracle_base='C:\oraclexe\app\oracle'#ORACLE_BASE set from environment
xe.__pga_aggregate_target=188743680
xe.__sga_target=566231040
xe.__shared_io_pool_size=92274688
xe.__shared_pool_size=335544320
xe.__streams_pool_size=0
*.audit_file_dest='C:\oraclexe\app\oracle\admin\XETEST\adump'
*.compatible='11.2.0.0.0'
*.control_files='C:\oraclexe\app\oracle\oradata\XETEST\control.dbf'
*.db_name='XETEST'
*.DB_RECOVERY_FILE_DEST_SIZE=10G
*.DB_RECOVERY_FILE_DEST='C:\oraclexe\app\oracle\flash_recovery_area'
*.diagnostic_dest='C:\oraclexe\app\oracle'###########################################
*.dispatchers='(PROTOCOL=TCP) (SERVICE=XETESTXDB)'
*.job_queue_processes=4
*.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=AZAR-PC.ace-ins.com)(PORT=1522))'
*.open_cursors=300
*.os_authent_prefix=''
*.pga_aggregate_target=180M
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=20
*.sga_target=540M
*.shared_servers=4
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'

Step 5: Stratup nomount stage db using new pfile

.
C:\Windows\system32>SET ORACLE_SID=XETEST

C:\Windows\system32>sqlplus

SQL*Plus: Release 11.2.0.2.0 Beta on Sun May 22 15:23:42 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Enter user-name: / as sysdba
Connected to an idle instance.

SQL> startup nomount pfile='d:\temp\initXETEST.ora';
ORACLE instance started.

Total System Global Area  564957184 bytes
Fixed Size                  1384956 bytes
Variable Size             171970052 bytes
Database Buffers          385875968 bytes
Redo Buffers                5726208 bytes

Step 6: Create Database Script  like below

create database XETEST
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
  GROUP 1 'D:\temp\redolog\REDO01.LOG'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 'D:\temp\redolog\REDO02.LOG'  SIZE 50M BLOCKSIZE 512
DATAFILE'C:\oraclexe\app\oracle\oradata\XETEST\SYSTEM.DBF' size 100m autoextend on
sysaux datafile 'C:\oraclexe\app\oracle\oradata\XETEST\SYSAUX.DBF' size 100m autoextend on
undo tablespace undotbs1 datafile  'C:\oraclexe\app\oracle\oradata\XETEST\UNDOTBS1.DBF' size 100m autoextend on
CHARACTER SET AL32UTF8
;

Step 7: After created it, you can run at sql prompt


SQL> @D:\temp\create.sql

Database created.

Step 8: Now database was created, Check Instance status & Version

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Beta
PL/SQL Release 11.2.0.2.0 - Beta
CORE    11.2.0.2.0      Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Beta
NLSRTL Version 11.2.0.2.0 - Production

SQL>
The above newly created database is Express edition version.
And also RUN
SQL> @C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\catalog.sql

SQL> @C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\catproc.sql