<?php
require_once('include/config.php');
$db = new Database();
//delete about page multiple
if(isset($_GET['type']) && $_GET['type'] == "multiple_delete_aboutus")
{
$ids = $_POST['id']; foreach ($ids as $id)
{
$del_query = "DELETE FROM queryabout WHERE a_id = '$id'";
$db->execute($del_query);
}
return 0;
}
//delete about page single
if(isset($_GET['type']) && $_GET['type'] == 'singledelete_aboutus')
{
$id = $_GET['id'];
$query = "DELETE FROM queryabout WHERE a_id = '$id'";
if($db->execute($query))
return 0;
else
return 1;
}
//delete Services page multiple
if(isset($_GET['type']) && $_GET['type'] == "delete_car_details")
{
$ids = $_POST['id']; foreach ($ids as $id)
{
$del_query = "DELETE FROM our_car WHERE car_id = '$id'";
$db->execute($del_query);
}
return 0;
}
//delete page single
if(isset($_GET['type']) && $_GET['type'] == 'singal_delete_car_d')
{
$id = $_GET['id'];
$query = "DELETE FROM our_car WHERE car_id = '$id'";
if($db->execute($query))
return 0;
else
return 1;
}
?>
ORACLE QUERY
CREATE TABLESPSCE
A tablespace is a storage location where the actual data underlying database objects can be kept. It provides a layer of abstraction between physical and logical data, and serves to allocate storage for all DBMS managed segments.
A tablespace is a logical group of data files in a database. A database typically contains at least one tablespace, and usually two or more. Within the database, the tablespace plays a role similar to that of a folder on the hard drive of a computer.
Datafile : Describe all database files , Datafiles are physical files stored on your disk created by Oracle database and has .dbf extension.
CREATE DBA DATA FILES TABLESPACE
We have to find the file location in DBA DATA FILES
Now here describing dba data files
SQL> desc dba_data_files;
We can use one of them
SQL> describe dba_data_files;


Here Selection Specific columns
DBA DATA FILES Selecting the FILE_NAME
SQL> SELECT FILE_NAME FROM dba_data_files;

TABLESPACENAME describe including with Created files name users
If we will create new TABLESPACENAME it will also reflect in File Name.
SQL> SELECT FILE_NAME, TABLESPACE_NAME FROM dba_data_files;

Now I am going to change the Bytes into MB

Now you can see here I have converted BYTES in MB.
SQL> select FILE_NAME,TABLESPACE_NAME,BYTES/1024 as size_in_mb from dba_data_files;

Now converting BYTES size in GB
SQL> select FILE_NAME,TABLESPACE_NAME,BYTES/1024/1024/1024 as size_in_gb from dba_data_files;

Now started to create tablespace
We need to know in which directory tablespace file used to create
So here
SQL> Select FILE_NAME from dba_data_files;

So We found the tablespace directory .
Whenever we are creating tablespace we used to create tablespace in oracle default directory including with path in string format.
(extention of tablespace .dbf)
SQL> create tablespace querypanel26 datafile ‘/u01/app/oracle/oradata/q
ueryp/querypanel26.dbf’ size 400m autoextend on;

Now you can see one tablespace is included in tablespace directory.

DATAFILE : before add datafile in tablespace we must have to aware about data files create location . How do we find datafiles storage location
SQL> desc dba_data_files;

Now we are looking for File Name and tablespace
so we promote a select query
SQL> select FILE_NAME,TABLESPACE_NAME from dba_data_files;

Here ADD datafile
SQL> alter tablespace q04 add datafile ‘/u01/app/oracle/oradata/queryp/q04datafile.dbf’ size 5m autoextend on;

we can also assign unlimited tablespace
sql>grant unlimited tablespace to q02;
Lock & Unlock Users
How do lock users account and unlock account.
SQL> alter user query1 account lock;

Now we need to find the user account status.
SQL> select USERNAME,ACCOUNT_STATUS from dba_users;
Here you can see query1 user account is locked

Now need to unlock user account
SQL> alter user query1 account unlock;

Now here user is unblock
SQL> select USERNAME,ACCOUNT_STATUS from dba_users;

User password Expire
We could not login via old password
SQL> alter user query1 password expire;

Whenever we will used to expire password need to set a new password during the user login
User session
Note: When it is in read/write mode, the status will simply say “ONLINE”
Rename Tablespace
SQL> alter tablespace Q05 OFFLINE normal;

SQL> alter tablespace Q05 RENAME TO QP05;

Assign Tablespace while creation of new users
here i have mention specific tablespace to user
SQL> create user q3 identified by q3 default tablespace sept_q3;

we can check here default tablespace to user

Q3 User default tablespace is sept_q3 because i used to mention this particular user carry this tablespace
we can also tablespace while we create table
easy to assign tablespace also like this
SQL> create table q3_insert_1(q_id INT NOT NULL PRIMARY KEY,NAME VARCHAR(20)) tablespace sept_q3;

A temporary tablespace, as its name implied, stores the temporary data that only exists during the database session.
Oracle uses temporary tablespaces to improve the concurrency of multiple sort operations which do not fit in memory. On top of this, Oracle stores temporary tables, temporary indexes, temporary B-trees, and temporary LOBs in temporary tablespaces.
By defeault, Oracle creates a single temporary tablespace named TEMP for each new Oracle Database installation. This TEMP tablespace can be shared by multiple users.
Now here we are going to create temporary tablespace
SQL> CREATE TEMPORARY TABLESPACE q3temp_1 TEMPFILE ‘/u02/app/oracle/oradata/sept/q3temp_1.dbf’ SIZE 40m;

now we can check temporary tablespace in dba_temp_files
we can see temporary tablespace is created

Oracle 11g Installation
To install Oracle Database Client perform the following steps:
Oracle DBA Installation Guide
How to install linux using oracle virtualbox
Steps:
Oracle VM VirtualBox is a free and open-source hosted hypervisor for x86 virtualization, developed by Oracle Corporation.
First Download Virtual box (Virtual Machine )
(Example : VirtualBox-6.0.10-132072-Win )

Custom Setup Just Next

Network Interface just next to it
click on Install and Next to finish

Installation Completed Oracle Virtual Box
Virtual Box after installation Display

Go to machine tab click over there add machine and select the Driver where you wanted to install Linux

add location specified where you wanted to install Linux and in Drop down menu Select Operating system and version
Click to next
Allocate RAM Space in your system & Allocate Hard disk (HDD) Space

Select Virtual Box Disk Image

Storage Section we can Assign Physical Hard Disk Space( we can select any of one now I am selected Dynamically

After the Following Steps User created in Virtual Box

Right click on user select Setting Tab
Click on Add button

After that click on empty and select disk option ,select Downloaded Linux Version file and click okay

Right click on user normal start tab after that booting just click to next

After that click on web server

We have to wait until the installation Will completed

Completed Installation

We need to follow the steps
During the Oracle step we will also used to create User
And password
Now we need to create login username : root : and password : 12345 if we will skip the user we can also login via root

Now Oracle Linux is ready to use after valid username & password & Window will be appear like this

now go to Linux Application tab and Click on Terminal tab


Now we need to download some of Specific Software Download PuTTY – a free SSH and telnet client PuTTY for Linux
PuTTY is a free and open-source terminal emulator, serial console and network file transfer application.
PuTTy Configuration we need to Connect PuTTy Via IP Address

connected via puTTy we will get New Black Window login as : username( root)

puTTy Password what we have used during Linux Installation

Now we need to Specific Software for Download
Create Database Using IF Condition
-
CREATE DATABASE IF NOT EXITS QueryPanel(Databasename);
