Oracle Create Table Syntax: 19 Different Examples


  1. Simple syntax for create table
SQL> CREATE TABLE CR_TABLE_EX
       (EMPNO NUMBER(4) ,
        ENAME VARCHAR2(10)); 

Table created.

  1. Create table with primary key

SQL> CREATE TABLE CR_TABLE_EX

NoMachine Tool: Better Remote Desktop Connectivity across Different OS platforms

NoMachine is similar to any desktop sharing tool like VNC, etc. But only thing it has lot of advanced features.
·        NoMachine gives better speed compared others.
·        NoMachine gives connectivity to any desktop across different OS platforms where you have NoMachine installed.
·        NoMachine can work with any type of content like DVD, video, YouTube, watch TV etc with good speed

Oracle NO_INDEX hint: Syntax, Purpose and Example

Syntax: /*+no_index (Table_name Index_name)*/
Purpose: NO_INDEX hint explicitly notifies the optimizer to not to use the specified index(s). This can be used for query testing purpose without dropping the actual index. In some cases queries will give better performance without indexes. This difference can be tested using this hint. This hint applies to function_based, B-tree, bitmap, cluster indexes.

How to Bypass DROP ANY TABLE Privilege for Truncate Table Command

You have to create a procedure with truncate table command (dynamic SQL) and grant the execute procedure privilege to the other user. This method will help you to avoid the granting of drop any table privilege to the target user. Here is the example for the same.
Example
I have 2 users called test and sthomas. Test wanted to drop the table from the sthomas schema. Dept table has 4 records.

How to Check AWR Snapshot Setting using SQL Queries?

a.   Query to check AWR snapshot interval and retention period set for the database. In below example the snapshot interval is one hour and retention is 8 days. The data type for the columns SNAP_INTERVAL RETENTION is having two fields – days and time with hour, min, sec.
select * from dba_hist_wr_control;

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer