Some of the commands or SQL statements commonly used by Oracle

Source: Internet
Author: User
Tags command line create index

1. Create a user, assign the Create permission to the user, and allocate the table space:
Create user Scott identified by Tiger;
Grant create session to Scott;

Grant CREATE table to Scott;

Alter user Scott default tablespace users;

Alter user Scott quota 512M on users;

2. Find all table names for which the user specified by the Where condition is owner:
Select owner, table_name from Dba_tables where owner= ' SCOTT ';

3. Create an index of the specified parameters on a specified table.
CREATE INDEX ind_test on test (x) tablespace users Storage
(Initial 2K
Next 2K
Minextents 1
Maxextents 100
Pctincrease 0);

4. View the name of the index for the specified user owner:
Select Index_name, table_owner from dba_indexes where owner= ' SCOTT ';

5. View all index information on the specified table:
Select Index_owner, Index_name, column_name from Dba_ind_columns where table_name= ' SCOTT ';

6. Create a sequence:
Create S
Incremen
Start WI
MaxValue
Cycle;

7. Use sequence:
INSERT INTO Scott.test
VALUES (Staff_id.nextval,
' Test ');

8. View table Space information:
SELECT * from Dba_tablespaces;

9. View current Online users:
Select username from v$session;

How can I compile and link my application?
Answer:
Compiling and linking are very platform specific. Your system-specific Oracle
Documentation has instructions on I to link a pro*c/c++ application. On UNIX
Systems, there is a makefile called Proc.mk in the demo directory. To link, say, the
Demo program sample1.pc, your would enter the command line
Make-f proc.mk Sample1
If you need the special Precompiler options, you can run pro*c/c++ separately,
Then do the make. Or, you can create your own custom makefile. For example, if
Your program contains embedded Pl/sql code, can enter
Proc Cv_demo Userid=scott/tiger Sqlcheck=semantics
Make-f proc.mk Cv_demo
On the VMS systems, there is a script called Lnproc the use to link your
pro*c/c++ applications.




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.