Skip to main content

Posts

Showing posts from 2012

ORA-12518: TNS:listener could not hand off client connection

You may get below error when trying to connect to the database using sqlplus or through an application login. ORA-12518: TNS:listener could not hand off client connection Reason: The process of handing off a client connection to another process failed. Solution;   Increase PROCESSES initialization parameter. Use the following command to check the value of the PROCESSES initialization parameter: show parameter processes; If the database was started using an spfile, then the following command can be used to increase the PROCESSES initialization parameter: alter system set processes=600 scope=spfile; If the database was started using a pfile, then the value of the processes parameter must be changed in the pfile and the database bounced.

ftp "500 OOPS: cannot change directory" error

Error: When trying to log in through ftp you may receive below error: ftp 500 OOPS: cannot change directory Solution: In the console do the following (Log in as ROOT) su - getsebool -a | grep ftp setsebool -P ftp_home_dir on getsebool -a | grep ftp Eg: [root@test ~]# getsebool -a | grep ftp allow_ftpd_anon_write --> on allow_ftpd_full_access --> off allow_ftpd_use_cifs --> off allow_ftpd_use_nfs --> off ftp_home_dir --> on httpd_enable_ftp_server --> off

Oracle CSS Daemon

In Oracle CSS Daemon refers to Cluster Synchronization Services  , a daemon process that is used for synchronization between different  RAC  nodes and synchronization between  ASM  and Oracle database instances. To stop the Oracle Cluster Services Synchronization (CSS) daemon, run the following command: On AIX: /etc/init.cssd stop On other platforms: /etc/init.d/init.cssd stop To start the CSS daemon, run the following command: /etc/init.d/init.cssd start This command stops the Oracle CSS daemon and then restarts it. $ORACLE_HOME/bin/localconfig reset

Oracle User Quota

Quota A quota is the amount of space allocated to a user in a tablespace. You may get oracle error like below due to this problem. ORA-01536:space quota exceeded for tablespace 'string' Change quota allocation A user's quota can be changed with the ALTER USER command. Examples: Restrict user to 10M: ALTER USER test QUOTA 10M ON users; Allow unlimited space ALTER USER test QUOTA unlimited ON users; Monitor Query the USER_TS_QUOTAS view to see the quota allocation. SQL> SELECT * FROM user_ts_quotas;

How to Create a Shortcut to Run a Program as a Specified User in Windows

1.  Right click on an empty area on desktop, and click on  New  and  Shortcut . 2.  Type the command below into the location area, and click on the  Next  button. (see screenshot below) Replace  USER-NAME  in the command with the actual name of the user account that you want to run the program as. runas /user:USER-NAME "C:\full\path\of\Program.exe" For example, if I wanted to run Notepad as the  test  user, I would type this command below. runas /user:myadmin "D:\myprogram\myprogram.exe" 3.  Type a name for the shortcut in the name section, and click on the  Finish  button.  4.  Right click on the new shortcut on the Desktop and click on  Properties . 5.  Click on the  Shortcut  tab, then click on the  Change Icon  button. 6. Now you can access the file through your new shortcut.  Double  click on the icon and you may...

DBVERIFY: Database Verification Utility

DBVERIFY  is a utility of Oracle , that can be used to perform a physical structure integrity check against  database files. Note that the database should be off line before performing a DBVERIFY. But it will work with online data files also,but its not recommended. DBVERIFY is invoked using dbv command.It should be called from ORACLE_HOME/bin directory. To access help on DB_VERIFY type:   dbv help=y To perform a simple DBVIRIFY use below command.Output will be written to the dbv.log file. >dbv file=/u01/oracle/product/10.2.0/oradata/orcl/users01.dbf logfile=dbv.log Note that this is only a verification tool to get a idea about data files,whether they are corrupted or not.You'll have to follow other methods to recover corrupted data files. Exmples: dbv example of  a datafile with no corruption. (Pages are data blocks) DBVERIFY: Release 11.2.0.2.0 - Production on Tue Mar 13 15:41:47 2012 Copyright (c) 1982, 2009, Oracle and/or its ...

Linux tar Command

The  tar (tape archive) command bundles a bunch of files together and creates an archive  on a tape, disk drive etc. Simple way for creating a tar file. Go to the relevant path.In our example go to the path where "myfolder" resides.So if I want to add files in myfolder to a tar file issue below command.It will create the tar file in /my location. tar -cvf  /my/test.tar  myfolder How to untar... Go to the location where you want to untar the files/folder and issue below command. tar -xvf  /my/test.tar You can use below command to list the contents of a tar file to a log. tar -tvf  test.tar  > temp/test.log Options available with tar command: c  Create a new archive. t  List the contents of an archive. x  Extract the contents of an archive. f  The archive file name is given on the command line (required whenever the tar output is going to a file) M  The archive can span multiple flop...

Oracle Database 9i DBCA error - ORA-29807: Specified oprator does not exist

During installation of Oracle 9i database - DBCA - Creating a database step - you will get an error like below.Error will be shown in " Creating data dictionary Views" section when the process is around 17% complete. ORA-29807: Specified oprator does not exist  This is actually a bug in the software. It is a known Oracle 9i problem regarding data dictionary views. It has been determined that this error is being raised while DBCA is running the script prvtxml.plb. Prvtxml.plb is a script which creates a particular package body. This script is called from the catxml.sql script - which in turn is called by the catproc.sql script - run automatically when creating a database using DBCA. Anyway  You can safely ignore the error and continue with the creation of the database. Workaround: 1. Click Ignore and go ahead with DBCA (after invoking DBCA).     The database creation using DBCA should now proceed without additional errors. OR  2. Go to the script catx...

Change open_cursors Value

The Oracle initialization parameter OPEN_CURSORS specifies the number of cursors a session can have open at any one time. The default value is 300. If the session attempts to open a new cursor but already has the maximum number of cursors open, the Oracle error -1000 will be returned. Your client application may hit the following error : ORA-01000: maximum open cursors exceeded You can do two things, 1) Change the inti.ora parameter open_cursors = <increased-no> init.ora file location = ORACLE_HOME\dbs A database restart is needed to affect the above change. You can check the value by below sql. SQL> show parameter OPEN_CURSORS; Note: If you are using a spfile you can do it through below statement. alter system set open_cursors=xxx scope=both; 2) In your application code , use For ...Cursors, because that automatically closes the cursor.     If you cannot use For..Cursor, take care to close the cursors. Otherwise the opened cursors will persist in memory and inc...

How to Enable Archive log Mode

If you are using an spfile With the database open, issue ALTER SYSTEM SET log_archive_start = true SCOPE=spfile; ALTER SYSTEM SET log_archive_dest_1 = "location=D:\Oracle\oradata\orcl\archive" SCOPE=spfile; ALTER SYSTEM SET log_archive_format = %%ORACLE_SID%%T%TS%S.ARC SCOPE spfile; Then do the shutdown and mount the database. connect sys/<pwd> as sysdba startup mount; ALTER DATABASE ARCHIVELOG;  ALTER DATABASE OPEN;  ALTER SYSTEM SWITCH LOGFILE; (To force the archive generation) archive log list ; (for see that database is runing on archive or not) If you are using a pfile shutdown the database in the INIT<SID>.ORA set log_archive_start = true log_archive_dest_1 = "location=D:\Oracle\oradata\orcl\archive"  log_archive_format = %%ORACLE_SID%%T%TS%S.ARC Then do the shutdown and mount the database. connect sys/<pwd> as sysdba startup mount; ALTER DATABASE ARCHIVELOG;  ALTER DATABASE OPEN;  ALTER SYSTEM SWI...

Flash Recovery Area renamed to Fast Recovery Area in 11g

Flash Recovery Area renamed to Fast Recovery Area in 11g Curious about this renaming? Is it just a word change or is there something else behind ?  It is just a name/word change.  Suppose Oracle wanted it to better reflect the meaning - Ultimate goal of Fast Recovery .  http://docs.oracle.com/cd/E11882_01/server.112/e10595/whatsnew003.htm#BGGBBGFI

Using ORADIM to Create Instance on Oracle - Windows Platform

Oradim is an Oracle utility that creates a Service to a database.  If a database is created upon install, or if you use Database Assistant to create a db, it will automatically use this utility to create a service to the db upon creation of the db. If you double click on the Services icon in Control Panel, you will see all the services that are available to the machine. If a machine has a db running on it, you will see a service by the name of OracleService(SID) with a manual or automatic startup type. If the startup is set to automatic, the db will shutdown/startup whenever the machine is restarted, else you will have to shutdown/startup manually.  So you have to use oradim only when you create a database without using the Database Configuration Assistant. You have to use Oradim to create services if you created the database manually.   Example of Oradim to create a service for an 9i database: Create an instance by specifying the following options: (type at comma...

Oracle Spool Command (Output To File)

You can use Oracle SPOOL command to output of a query in SQL Plus in Oracle to an output file. Below is an example. SQL> Spool on SQL> Spool c:\abc.log SQL> Query SQL> Spool off Spool the output to a file without column names included. SQL> Spool on SQL> set heading off  SQL> Spool  c:\abc.log SQL> Query SQL> Spool off

Difference between ALTER DATABASE RECOVER & RECOVER DATABASE

Do you know the difference between below two commands/methods of recovery..? You may get confused over these two commands. 1.ALTER DATABASE RECOVER; 2.RECOVER DATABASE;    or    RECOVER DATABASE UNTIL CANCEL;  Both above commands are intend to achieve same task..but only difference is.. (1)Use ALTER DATABASE if you want to do the recoverying step by step, manually , issuing each and  every single command to recover the database. (2)Use the SQLPLUS  'RECOVER' command to have sqlplus automate the steps in (1) for you.  RECOVER is not even a SQL command, rather it is a SQLPlus command.It is an automated command to do the  normal recovery steps. Oracle Corporation recommends that you use the SQL*Plus RECOVER statement.

Setting ORACLE_SID

The  Oracle System ID  ( S ID ) is used to uniquely identify a particular database on a system How to set ORACLE_SID: Windows: set ORACLE_SID=orcl Unix/ Linux: export ORACLE_SID=orcl SID is case sensitive in Unix / Linux environments. How to check the current ORACLE_SID: Windows: Go to the commnand prompt and type as C:\> set ORACLE_SID (This will show if any ORACLE_SID is already set). C:\> set (To know all the parameters set) Unix/ Linux: echo $ORACLE_SID