├── Images ├── Oracle Architrecture.jpg ├── Oracle background Processes.JPG ├── Oracle download-copy link.png ├── Oracle download-downlaod file.png ├── Oracle download-signin.png ├── Oracle physical files.png ├── Oracle_CheatSheet_SGA and PGA.png └── Oracledownload-wget.png ├── Installing Oracle ├── Download using wget and curl.md └── Install Oracle in Linux.md ├── Oracle Internals ├── Background Processes.md ├── Memory Stucture.md ├── Oracle Architecture.md ├── Physical File Structure.md └── Technical Terms.md └── README.md /Images/Oracle Architrecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracle Architrecture.jpg -------------------------------------------------------------------------------- /Images/Oracle background Processes.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracle background Processes.JPG -------------------------------------------------------------------------------- /Images/Oracle download-copy link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracle download-copy link.png -------------------------------------------------------------------------------- /Images/Oracle download-downlaod file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracle download-downlaod file.png -------------------------------------------------------------------------------- /Images/Oracle download-signin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracle download-signin.png -------------------------------------------------------------------------------- /Images/Oracle physical files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracle physical files.png -------------------------------------------------------------------------------- /Images/Oracle_CheatSheet_SGA and PGA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracle_CheatSheet_SGA and PGA.png -------------------------------------------------------------------------------- /Images/Oracledownload-wget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQLadmin/Oracle_CheatSheet/6078d91ccd8af170c8283f494dfe292713c53da4/Images/Oracledownload-wget.png -------------------------------------------------------------------------------- /Installing Oracle/Download using wget and curl.md: -------------------------------------------------------------------------------- 1 | # Download using wget and curl 2 | 3 | Downloading Oracle in linux is a bit tricky. Oracle provide a shell schript to download oracle, but for me it was taking more time to download, So here is the trick. 4 | 5 | > ## Do this in your GUI browser, like chrome or firefox. 6 | 7 | * First create an account in oracle and [Signin](https://login.oracle.com/mysso/signon.jsp). 8 | 9 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracle%20download-signin.png) 10 | 11 | 12 | * [Click here](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html) to download oracle for Linux and accept the license. 13 | 14 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracle%20download-downlaod%20file.png) 15 | 16 | 17 | * Click the files you want to download and while downloading just pause it copy the download link. 18 | 19 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracle%20download-copy%20link.png) 20 | 21 | * Now go to your terminal, install wget or curl. 22 | 23 | > -- For Ubuntu 24 | > 25 | > apt-get install wget curl 26 | > 27 | > -- For RedHat,Centos and Amazon Linux 28 | > 29 | > yum install wget curl 30 | > 31 | 32 | 33 | 34 | * Now type the below command to download via wget. 35 | 36 | `wget -O filename.zip` 37 | 38 | Eg: 39 | 40 | ```` 41 | wget http://download.oracle.com/otn/linux/oracle12c/122010/linuxx64_12201_database.zip?AuthParam=111111111_cb3a26b3a63c89b4405a1e32822d19fc -O file1.zip 42 | ```` 43 | 44 | 45 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracledownload-wget.png) -------------------------------------------------------------------------------- /Installing Oracle/Install Oracle in Linux.md: -------------------------------------------------------------------------------- 1 | # Install Oracle in Linux 2 | 3 | I have installed Oracle 12C release 1 on CentOS and followed the same step for RedHat and Amazon Linux. You can use X windows as well, but I recommend to user Silent installation which saves more time. 4 | 5 | Read my previous page to download Oracle on Linux. 6 | 7 | >For this installtion I used Centos 7.2, 8 | 9 | >Server Name ora, 10 | 11 | >IP address 10.10.0.1 12 | 13 | 14 | ## Put a FQDN name for the server 15 | ```sh 16 | vi /etc/hosts 17 | 18 | 127.0.0.1 ora.sqladmin.com ora 19 | 10.10.0.1 ora.sqladmin.com ora 20 | ``` 21 | 22 | ## Set selinux value to permissive 23 | 24 | ```sh 25 | vi /etc/sysconfig/selinux 26 | 27 | SELINUX=permissive 28 | ``` 29 | 30 | ## Kernel level parameters 31 | ```sh 32 | vi /etc/sysctl.conf 33 | 34 | kernel.shmmax = 4294967295 35 | kernel.shmall = 2097152 36 | fs.aio-max-nr = 1048576 37 | fs.file-max = 6815744 38 | kernel.shmmni = 4096 39 | kernel.sem = 250 32000 100 128 40 | net.ipv4.ip_local_port_range = 9000 65500 41 | net.core.rmem_default = 262144 42 | net.core.rmem_max = 4194304 43 | net.core.wmem_default = 262144 44 | net.core.wmem_max = 1048576 45 | ``` 46 | 47 | ## Update your Server 48 | ```sh 49 | sudo yum install epel-release 50 | sudo yum clean metadata && sudo yum upgrade 51 | ``` 52 | 53 | ## Reboot to apply all the the config changes 54 | `reboot` 55 | 56 | 57 | ## Install pre-requirement packages 58 | ```sh 59 | 60 | sudo yum -y install binutils.x86_64 compat-libcap1.x86_64 compat-libstdc++-33.x86_64 compat-libstdc++-33.i686 compat-gcc-44 compat-gcc-44-c++ gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64 ksh.x86_64 libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 libXext.i686 libXext.x86_64 libXtst.i686 libXtst.x86_64 libX11.x86_64 libX11.i686 libXau.x86_64 libXau.i686 libxcb.i686 libxcb.x86_64 libXi.i686 libXi.x86_64 make.x86_64 unixODBC unixODBC-devel sysstat.x86_64 61 | 62 | yum -y install binutils-2.* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-* gcc-4.* gcc-c++-4.* glibc-2.* glibc-common-2.* glibc-devel-2.* glibc-headers-2.* ksh-2* libaio-0.* libaio-devel-0.* libgcc-4.* libstdc++-4.* libstdc++-devel-4.* make-3.* sysstat-7.* unixODBC-2.* unixODBC-devel-2.* 63 | 64 | ``` 65 | 66 | ## Add user and groups for oracle 67 | 68 | ```sh 69 | sudo groupadd -g 54321 oracle 70 | sudo groupadd -g 54322 dba 71 | sudo groupadd -g 54323 oper 72 | sudo useradd -u 54321 -g oracle -G dba,oper oracle 73 | sudo usermod -a -G wheel oracle 74 | sudo passwd oracle 75 | ``` 76 | 77 | ## Disable iptables or configure to allow oracle 78 | ```sh 79 | sudo iptables -F 80 | sudo service iptables save 81 | sudo chkconfig iptables on 82 | ``` 83 | 84 | 85 | ## Create swap file 86 | ```sh 87 | sudo dd if=/dev/zero of=/swapfile bs=10M count=70 88 | sudo chmod 600 /swapfile 89 | sudo mkswap /swapfile 90 | sudo swapon /swapfile 91 | ``` 92 | 93 | ### Make swap file at startup 94 | ```sh 95 | 96 | vi /etc/fstab 97 | 98 | /swapfile none swap sw 0 0 99 | ``` 100 | 101 | ## Create directories for oracle installation 102 | ```sh 103 | sudo mkdir -p /ora01/app/oracle/product/12.1.0/db_1 104 | mkdir -p /ora01/app/oracle/distribs 105 | sudo chown -R oracle:oracle /ora01 106 | sudo chmod -R 775 /ora01 107 | ls -l /ora01 108 | ``` 109 | 110 | ## Create bash profile file 111 | ```sh 112 | vi /home/oracle/.bash_profile 113 | 114 | export TMP=/tmp 115 | export ORACLE_HOSTNAME=ora 116 | export ORACLE_UNQNAME=ORA12C 117 | export ORACLE_BASE=/ora01/app/oracle 118 | export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1 119 | export ORACLE_SID=ORA12C 120 | export PATH=$ORACLE_HOME/bin:$PATH 121 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH 122 | export CLASSPATH=ORACLE_HOME/jlib:ORACLE_HOME/rdbms/jlib; 123 | alias cdob='cd ORACLE_BASE' 124 | alias cdoh='cd ORACLE_HOME' 125 | alias tns='cd ORACLE_HOME/network/admin' 126 | alias envo='env | grep ORACLE' 127 | umask 022 128 | envo 129 | ``` 130 | 131 | ## Set file limits and file descriptor values 132 | ```sh 133 | vi /etc/security/limits.conf 134 | 135 | oracle soft nofile 1024 136 | oracle hard nofile 65536 137 | oracle soft nproc 2047 138 | oracle hard nproc 16384 139 | oracle soft stack 10240 140 | oracle hard stack 32768 141 | ``` 142 | 143 | ```sh 144 | 145 | vi /etc/security/limits.d/20-nproc.conf 146 | 147 | -- By default it was set to 148 | * soft nproc 1024 149 | -- We need to change it to. 150 | * - nproc 16384 151 | ``` 152 | 153 | ## Installation: 154 | 155 | We are doing this installation in three parts. 156 | 157 | * `db_install.rsp` – used to install oracle binaries, install/upgrade a database in silent mode 158 | * `dbca.rsp` – used to install/configure/delete a database in silent mode 159 | * `netca.rsp` – used to configure simple network for oracle database in silent mode 160 | 161 | ### db_install file installation 162 | 163 | Move oracle installer to appropriate directory. I have downloaded and extracted Oracle software in /home/ubuntu/database. 164 | 165 | ```sh 166 | 167 | mv /home/oracle/database /ora01/app/oracle/distribs 168 | sudo chown -R oracle:oracle /ora01/app/oracle/distribs/database 169 | sudo chmod -R 775 /ora01/app/oracle/distribs/database 170 | 171 | ``` 172 | 173 | >### Now Login as Oracle user. 174 | 175 | 176 | **Edit and install db_install.rsp** 177 | ```sh 178 | 179 | cp db_install.rsp db_install.rsp.bck 180 | 181 | vi /ora01/app/oracle/distribs/database/response/db_install.rsp 182 | 183 | oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0 184 | oracle.install.option=INSTALL_DB_SWONLY 185 | ORACLE_HOSTNAME=ora 186 | UNIX_GROUP_NAME=oracle 187 | INVENTORY_LOCATION=/ora01/app/oraInventory 188 | SELECTED_LANGUAGES=en 189 | ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1 190 | ORACLE_BASE=/ora01/app/oracle 191 | oracle.install.db.InstallEdition=EE 192 | oracle.install.db.DBA_GROUP=oracle 193 | oracle.install.db.OPER_GROUP=oracle 194 | oracle.install.db.BACKUPDBA_GROUP=oracle 195 | oracle.install.db.DGDBA_GROUP=oracle 196 | oracle.install.db.KMDBA_GROUP=oracle 197 | DECLINE_SECURITY_UPDATES=true 198 | 199 | ``` 200 | Save and close. 201 | 202 | Call the source file 203 | 204 | `source ~/.bash_profile` 205 | 206 | **Install** 207 | ```sh 208 | cd /ora01/app/oracle/distribs/database/ 209 | 210 | ./runInstaller -silent -responseFile /ora01/app/oracle/distribs/database/response/db_install.rsp 211 | ``` 212 | 213 | Once its done it’ll show to execute two sh files in root user. 214 | 215 | ```sh 216 | 217 | su root 218 | /ora01/app/oraInventory/orainstRoot.sh 219 | /ora01/app/oracle/product/12.1.0/db_1/root.sh 220 | 221 | ``` 222 | 223 | Now test the installation. 224 | ```sh 225 | 226 | source ~/.bash_profile 227 | sqlplus / as sysdba 228 | 229 | ``` 230 | ### netca.rsp file installation 231 | You can edit netca.rsp to set own parameters. I didn’t changed anything here. So just start standard configuration. It will configure LISTENER with standard settings. 232 | 233 | ```sh 234 | 235 | netca -silent -responseFile /ora01/app/oracle/distribs/database/response/netca.rsp 236 | ``` 237 | Check LISTENER status 238 | 239 | `lsnrctl status` 240 | 241 | ### dbca.rsp file installation 242 | Lets install the database software, you can also use this to install container database. But here I’m going to install single instance database called ORA12C. 243 | 244 | _Make the directories for data files_ 245 | ```sh 246 | su oracle 247 | mkdir /ora01/app/oracle/oradata 248 | mkdir /ora01/app/oracle/flash_recovery_area 249 | ``` 250 | Edit the dbca.rsp file 251 | 252 | ```sh 253 | vi /ora01/app/oracle/distribs/database/response/dbca.rsp 254 | 255 | GDBNAME = "ora_master" 256 | SID = "ORA12C" 257 | TEMPLATENAME = "General_Purpose.dbc" 258 | SYSPASSWORD = "oracle" 259 | SYSTEMPASSWORD = "oracle" 260 | EMCONFIGURATION = "DBEXPRESS" 261 | EMEXPRESSPORT = "5500" 262 | SYSMANPASSWORD = "oracle" 263 | DBSNMPPASSWORD = "oracle" 264 | DATAFILEDESTINATION = /ora01/app/oracle/oradata 265 | RECOVERYAREADESTINATION = /ora01/app/oracle/flash_recovery_area 266 | STORAGETYPE = FS 267 | LISTENERS = "LISTENER" 268 | DATABASETYPE = "OLTP" 269 | AUTOMATICMEMORYMANAGEMENT = "TRUE" 270 | TOTALMEMORY = "1024" 271 | ``` 272 | > `TOTALMEMORY` = Please set this value as 70% of your total memory. 273 | 274 | Now execute the below command to create the database. 275 | ```sh 276 | dbca -silent -responseFile /ora01/app/oracle/distribs/database/response/dbca.rsp 277 | ``` 278 | 279 | Alternatively, 280 | 281 | ```sh 282 | dbca \ 283 | -silent \ 284 | -createDatabase \ 285 | -templateName General_Purpose.dbc \ 286 | -gdbName ORA12C \ 287 | -pdbadminPassword oracle \ 288 | -SysPassword oracle \ 289 | -SystemPassword oracle \ 290 | -emConfiguration NONE \ 291 | -datafileDestination /ora01/app/oracle/oradata \ 292 | -asmSysPassword oracle \ 293 | -characterSet AL32UTF8 \ 294 | -totalMemory 6000 \ 295 | -recoveryAreaDestination /ora01/app/oracle/flash_recovery_area 296 | 297 | THIS IS FOR STANDARD EDITION 298 | ``` 299 | 300 | Thats it!! :) 301 | 302 | 303 | -------------------------------------------------------------------------------- /Oracle Internals/Background Processes.md: -------------------------------------------------------------------------------- 1 | # Oracle Background Process 2 | 3 | Whenever the Oracle is stated then there will be some processes also started which are mandatory to the keep Oracle up and running. I'm going to talk about the most common and important process. 4 | 5 | 6 | * Database Writer Process 7 | * Log Writer Process 8 | * Checkpoint Process 9 | * System Monitor Process 10 | * Process Monitor Process 11 | * Archiver Process 12 | * Recovery Process 13 | 14 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracle%20background%20Processes.JPG) 15 | 16 | ### Database Writer process(DBWR): 17 | This process is responsible for write the data from Data buffer cache to Data files. 18 | 19 | ### Log Writer Process(LGWR): 20 | This process is responsible for write redo logs from Redo buffer cache to Redo log files. 21 | 22 | **Some intersting points** 23 | 24 | 1. Once the redo buffer write to the disk then the next redo buffer will for previous commits acknowledement. 25 | 26 | 1. All other waiting redo buffers will write to the disk as a group commit. So the I/O will reduce. 27 | 28 | 1. `DBWR` will write the data files after the Redo logs written to the Disk. 29 | 30 | 31 | 32 | ### Checkpoint Process(CKPT): 33 | Checkpoints will occur when the transaction got committed, Once the transaction is committed then this process will update the header of the data files to record the details of the checkpoint. 34 | 35 | ### System Monitor Process(SMON): 36 | This process will start when the Oracle is started. It is responsible for recovery kind of things. During startup of the database, it will go and check if any uncommitted transactions and rollback them. 37 | 38 | ### Process Monitor Process(PMON): 39 | Whenever the user's session got killed or abnormally terminated then this process is responsible for clean up that user's session data, temp data and etc. 40 | 41 | ### Archiver Process(ARCn): 42 | There is no use for keeping the redo logs for so long time, so this process will help to archive the Redo logs to archive log files. 43 | 44 | ### Recovery Process(RECO): 45 | This process is intended for recovery of distributed databases. The distributed transaction recovery process finds pending distributed transactions and resolves them. All in-doubt transactions are recovered by this process in the distributed database setup. RECO will connect to the remote database to resolve pending transactions. 46 | 47 | ### Reference Links: 48 | [Reference Video](https://www.youtube.com/watch?v=zCKWRKSGlA0&t=2s) 49 | 50 | [A blog post](http://satya-dba.blogspot.in/2009/08/background-processes-in-oracle.html) -------------------------------------------------------------------------------- /Oracle Internals/Memory Stucture.md: -------------------------------------------------------------------------------- 1 | # Memory Structure: 2 | Basically all the databases servers needs its own memory from the underlying servers. In oracle the memory allocation is divided into two parts. 3 | * System Global Area or Shared Global Area 4 | * Process Global Area or Program Global Area 5 | 6 | ## System Global Area: 7 | 8 | The System Global Area (SGA) is a group of shared memory areas that are dedicated to an Oracle instance. You only need to define two parameters (sga_target and sga_max_size) to configure your SGA, this will automatically allocate the memory for each component of SGA using a feature called Automatic Memory Management (AMM). SGA includes the below divisions. 9 | 10 | * Data buffer cache - cache data and index blocks for faster access. 11 | * Shared pool - cache parsed SQL(Save SQL query results) and PL/SQL(Functions results with same parameters) statements. 12 | * Dictionary Cache - information about data dictionary objects. 13 | * Redo Log Buffer - committed transactions that are not yet written to the redo log files. 14 | * JAVA pool - caching parsed Java programs. 15 | * Streams pool - cache Oracle Streams objects. 16 | * Large pool - used for huge memory consuming operations like backups, UGAs, etc. 17 | 18 | ## Process Global Area: 19 | 20 | A memory buffer that contains data and control information for a server process. The information in a PGA depends on the Oracle configuration. 21 | 22 | > **Note:** 23 | SGA is allocate when server startup and PGA will allocate when a Server process is started. 24 | 25 | 26 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracle_CheatSheet_SGA%20and%20PGA.png?raw=true|alt=SGA and PGA) 27 | 28 | ## Reference: 29 | 30 | [Reference Video](https://www.youtube.com/watch?v=zCKWRKSGlA0&t=2s) 31 | -------------------------------------------------------------------------------- /Oracle Internals/Oracle Architecture.md: -------------------------------------------------------------------------------- 1 | # Oracle Architrecture 2 | 3 | A well-crafted architecture will help the Oracle to do its best. Basically, the architecture is the both combination of physical and logical components. Here I have divided the Oracle's Architecture into four blocks. 4 | 5 | 1. Process block 6 | 1. Memory block 7 | 1. Storage block 8 | 1. Background process block 9 | 10 | I'll explain each block in several posts, now I'm just going to explain how Oracle is architected. 11 | 12 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracle%20Architrecture.jpg?raw=true|alt=oracle architecture) 13 | 14 | Let's assume that we are going to start with an example query 15 | 16 | ````select * from customer;```` 17 | 18 | ## Process Block: 19 | In this block, the user process is nothing just the user's query which has been executed in SqlPlus. Then the SQLplus pass this query to the Oracle, now this user process is converted to System Process which means the Oracle will be handling this process. Whenever a process is started in by oracle a particular amount of Memory will allocate to that process. This memory is called Process Global Area(PGA). These are the things will happen in the Process block. 20 | 21 | ## Memory Block: 22 | Oracle has two types of memory allocations. 23 | * Program Global Area 24 | * System Global Area 25 | 26 | We already saw what is PGA. SGA is nothing but a group of shared memory areas that are dedicated to an Oracle instance. 27 | 28 | **Data Dictionary Cache:** 29 | 30 | Now the select query process will go Data dictionary Cache, this cache contains the information about other database objects like tables owners, permission, etc. 31 | 32 | **Data Buffer Cache:** 33 | 34 | So if the user has access to that table then it'll start getting the data from the table and store it in Data buffer and give the results to us. 35 | 36 | **Redo Buffer:** 37 | 38 | All the changes which are happening inside the database will right Redo buffers first and flushed to the Redo log files. 39 | 40 | ## Storage Block: 41 | 42 | This block contains the actual physical data files such as Control files, Redo log files, password files, etc. 43 | 44 | 45 | ## Background process Block: 46 | 47 | This block contains some background services which are owned by oracle. For example DBWR, this process will write the data from Data buffer cache to Data files and LGWR will write redo logs from redo buffer. 48 | 49 | 50 | ### Reference 51 | [Reference Video](https://www.youtube.com/watch?v=8_YXIj7sh8M) -------------------------------------------------------------------------------- /Oracle Internals/Physical File Structure.md: -------------------------------------------------------------------------------- 1 | # Oracle Physical Files Structure 2 | 3 | Oracle has the below important physical files to help the Oracle instance and Database to start and work. Without anyone of these files Oracle never start. 4 | 5 | * Parameter Files 6 | * Spfile 7 | * Pfile 8 | * password File 9 | * Data Files 10 | * Data file 11 | * Control file 12 | * Undo log file. 13 | * Redo log file 14 | * Diagnostic Files: 15 | * Alert Log file 16 | * Trace File 17 | * Other Files: 18 | * Backups files 19 | * Archive Log files 20 | 21 | ![](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Images/Oracle%20physical%20files.png) 22 | 23 | ## Spfile 24 | Spfile is a binary files that contains parameters to control the oracle instance and Database.If any changes made on this file it'll apply to all running and future instances. 25 | 26 | ## Pfile: 27 | Pfile is a normal text file, this also contains the parameter to configure the Instance setting and database settings, If any changes made on this file you must restart the instances. 28 | 29 | > **Note:** While the oracle startup this parameter files only called first, it has the name and location of the control files. 30 | 31 | ## Password File: 32 | This file has the user names and passwords. This will use when a user login with SYSDBA privileges. 33 | 34 | ## Data Files: 35 | It has the exact data that we inserted into the database. 36 | 37 | ## Control file: 38 | The control file is the main part of oracle. It has the information about the all database names, database file names, tablespace names and their location. And also it contains the backup information of a database. 39 | 40 | ## Undo log files: 41 | When you change data you should be able to either rollback that change or to provide a read consistent view of the original data. 42 | 43 | ## Redo log files: 44 | Redo logs used for recovery purpose. It records all the activity. The transaction must be committed to the Redo logs first, then it'll commit to the data files. 45 | 46 | ## Alert files: 47 | This file is responsible for to store the information about the Startup, Shutdown, Tablespace creation and etc. its recommended to DBA's at least to check this log once a day. 48 | 49 | ## Trace Files: 50 | Traces files are debugging files which can trace background process information (LGWR, DBWn, etc), core dump information (ora-600 errors, etc) and user processing information (SQL). 51 | 52 | ## Backup files: 53 | This is nothing just the files of oracle database backup which are taken from RMAN or Export. 54 | 55 | ## Archive Logs: 56 | Archive logs are nothing but old redo log file, there is no use for keeping redo logs for a long time, So we can archive this redo logs. 57 | 58 | ### Read More: 59 | 60 | [A blog post](http://www.datadisk.co.uk/html_docs/oracle/structure.htm) -------------------------------------------------------------------------------- /Oracle Internals/Technical Terms.md: -------------------------------------------------------------------------------- 1 | 2 | # Oracle Technical Terms 3 | 4 | Before stating with oracle we should know the basic technical terms. 5 | 6 | 7 | ### SID: 8 | 9 | The Oracle System ID (SID) is used to `uniquely identify a particular database` on a system. 10 | 11 | SID = DataBaseName + Instance Name. 12 | 13 | ### DATABASE: 14 | 15 | Nothing its just a of a database which is the collection of data files, Redo Log files, Control file and etc. In RAC a database can be shared to multiple instanaces. 16 | 17 | ### INSTANCE: 18 | 19 | Instanace is a `collection of all the backgroud process` of oracle. While startup the oracle should be start the instance first, so it includes Memory process(SGA and PGA), SMON,PMON, DBwR, etc. Once the instance is started then it'll start the database. 20 | 21 | ### DATABASE DOMAIN: 22 | 23 | Usually the same as your company domain (somecompany.com). 24 | 25 | ### GLOBAL DATABASE NAME: 26 | 27 | GDN = Database name + database domain (somedb.somecompany.com). 28 | 29 | ### SERVICE NAME: 30 | 31 | A database service name is a service created in listener to capture the application connections. Whenever we configure listener, the service name will be given where it listens/captures the connections from client and connects to DB using service 32 | and OS/User/Password authentication 33 | 34 | ### Lintener.ora: 35 | 36 | A file that has to be configured on oracle server to resolve incoming connection requests to the listener on `Oracle Sever`. 37 | 38 | ### tnsnames.ora: 39 | 40 | Afile that has to be configured on the client computer to tell the client computer the address where the listener is located. 41 | 42 | ### UNIQUE DB NAME: 43 | 44 | The ORACLE_UNQNAME is an operating system environment variable that holds the database’s unique name value. 45 | 46 | ### oraenv: 47 | 48 | Set of environment variables for linux system. 49 | 50 | ### Oracle_Home: 51 | 52 | a directory where the Oracle software is installed; 53 | 54 | ### Oracle_Base: 55 | 56 | ORACLE_BASE is an environment variable used as base directory for an OFA installation. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Oracle_CheatSheet 2 | #### Oracle DBA cheatsheet for who will learn oracle 3 | 4 | This is a documentation for beginners who wants to learn Oracle DBA stuffs, I'm a SQL server DBA and I used to learn oracle with so many books, blogs, youtube videos and etc. Now I'm preparing this documentation to quickly learn Oracle DBA without difficulties. 5 | 6 | 7 | # Table of contents 8 | 9 | ### Oracle Internals 10 | * [Oracle Architecture](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Oracle%20Internals/Oracle%20Architecture.md) 11 | * [Memory Structure](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Oracle%20Internals/Memory%20Stucture.md) 12 | * [Background Processes](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Oracle%20Internals/Background%20Processes.md) 13 | * [Physical File Structure](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Oracle%20Internals/Physical%20File%20Structure.md) 14 | * [Technical Terms](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Oracle%20Internals/Technical%20Terms.md) 15 | 16 | ### Installing Oracle 17 | * [Download using wget, curl](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Installing%20Oracle/Download%20using%20wget%20and%20curl.md) 18 | * [Install Oracle in Linux](https://github.com/SqlAdmin/Oracle_CheatSheet/blob/master/Installing%20Oracle/Install%20Oracle%20in%20Linux.md) --------------------------------------------------------------------------------