* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download CREATION OF DATABASE – Practical Approach
Survey
Document related concepts
Serializability wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Microsoft Access wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Ingres (database) wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Concurrency control wikipedia , lookup
Relational model wikipedia , lookup
Database model wikipedia , lookup
Transcript
Dharampal Singh Data Processor O/o the AG(A&E)-I, MP, Gwalior CREATION OF DATABASE – Practical Approach There are two ways to create an Oracle Database - either one can use the system created Database that is created at the time of Oracle installation or can be created manually. It should always be kept in mind that some settings can not be changed after Database creation i.e. DB_BLOCK_SIZE AND CHARACTER SET. It is also mentionable here that sufficient disk space should be available for Database creation. STEPS FOR CREATION OF DATABASE : 1. CREATE A DIRECTORY AT ANY LOCATION WHERE THE DATABASE WILL RESIDE. /home/oracle/dpgwl (if you are at /home/oracle fire a command to create a directory as) – $ mkdir dpgwl $ pwd $ cd dpgwl /home/oracle/dpgwl 2. COPY THE PARAMETER FILE init.ora TO THIS NEWLY CREATED DIRECTORYcp /home/oracle/app/oracle/product/8.0.4/dbs/init.ora 3. RENAME THE PARAMETER FILE init.ora as initdpgwl.ora $ mv init.ora initdpgwl.ora 4. OPEN THE initdpgwl FILE USING ANY EDITOR – $ vi initdpgwl.ora or $ pico initdpgwl.ora 5. CHANGE THE PARAMETER VALUE OF DB_NAME= dpgwl, CONTROL FILES= /home/oracle/dpgwl/ctldpgwl.ora (It is always advised to keep more than one control file on different locations) 6. SAVE THE FILE. 7. DO NOT FORGET TO SHUTDOWN ALL THE RUNNING DATABASES. 8. AT DOLLAR PROMPT EXECUTE THE FOLLOWING COMMANDS$ ORACLE_SID=dpgwl $ export ORACLE_SID 9. $ set ORACLE_SID=dpgwl GO TO /home/oracle/app/oracle/product/8.0.4/dbs DIRECTORY AND CREATE A FILE NAMED initdpgwl and make the following entry in ifile=/home/oracle/dpgwl/initdpgwl.ora AND SAVE IT. 10. $ svrmgrl svrmgr> connect internal svrmgr> startup nomount pfile =/home/oracle/dpgwl/initdpgwl.ora MESSAGE WILL APPEAR - ORACLE INSTANCE STARTED. 11. svrmgrl> create database dpgwl MAXLOGFILES 6 MAXLOGMEMBERS 6 MAXDATAFILES 30 MAXLOGHISTORY 100 LOGFILE GROUP 1 ('/home/oracle/dpgwl/dpgwllog1a.rdo', '/home/oracle/dpgwl/dpgwllog1b.rdo') SIZE 5m, GROUP 2 (‘/home/oracle/dpgwl/dpgwllog2a.rdo', '/home/oracle/dpgwl/dpgwllog2b.rdo') SIZE 5m DATAFILE '/home/oracle/dpgwl/dpgwldata01.dbf' size 30M CHARACTER SET WE8ISO8859P1; MESSAGE WILL APPEAR “ Statement Processed” Oorh…….. Database has been created. CONFIRMATION OF DATABASE CREATION - issue the commandsvrmgr> select name from v$database 12. NEWLY CREATED IS USELESS UNLESS DATA DICTIONARY OBJECTS AND PL/SQL OBJECTS ARE CREATED. TO CREATE THESE OBJECTS EXECUTE THE CATALOG.SQL AND CATPROC.SQL . BOTH THE FILES ARE AVAILABLE IN THE FOLLOWING DIRECTORY – //home/oracle/app/oracle/product/8.0.4/rdbms/admin 13. svrmgr> @/home/oracle/app/oracle/product/8.0.4/rdbms/admin/catalog.sql svrmgr> @/home/oracle/app/oracle/product/8.0.4/rdbms/admin/catproc.sql 14. NOW THE DATABASE REQUIRES NETWORK CONNECTIVITY WHICH IS POSSIBLE TRHOUGH THE LISTENER PROCESS. THIS PROCESS RECEIVES THE REQUEST FROM VARIOUS CLIENT MACHINES AND HANDS IT OVER TO THE RESPECTIVE ORACLE PROCESS. TO ACCOMPLISH THIS JOB THERE IS A FILE CALLED ‘LISTENER.ORA’ WHICH CONTAINS THE DEFINITION OF ALL THE DATABASES. BY DEFAULT THIS FILE IS LOCATED IN – /home/oracle/app/oracle/product/8.0.4/network/admin (Edit the file by any editor) $ vi listener.ora (Add the following below SID_LIST_LISTENER) (sid_desc= (oracle_home=/home/oracle/app/oracle/product/8.0.4) (sid_name=dpgwl) ) SAVE THE FILE AND RESTART THE LISTENER PROCESS. 15. $ lsnrctl stop (To stop the currently running listener) $ lsnrct start (It will show the name of newly created Database) 16. CONFIGURE THE CLIENT MACHINE ACCORDINGLY BY USING “SQLNet Easy Config” or “ Net8Easy Config” depending on the SQL version. Select Database Instance=dpgwl, Database Alias=db_gwl and Database Host=10.80.1.1 17. Start the CLIENT machine and run SQL with Newly defined database alias name. Note: Dear DBAs this was my first submission called “Creation of Database – Practical Approach” . In the present status of VLC this script will be rarely used in any of the office because all of us are running in 2nd or 3rd year of VLC project and have already submitted one or two ‘Finance and Appropriation Accounts’ on the basis of VLC data. But might help those who never experienced the scene of Database Creation But my second submission will really help you in case of database crash. Very soon I will submit my second part of “Creation of Database – Practical Approach ” . Please keep on reading and commenting. In case of any doubt do not hesitate to write me . Contd……..