Wonderful Oracle Faqs are in the following links
SQL Commands for interviews :
- SQL Query to Find Duplicate Names in a Table
SELECT Names,COUNT(*) AS Occurrence FROM Users1 GROUP BY Names HAVING COUNT(*)>1;
- SQL to find nth highest salary
select * from(
select ename, sal, dense_rank()
over(order by sal desc)r from Employee) where r=&n;
- SQL query to find second highest salary
select *from employee where
salary=(select Max(salary) from employee);
1. Difference between Instance and Database?
The terms instance and database are closely related, but don't refer to the same thing. The database is the set of files where application data (the reason for a database) and meta data is stored. An instance is the software (and memory) that Oracle uses to manipulate the data in the database. In order for the instance to be able to manipulate that data, the instance must open the database. A database can be opened (or mounted) by more than one instance; however, an instance can open at most one database.
2. How to connect to new database in oracle?
sqlplus username/password@connect_identifier
SQL> connect username/password@connect_identifier
To hide your password, enter the CONNECT command in the form:
SQL> connect username@connect_identifier
You will be prompted to enter your password.
In windows another ex usage :
SQL> connect sys@connect_identifier as sysdba
Enterpassword :
Connected.
3. How to create a new user in a particular database?
CREATE USER user_name IDENTIFIED BY password;
CREATE USER uwclass IDENTIFIED BY uwclass;
CREATE USER user IDENTIFIED {BY password |
EXTERNALLY}
4. How to alter a user?
ALTER USER sidney IDENTIFIED BY second_2nd_pwd DEFAULT TABLESPACE exmple;
ALTER USER sh PROFILE new_profile;
ALTER USER sh DEFAULT ROLE ALL EXCEPT dw_manager;
ALTER USER app_user1 IDENTIFIED GLOBALLY AS 'CN=tom,O=oracle,C=US';
ALTER USER sidney PASSWORD EXPIRE;
ALTER USER sh TEMPORARY TABLESPACE tbs_grp_01;
ALTER USER app_user1 GRANT CONNECT THROUGH sh WITH ROLE warehouse_user;
ALTER USER app_user1 REVOKE CONNECT THROUGH sh;
ALTER USER sully GRANT CONNECT THROUGH OAS1 AUTHENTICATED USING PASSWORD;
5. How to see existing users in Oracle Database?
select name from sys.user$;
select username,password from dba_users;
6. How to change the existing user password in the present oracle database?
alter user myuser identified by my!supersecretpassword;
grant connect to myuser identified by my!supersecretpassword
update sys.user$ set password='F894844C34402B67' where name='SCOTT'; (restart of the database necessary)
SQL*Plus command: password or password username
7. How to launch the database configuration assistant tool in Oracle?
Go to $ORACLEHOME/bin
And run the “dbca” binary.
/app/oracle/product/10.2.0/Db_1/bin/dbca
8.Oracle Versions
Oracle products have historically followed their own release-numbering and naming conventions. With the Oracle RDBMS 10g release, Oracle Corporation started standardizing all current versions of its major products using the "10g" label, although some sources continued to refer to Oracle Applications Release 11i as Oracle 11i. Major database-related products and some of their versions include:
• Oracle Application Server 10g (also known as "Oracle AS 10g"): a middleware product;
• Oracle Applications Release 11i (aka Oracle e-Business Suite, Oracle Financials or Oracle 11i): a suite of business applications;
• Oracle Developer Suite 10g (9.0.4);
• Oracle JDeveloper 10g: a Java integrated development environment;
Since version 7, Oracle's RDBMS release numbering has used the following codes:
• Oracle7: 7.0.16 — 7.3.4
• Oracle8 Database: 8.0.3 — 8.0.6
• Oracle8i Database Release 1: 8.1.5.0 — 8.1.5.1
• Oracle8i Database Release 2: 8.1.6.0 — 8.1.6.3
• Oracle8i Database Release 3: 8.1.7.0 — 8.1.7.4
• Oracle9i Database Release 1: 9.0.1.0 — 9.0.1.5 (Latest current patchset as of December 2003)
• Oracle9i Database Release 2: 9.2.0.1 — 9.2.0.8 (Latest current patchset as of April 2007)
• Oracle Database 10g Release 1: 10.1.0.2 — 10.1.0.5 (Latest current patchset as of February 2006)
• Oracle Database 10g Release 2: 10.2.0.1 — 10.2.0.3 (Latest current patchset as of November 2006)
• Oracle Database 11g Release 1: 11.1.0.6 — no patchset available as of October 2007
The version numbering syntax within each release follows the pattern: major.maintenance.application-server.component-specific.platform-specific.
For example, "10.2.0.1 for 64-bit Solaris" means: 10th major version of Oracle, maintenance level 2, Oracle Application Server (OracleAS) 0, level 1 for Solaris 64-bit.
9. How to see exixsting Oracle Version on the system ?
1)select * from v$version;
10.How do we know which version of oracle we are using ?
I need to know whether it is 32 bit Or 64 bit.
From the unix prompt enter, then enter
bash-2.05$ file oracle
a. A 32 bit oracle server will return:
oracle: ELF 32-bit MSB executable SPARC Version 1,
dynamically linked, not stripped.
b. A 64 bit oracle server will return:
oracle: ELF 64-bit MSB executable SPARCV9 Version 1,
dynamically linked, not stripped.
11.How to see the Patches applied on existing Oracle
$ORACLE_HOME/OPatch/opatch lsinventory
opatch does not list the patches applied on DB. it lists the interim patches applied on oracle binaries.
the patched applied on DB are listed with
SQL> select * from registry$history;
How to create a password policy to not to use the used password for any users?
/* when a user is assigned with above policy he cant reuse the password again */
-- Add user CDSSCHEMA. This MUST exist for Oracle schema creation.
-- CDS explicitly addresses the schema, and they way Oracle
-- names a schema is by the user name that creates it.
-- The password should be changed from the default value 'tivoli'.
The above will create a user called CDSSCHEMA and the he will be under profile krish and hence he cant re-use the same password again.
the above will through error because of the not to use used passwords policy.
/* GRANT will reset the passowrd to new one , it will change the existing password if we specify identified by is given */
Error sample
How to avoid overlapping of columns when working on SQL prompts (DOS/UNIX )?
SQL> set wrap off
How to upgrade Oracle 9i(or lower) version to 10g ?
Oracle 9i to 10g
ORcle 9i to 10g upgrade.pdf
The terms instance and database are closely related, but don't refer to the same thing. The database is the set of files where application data (the reason for a database) and meta data is stored. An instance is the software (and memory) that Oracle uses to manipulate the data in the database. In order for the instance to be able to manipulate that data, the instance must open the database. A database can be opened (or mounted) by more than one instance; however, an instance can open at most one database.
2. How to connect to new database in oracle?
sqlplus username/password@connect_identifier
SQL> connect username/password@connect_identifier
To hide your password, enter the CONNECT command in the form:
SQL> connect username@connect_identifier
You will be prompted to enter your password.
In windows another ex usage :
SQL> connect sys@connect_identifier as sysdba
Enterpassword :
Connected.
3. How to create a new user in a particular database?
CREATE USER user_name IDENTIFIED BY password;
CREATE USER uwclass IDENTIFIED BY uwclass;
CREATE USER user IDENTIFIED {BY password |
EXTERNALLY}
4. How to alter a user?
ALTER USER sidney IDENTIFIED BY second_2nd_pwd DEFAULT TABLESPACE exmple;
ALTER USER sh PROFILE new_profile;
ALTER USER sh DEFAULT ROLE ALL EXCEPT dw_manager;
ALTER USER app_user1 IDENTIFIED GLOBALLY AS 'CN=tom,O=oracle,C=US';
ALTER USER sidney PASSWORD EXPIRE;
ALTER USER sh TEMPORARY TABLESPACE tbs_grp_01;
ALTER USER app_user1 GRANT CONNECT THROUGH sh WITH ROLE warehouse_user;
ALTER USER app_user1 REVOKE CONNECT THROUGH sh;
ALTER USER sully GRANT CONNECT THROUGH OAS1 AUTHENTICATED USING PASSWORD;
5. How to see existing users in Oracle Database?
select name from sys.user$;
select username,password from dba_users;
6. How to change the existing user password in the present oracle database?
alter user myuser identified by my!supersecretpassword;
grant connect to myuser identified by my!supersecretpassword
update sys.user$ set password='F894844C34402B67' where name='SCOTT'; (restart of the database necessary)
SQL*Plus command: password or password username
7. How to launch the database configuration assistant tool in Oracle?
Go to $ORACLEHOME/bin
And run the “dbca” binary.
/app/oracle/product/10.2.0/Db_1/bin/dbca
8.Oracle Versions
Oracle products have historically followed their own release-numbering and naming conventions. With the Oracle RDBMS 10g release, Oracle Corporation started standardizing all current versions of its major products using the "10g" label, although some sources continued to refer to Oracle Applications Release 11i as Oracle 11i. Major database-related products and some of their versions include:
• Oracle Application Server 10g (also known as "Oracle AS 10g"): a middleware product;
• Oracle Applications Release 11i (aka Oracle e-Business Suite, Oracle Financials or Oracle 11i): a suite of business applications;
• Oracle Developer Suite 10g (9.0.4);
• Oracle JDeveloper 10g: a Java integrated development environment;
Since version 7, Oracle's RDBMS release numbering has used the following codes:
• Oracle7: 7.0.16 — 7.3.4
• Oracle8 Database: 8.0.3 — 8.0.6
• Oracle8i Database Release 1: 8.1.5.0 — 8.1.5.1
• Oracle8i Database Release 2: 8.1.6.0 — 8.1.6.3
• Oracle8i Database Release 3: 8.1.7.0 — 8.1.7.4
• Oracle9i Database Release 1: 9.0.1.0 — 9.0.1.5 (Latest current patchset as of December 2003)
• Oracle9i Database Release 2: 9.2.0.1 — 9.2.0.8 (Latest current patchset as of April 2007)
• Oracle Database 10g Release 1: 10.1.0.2 — 10.1.0.5 (Latest current patchset as of February 2006)
• Oracle Database 10g Release 2: 10.2.0.1 — 10.2.0.3 (Latest current patchset as of November 2006)
• Oracle Database 11g Release 1: 11.1.0.6 — no patchset available as of October 2007
The version numbering syntax within each release follows the pattern: major.maintenance.application-server.component-specific.platform-specific.
For example, "10.2.0.1 for 64-bit Solaris" means: 10th major version of Oracle, maintenance level 2, Oracle Application Server (OracleAS) 0, level 1 for Solaris 64-bit.
9. How to see exixsting Oracle Version on the system ?
1)select * from v$version;
10.How do we know which version of oracle we are using ?
I need to know whether it is 32 bit Or 64 bit.
From the unix prompt enter
bash-2.05$ file oracle
a. A 32 bit oracle server will return:
oracle: ELF 32-bit MSB executable SPARC Version 1,
dynamically linked, not stripped.
b. A 64 bit oracle server will return:
oracle: ELF 64-bit MSB executable SPARCV9 Version 1,
dynamically linked, not stripped.
11.How to see the Patches applied on existing Oracle
$ORACLE_HOME/OPatch/opatch lsinventory
opatch does not list the patches applied on DB. it lists the interim patches applied on oracle binaries.
the patched applied on DB are listed with
SQL> select * from registry$history;
CREATE PROFILE krish LIMIT
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_REUSE_MAX 10; COMMIT;
-- Add user CDSSCHEMA. This MUST exist for Oracle schema creation.
-- CDS explicitly addresses the schema, and they way Oracle
-- names a schema is by the user name that creates it.
-- The password should be changed from the default value 'tivoli'.
CREATE USER CDSSCHEMA
IDENTIFIED BY oracle
DEFAULT TABLESPACE cds_ts123
TEMPORARY TABLESPACE cds_temp_ts123
QUOTA UNLIMITED ON cds_ts123
PROFILE krish;
COMMIT;
GRANT CONNECT, RESOURCE, ALTER SESSION, CREATE SEQUENCE, CREATE SESSION, IDENTIFIED BY oracle
CREATE SYNONYM, CREATE TABLE, CREATE VIEW, UNLIMITED TABLESPACE
TO CDSSCHEMA;
COMMIT;
/* GRANT will reset the passowrd to new one , it will change the existing password if we specify identified by
Error sample
GRANT CONNECT, RESOURCE, ALTER SESSION, CREATE SEQUENCE, CREATE SESSION,
*
ERROR at line 1:
ORA-28007: the password cannot be reused
Oracle 9i to 10g
ORcle 9i to 10g upgrade.pdf
How do I execute an SQL script file in SQLPlus?
To execute a script file in SQLPlus, type @ and then the file name.
SQL > @{file}
For example, if your file was called script.sql, you'd type the following command at the SQL prompt:
SQL > @script.sql
The above command assumes that the file is in the current directory. (ie: the current directory is usually the directory that you were located in before you launched SQLPlus.)
If you need to execute a script file that is not in the current directory, you would type:
SQL > @{path}{file}
For example:
SQL > @/oracle/scripts/script.sql
This command would run a script file called script.sql that was located in the /oracle/scripts directory.
what does i stands for in oracle 8i and oracle 9i ?
i stands for internet in oracle 8i and 9i
What does g stands for in oracle 10g ?
g stands for grid technology in Oracle 10g.
from 10g onwards oracle supports grid architecture.
How to see the existing constrains applied on a table columns?
select constraint_name, constraint_type from user_constraints where table_name='';
Ex : table name : call_qr_nortel_active
select constraint_name, constraint_type from user_constraints where table_name='call_qr_nortel_active';
what is this grid computing ?
Write a typical insert command to put system date as the date column data ?
insert into call_qr_nortel_active values(sysdate,1,'cProbe:15','iProbe:30','3215551234','3215551234','192.168.2.10:',
'192.18.2.10:','11-APR-2008',12,'E1:30',999,'192.168.2.10:160','192.168.2.10:460',70,
8,41,33,3,5,999,4,33,600,999,'92.168.3.10:48160','192.168.3.10:49160',
54,23,45,33,5,23,999,6,33,5000,677,'unknown data value',
33,'16:40',4,3);
15 comments to "Oracle Basic FAQ's"
Post a Comment
Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")
Popular Posts
-
The best solution to know about these init levels is to understand the " man init " command output on Unix. There are basically 8...
-
How to Unlock BSNL 3G data card to use it with Airtel and Vodafone Model no : LW272 ? How to unlock BSNL 3G data card( Model no : LW272 )us...
-
How to transfer bike registration from one State to other (Karnataka to Andhra)?? Most of us having two wheelers purchased and registered in...
-
ఓం శ్రీ స్వామియే శరణం ఆయ్యప్ప!! Related posts : Trip to Sabarimala - Part 1 Trip to Sabarimala - Part 2 Ayappa Deeksha required things...
-
Following are some of interesting blogs I found till now ...please comment to add your blog here. Blogs in English : http://nitawriter.word...
Popular posts
- Airtel and vodafone GPRS settings for pocket PC phones
- Andhra 2 America
- Ayyappa Deeksha required things
- Blogs I watch !
- Captions for your bike
- DB2 FAQs
- Deepavali Vs The Goddes of sleep
- ETV - Dhee D2 D3
- Evolution of smoking in India Women
- How to make credit card payments?
- init 0, init 1, init 2 ..
- Java-J2EE interview preparation
- mCheck Application jar or jad download
- My SQL FAQs
- My Travelogues
- Old is blod - New is italic
- Online pay methids for credit cards
- Oracle FAQs
- Pilgrimages
- Smoking in Indian Women
- Technology Vs Humans
- Twitter feeds for all Telugu stars on single page.
- Unix best practices
- Unix FAQs
Buffs ...
Tags
Powered by WidgetsForFree
Archives
-
▼
2008
(132)
-
▼
May
(20)
- How to make Credit Card Payment using cheq(what to...
- How to determine whether your computer is running ...
- HTML Basics
- Oracle Basic FAQ's
- Short-hand form of communication in chating. (chat...
- Corporate language ....
- 156 Useful Run Commands ....
- Great Indians
- HIDDEN PROGRAMS OF WINDOWS Operating System !!!!
- Words of wisdom for new brides and grooms !!!!!!!
- New Year !!!!
- How to reach ur destiny using MAPS ....on internet
- How to enable/disable USB ports from Windows Oper...
- Tips on Filling your Vehicles...
- Forgotten Root Password - Suse 10.3 ???
- We will rock you
- UNIX Basic FAQ's
- How to recover the Root Password in Soalris 10 ???
- Trip to Nandi Hills
- Krishna's page ads free information contact
-
▼
May
(20)
harinath says:
how increase oracle parameters,upto which level can increase parameters in pfile?having of 2gb of ram ?
harinath says:
i am facing the error of ora1652 ,1653,1631,1632,255,272how to resolve it?plz reply asap?
harinath says:
can we create our control file in oracle?
harinath says:
what is difference between startup and mount?
harinath says:
if we change the sid of oracledb can we work with the database?
harinath says:
where can we see the oracle services in windows?ie pmon, smon,dbwr,lgwr,arcn,ckpt
harinath says:
how many instance can be created for one data base?
harinath says:
can administrator change the control file?
harinath says:
can we create virtual port numbers in oracle?
harinath says:
if i applied patches where can i see applied patches? how can i test it?
harinath says:
how to archive oracle tables?
harinath says:
how to trace user activites ?
harinath says:
what is shadow process?
harinath says:
what is the difference oracle 9i and 10g?
harinath says:
how to copy whole oralce data to one system to another?