Category: Database

How to Disable and Enable triggers in oracle

oracle

In this post, we are discussing on how to enable, disable and drop triggers in oracle.   Enable ONE Trigger in a table Syntax ALTER TRIGGER <trigger-name> ENABLE; Example ALTER TRIGGER NarayanaTutorial_Trigger ENABLE;   Enable ALL Triggers in a table Syntax ALTER TABLE <table-name> ENABLE ALL TRIGGERS; Example ALTER TABLE NarayanaTutorial_TABLE ENABLE ALL TRIGGERS;     Disable […]

SQL DBA

SQL DBA SQL statement for creating table space Syntax CREATE TABLESPACE <TablespaceName> DATAFILE ‘<Datafile Path>’ SIZE 100M AUTOEXTEND ON MAXSIZE UNLIMITED ; Example CREATE TABLESPACE TUTORIALTBS DATAFILE ‘C:oraclexeoradataXETUTORIALTBS.DBF’ SIZE 100M AUTOEXTEND ON MAXSIZE UNLIMITED ;   SQL statement for alter table space — ADD DATAFILE Syntax ALTER TABLESPACE <TablespaceName> ADD DATAFILE ‘<Datafile Path>’ SIZE 4G […]

SQL RENAME

SQL RENAME By using RENAME command, we can rename a table. The rename operation is done automatically. Which means that no other thread can access any of the tables while the rename processing is running. Syntax RENAME <TableName> TO <NewTAbleName>; Example RENAME EMPLOYEE TO EMPLOYEE_DETAILS;   NarayanaswamyHello! I am Narayanaswamy founder and admin of narayanatutorial.com. […]

SQL ALTER

SQL ALTER The structure of the table can be modified by using ALTER TABLE command. ALTER TABLE works by making a temporary copy of the original table. The alteration is performed on the copy, then the original table is deleted and the new one is renamed. ALTER TABLE changing the structure of an existing table […]

SQL UPDATE

SQL UPDATE The UPDATE command is used to change or update data values in a table. UPDATE all rows one column Syntax UPDATE <TableName> SET <ColumnName 1>=<Expression> or <Value> Example UPDATE EMPLOYEE SET COUNTRY=”INDIA”; UPDATE all rows more than one column Syntax UPDATE <TableName> SET <ColumnName 1>=<Expression> or <Value>, <ColumnName 2>=<Expression> or <Value> Example UPDATE […]

SQL DELETE

SQL DELETE OPERATIONS The DELETE command deletes rows from the table that satisfies the condition provided by its WHERE clause and returns the number of records are deleted. If the DELETE command without a WHERE clause is issued then, all rows are deleted. We can retrieve the deleted records back if we had not executed […]

SQL INSERT

SQL INSERT DATA INTO A TABLE FROM ANOTHER TABLE We can insert data into table in two different ways. They are 1) Using INSERT INTO without using SELECT statement. Syntax INSERT INTO <TableName>(<ColumnName1>,<ColumnName2>) VALUES (<ColumnValue1>,<ColumnValue2>); Example INSERT INTO EMPLOYEE (FIRSTNAME, LASTNAME) VALUES (‘Narayana’,’Ragi’); 2) Using INSERT INTO with SELECT statement Syntax INSERT INTO <TableName> SELECT […]

SQL CREATE

SQL CREATE TABLE FROM ANOTHER TABLE We can create tables two ways they are 1) Using CREATE TABLE by specifying columns names, columns data types, columns data length. Syntax: CREATE TABLE <TableName> ( <ColumnName1> <DataType>(Length), <ColumnName2> <DataType>(Length)); Example CREATE TABLE EMPLOYEE (NAME Varchar2(20), ID Number(10)); 2) Using CREATE TABLE statement for target table and SELECT […]