2008. 9. 4. 23:01 오라클
'오라클'에 해당되는 글 499건
- 2008.09.04 Windows 2008 server에서 oracle10g 설치 시 에러날 때
- 2008.07.15 ORA-4031 On Using Auto SGA
- 2008.07.14 XPT 서비스 멈추기
- 2008.04.16 Oracle RAC patch 후 startup 안될때.
- 2008.02.13 DEAD LOCK이 발생했을때 발생시킨 유저와 SQL문을 찾아주는 SQL 1
- 2007.12.26 How to use Very Large Memory, higher than 4Gb on Windows 2003 32 bit
- 2007.12.21 Script: To Recompile Invalid Objects
- 2007.12.12 genclntsh: Could not locate $ORACLE_HOME/network/admin/shrept.lst
- 2007.12.11 ORA-1536: When Inserting Into a Table
- 2007.08.06 Mac OS 에 oracle 설치하기.
2008. 7. 15. 18:07 오라클
ORA-4031 On Using Auto SGA
Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.1.0.6
This problem can occur on any platform.
Symptoms
- Getting ORA-4031 that is reported in the shared pool.
- Using auto SGA.
- Shared pool and SGA are set to appropriate values.
- Opening the ORA-4031 trace file, you can see a lot of space allocated to "Free Space" field.
- Running the following queries will return values less than 10
select a.ksppinm "Parameter",
b.ksppstvl "Session Value",
c.ksppstvl "Instance Value"
from sys.x$ksppi a, sys.x$ksppcv b, sys.x$ksppsv c
where a.indx = b.indx and a.indx = c.indx
and a.ksppinm = '_shared_pool_reserved_pct';
Parameter Session Value Instance Value
------------------------------------------------------------------------------
_shared_pool_reserved_pct 5 5
Cause
The issue is Shared Pool fragmentation. This fragmentation is caused because the shared pool reserved size is set to less than 10% of the shared pool size (5% in the above example). It is always recommended that shared pool reserved size is 10% of the shared pool size to avoid fragmentation.
Modifying the shared pool in Auto-SGA is done only using a hidden parameter as below.
Solution
SQL> alter system set "_shared_pool_reserved_pct"=10 scope=spfile
or set it in init.ora
"_shared_pool_reserved_pct"=10
And restart the instance.
2008. 7. 14. 16:01 오라클
XPT 서비스 멈추기
10,2 를 깔면 셋팅도 안했는데 자동적으로 listener에 SID_XPT라는 서비스가 등록이 됩니다.
서비스에 전혀 영향을 주지 않으나 없애 버리고 싶으면 아래와 같이 해 버리면 됩니다.
XPT는 Data Guard 환경에서 쓰이기 위해 생기는 것이라고 함.
================================================
1. init_ora 화일에 __dg_broker_service_names=''
or
2. alter system set "__dg_broker_service_names" = ' scope=spfile;
2008. 4. 16. 09:53 오라클
Oracle RAC patch 후 startup 안될때.
RAC 환경에서 patch 후 한쪽 노드가 올라오지 않을때.
alert.log 나 udump, cdump 등에도 특별한 로그는 남지 않음. 올리면 아래와 같이 나오기만 하고 난감함.
ORA-00469: CKPT process terminated with error
ORA-07445: exception encountered: core dump [] [] [] [] [] []
9i or 10g 상관없이 에러 발생함.
잘 찾아보면 1번 노드에는 $ORACLE_HOME/rdbms/lib/libknlopt.a 화일이 있으나 2번에는 없음.
수동으로 동일한 위치에 copy 해주고 (DB 내리고 할것) 다시 relink 해주면 한방에 올라옴.
요로코롬 해결하면 됨. 자세한 방법은 아래의 metalink 문서 참조.
==================================================================================================
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.2
This problem can occur on any platform.
After installing any One-off patch in RAC nodes, one of those nodes may fail to start the instance.
NOTE: We did observe the similar problem on 10.2.0.2 RAC installations where certain libraries are not copied from the installing node to other RAC nodes. For such type of problem while performing installation, please refer to the following note.
Note 363840.1 - 10.2.0.2 RAC: ORA-7445 in KKXSYN or KKXCMS ON ALL NODES BUT INSTALL NODE
Symptoms
Oracle Instance does not startup on one of RAC the nodes after installing any One-off Patch.
If you see the alert and trace log files, you may see the following errors:
ORA-00469: CKPT process terminated with error
ORA-07445: exception encountered: core dump [] [] [] [] [] []
Cause
It was noted that the resulting 'Oracle' binaries on different nodes were not the same. Running a cksum on all involved libraries in lib/ and rdbms/lib/, it was evident that libknlopt.a was different across nodes. The object modules that get into libknlopt.a however are identical, so it clearly appears that libknlopt.a isn't relinked on nodes other than the installation one.Solution
Copy the good library in the faulty node and manually re-link the Oracle again.
Ensure all instances are shut down !
Manually copy good $ORACLE_HOME/rdbms/lib/libknlopt.a from the local node to all remote faulty nodes and relink Oracle again on all faulty nodes.
eg: cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk ioracle
2008. 2. 13. 23:39 오라클
DEAD LOCK이 발생했을때 발생시킨 유저와 SQL문을 찾아주는 SQL
====================================================================================================
- DEAD LOCK이 발생했을때 발생시킨 유저와 SQL문을 찾아주는 SQL
: 데드락이 발생할 경우 LOCKING 된 유저와 SQL문을 보여준다.
SELECT A.SERIAL#, A.SID, A.USERNAME, B.ID1, C.SQL_TEXT
FROM V$SESSION A, V$LOCK B, V$SQLTEXT C
WHERE B.ID1 IN( SELECT DISTINCT E.ID1 FROM V$SESSION D, V$LOCK E
WHERE D.LOCKWAIT = E.KADDR)
AND A.SID = B.SID
AND C.HASH_VALUE = A.SQL_HASH_VALUE
AND B.REQUEST = 0;
: 데드락이 발생한 유저를 KILL 하려면.
ALTER SYSTEM KILL SESSION '{SERIAL#},{SID}';
2007. 12. 26. 10:42 오라클
How to use Very Large Memory, higher than 4Gb on Windows 2003 32 bit
Applies to:
Oracle Server - Enterprise Edition - Version: 10GMicrosoft Windows Server 2003
Goal
How to use Very Large Memory, higher than 4Gb on Windows 2003 32 bitVLM and AWE are for 32-bit Windows environments only
Solution
We can make use of more than 4 GB of RAM on Windows using the AWE(Advanced Windowing Extentions).The Steps we need to do are
1- Enabling support at the OS level
AWE can be enabled at the OS by adding the /PAE switch to the boot.ini as such:
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /PAE
2- Enabling AWE Support at the Database/Instance Level:
To enable the AWE implementation on Oracle, you must set the following parameter in the
init file (or spfile) used to start the instance:
USE_INDIRECT_DATA_BUFFERS=TRUE
buffer cache MUST be defined using the parameter DB_BLOCK_BUFFERS
3- In order to take advantage of the additional memory afforded through PAE,the operating system
user account which is used to start the OracleService must be granted the 'Lock Pages in Memory'
system privilege at the operating system level. By default, the OracleService starts as the
LocalSystem account. The LocalSystem account has the privilege to Lock Pages in Memory granted to
it by default.
2007. 12. 21. 13:18 오라클
Script: To Recompile Invalid Objects
set pagesize 0
set linesize 79
set verify off
set echo off
spool comp_all.sql
select
decode( OBJECT_TYPE, 'PACKAGE BODY',
'alter package ' || OWNER||'.'||OBJECT_NAME || ' compile body;',
'alter ' || OBJECT_TYPE || ' ' || OWNER||'.'||OBJECT_NAME || ' compile;' )
from
dba_objects
where
STATUS = 'INVALID' and OBJECT_TYPE in
( 'PACKAGE BODY', 'PACKAGE', 'FUNCTION', 'PROCEDURE', 'TRIGGER', 'VIEW' )
order by OWNER, OBJECT_TYPE, OBJECT_NAME;
spool off
2007. 12. 12. 22:43 오라클
genclntsh: Could not locate $ORACLE_HOME/network/admin/shrept.lst
Symptoms
Installation of an Oracle9i/10g patchset may fail with the following error:e.g
/usr/ccs/bin/make -f ins_net_client.mk mkldflags client_sharedlib install
ORACLE_HOME=/u01/app/oracle/product/9.2.0 /u01/app/oracle/product/9.2.0/bin/genclntsh
genclntsh: Could not locate /u01/app/oracle/product/9.2.0/network/admin/shrept.lst
genclntsh: exiting ...
make: Fatal error:
INFO: genclntsh: genclntsh: Could not locate
/app/oracle/product/10.2.0/network/admin/shrept.lst
INFO: *** Error exit code 1
INFO: ld: Can't find library or mismatched ABI for -lclntsh
Fatal error.
INFO: ld: I/O error, file "/app/oracle/product/10.2.0/lib/libclntsh.so":
Invalid argument
Fatal error.
Changes
Installing an Oracle9i/10g patchsetCause
Either the $ORACLE_HOME/network/admin/shrept.lst is missing or it has the wrong file permissionsSolution
Please ensure the $ORACLE_HOME is set:
env | grep ORACLE_HOME
If it is not set, set it and then follow one of the following options:
Option 1:
======
If the file is missing, create $ORACLE_HOME/network/admin/shrept.lst with a text editor and put the following lines into it.
network : snaumihi_inithostinfo network : snaumbg_gmt network : naedpwd_encrypt network : naumbsb_bld_singlebyte network : ztapis
Using the 'ls -al' command, check that the file has 644 permissions:
-rw-r--r-- $ORACLE_HOME/network/admin/shrept.lst
If necessary, change the permissions using the command:
chmod 644 $ORACLE_HOME/network/admin/shrept.lst
Now manually relink using the command 'relink all'
Option 2:
======
If the file is missing, for Oracle9i extract it from the first 9.2.0.1.0 CD as follows:
cd $ORACLE_HOME/network/admin
jar xvf /cdrom/cdrom0/stage/Components/oracle.rsf.net_rsf/9.2.0.1.0/1/DataFiles/admin.1.1.jar shrept.lst
For Oracle10g extract the missing file from the first 10.2.0.1.0 CD as follows:
cd $ORACLE_HOME/network/admin
jar xvf <10.2.0.1staging_area>/stage/Components/oracle.network.rsf/10.2.0.1.
0/1/DataFiles/filegroup8.jar
Using the 'ls -al' command, check that the file has 644 permissions:
-rw-r--r-- $ORACLE_HOME/network/admin/shrept.lst
If necessary, change the permissions using the command:
chmod 644 $ORACLE_HOME/network/admin/shrept.lst
Now manually relink using the command 'relink all'
Option 3:
======
Manually copy the file from another Oracle9i/10g installation
Using the 'ls -al' command, check that the file has 644 permissions:
-rw-r--r-- $ORACLE_HOME/network/admin/shrept.lst
If necessary, change the permissions using the command:
chmod 644 $ORACLE_HOME/network/admin/shrept.lst
Now manually relink using the command 'relink all'
2007. 12. 11. 16:58 오라클
ORA-1536: When Inserting Into a Table
====================
You are inserting into a table and receive ORA-1536 errors.
Ora-1536 "space quota exceeded for tablespace '%s'"
Cause:
The user is attempting to perform an operation which
Requires the creation of a new extent in a tablespace.
The user has already reached his quota of space in the tablespace.
Action:
A privileged user must grant additional resource quota on
the tablespace to the user that owns the table.
Solution Description:
====================
One or all of the following solutions may fix the problem:
1) Increase the tablespace quota allocated to that user by using the following
command:
ALTER USER <username> QUOTA <integer> [K/M] ON <tablespacename>
2) Grant unlimited quota to the user on that tablespace by using the following
command:
ALTER USER <username> QUOTA UNLIMITED ON <tablespacename>
If the problem occurs even after executing the above steps, then run the
following command:
GRANT RESOURCE TO <username>
Solution Explanation
====================
The problem is not caused by the lack of permissions from the users who are
using the application. The problem is due to the lack of permissions for
the owner of the object. By granting the owner of the table the Unlimited
Tablespace privilege (or sufficient quota on the particular tablespace),
the users were able to insert/update the table.
If you Grant the RESOURCE role, the Unlimited Tablespace privilege
will be included as well.
Examples:
====================
Please verify:
**You are the owner of the table with unlimited quota on the
tablespaces for both the table and the index.
Command:
Select OWNER, TABLESPACE_NAME, TABLE_NAME From dba_Tables Where
TABLESPACE_NAME =’<the_tablespace_the_error_is_occuring_on>’;
- Check the tablespace quotas for the schema under which the table is
being created, not under the user who is logged on as.
For example, if logged on as user SYSTEM and creating a table
scott.test, check for the quotas and system privileges such as unlimited
tablespace given to the user scott.
Tablespace quotas for a user can be checked in DBA_TS_QUOTAS.
A value of -1 in the column MAX_BYTES means the user has unlimited
tablespace quota on that tablespace.
Any system privileges give to a user can be verified in DBA_SYS_PRIVS or
USER_SYS_PRIVS.
In addition, please research if the table also has indexes owned by another
user (non-owner schema). If so, drop and recreate the indexes as the table owner.
ALSO VERIFY:
** The owner of the object has been granted Unlimited Tablespace
privilege. Even with autoextend enabled, if a particular user was created
with a quota limit on this tablespace, then when this limit is reached,
the user doesn't have any remaining quota on the tablespace.
You may wish to do the following to verify that the user's quota isn't
unlimited:
Command:
select username, tablespace_name, bytes, max_bytes
from dba_ts_quotas
where username = '<the_user_getting_the_error>'
and tablespace_name = '<the_tablespace_the_error_is_occuring_on>';
For example:
SQL> select username, tablespace_name, bytes, max_bytes
2 from dba_ts_quotas
3 where username = 'ERIC';
USERNAME TABLESPACE_NAME BYTES MAX_BYTES
-------------------- -------------------- ---------- ----------
ERIC USERS 1048576 1048576
If you see a value for MAX_BYTES for this user,
then there is a limit on how much of the tablespace they can use.
You will likely see a value for BYTES that is equal to that of
MAX_BYTES for the user that encountered the ORA-01536 error.
If a user has unlimited quota, then MAX_BYTES will be (-1).
For example:
SQL> select username, tablespace_name, bytes, max_bytes
2 from dba_ts_quotas
3 where username = 'BOB';
USERNAME TABLESPACE_NAME BYTES MAX_BYTES
-------------------- -------------------- ---------- ----------
BOB BOB 20480 -1
You can alter the user that encountered the problem to either give
them more quota on the tablespace or to give them unlimited quota on
the tablespace.
For example:
SQL> alter user eric
2 quota unlimited on users;
User altered.
SQL> select username, tablespace_name, bytes, max_bytes
2 from dba_ts_quotas
3 where username = 'ERIC';
USERNAME TABLESPACE_NAME BYTES MAX_BYTES
-------------------- -------------------- ---------- ----------
ERIC USERS 1048576 -1
References:
=====================
Note 270582.1 ORA-01536, when enough space is available
2007. 8. 6. 17:13 오라클
Mac OS 에 oracle 설치하기.
이런 무모한 짓을 할 사람은 거의 없겠지만 필요하면 참고하시길 ^^
맥에 오라클이라..끔찍해.
=======================================
Installing Oracle Database 10g on Mac OS X
Recently Oracle and Apple announced the availability of Oracle Database 10g for Mac OS X. In in this — longer than usual — blog post, I document my experience installing the Oracle database on my Mac. In a subsequent post, I'll talk about my experience installing Oracle HTML DB. These instructions should not be considered a best practice, but they are steps that worked for me. I tried to incorporate as many screenshots as possible to help you when you are performing the install.
1. Hardware Requirements
The Quick Installation Guide states the following hardware requirements:
- 512 MB RAM
- 1GB or twice the size of RAM swap space
- 400MB of disk space in /tmp
- 2Gb disk space for software files
- 1.2Gb disk space for database files
I performed my installation on an iMac G5 with 1Gb of RAM and 160GB of disk.
2. Operating Sytems Requirements
Oracle Database 10g is only supported on Mac OS X Server. As I was just experimenting, I installed on regular OS X. There are no doubt minimum requirements. You can verify the version of Mac OS X, by executing the following command:
# sw_vers
Below is what I saw when I executed this.
3. Install Developer Tools
To install the Oracle database, you need a C compiler. I didn't have one installed, so I signed up for a (free) Apple Developer Connection (ADC) account to download the Developer tools. To do this, sign in to ADC then click on Download Software then Developer Tools. First, download and install Xcode Tools v1.1 then download and install Dec 2003 gccLongBranch Tools Installing Xcode 1.1
After installing these packages you, verify you have the correct version of gcc installed by issuing the following command:
# gcc -v
Make sure you have at least the version as shown below.
4. Create Required User and Groups
The Quick Installation Guide suggests to start the Workgroup Manager. I didn't find one on my system, so I imagine this is a OS X Server thing. I used the command line instructions from the Database Installation Guide 10g for Mac OS X instead.
First, make sure you're root by executing in a Terminal:
# sudo sh
Determine Available Group ID
Execute the following command:
# nireport . /groups gid name | more
You'll see a list similar to the one below.
... 70 www 74 mysql 75 sshd 76 qtss 78 mailman 79 appserverusr 80 admin 81 appserveradm 99 unknown ...
Choose an unused group ID. I chose 600.
Create oinstall Group
Using the available group ID, create a group called oinstall by executing the following three commands:
# nicl . -create /groups/oinstall # nicl . -append /groups/oinstall gid 600 # nicl . -append /groups/oinstall passwd "*"
Create dba Group
Repeat the steps above to determine another available group ID. I chose 601. Then, create a dba group by executing these commands:
# nicl . -create /groups/dba # nicl . -append /groups/dba gid 601 # nicl . -append /groups/dba passwd "*"
Create the Oracle Software Owner User
First, find an unused user ID, or UID, by executing the following command:
# nireport . /users uid name | more
You'll see a list similar to the following:
... 27 postfix 70 www 71 eppc 74 mysql 75 sshd 76 qtss 77 cyrus 78 mailman 79 appserver 502 sleuniss ...
I chose 601 as an available UID. Create the oracle user by executing these commands. Substitiute the gid and uid you chose where appropriate:
# nicl . -create /users/oracle # nicl . -append /users/oracle uid 601 # nicl . -append /users/oracle gid 600 # nicl . -append /users/oracle shell /bin/bash # nicl . -append /users/oracle home /Users/oracle # nicl . -append /users/oracle realname "Oracle software owner"
Here's what it looked like.
Next, add the oracle user to the dba group:
# nicl . -append /groups/dba users oracle
Create a home directory and change the owner and group:
# mkdir /Users/oracle # chown oracle:oinstall /Users/oracle
Finally, set the password for the oracle user:
# passwd oracle
5. Create Required Directories
Based on the suggestions in the Quick Installation Guide, I created two directories, one for the Oracle software, and one for the datafiles. Strictly speaking two separate directories are not required here.
Create the Oracle Base Directory
Create the Oracle base directory as follows:
# mkdir -p /Volumes/u01/app/oracle
Create Directory for Datafiles
Create the directory for datafile as follows:
# mkdir -p /Volumes/u02/oradata
Change Groups and Permissions for Directories
Change the groups and permissions for the directories you just created by executing these commands:
# chown -R oracle:oinstall /Volumes/u01/app/oracle # chown -R oracle:oinstall /Volumes/u02/oradata
then:
# chmod -R 775 /Volumes/u01/app/oracle # chmod -R 775 /Volumes/u02/oradata
6. Configure Kernel Parameters
As is often the case when installing Oracle on Linux or other flavors or UNIX, certain kernel parameters will have to be adjusted for Oracle to run properly. The Quick Installation Guide specifies the proper minimum values.
To verify the kernel parameter values, execute:
# /usr/sbin/sysctl -a | grep corefile # /usr/sbin/sysctl -a | grep sem # /usr/sbin/sysctl -a | grep maxproc
Here's what I saw:
I only had to adjust two values by executing these commands:
To make these values stick, that is, presist after a reboot, edit /etc/sysctl.conf and add lines for values that need changing. I used vi to edit the file, but you can use any text editor.
Set Shell Limits
For performance reasons, shell limits need to be adjusted. Begin by navigating to the directory that contains the IPServices script.
# cd /System/Library/StartupItems/IPServices
Using any text editor, edit the file IPServices and add the following ulimit commands inside the StartService() function:
ulimit -Hu 2068 ulimit -Su 2068 ulimit -Hn 65536 ulimit -Sn 65536
Here's where I put them:
7. Configure Oracle User's Environment
The installer is run from the oracle user. Before you can run the installer, however, the environment for oracle has to be set properly.
Create .bash_profile
While logged in as oracle, I created a file called .bash_profile using a text editor.
Execute .bash_profile
Run the .bash_profile as follows:
oracle$ . ./.bash_profile
8. Add Hostname to /etc/hosts
Because I performed my installation on machine at home, which gets its IP address through DHCP from a wireless router, I had to make sure the installer could find this IP address by adding it to my /etc/hosts file. You may not need to do this, depending on how your machine is networked. If, during the install process, you see an error related to the installer not being able to determine the IP address, stop the installer, perform these steps and launch the installer again. As Root, edit the file /etc/hosts and add an entry with your hostname and IP address. I determined my IP address by executing the following commands as root:
sh-2.05b# hostname sh-2.05b# ifconfig -a
The first command returned sergio-g5.local. The second returned configuration details for each network device in my iMac. The one I'm using is en1, an Airport card. The IP address for that is 192.168.0.5. So, I added a line to my /etc/hosts file to make it look like this:
9. Install Oracle
Download the Files
If you're like me and you don't have the CDs, you can download the necessary files from OTN. To install the database, you'll need the file ship_mac_db.cpio.gz While you're there, you might as well get the Companion CD, ship_mac_companioncd.cpio.gz and HTML DB 1.6 as well. I downloaded the files to the desktop while logged using my own account, so for the oracle user to access these files, I first moved the file from the Desktop to the /tmp directory and then copied them there to a stage directory in /Volumes/u01/app/oracle/, owned by oracle by executing the following commands from within a Terminal:
sleuniss% cd Desktop sleuniss% mv ship_mac_db.cpio.gz /tmp sleuniss% su - oracle oracle$ mkdir /Volumes/u01/app/oracle/stage oracle$ cd /Volumes/u01/app/oracle/stage oracle$ cp /tmp/ship_mac_db.cpio.gz .
Uncompress the File
While in the stage directory, issue the following commands to uncompress the file:
oracle$ gunzip ship_mac_db.cpio.gz oracle$ cpio -idm < ship_mac_db.cpio
When I did this, I was presented with a message after the first command, Operation not permitted. Not sure what that was about, but it seemed harmless.
Launch Installer
To launch the installer, run the script runInstaller in the Disk1 directory.
oracle$ cd Disk1 oracle$ ./runInstaller
Keep clicking Next until you are asked to run a script as root. To do so, launch a new Terminal and become root. Then execute these commands:
sh-2.05b# cd /Volumes/u01/app/oracle/oraInventory/ sh-2.05b# ./orainstRoot.sh
Accept all the default values, and keep clicking Next.
Choose Edition
When prompted to choose a database edition, I selected Enterprise.
Choose Starter Database
I chose to create a General Purpose starter database
Choose Character Set
I changed from the default to AL32UTF8. This is not necessary unless you plan to to use Unicode or multibyte characters in your database.
Database File Storage
Earlier, during preparation for this installation, I set up a location for database files in /Volumes/u02/oradata. When prompted for the location on the file system for database files, change the default value.
Database Schema Passwords
The installer allows you to set all password to be the same.
Install
After a quick glance at the install summary, it's time to kick off the installation.
Run root.sh
When prompted to run root.sh, run the following commands as root:
sh-2.05b# cd /Volumes/u01/app/oracle/product/10.1.0/g5db/ sh-2.05b# ./root.sh
End of Installation
You've reached the end of the installation
Logging in
To run SQL*PLUS, you'll need to configure the PATH to the executables. While logged in as oracle, execute these commands:
oracle$ cd /Volumes/u01/app/oracle/product/10.1.0/g5db oracle$ export ORACLE_HOME=`pwd` oracle$ export PATH=$PATH:$ORACLE_HOME/bin
Now you can run SQL*PLUS. You may want to add these environment variable settings to the oracle user's .bash_profile for subsequent sessions.
That's it, the 10g database is installed. In the next few weeks, I'll write up some instructions to install Oracle HTML DB as well.