SQLPlus question...
Hi All,
I am trying to create a package in Oracle 10g Express Edition as follows (the package is contained in the file newpackagefile.sql):
SQL> sqlplus username/pwd@dsn @newpackagefile.sql
But it prompts me 5 times to enter values for different variables. After I hit the "Enter" key 5 times, it creates the package successfully.
I searched the newpackagefile.sql file for the variables but cannot find them. Why do you think it prompts me for variables and how do I create the package without having it prompt me, eg., can I send it dummy parameters with the sqlplus statement in the command line?
Thanks!
Hi,
Issue the SQL*Plus command
SET DEFINE OFFbefore running the script.
Apparantly, it contains the character used to mark substitution variables ('&' by default).
<tt>SET DEFINE OFF</tt> will turn off scanning for substitution variables, and then the marker will be treated like a normal character.
Similar Messages
-
A question about the SPOOL command in sqlplus
Dear all,
I have a question about the SPOOL Command and I would appreciate if you could kindly give me a hand. Consider the following sql script.
SPOOL result.txt
SELECT * FROM mytable;
SPOOL OFF;This works pretty well, and the whole content of the table "mytable" is exported to the text file "result.txt". However, sqlplus prints also the number of lines
printed after each query. As a result, after running this script, at the end of the file, I have always a line like
"20541 lines returned"How can I avoid this line (the number of returned lines) in my result file?
Thanks in advance,
DariyooshPeter Gjelstrup wrote:
Hi Dariyoosh,
As you are about to find out, SQL*Plus is a really powerful tool once the wonders of it are discovered.
You really should study the reference
http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/toc.htm
In your current case especially the SET command
http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/ch_twelve040.htm#BACGAJIC
Regards
PeterHello there,
Thank you very much for your attention to my problem and in particular the interesting links.
Kind Regards,
Dariyoosh -
Newbie question: sql runs on sqlplus but not compile in pl/sql?
I have the following two tables I would like to put a sql statement into pl/sql packages so I can use dbms_jobs automate it however, I keep getting compile time error. It seems to me that pl/sql does not like my sql that runs fine in sqlplus. Below is the error message and my test case?
mdb_user@CMD> show error
Errors for PACKAGE BODY DATA_QUALITY_REPORT_P:
LINE/COL ERROR
10/1 PL/SQL: SQL Statement ignored
13/42 PL/SQL: ORA-00942: table or view does not exist
create table S_ORG_EXT
accnt_type_cd varchar2(100),
cust_stat_cd varchar2(100)
insert into s_org_ext
select column_name,data_type from user_tab_columns where rownum <= 100
select * from s_org_ext
create table data_quality_report
runid number not null,
report_type number not null, --report type such as dup or not dup or other metrics
org_level number not null, --organization level nsgn, sgn, shipto
loc_level number not null,--locale level by city, by country, by region, grand_total
name varchar2(100) not null,--the row output name of the agg
value number not null,-- the row output value of the agg
rundate date default sysdate
create sequence data_quality_report_seq start with 1000
INCREMENT BY 1
NOCACHE
NOCYCLE
insert into data_quality_report
select data_quality_report_seq.nextval,3,99,99,accnt_type_cd,cnt,sysdate from
select accnt_type_cd, count (*) cnt from S_ORG_EXT where cust_stat_cd = 'VARCHAR2' group by accnt_type_cd order by 2 desc
select * from data_quality_report
truncate table data_quality_report
CREATE or replace PACKAGE data_quality_report_p AS
function pull_data return data_quality_report.runid%type;
END data_quality_report_p ;
create or replace package body data_quality_report_p as
function pull_data return data_quality_report.runid%type is
new_rid data_quality_report.runid%type;
begin
select data_quality_report_seq.nextval into new_rid from dual;
insert into data_quality_report
select new_rid,3,999999,999999,accnt_type_cd,cnt,sysdate from
select accnt_type_cd, count (*) cnt from S_ORG_EXT where cust_stat_cd = 'VARCHAR2' group by accnt_type_cd order by 2 desc
return new_rid;
exception
when no_data_found then
DBMS_OUTPUT.PUT_LINE('Handling NO_DATA_FOUND exception.');
when others then
DBMS_OUTPUT.PUT_LINE('Handling OTHER exception.');
end; --end pull_data
end data_quality_report_p;
/Hi,
A very common cause for ORA-00942 in a stored procedure (here I'm including packages and functions) is that you have privileges only through a role. Roles don't count in stored procedures if they are compiled with the default "AUTHID DEFINER". Either
(1) have whatever privileges you need (e.g. "INSERT ON data_quality_report" or "SELECT ON s_org_ext") granted directly to you (the package owner), or to the pseudo-user PUBLIC, and not merely to some role that you have, or
(2) create the package in the same schema as the tables, or
(3) create the package with "invoker's rights", like this
CREATE OR REPLACE PACKAGE data_quality_report_p
AUTHID CURRENT_USER -- Added
AS
FUNCTION pull_data ...'AUTHID CURRENT_USER" goes right before the keyword "IS" (or "AS") in the package spec; you don't have to do anything to the package body.
However, if you do this, then whoever runs the package will need to have those privileges, in addition to EXECUTE privileges on the package. Privileges granted through a role will be okay.
Usually, (1) is the best solution. Have the table owner(s), or someone with the proper authority, grant privileges directly to you.
By the way, there's no point in having an ORDER BY clause in a sub-query like you're doing, and there's no point in having ORDER BY in an INSERT statement. It's not causing the ORA_00932 error (or any other error), it's just wasting resources.
Edited by: Frank Kulash on Mar 23, 2011 4:02 PM
Change DEFINER to CURRENT_USER in a couple of places. (Bad mistake!) -
Sqlplus access , setting enviromnet question
Just installed OELinux and 10.2 and trying to acess sqlplus but cant, what i am doing wrong?
[oracle@localhost db_1]$ export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
[oracle@localhost db_1]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@localhost db_1]$ export ORACLE_SID=p10bma
[oracle@localhost db_1]$ sqlplus /nolog
[oracle@localhost db_1]$[oracle@localhost ~]$ ls -l /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus
-rwxr-xr-x 1 oracle oinstall 0 Jun 30 2005 /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus
[oracle@localhost ~]$ sqlplus /nolog
[oracle@localhost ~]$
[oracle@localhost ~]$ which sqlplus
/u01/app/oracle/product/10.2.0/db_1/bin/sqlplus
[oracle@localhost ~]$ env
SSH_AGENT_PID=2799
HOSTNAME=localhost.localdomain
DESKTOP_STARTUP_ID=
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
GTK_RC_FILES=/etc/gtk/gtkrc:/home/oracle/.gtkrc-1.2-gnome2
WINDOWID=54526033
USER=oracle
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
ORACLE_SID=p00ibm
GNOME_KEYRING_SOCKET=/tmp/keyring-fhEFH8/socket
ORACLE_BASE=/u01/app/oracle
SSH_AUTH_SOCK=/tmp/ssh-TjFstJ2746/agent.2746
SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/2746
USERNAME=oracle
MAIL=/var/spool/mail/oracle
DESKTOP_SESSION=default
PATH=/u01/app/oracle/product/10.2.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin
GDM_XSERVER_LOCATION=local
INPUTRC=/etc/inputrc
PWD=/home/oracle
XMODIFIERS=@im=none
LANG=en_US.UTF-8
ORACLE_TERM=xterm
GDMSESSION=default
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/home/oracle
SHLVL=2
GNOME_DESKTOP_SESSION_ID=Default
TMP=/tmp
LOGNAME=oracle
CLASSPATH=/u01/app/oracle/product/10.2.0/db_1/JRE:/u01/app/oracle/product/10.2.0/db_1/jlib:/u01/app/oracle/product/10.2.0/db_1/rdbms/jlib
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-fJsiThSPob,guid=bc336347c84a8afaef868f4394472300
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY=:0.0
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
G_BROKEN_FILENAMES=1
COLORTERM=gnome-terminal
XAUTHORITY=/tmp/.gdm3QSO3T
_=/usr/bin/env -
hello all. i'm so new to oracle. i'm sorry if i'm not making any sense. ;)
i installed Oracle 10g R2 on Solaris 8.
how can ordinary OS users run sqlplus if they do not belong to the dba group?
the access permission of "others" for /u01/app/oracle/'s subdirectories is ---.
issuing "ls -a" returns
drwxrwx--- 6 oracle dba 512 Oct 4 18:38 oraInventory
drwxrwx--- 3 oracle dba 512 Sep 25 17:38 product
or did i just mess up my installation?Hi,
I'm not aware about restrictions on file system, but I0ve checked a working configuration on a Sun Solaris 9i R2 installation:
The directory list:
... $ORACLE_BASE/product
drwxr-xr-x 64 oracle dba 1536 May 6 2005 9.2.0
... $ORACLE_HOME
drwxr-xr-x 2 oracle dba 4096 Aug 7 16:54 bin
drwxr-xr-x 3 oracle dba 4096 Aug 7 16:53 lib
... $ORACLE_HOME/bin
-rwxr-x--x 1 oracle dba 766904 Mar 17 2005 sqlldr
-rwxr-x--x 1 oracle dba 1069280 Mar 17 2005 sqlplus
-rwxr-xr-x 1 oracle dba 1345 Feb 17 2004 statusnc
-rwxr-xr-x 1 oracle dba 3261 May 11 2002 symfind
... $ORACLE_HOME/lib
-rw-rw-r-- 1 oracle dba 195060 Oct 16 2004 libctxs9.a
-rw-rw-r-- 1 oracle dba 2889288 Oct 17 2004 libctxx9.so
-rw-rw-r-- 1 oracle dba 33312 Oct 16 2004 libdm9.a
-rw-rw-r-- 1 oracle dba 7760032 Apr 19 2005 libgeneric9.a
-rw-r--r-- 1 oracle dba 6808 Nov 22 2004 libgslavl9.a
-rw-r--r-- 1 oracle dba 53504 Nov 22 2004 libgslber_s9.a
-rw-r--r-- 1 oracle dba 1260040 Nov 22 2004 libgsldb9.a
-rw-r--r-- 1 oracle dba 54536 Nov 22 2004 libgslec9.a
-rw-r--r-- 1 oracle dba 63192 Nov 22 2004 libgslmt9.a
-rw-r--r-- 1 oracle dba 437684 Nov 22 2004 libgslr9.a
-rw-r--r-- 1 oracle dba 71708 Nov 22 2004 libgslsg9.aSo, It seems that You have to change the permissions to the subtrees..
Max -
SQLPLUS multiple data entry. Very easy question for experts.
Hi sorry to bother you again but is it the same method as in MySQL to enter multiple data at once?
I am trying to save time by entering all the contents of a table all at once,
For example;
INSERT INTO Borrower (BorId, BorName, BorMaxBooks) VALUES (
(001, 'Bob', 4),
(002, 'James', 5),
(003, 'Dave', 6);
Please can you tell me where I cam going wrong and I promise I will shut up and go away.
Thanks.i can! :)
SQL> create table T
2 (BorId varchar2(64),
3 BorName varchar2(64),
4 BorMaxBooks number)
5 /
Table created
SQL> insert into t
2 select '001', 'Bob', 4 from dual
3 union all
4 select '002', 'James', 5 from dual
5 union all
6 select '003', 'Dave', 6 from dual
7 /
3 rows inserted
SQL> select * from t
2 /
BORID BORNAME BORMAXBOOKS
001 Bob 4
002 James 5
003 Dave 6
SQL> -
Question: 10gR2 database can not see the 11gR2 ASM diskgroup?
Hi there,
env:
uname -rm
2.6.18-92.1.22.el5xen x86_64
Single server(non-RAC)
note: we don't want to upgrade 10gr2 database into 11gR2 yet. But we created the 11gR2 ASM, then a 11gr2 database on ASM, and plan to migrate datafile in 10gR2 database to 11gR2 ASM
1. oracle 10gR2 installed first version: 10.2.0.3.0
2. then install 11gR2 Grid Infrastructure, and created ASM (version 11gr2)
$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 19 10:30:56 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Automatic Storage Management option
SQL> col name form a15
SQL> col COMPATIBILITY form a15
SQL> col DATABASE_COMPATIBILITY form a15
SQL> l
1* select name , STATE, COMPATIBILITY, DATABASE_COMPATIBILITY from v$asm_diskgroup
SQL> /
NAME STATE COMPATIBILITY DATABASE_COMPAT
ORCL_DATA1 MOUNTED 11.2.0.0.0 10.1.0.0.0
ORA_DATA MOUNTED 10.1.0.0.0 10.1.0.0.0
3. in 10gR2 database
sqlplus /
SQL*Plus: Release 10.2.0.3.0 - Production on Tue Oct 19 12:12:31 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
SQL> select * from v$asm_diskgroup;
no rows selected
4. pin the node into css
# /u01/app/product/11.2.0/grid/bin/crsctl pin css -n mynodename
CRS-4000: Command Pin failed, or completed with errors.
Question: 10gR2 database can not see the 11gR2 ASM diskgroup?
please help
Thanks
ScottWhat is the output of
olsnodes -t -n
Also, see unix error log and ohasd error log if you find anything in that -
Question regarding Listener and Server Processes in dedicated server mode
Good morning,
The Oracle documentation states that when a client connection request is received on the server, the Listener creates a Server Process which will work with the database instance to carry out the tasks requested by the user/client process. So far, everything good.
Now, when the user is at the Oracle server itself, the Listener does not need to be running to establish a connection to the database. It is therefore possible to stop the Listener and still connect using sqlplus and a valid username and password.
In the above case, the question is: if the Listener is not running, what/who created the Server Process that communicates with the database instance on behalf of the user ? Stated a different way, in the normal case, the Listener would get the request and create the server process. When the Listener is not running what part of Oracle gets the requests and creates the server process ?
Clarification on how this case is handled is much appreciated, thank you,
John.When using bequeath protocol the server process is created by the client process: it's the client process that is using ORACLE_SID and ORACLE_HOME to compute shared memory key (under UNIX) to know which SGA to attach (i.e. which instance to connect to):
Example with SQL*Plus :
$ ps -fu oracle | grep DB112
oracle 5675 1 0 18:13 ? 00:00:00 ora_pmon_DB112
oracle 5677 1 3 18:13 ? 00:00:02 ora_vktm_DB112
oracle 5681 1 0 18:13 ? 00:00:00 ora_gen0_DB112
oracle 5683 1 0 18:13 ? 00:00:00 ora_diag_DB112
oracle 5685 1 0 18:13 ? 00:00:00 ora_dbrm_DB112
oracle 5687 1 0 18:13 ? 00:00:00 ora_psp0_DB112
oracle 5689 1 0 18:13 ? 00:00:00 ora_dia0_DB112
oracle 5691 1 0 18:13 ? 00:00:00 ora_mman_DB112
oracle 5693 1 0 18:13 ? 00:00:00 ora_dbw0_DB112
oracle 5695 1 0 18:13 ? 00:00:00 ora_lgwr_DB112
oracle 5697 1 0 18:13 ? 00:00:00 ora_ckpt_DB112
oracle 5699 1 0 18:13 ? 00:00:00 ora_smon_DB112
oracle 5701 1 0 18:13 ? 00:00:00 ora_reco_DB112
oracle 5703 1 0 18:13 ? 00:00:00 ora_mmon_DB112
oracle 5705 1 0 18:13 ? 00:00:00 ora_mmnl_DB112
oracle 5707 1 0 18:13 ? 00:00:00 ora_d000_DB112
oracle 5709 1 0 18:13 ? 00:00:00 ora_s000_DB112
oracle 5745 1 0 18:13 ? 00:00:00 ora_arc0_DB112
oracle 5747 1 0 18:13 ? 00:00:00 ora_arc1_DB112
oracle 5749 1 0 18:13 ? 00:00:00 ora_arc2_DB112
oracle 5751 1 0 18:13 ? 00:00:00 ora_arc3_DB112
oracle 5753 1 0 18:13 ? 00:00:00 ora_qmnc_DB112
oracle 5769 1 1 18:13 ? 00:00:00 ora_cjq0_DB112
oracle 5773 1 0 18:13 ? 00:00:00 ora_q000_DB112
oracle 5775 1 0 18:13 ? 00:00:00 ora_q001_DB112
oracle 5777 1 1 18:13 ? 00:00:00 ora_vkrm_DB112
oracle 5785 1 46 18:13 ? 00:00:24 ora_j003_DB112
oracle 5797 5796 2 18:14 ? 00:00:00 oracleDB112 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 5832 5801 0 18:14 pts/2 00:00:00 grep DB112
$ ps -fp 5796
UID PID PPID C STIME TTY TIME CMD
oracle 5796 5584 0 18:14 pts/1 00:00:00 sqlplusThis is also documented in 11.2 Net Admin. Guide http://download.oracle.com/docs/cd/E11882_01/network.112/e10836/concepts.htm#CIAFHAEE
>
If the client and database exist on the same computer, then a client connection can be passed directly to a dedicated server process without going through the listener. This is known as a bequeath protocol. The application initiating the session spawns a dedicated server process for the connection request. This happens automatically if the application used to start the database is on the same computer as the database.
>
Edited by: P. Forstmann on 5 sept. 2010 18:23 -
Oracle 9i R2 Installation on RH Linux 7.3 -- Have a few questions.
Hello,
I am at the end of the Oracle 9i R2 installation and have a few questions.
1) The "Agent Configuration Assistant" keeps failing. I get the following message.
Parameters "orahome" = /opt/oracle/product/9.2.0
Parameters "nodeinfo" = NODE_VALUE
Agent Service Failed
What does this mean and how can I complete Agent Configuration Assistant install?
2) I completed the Oracle Database Configuration Assistant successfully and created passwords for sys and sysoper (not sure if these were the exact users). Note I did not modify any other users or unlock them.
How do I log into the sqlplus prompt, what users should I use and how can I create new users and databases?
Thanks for your help in advance.
Regards,
Chris Barone
[email protected](1) You can probably just ignore the Agent Configuration (are you using the Agent to collect data?)
(2) sqlplus '/ as sysdba' will log you into the SQL*Plus prompt.
Rob -
Oracle 9.2.0.3.0 patch set for windows - questions
Hi!
I have for that some questions. I have oracle 9.2.0.1.0 on a windows 2003 server running with one local database - no real apllication cluster.
I don't understand which instructions I have to make for oracle upgrade?
Must I also make the 3. instruction? Connect to databse prior and drop?
Must I also make the post install action for my database?
(startup migrate ...)
what means at post install actions the following:
'execute these post install actions only if you have one or more databases associated to the upgraded $oracle_homee.
My database path is e:\oracle\oradata\database my oracle path is e:\oracle\ora92 have I in my case make the post install actions?
Thanks for help!
1. When applying this patchset on Windows NT, XP or Windows 2000, you must log onto the system as a user with Administrative privileges
(e.g. as a user which is a member of the local Administrators group).
2. Unzip the downloaded patch set file into a new directory.
3. Drop the xmlconcat function by running the following commands:
drop public synonym xmlconcat;
drop function xmlconcat;
4. Shut down any existing Oracle Server instances in the ORACLE_HOME to be patched with normal or immediate priority. i.e.: Shutdown all instances (cleanly). Stop the database services, and stop all listener, agent and other Oracle processes running in or against the ORACLE_HOME to be installed into.
5. Perform the following pre-install steps for Real Application Clusters (RAC) enviroments only:
IN ADDITION TO STOPPING ALL ORACLE SERVICES IN THE ORACLE_HOME TO BE UPGRADED:
If you are running in a RAC enviroment, stop the following Windows service(s)/devices(s) using the Net Stop command:
Stop the Windows service named "OracleGSDService"
Stop the Windows service named "OracleCMService9i".
Stop the Windows device named "OraFenceService" (This Device does NOT show up as a Service in the Control Panel).
For Example:
C:\>net stop OracleGSDService
C:\>net stop OracleCMService9i
C:\>net stop OraFenceService
Once the above steps have been performed on all the nodes of the cluster, you should then be able to upgrade the OSD components to the 9.2.0.3 versions. This can be accomplished by...
xcopy all the files in the \Disk1\preinstall_rac\osd\*.* directory to the directory in which the OSD components were originally installed on all nodes(typically %SystemRoot%\system32\osd9i).
Note: You may also be able to look in HKEY_LOCAL_MACHINE\Software\Oracle\OSD9i registry key to determine the directory in which the original OSD components were installed. Now the OSD components can be restarted on all the nodes in the cluster.
C:\>net start OraFenceService
C:\>net start OracleCMService9i
C:\>net start OracleGSDService
After all of the above steps have been completed on all the nodes of the cluster, you are now ready to proceed with the Oracle 9.2.0.3.0 patchset installation.
6. Start the installer:
If the current Installer version is less than 2.2.0.18.0 then download the Installer 2.2.0.18.0 from Oracle Metalink where it can be accessed with the bug number 2878462 and choosing the MS Windows NT/2000 Server platform, then run the setup.exe 2.2.0.18.0 from the C:\Program Files\Oracle\oui\install directory .
7. You may install the Patch Set through either an interactive or a silent installation.
To perform an interactive installation using the Oracle Universal Installer graphical interface:
1. Start the installer from the newly installed OUI 2.2.0.18.0 by running the version of setup.exe located at C:\Program Files\Oracle\oui\install and verify
that the version of the OUI GUI is 2.2.0.18.0 before proceeding.
2. Follow the steps given below within the installer:
1. On the Welcome screen, click the Next button. This will display the File Locations screen.
2. Click the Browse button for the Source... entry field and navigate to the stage directory where you unpacked
the Patch Set tar file.
3. Select the products.jar file. Click the Next button
The products file will be read and the installer will load the product definitions.
The products to be loaded will be displayed (verify ORACLE_HOME setting for this first).
4. Verify the products listed and then click on the Install button.
5. Once the installation has completed successfully, it will display End of Installation. Click on Exit and confirm
to exit the installer.
To perform a silent installation requiring no user intervention:
1. Copy the response file template provided in the response directory where you unpacked the Patch
Set tar file.
2. Edit the values for all fields labeled as "<Value Required>" according to the comments and examples
in the template.
3. From the unzipped patchset installation area, start the installer by running the setup executable passing
as the last argument the full path of the response file template you have edited locally with your own
value of ORACLE_HOME and FROM_LOCATION:
setup.exe -silent -responseFile <full_path_to_your_response_file>
Post Install Actions
Execute these "Post Install Actions" only if you have one or more databases associated to the upgraded $ORACLE_HOME.
Important Notes
1: Java VM and XML DB Requirements
Users who have JVM (Java enabled) or JVM and XDB installed on their 9.2.0.1 databases should make sure that the init.ora parameters shared_pool_size and java_pool_size are each 150 MB or more before running the catpatch.sql upgrade script. Failure to do so could result in an unrecoverable memory failure during running of the script. Please note that JVM and XML DB was shipped as part of the default 9.2.0.1 seed database and will be present unless the user explicitly installed a 9.2.0.1 instance without them.
2: SYSTEM table space
If you have JServer installed in the database, you should check to be sure there is at least 10M of free space in the SYSTEM table space before running these actions.
3: Installing on Cluster Databases
If you are applying this patch set to a cluster database, then set the CLUSTER_DATABASE initialization parameter to false. After the post-install actions are completed, you must set this initialization parameter back to true.
To complete the installation of this patch set, you need to start up each database associated with the upgraded $ORACLE_HOME, start the database listener (e.g., lsnrctl start), login using SQL*Plus (e.g., sqlplus "/ as sysdba"), and run the following commands/scripts in order from $ORACLE_HOME within a MIGRATE session. If you are using the OLAP option, make sure that the database listener is up.
startup migrate
spool patch.log
@rdbms/admin/catpatch.sql
spool off
Review the patch.log file for errors and re-run the catpatch script after correcting any problems
shutdown
startup
This step is optional - it will recompile all invalid PL/SQL packages now rather than when accessed for the first time - you can also use utlrcmp.sql to parallelize this in multiprocessor machines:
@rdbms/admin/utlrp.sql
Execute the following if you use Oracle OLAP option:
alter user olapsys identified by <password> account unlock
connect olapsys/<password>
@cwmlite/admin/cwm2awmd.sql
exit
Execute the following script only if you have version 9.2.0.1.0 of Oracle Internet Directory installed in your ORACLE_HOME. Make sure that the database and database listener are running and that all parameters are specified prior to running the script:
$ORACLE_HOME/bin/oidpatchca.bat
-connect <Connect String>
-lsnrport <Listener Port>
-systempwd <SYSTEM Password>
-odspwd <ODS Password>
-sudn <Super-User DN>
-supwd <Super-User Password>
-dippwd <Password to register DIP Server>
Where:
connect - Database connect string
lsnrport - Database Listener port
systempwd - Password of the database 'SYSTEM' user
odspwd - Password of the database 'ODS' user
sudn - Super-user DN
supwd - Super-user Password
dippwd - New password to register Directory Integration Server. This password must conform to the password policy in the OID server
Execute the following steps only is you are using the RMAN catalog.:
rman catalog <user/passwd@alias>
upgrade catalog;
upgrade catalog;I don't understand which instructions I have to make for oracle upgrade?
-- You have to follow all the instructions mentioned
(Just check for few if's for Cluster enabled, OID and OLAP databases. Perform these steps only if they apply)
Must I also make the 3. instruction? Connect to databse prior and drop?
-- Yes you should do
Must I also make the post install action for my database?
(startup migrate ...)
-- Yes. Do run catpatch.sql .
what means at post install actions the following:
'execute these post install actions only if you have one or more databases associated to the upgraded $oracle_homee.
-- In this step make sure you do step 1
1: Java VM and XML DB Requirements
Otherwise catpatch.sql will fail.
Do 2 and 3 only if applicable
Chandar
My database path is e:\oracle\oradata\database my oracle path is e:\oracle\ora92 have I in my case make the post install actions? -
A question about the impact of SQL*PLUS SERVEROUTPUT option on v$sql
Hello everybody,
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL>
OS : Fedora Core 17 (X86_64) Kernel 3.6.6-1.fc17.x86_64I would like to ask a question about the SQL*Plus SET SERVEROUTPUT ON/OFF option and its impact on queries on views such as v$sql and v$session. Here is the problem
Actually I define three variables in SQL*Plus in order to store sid, serial# and prev_sql_id columns from v$session in order to be able to use them later, several times in different other queries, while I'm still working in the current session.
So, here is how I proceed
SET SERVEROUTPUT ON; -- I often activate this option as the first line of almost all of my SQL-PL/SQL script files
SET SQLBLANKLINES ON;
VARIABLE mysid NUMBER
VARIABLE myserial# NUMBER;
VARIABLE saved_sql_id VARCHAR2(13);
-- So first I store sid and serial# for the current session
BEGIN
SELECT sid, serial# INTO :mysid, :myserial#
FROM v$session
WHERE audsid = SYS_CONTEXT('UserEnv', 'SessionId');
END;
PL/SQL procedure successfully completed.
-- Just check to see the result
SQL> SELECT :mysid, :myserial# FROM DUAL;
:MYSID :MYSERIAL#
129 1067
SQL> Now, let's say that I want to run the following query as the last SQL statement run within my current session
SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;According to Oracle® Database Reference 11g Release 2 (11.2) description for v$session
http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3016.htm#REFRN30223]
the column prev_sql_id includes the sql_id of the last sql statement executed for the given sid and serial# which in the case of my example, it will be the above mentioned SELECT query on the employees table. As a result, right after the SELECT statement on the employees table I run the following
BEGIN
SELECT prev_sql_id INTO :saved_sql_id
FROM v$session
WHERE sid = :mysid AND serial# = :myserial#;
END;
PL/SQL procedure successfully completed.
SQL> SELECT :saved_sql_id FROM DUAL;
:SAVED_SQL_ID
9babjv8yq8ru3
SQL> Having the value of sql_id, I'm supposed to find all information about cursor(s) for my SELECT statement and also its sql_text value in v$sql. Yet here is what I get when I query v$sql upon the stored sql_id
SELECT child_number, sql_id, sql_text
FROM v$sql
WHERE sql_id = :saved_sql_id;
CHILD_NUMBER SQL_ID SQL_TEXT
0 9babjv8yq8ru3 BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;Therefore instead of
SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;for the value of sql_text I get the following value
BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES);Which is not of course what I was expecting to find in v$sql for the given sql_id.
After a bit googling I found the following thread on the OTN forum where it had been suggested (well I think maybe not exactly for the same problem) to turn off SERVEROUTPUT.
Problem with dbms_xplan.display_cursor
This was precisely what I did
SET SERVEROUTPUT OFFafter that I repeated the whole procedure and this time everything worked pretty well as expected. I checked SQL*Plus documentation for SERVEROUTPUT
and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
Could anyone kindly make some clarification?
thanks in advance,
Regards,
Dariyoosh>
and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
Hi Dariyoosh,
SET SERVEROUTPUT ON has the effect of executing dbms_output.get_lines after each and every statement. Not only related to system view.
Here below what Tom Kyte is explaining in this page:
Now, sqlplus sees this functionality and says "hey, would not it be nice for me to dump this buffer to screen for the user?". So, they added the SQLPlus command "set serveroutput on" which does two things
1) it tells SQLPLUS you would like it <b>to execute dbms_output.get_lines after each and every statement</b>. You would like it to do this network rounding after each call. You would like this extra overhead to take place (think of an install script with hundreds/thousands of statements to be executed -- perhaps, just perhaps you don't want this extra call after every call)
2) SQLPLUS automatically calls the dbms_output API "enable" to turn on the buffering that happens in the package.Regards.
Al -
Oracle 9i Support for multi language is not working.. Giving question mark
HI,
We have an application which uses oracle 9i as the database. Riight now we are supporting only english and there is a requirement to support multiple languages like korean, chineese and japaneese.
But we are planning to migrate one part of the application to support multi languages. Means it may affect around 10 tables but with huge data. Totally we have around 100 tables.
How to enable the database for supporting multiple langugages.?
Is there any way to enable only the few tables supporting multiple languages. Because if we change the database level parameters for supporting languages, we may need to migrate entire tables. this will be a huge task.
Even if want to set the parameters for supporting multiple languages.. how to set it. Is it possible set it in the existing database or do we need to re-create the table with these prameters.
I have read in some documentation, that we can create table columns with nVarchar2 for supporting multi languages. I have created it. but if i copy some other language characters into those columns, it is giving question mark.
Is it possible to do search using text in native langugage like chineese..
Could somebody guide me on the above clarificationa and what would be the best approach..
Thanks in advance
Jino
Regards,
Jino George
Ext: 6520You should not use any more Oracle 9.0.1 but at least Oracle 9.2.0.8 to get some extended support if you really cannot upgrade to 10g.
I don't have any Oracle 9.x database available but I've run successfully following test with Oracle 10.2.0.1 in character mode under Linux:
oracle@pbell:~$ export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
oracle@pbell:~$ sqlplus / @nls
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Aug 29 17:29:56 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> drop table t;
Table dropped.
SQL> select * from v$nls_parameters where parameter like '%SET%';
PARAMETER
VALUE
NLS_CHARACTERSET
WE8ISO8859P1
NLS_NCHAR_CHARACTERSET
AL16UTF16
SQL> create table t ( data nvarchar2(100));
Table created.
SQL> insert into t values(unistr('\76EE\7684\5730'));
1 row created.
SQL> select * from t;
DATA
目的地Try to make sure you have the right NLS_LANG setting on the client side (under Windows this is a registry setting). -
How can I allow users to access SQLPLUS?
Hi everyone,
I have been charged with the task of creating an Oracle server on a CentOS VM. Installation and configuration is complete and SQL is working fine for the database admin user "oracle." I copied the environment variables to the .bashrc file for "oracle" and SQLPLUS starts without a hitch.
Here is where I need a little guidance...
I need to create basic Linux user accounts that will have access to the database, so they can then in turn log into their SQLPLUS accounts. The problem is, all of the database files and software are in located in the user "oracle's" directory. This means that no one but "oracle" and root have access to these files because they are the only ones with proper permissions.
Before I put a ton of time into this, I thought I would pose these questions to the Oracle Linux community:
1) Could I enable a specific Linux group (ex. "Oracle Users") to have access to the main database folder or possibly all folders along the path? I am hoping this would allow any users I put in the group access to the folders, and essentially the SQLPLUS application. (here is ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1)
2) If that is not an option, will I need to make a completely new database and locate it in a location that all users can access?
I understand that my first idea may not be the SAFEST method, but this is only for a small class of students learning how to use SQL and writing queries. There will be no sensitive information at risk. This would be a quick fix until I learned more about Oracle and how to use it.
Thank you everyone.It certainly is rather a question for the General Database forum, though I doubt you will get a lot of happy replies for such a basic question.
You can use / as sysdba OS authentication through SSH or using the server console, provided the user's account belongs to the "dba" user group. For remote connection through sqlnet you need create a $ORACLE_HOME/dbs/orapw$SID password file.
If you would like to know more about this:
Connecting / as sysdba is used for OS authentication. It ignores password credentials stored in the database and allows any user belonging to the OSDBA system group to connect to the database. Connections as sysdba will always connect to the SYS schema of the database, regardless of any username or password specified. Using OS authentication relies on the BEQ protocol, which connects to the database directly, without using the Oracle Listener process.
The "oinstall" group will give access to the database software repository. There could be different oracle home installations, each with a different oracle user/owner like "oracle_prod1" and "oracle_prod2", but both users must be able to read/write the shared oraInventory, in which case both users must have read and write access to the oraInventory directory, hence the oinstall group. -
System and Object privileges question
hello everyone.
I was really making it a priority to really understand both system and object privileges for users. I have setup a couple of 'sandboxes' at home and have done lots of testing. So far, it has gone very well in helping me understand all the security involved with Oralce (which, IMHO, is flat out awesome!).
Anyway, a couple of quick questions.
As a normal user, what view can I use to see what permissions I have in general? what about permissions on other schemas?
I know I can do a:
select * from session_privs
which lists my session privileges.
What other views (are they views/data dictionary?) that I can use to see what I have? Since this is a normal user, they don't have access to any of the DBA_ views.
I'll start here for now, but being able to see everything this user has, would be fantastic.
Cheers,
TCGSorry. should have elaborated more.
In SQLPLUS, (logged in while logged into my Linux OS), I am working to try and get sqlplus to display the results of my query so it is easy to read. Right now, it just displays using the first 1/4 or 1/3 of the monitor screen to the left. Make sense? So it does not stretch the results out to utilize the full screen. it is hard to break down and read the results because they are "stacked" on top of each other.
Would be nice if I could adjust sqlplus so the results are easier to read.
HTH.
Jason -
Hi,
This is a database question.
I am using JDeveloper 10.1.3.4 and got an error when entering a WHERE clause in the definition of a view object:
SQL Query Error Message: ORA-00904: "LDAPUID": invalid identifierI figure the cause of this problem lies in the database tables because I can connect to the database schema from the Connection Navigator, and can see the table descriptions of all the three tables in the Structure tab, but can not see any rows in any of the three tables on the Data tab. (I can query the tables and get expected returns in sqlplus, though).
I have three tables in the schema, with foreign key constraints. When inserting rows into the empty tables, I use saved scripts that contain the INSERT command lines, such as
INSERT INTO BILL VALUES ('LDAP_UID', 'FIRST_NAME', 'LAST_NAME', ....);The saved scripts contain up to more than 20,000 lines. When these scripts are run (such as SQL> @fill_bill.sql), in addition to the "1 row created" lines, I also saw long lines flashing by on the screen. These must be some error messages. But they flashed by too fast I could not catch any of them.
Is there any way to capture the messages in a log file so I can examine them afterwards. Or somehow have the execution of the sql script halted automatically upon encountering a culprit INSERT statement in the script so that I can see which line has what problem?
Thanks a lot!
NewmanHi, Shay:
The column name in the table is LDAP_UID. In the entity object the name of the attribute for the column is LdapUid. The WHERE clause I used is: LdapUid=lower(:TheCurrentUser). I clicked Test button to test the WHERE clause. When the error pops up, I clicked the Help button and the explanation is:
View Object SQL Query Statement
This area displays the view object SQL, to the line where the error occurred. For view objects,
this is the view object's query. For view links, it is the destination view object's query, as
modified by the view link's WHERE clause. In either case, null is passed in for all parameters
(such as WHERE clause parameters in a view object or source attributes in a view link). This explanation made me think that the test query did not receive any return.
Again, is there a way to capture the errors in a log file when executing the sql INSERT statements?
Thanks!
Newman
Maybe you are looking for
-
My Adobe CS4 Photoshop keeps crashing on Windows XP
It's pretty much right when i start the program up and make a new project, as soon as i hit okay the "Photoshop has to close" window comes up. I've tried everything, i even went from 2000 fonts to 300 (was thinking that was the cause but it wasn't as
-
Add serial number in the report file name when using batch process model
I would like to append a string containing the current UUT serial number to the base name of the report file. For example, uut_report.html becomes uut_report[SN000001].html. This setting is not available if I use NI BatchModel.seq as my process m
-
Ok this is driving me nuts, I have just purchased PE7, how can i get a created dvd to display in full screen on a 16.9 tv, I appreciate i will still get the small black bands top n bottom,, but what i am getting is a picture in the middle with large
-
Comparison of Fax features for EBS configuration
H All, Could anyone please let me know where could find a document related to different Fax features with comparison for EBS configuration. We need to find out which fax will be better to be integarted with EBS 12.0.6 to work. Thanks for your time! R
-
Accounting doc not generated Item category 02000 is missing
Dear all, While releasing billing document to accounting Item category 02000 is missing (obligatory in accounting transaction 0200/0001) Message no. GLT2002 Diagnosis The online document splitting is active in your system. Here, each document is assi