Oracle数据库管理
生活随笔
收集整理的這篇文章主要介紹了
Oracle数据库管理
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
我們一起安裝了ORACLE的客戶端和服務(wù)端,并且我們最后通過配置,可以使用客戶端來連接服務(wù)端,這是我們學(xué)習(xí)的第一步,那么這一節(jié)的學(xué)習(xí)我們帶著大家,就進(jìn)行一個(gè)ORACLE數(shù)據(jù)庫管理的學(xué)習(xí),我們這里畢竟不是做DBA開發(fā)的,涉及到很深層的東西,我們就不會(huì)給大家講過多,基本的管理還是要帶著大家來學(xué)習(xí)一下的,學(xué)習(xí)之前,如果你是安裝完以后,你一定要注意,手動(dòng)的將我們需要的兩個(gè)服務(wù),給他開啟,因?yàn)榈谝还?jié)安裝的時(shí)候我們已經(jīng)說了,ORACLE的安裝和使用是比較耗費(fèi)內(nèi)存的,所以說,我們每次使用的時(shí)候,把它開啟,只需要開啟ServiceORCL,Listener,這個(gè)當(dāng)時(shí)我們給他設(shè)置成手動(dòng)了,忘了改他了,以及讓OracleServiceORCL啟動(dòng),至于Listener和ORCL,這兩個(gè)誰先啟,誰后啟,都可以,這個(gè)是沒有關(guān)系的,啟動(dòng)好以后,我們關(guān)了他,然后我們就可以通過這樣一個(gè)工具,叫SQLPlus,在client的應(yīng)用程序開發(fā),有一個(gè)叫SQL Plus,我們以管理員身份運(yùn)行,用戶名比如說system,口令orcl,主機(jī)字符串orcl默認(rèn)的,確定
這樣就表明我們可以通過客戶端來連接服務(wù)端了,就說明我們的安裝沒有問題的,在這里再給大家說一個(gè)工具,叫PL/SQL dev,這個(gè)工具也可以從網(wǎng)絡(luò)上來下載,就是客戶端和服務(wù)端,然后還有一個(gè)開發(fā)工具叫PL/SQL Dev,把這個(gè)給大家下載下來,我們之后學(xué)習(xí)SQL和PL/SQL的時(shí)候,就使用這樣的工具,有點(diǎn)類似于什么,我們之前講JAVA的時(shí)候,我們可以用記事本,可以用EditPlus,然后真正企業(yè)開發(fā)的時(shí)候,使用Eclipse進(jìn)行JAVA程序的編寫,那么PL/SQL Dev你可以看成是一個(gè)eclipse,他比我們剛才講的SQL Plus,要好用一些,但是你用哪個(gè)都可以,而這個(gè)大家直接安裝就行了,沒啥難度,這里也是要以管理員來運(yùn)行,我們這里以scott用戶來登陸,密碼tiger,數(shù)據(jù)庫就是ORCL
這表明我已經(jīng)登陸上了,PL/SQL工具的一個(gè)登陸頁面,左上角我們可以看到是以scott用戶登陸的
在左端列出了一些項(xiàng),比如說,表,視圖,序列,同義詞,這樣的一些信息
我們點(diǎn)MyObjects,我的對象,我們看看我們這里有什么表,暫時(shí)是有幾個(gè)表
這個(gè)表除了他自己存在的,還可以添加,還可以添加表,我們之后SQL學(xué)習(xí)的時(shí)候,需要用到自己添加的幾個(gè)表,進(jìn)行增刪改查一系列的操作的學(xué)習(xí),那我們在講ORACLE數(shù)據(jù)庫管理之前,我們先帶著大家先把這個(gè)表,添加進(jìn)來,表怎么添加,大家點(diǎn)一下左上角有一個(gè)文本文件,New打開,點(diǎn)一下Command Window
出來一個(gè)框
我們出來一個(gè)操作框,我們在這里面,我們把已有的表導(dǎo)入進(jìn)來,或者一個(gè)簡單的操作,select sysdate from dual;
顯示了我們當(dāng)前的時(shí)間,那么我們?nèi)绾螌?dǎo)這個(gè)表,我們先打開我們已有的表的信息,我需要將這幾個(gè)表的信息導(dǎo)入進(jìn)來,每個(gè)文件里面有多個(gè)表,大家需要按照我的要求來進(jìn)行,@然后就是這個(gè)文件的地址,這三個(gè)表的順序也是有要求的,大家需要添加del這個(gè)文件,分號(hào)結(jié)束,然后回車
ALTER TABLE departments
DISABLE CONSTRAINT DEPT_MGR_FK;ALTER TABLE job_history
DISABLE CONSTRAINT JHIST_EMP_FK;DROP TRIGGER secure_employees;DROP TRIGGER update_job_history;DROP PROCEDURE add_job_history;DROP PROCEDURE secure_dml;DELETE FROM employees
WHERE manager_id IN (108, 114, 120, 121, 122, 123, 145, 146, 147, 148);DELETE FROM employees
WHERE employee_id IN (114, 120, 121, 122, 123, 145, 146, 147, 148, 196, 197, 198, 199, 105, 106, 108, 175, 177, 179, 203, 204);DELETE FROM locations
WHERE location_id NOT IN (SELECT DISTINCT location_idFROM departments);DELETE FROM countries
WHERE country_id NOT IN(SELECT country_idFROM locations);DELETE FROM jobs
WHERE job_id NOT IN(SELECT job_idFROM employees);DELETE FROM departments
WHERE department_id NOT IN (SELECT DISTINCT department_idFROM employeesWHERE department_id IS NOT NULL);UPDATE departments
SET manager_id = 124
WHERE department_id = 50;UPDATE departments
SET manager_id = 149
WHERE department_id = 80;DELETE FROM locations
WHERE location_id IN (2700, 2400);UPDATE locations
SET street_address = '460 Bloor St. W.', postal_code = 'ON M5S 1X8'
WHERE location_id = 1800;ALTER TABLE departments
ENABLE CONSTRAINT DEPT_MGR_FK;CREATE TABLE job_grades
(grade_level VARCHAR2(3),lowest_sal NUMBER,highest_sal NUMBER);INSERT INTO job_grades
VALUES ('A', 1000, 2999);INSERT INTO job_grades
VALUES ('B', 3000, 5999);INSERT INTO job_grades
VALUES('C', 6000, 9999);INSERT INTO job_grades
VALUES('D', 10000, 14999);INSERT INTO job_grades
VALUES('E', 15000, 24999);INSERT INTO job_grades
VALUES('F', 25000, 40000);INSERT INTO departments VALUES ( 190 , 'Contracting', NULL, 1700);COMMIT;
然后添加hr_cre這個(gè)文件
SET FEEDBACK 1
SET NUMWIDTH 10
SET LINESIZE 80
SET TRIMSPOOL ON
SET TAB OFF
SET PAGESIZE 100
SET ECHO OFF REM ********************************************************************
REM Create the REGIONS table to hold region information for locations
REM HR.LOCATIONS table has a foreign key to this table.Prompt ****** Creating REGIONS table ....CREATE TABLE regions( region_id NUMBER CONSTRAINT region_id_nn NOT NULL , region_name VARCHAR2(25) );CREATE UNIQUE INDEX reg_id_pk
ON regions (region_id);ALTER TABLE regions
ADD ( CONSTRAINT reg_id_pkPRIMARY KEY (region_id)) ;REM ********************************************************************
REM Create the COUNTRIES table to hold country information for customers
REM and company locations.
REM OE.CUSTOMERS table and HR.LOCATIONS have a foreign key to this table.Prompt ****** Creating COUNTRIES table ....CREATE TABLE countries ( country_id CHAR(2) CONSTRAINT country_id_nn NOT NULL , country_name VARCHAR2(40) , region_id NUMBER , CONSTRAINT country_c_id_pk PRIMARY KEY (country_id) ) ORGANIZATION INDEX; ALTER TABLE countries
ADD ( CONSTRAINT countr_reg_fkFOREIGN KEY (region_id)REFERENCES regions(region_id) ) ;REM ********************************************************************
REM Create the LOCATIONS table to hold address information for company departments.
REM HR.DEPARTMENTS has a foreign key to this table.Prompt ****** Creating LOCATIONS table ....CREATE TABLE locations( location_id NUMBER(4), street_address VARCHAR2(40), postal_code VARCHAR2(12), city VARCHAR2(30)CONSTRAINT loc_city_nn NOT NULL, state_province VARCHAR2(25), country_id CHAR(2)) ;CREATE UNIQUE INDEX loc_id_pk
ON locations (location_id) ;ALTER TABLE locations
ADD ( CONSTRAINT loc_id_pkPRIMARY KEY (location_id), CONSTRAINT loc_c_id_fkFOREIGN KEY (country_id)REFERENCES countries(country_id) ) ;Rem Useful for any subsequent addition of rows to locations table
Rem Starts with 3300CREATE SEQUENCE locations_seqSTART WITH 3300INCREMENT BY 100MAXVALUE 9900NOCACHENOCYCLE;REM ********************************************************************
REM Create the DEPARTMENTS table to hold company department information.
REM HR.EMPLOYEES and HR.JOB_HISTORY have a foreign key to this table.Prompt ****** Creating DEPARTMENTS table ....CREATE TABLE departments( department_id NUMBER(4), department_name VARCHAR2(30)CONSTRAINT dept_name_nn NOT NULL, manager_id NUMBER(6), location_id NUMBER(4)) ;CREATE UNIQUE INDEX dept_id_pk
ON departments (department_id) ;ALTER TABLE departments
ADD ( CONSTRAINT dept_id_pkPRIMARY KEY (department_id), CONSTRAINT dept_loc_fkFOREIGN KEY (location_id)REFERENCES locations (location_id)) ;Rem Useful for any subsequent addition of rows to departments table
Rem Starts with 280 CREATE SEQUENCE departments_seqSTART WITH 280INCREMENT BY 10MAXVALUE 9990NOCACHENOCYCLE;REM ********************************************************************
REM Create the JOBS table to hold the different names of job roles within the company.
REM HR.EMPLOYEES has a foreign key to this table.Prompt ****** Creating JOBS table ....CREATE TABLE jobs( job_id VARCHAR2(10), job_title VARCHAR2(35)CONSTRAINT job_title_nn NOT NULL, min_salary NUMBER(6), max_salary NUMBER(6)) ;CREATE UNIQUE INDEX job_id_pk
ON jobs (job_id) ;ALTER TABLE jobs
ADD ( CONSTRAINT job_id_pkPRIMARY KEY(job_id)) ;REM ********************************************************************
REM Create the EMPLOYEES table to hold the employee personnel
REM information for the company.
REM HR.EMPLOYEES has a self referencing foreign key to this table.Prompt ****** Creating EMPLOYEES table ....CREATE TABLE employees( employee_id NUMBER(6), first_name VARCHAR2(20), last_name VARCHAR2(25)CONSTRAINT emp_last_name_nn NOT NULL, email VARCHAR2(25)CONSTRAINT emp_email_nn NOT NULL, phone_number VARCHAR2(20), hire_date DATECONSTRAINT emp_hire_date_nn NOT NULL, job_id VARCHAR2(10)CONSTRAINT emp_job_nn NOT NULL, salary NUMBER(8,2), commission_pct NUMBER(2,2), manager_id NUMBER(6), department_id NUMBER(4), CONSTRAINT emp_salary_minCHECK (salary > 0) , CONSTRAINT emp_email_ukUNIQUE (email)) ;CREATE UNIQUE INDEX emp_emp_id_pk
ON employees (employee_id) ;ALTER TABLE employees
ADD ( CONSTRAINT emp_emp_id_pkPRIMARY KEY (employee_id), CONSTRAINT emp_dept_fkFOREIGN KEY (department_id)REFERENCES departments, CONSTRAINT emp_job_fkFOREIGN KEY (job_id)REFERENCES jobs (job_id), CONSTRAINT emp_manager_fkFOREIGN KEY (manager_id)REFERENCES employees) ;ALTER TABLE departments
ADD ( CONSTRAINT dept_mgr_fkFOREIGN KEY (manager_id)REFERENCES employees (employee_id)) ;Rem Useful for any subsequent addition of rows to employees table
Rem Starts with 207 CREATE SEQUENCE employees_seqSTART WITH 207INCREMENT BY 1NOCACHENOCYCLE;REM ********************************************************************
REM Create the JOB_HISTORY table to hold the history of jobs that
REM employees have held in the past.
REM HR.JOBS, HR_DEPARTMENTS, and HR.EMPLOYEES have a foreign key to this table.Prompt ****** Creating JOB_HISTORY table ....CREATE TABLE job_history( employee_id NUMBER(6)CONSTRAINT jhist_employee_nn NOT NULL, start_date DATECONSTRAINT jhist_start_date_nn NOT NULL, end_date DATECONSTRAINT jhist_end_date_nn NOT NULL, job_id VARCHAR2(10)CONSTRAINT jhist_job_nn NOT NULL, department_id NUMBER(4), CONSTRAINT jhist_date_intervalCHECK (end_date > start_date)) ;CREATE UNIQUE INDEX jhist_emp_id_st_date_pk
ON job_history (employee_id, start_date) ;ALTER TABLE job_history
ADD ( CONSTRAINT jhist_emp_id_st_date_pkPRIMARY KEY (employee_id, start_date), CONSTRAINT jhist_job_fkFOREIGN KEY (job_id)REFERENCES jobs, CONSTRAINT jhist_emp_fkFOREIGN KEY (employee_id)REFERENCES employees, CONSTRAINT jhist_dept_fkFOREIGN KEY (department_id)REFERENCES departments) ;REM ********************************************************************
REM Create the EMP_DETAILS_VIEW that joins the employees, jobs,
REM departments, jobs, countries, and locations table to provide details
REM about employees.Prompt ****** Creating EMP_DETAILS_VIEW view ...CREATE OR REPLACE VIEW emp_details_view(employee_id,job_id,manager_id,department_id,location_id,country_id,first_name,last_name,salary,commission_pct,department_name,job_title,city,state_province,country_name,region_name)
AS SELECTe.employee_id, e.job_id, e.manager_id, e.department_id,d.location_id,l.country_id,e.first_name,e.last_name,e.salary,e.commission_pct,d.department_name,j.job_title,l.city,l.state_province,c.country_name,r.region_name
FROMemployees e,departments d,jobs j,locations l,countries c,regions r
WHERE e.department_id = d.department_idAND d.location_id = l.location_idAND l.country_id = c.country_idAND c.region_id = r.region_idAND j.job_id = e.job_id
WITH READ ONLY;COMMIT;
然后我們操作最后一個(gè)hr_popul文件
SET VERIFY OFF
ALTER SESSION SET NLS_LANGUAGE=American; REM ***************************insert data into the REGIONS tablePrompt ****** Populating REGIONS table ....INSERT INTO regions VALUES ( 1, 'Europe' );INSERT INTO regions VALUES ( 2, 'Americas' );INSERT INTO regions VALUES ( 3, 'Asia' );INSERT INTO regions VALUES ( 4, 'Middle East and Africa' );REM ***************************insert data into the COUNTRIES tablePrompt ****** Populating COUNTIRES table ....INSERT INTO countries VALUES ( 'IT', 'Italy', 1 );INSERT INTO countries VALUES ( 'JP', 'Japan', 3 );INSERT INTO countries VALUES ( 'US', 'United States of America', 2 );INSERT INTO countries VALUES ( 'CA', 'Canada', 2 );INSERT INTO countries VALUES ( 'CN', 'China', 3 );INSERT INTO countries VALUES ( 'IN', 'India', 3 );INSERT INTO countries VALUES ( 'AU', 'Australia', 3 );INSERT INTO countries VALUES ( 'ZW', 'Zimbabwe', 4 );INSERT INTO countries VALUES ( 'SG', 'Singapore', 3 );INSERT INTO countries VALUES ( 'UK', 'United Kingdom', 1 );INSERT INTO countries VALUES ( 'FR', 'France', 1 );INSERT INTO countries VALUES ( 'DE', 'Germany', 1 );INSERT INTO countries VALUES ( 'ZM', 'Zambia', 4 );INSERT INTO countries VALUES ( 'EG', 'Egypt', 4 );INSERT INTO countries VALUES ( 'BR', 'Brazil', 2 );INSERT INTO countries VALUES ( 'CH', 'Switzerland', 1 );INSERT INTO countries VALUES ( 'NL', 'Netherlands', 1 );INSERT INTO countries VALUES ( 'MX', 'Mexico', 2 );INSERT INTO countries VALUES ( 'KW', 'Kuwait', 4 );INSERT INTO countries VALUES ( 'IL', 'Israel', 4 );INSERT INTO countries VALUES ( 'DK', 'Denmark', 1 );INSERT INTO countries VALUES ( 'HK', 'HongKong', 3 );INSERT INTO countries VALUES ( 'NG', 'Nigeria', 4 );INSERT INTO countries VALUES ( 'AR', 'Argentina', 2 );INSERT INTO countries VALUES ( 'BE', 'Belgium', 1 );REM ***************************insert data into the LOCATIONS tablePrompt ****** Populating LOCATIONS table ....INSERT INTO locations VALUES ( 1000 , '1297 Via Cola di Rie', '00989', 'Roma', NULL, 'IT');INSERT INTO locations VALUES ( 1100 , '93091 Calle della Testa', '10934', 'Venice', NULL, 'IT');INSERT INTO locations VALUES ( 1200 , '2017 Shinjuku-ku', '1689', 'Tokyo', 'Tokyo Prefecture', 'JP');INSERT INTO locations VALUES ( 1300 , '9450 Kamiya-cho', '6823', 'Hiroshima', NULL, 'JP');INSERT INTO locations VALUES ( 1400 , '2014 Jabberwocky Rd', '26192', 'Southlake', 'Texas', 'US');INSERT INTO locations VALUES ( 1500 , '2011 Interiors Blvd', '99236', 'South San Francisco', 'California', 'US');INSERT INTO locations VALUES ( 1600 , '2007 Zagora St', '50090', 'South Brunswick', 'New Jersey', 'US');INSERT INTO locations VALUES ( 1700 , '2004 Charade Rd', '98199', 'Seattle', 'Washington', 'US');INSERT INTO locations VALUES ( 1800 , '147 Spadina Ave', 'M5V 2L7', 'Toronto', 'Ontario', 'CA');INSERT INTO locations VALUES ( 1900 , '6092 Boxwood St', 'YSW 9T2', 'Whitehorse', 'Yukon', 'CA');INSERT INTO locations VALUES ( 2000 , '40-5-12 Laogianggen', '190518', 'Beijing', NULL, 'CN');INSERT INTO locations VALUES ( 2100 , '1298 Vileparle (E)', '490231', 'Bombay', 'Maharashtra', 'IN');INSERT INTO locations VALUES ( 2200 , '12-98 Victoria Street', '2901', 'Sydney', 'New South Wales', 'AU');INSERT INTO locations VALUES ( 2300 , '198 Clementi North', '540198', 'Singapore', NULL, 'SG');INSERT INTO locations VALUES ( 2400 , '8204 Arthur St', NULL, 'London', NULL, 'UK');INSERT INTO locations VALUES ( 2500 , 'Magdalen Centre, The Oxford Science Park', 'OX9 9ZB', 'Oxford', 'Oxford', 'UK');INSERT INTO locations VALUES ( 2600 , '9702 Chester Road', '09629850293', 'Stretford', 'Manchester', 'UK');INSERT INTO locations VALUES ( 2700 , 'Schwanthalerstr. 7031', '80925', 'Munich', 'Bavaria', 'DE');INSERT INTO locations VALUES ( 2800 , 'Rua Frei Caneca 1360 ', '01307-002', 'Sao Paulo', 'Sao Paulo', 'BR');INSERT INTO locations VALUES ( 2900 , '20 Rue des Corps-Saints', '1730', 'Geneva', 'Geneve', 'CH');INSERT INTO locations VALUES ( 3000 , 'Murtenstrasse 921', '3095', 'Bern', 'BE', 'CH');INSERT INTO locations VALUES ( 3100 , 'Pieter Breughelstraat 837', '3029SK', 'Utrecht', 'Utrecht', 'NL');INSERT INTO locations VALUES ( 3200 , 'Mariano Escobedo 9991', '11932', 'Mexico City', 'Distrito Federal,', 'MX');REM ****************************insert data into the DEPARTMENTS tablePrompt ****** Populating DEPARTMENTS table ....REM disable integrity constraint to EMPLOYEES to load dataALTER TABLE departments DISABLE CONSTRAINT dept_mgr_fk;INSERT INTO departments VALUES ( 10, 'Administration', 200, 1700);INSERT INTO departments VALUES ( 20, 'Marketing', 201, 1800);INSERT INTO departments VALUES ( 30, 'Purchasing', 114, 1700);INSERT INTO departments VALUES ( 40, 'Human Resources', 203, 2400);INSERT INTO departments VALUES ( 50, 'Shipping', 121, 1500);INSERT INTO departments VALUES ( 60 , 'IT', 103, 1400);INSERT INTO departments VALUES ( 70 , 'Public Relations', 204, 2700);INSERT INTO departments VALUES ( 80 , 'Sales', 145, 2500);INSERT INTO departments VALUES ( 90 , 'Executive', 100, 1700);INSERT INTO departments VALUES ( 100 , 'Finance', 108, 1700);INSERT INTO departments VALUES ( 110 , 'Accounting', 205, 1700);INSERT INTO departments VALUES ( 120 , 'Treasury', NULL, 1700);INSERT INTO departments VALUES ( 130 , 'Corporate Tax', NULL, 1700);INSERT INTO departments VALUES ( 140 , 'Control And Credit', NULL, 1700);INSERT INTO departments VALUES ( 150 , 'Shareholder Services', NULL, 1700);INSERT INTO departments VALUES ( 160 , 'Benefits', NULL, 1700);INSERT INTO departments VALUES ( 170 , 'Manufacturing', NULL, 1700);INSERT INTO departments VALUES ( 180 , 'Construction', NULL, 1700);INSERT INTO departments VALUES ( 190 , 'Contracting', NULL, 1700);INSERT INTO departments VALUES ( 200 , 'Operations', NULL, 1700);INSERT INTO departments VALUES ( 210 , 'IT Support', NULL, 1700);INSERT INTO departments VALUES ( 220 , 'NOC', NULL, 1700);INSERT INTO departments VALUES ( 230 , 'IT Helpdesk', NULL, 1700);INSERT INTO departments VALUES ( 240 , 'Government Sales', NULL, 1700);INSERT INTO departments VALUES ( 250 , 'Retail Sales', NULL, 1700);INSERT INTO departments VALUES ( 260 , 'Recruiting', NULL, 1700);INSERT INTO departments VALUES ( 270 , 'Payroll', NULL, 1700);REM ***************************insert data into the JOBS tablePrompt ****** Populating JOBS table ....INSERT INTO jobs VALUES ( 'AD_PRES', 'President', 20000, 40000);
INSERT INTO jobs VALUES ( 'AD_VP', 'Administration Vice President', 15000, 30000);INSERT INTO jobs VALUES ( 'AD_ASST', 'Administration Assistant', 3000, 6000);INSERT INTO jobs VALUES ( 'FI_MGR', 'Finance Manager', 8200, 16000);INSERT INTO jobs VALUES ( 'FI_ACCOUNT', 'Accountant', 4200, 9000);INSERT INTO jobs VALUES ( 'AC_MGR', 'Accounting Manager', 8200, 16000);INSERT INTO jobs VALUES ( 'AC_ACCOUNT', 'Public Accountant', 4200, 9000);
INSERT INTO jobs VALUES ( 'SA_MAN', 'Sales Manager', 10000, 20000);INSERT INTO jobs VALUES ( 'SA_REP', 'Sales Representative', 6000, 12000);INSERT INTO jobs VALUES ( 'PU_MAN', 'Purchasing Manager', 8000, 15000);INSERT INTO jobs VALUES ( 'PU_CLERK', 'Purchasing Clerk', 2500, 5500);INSERT INTO jobs VALUES ( 'ST_MAN', 'Stock Manager', 5500, 8500);
INSERT INTO jobs VALUES ( 'ST_CLERK', 'Stock Clerk', 2000, 5000);INSERT INTO jobs VALUES ( 'SH_CLERK', 'Shipping Clerk', 2500, 5500);INSERT INTO jobs VALUES ( 'IT_PROG', 'Programmer', 4000, 10000);INSERT INTO jobs VALUES ( 'MK_MAN', 'Marketing Manager', 9000, 15000);INSERT INTO jobs VALUES ( 'MK_REP', 'Marketing Representative', 4000, 9000);INSERT INTO jobs VALUES ( 'HR_REP', 'Human Resources Representative', 4000, 9000);INSERT INTO jobs VALUES ( 'PR_REP', 'Public Relations Representative', 4500, 10500);REM ***************************insert data into the EMPLOYEES tablePrompt ****** Populating EMPLOYEES table ....INSERT INTO employees VALUES ( 100, 'Steven', 'King', 'SKING', '515.123.4567', TO_DATE('17-JUN-1987', 'dd-MON-yyyy'), 'AD_PRES', 24000, NULL, NULL, 90);INSERT INTO employees VALUES ( 101, 'Neena', 'Kochhar', 'NKOCHHAR', '515.123.4568', TO_DATE('21-SEP-1989', 'dd-MON-yyyy'), 'AD_VP', 17000, NULL, 100, 90);INSERT INTO employees VALUES ( 102, 'Lex', 'De Haan', 'LDEHAAN', '515.123.4569', TO_DATE('13-JAN-1993', 'dd-MON-yyyy'), 'AD_VP', 17000, NULL, 100, 90);INSERT INTO employees VALUES ( 103, 'Alexander', 'Hunold', 'AHUNOLD', '590.423.4567', TO_DATE('03-JAN-1990', 'dd-MON-yyyy'), 'IT_PROG', 9000, NULL, 102, 60);INSERT INTO employees VALUES ( 104, 'Bruce', 'Ernst', 'BERNST', '590.423.4568', TO_DATE('21-MAY-1991', 'dd-MON-yyyy'), 'IT_PROG', 6000, NULL, 103, 60);INSERT INTO employees VALUES ( 105, 'David', 'Austin', 'DAUSTIN', '590.423.4569', TO_DATE('25-JUN-1997', 'dd-MON-yyyy'), 'IT_PROG', 4800, NULL, 103, 60);INSERT INTO employees VALUES ( 106, 'Valli', 'Pataballa', 'VPATABAL', '590.423.4560', TO_DATE('05-FEB-1998', 'dd-MON-yyyy'), 'IT_PROG', 4800, NULL, 103, 60);INSERT INTO employees VALUES ( 107, 'Diana', 'Lorentz', 'DLORENTZ', '590.423.5567', TO_DATE('07-FEB-1999', 'dd-MON-yyyy'), 'IT_PROG', 4200, NULL, 103, 60);INSERT INTO employees VALUES ( 108, 'Nancy', 'Greenberg', 'NGREENBE', '515.124.4569', TO_DATE('17-AUG-1994', 'dd-MON-yyyy'), 'FI_MGR', 12000, NULL, 101, 100);INSERT INTO employees VALUES ( 109, 'Daniel', 'Faviet', 'DFAVIET', '515.124.4169', TO_DATE('16-AUG-1994', 'dd-MON-yyyy'), 'FI_ACCOUNT', 9000, NULL, 108, 100);INSERT INTO employees VALUES ( 110, 'John', 'Chen', 'JCHEN', '515.124.4269', TO_DATE('28-SEP-1997', 'dd-MON-yyyy'), 'FI_ACCOUNT', 8200, NULL, 108, 100);INSERT INTO employees VALUES ( 111, 'Ismael', 'Sciarra', 'ISCIARRA', '515.124.4369', TO_DATE('30-SEP-1997', 'dd-MON-yyyy'), 'FI_ACCOUNT', 7700, NULL, 108, 100);INSERT INTO employees VALUES ( 112, 'Jose Manuel', 'Urman', 'JMURMAN', '515.124.4469', TO_DATE('07-MAR-1998', 'dd-MON-yyyy'), 'FI_ACCOUNT', 7800, NULL, 108, 100);INSERT INTO employees VALUES ( 113, 'Luis', 'Popp', 'LPOPP', '515.124.4567', TO_DATE('07-DEC-1999', 'dd-MON-yyyy'), 'FI_ACCOUNT', 6900, NULL, 108, 100);INSERT INTO employees VALUES ( 114, 'Den', 'Raphaely', 'DRAPHEAL', '515.127.4561', TO_DATE('07-DEC-1994', 'dd-MON-yyyy'), 'PU_MAN', 11000, NULL, 100, 30);INSERT INTO employees VALUES ( 115, 'Alexander', 'Khoo', 'AKHOO', '515.127.4562', TO_DATE('18-MAY-1995', 'dd-MON-yyyy'), 'PU_CLERK', 3100, NULL, 114, 30);INSERT INTO employees VALUES ( 116, 'Shelli', 'Baida', 'SBAIDA', '515.127.4563', TO_DATE('24-DEC-1997', 'dd-MON-yyyy'), 'PU_CLERK', 2900, NULL, 114, 30);INSERT INTO employees VALUES ( 117, 'Sigal', 'Tobias', 'STOBIAS', '515.127.4564', TO_DATE('24-JUL-1997', 'dd-MON-yyyy'), 'PU_CLERK', 2800, NULL, 114, 30);INSERT INTO employees VALUES ( 118, 'Guy', 'Himuro', 'GHIMURO', '515.127.4565', TO_DATE('15-NOV-1998', 'dd-MON-yyyy'), 'PU_CLERK', 2600, NULL, 114, 30);INSERT INTO employees VALUES ( 119, 'Karen', 'Colmenares', 'KCOLMENA', '515.127.4566', TO_DATE('10-AUG-1999', 'dd-MON-yyyy'), 'PU_CLERK', 2500, NULL, 114, 30);INSERT INTO employees VALUES ( 120, 'Matthew', 'Weiss', 'MWEISS', '650.123.1234', TO_DATE('18-JUL-1996', 'dd-MON-yyyy'), 'ST_MAN', 8000, NULL, 100, 50);INSERT INTO employees VALUES ( 121, 'Adam', 'Fripp', 'AFRIPP', '650.123.2234', TO_DATE('10-APR-1997', 'dd-MON-yyyy'), 'ST_MAN', 8200, NULL, 100, 50);INSERT INTO employees VALUES ( 122, 'Payam', 'Kaufling', 'PKAUFLIN', '650.123.3234', TO_DATE('01-MAY-1995', 'dd-MON-yyyy'), 'ST_MAN', 7900, NULL, 100, 50);INSERT INTO employees VALUES ( 123, 'Shanta', 'Vollman', 'SVOLLMAN', '650.123.4234', TO_DATE('10-OCT-1997', 'dd-MON-yyyy'), 'ST_MAN', 6500, NULL, 100, 50);INSERT INTO employees VALUES ( 124, 'Kevin', 'Mourgos', 'KMOURGOS', '650.123.5234', TO_DATE('16-NOV-1999', 'dd-MON-yyyy'), 'ST_MAN', 5800, NULL, 100, 50);INSERT INTO employees VALUES ( 125, 'Julia', 'Nayer', 'JNAYER', '650.124.1214', TO_DATE('16-JUL-1997', 'dd-MON-yyyy'), 'ST_CLERK', 3200, NULL, 120, 50);INSERT INTO employees VALUES ( 126, 'Irene', 'Mikkilineni', 'IMIKKILI', '650.124.1224', TO_DATE('28-SEP-1998', 'dd-MON-yyyy'), 'ST_CLERK', 2700, NULL, 120, 50);INSERT INTO employees VALUES ( 127, 'James', 'Landry', 'JLANDRY', '650.124.1334', TO_DATE('14-JAN-1999', 'dd-MON-yyyy'), 'ST_CLERK', 2400, NULL, 120, 50);INSERT INTO employees VALUES ( 128, 'Steven', 'Markle', 'SMARKLE', '650.124.1434', TO_DATE('08-MAR-2000', 'dd-MON-yyyy'), 'ST_CLERK', 2200, NULL, 120, 50);INSERT INTO employees VALUES ( 129, 'Laura', 'Bissot', 'LBISSOT', '650.124.5234', TO_DATE('20-AUG-1997', 'dd-MON-yyyy'), 'ST_CLERK', 3300, NULL, 121, 50);INSERT INTO employees VALUES ( 130, 'Mozhe', 'Atkinson', 'MATKINSO', '650.124.6234', TO_DATE('30-OCT-1997', 'dd-MON-yyyy'), 'ST_CLERK', 2800, NULL, 121, 50);INSERT INTO employees VALUES ( 131, 'James', 'Marlow', 'JAMRLOW', '650.124.7234', TO_DATE('16-FEB-1997', 'dd-MON-yyyy'), 'ST_CLERK', 2500, NULL, 121, 50);INSERT INTO employees VALUES ( 132, 'TJ', 'Olson', 'TJOLSON', '650.124.8234', TO_DATE('10-APR-1999', 'dd-MON-yyyy'), 'ST_CLERK', 2100, NULL, 121, 50);INSERT INTO employees VALUES ( 133, 'Jason', 'Mallin', 'JMALLIN', '650.127.1934', TO_DATE('14-JUN-1996', 'dd-MON-yyyy'), 'ST_CLERK', 3300, NULL, 122, 50);INSERT INTO employees VALUES ( 134, 'Michael', 'Rogers', 'MROGERS', '650.127.1834', TO_DATE('26-AUG-1998', 'dd-MON-yyyy'), 'ST_CLERK', 2900, NULL, 122, 50);INSERT INTO employees VALUES ( 135, 'Ki', 'Gee', 'KGEE', '650.127.1734', TO_DATE('12-DEC-1999', 'dd-MON-yyyy'), 'ST_CLERK', 2400, NULL, 122, 50);INSERT INTO employees VALUES ( 136, 'Hazel', 'Philtanker', 'HPHILTAN', '650.127.1634', TO_DATE('06-FEB-2000', 'dd-MON-yyyy'), 'ST_CLERK', 2200, NULL, 122, 50);INSERT INTO employees VALUES ( 137, 'Renske', 'Ladwig', 'RLADWIG', '650.121.1234', TO_DATE('14-JUL-1995', 'dd-MON-yyyy'), 'ST_CLERK', 3600, NULL, 123, 50);INSERT INTO employees VALUES ( 138, 'Stephen', 'Stiles', 'SSTILES', '650.121.2034', TO_DATE('26-OCT-1997', 'dd-MON-yyyy'), 'ST_CLERK', 3200, NULL, 123, 50);INSERT INTO employees VALUES ( 139, 'John', 'Seo', 'JSEO', '650.121.2019', TO_DATE('12-FEB-1998', 'dd-MON-yyyy'), 'ST_CLERK', 2700, NULL, 123, 50);INSERT INTO employees VALUES ( 140, 'Joshua', 'Patel', 'JPATEL', '650.121.1834', TO_DATE('06-APR-1998', 'dd-MON-yyyy'), 'ST_CLERK', 2500, NULL, 123, 50);INSERT INTO employees VALUES ( 141, 'Trenna', 'Rajs', 'TRAJS', '650.121.8009', TO_DATE('17-OCT-1995', 'dd-MON-yyyy'), 'ST_CLERK', 3500, NULL, 124, 50);INSERT INTO employees VALUES ( 142, 'Curtis', 'Davies', 'CDAVIES', '650.121.2994', TO_DATE('29-JAN-1997', 'dd-MON-yyyy'), 'ST_CLERK', 3100, NULL, 124, 50);INSERT INTO employees VALUES ( 143, 'Randall', 'Matos', 'RMATOS', '650.121.2874', TO_DATE('15-MAR-1998', 'dd-MON-yyyy'), 'ST_CLERK', 2600, NULL, 124, 50);INSERT INTO employees VALUES ( 144, 'Peter', 'Vargas', 'PVARGAS', '650.121.2004', TO_DATE('09-JUL-1998', 'dd-MON-yyyy'), 'ST_CLERK', 2500, NULL, 124, 50);INSERT INTO employees VALUES ( 145, 'John', 'Russell', 'JRUSSEL', '011.44.1344.429268', TO_DATE('01-OCT-1996', 'dd-MON-yyyy'), 'SA_MAN', 14000, .4, 100, 80);INSERT INTO employees VALUES ( 146, 'Karen', 'Partners', 'KPARTNER', '011.44.1344.467268', TO_DATE('05-JAN-1997', 'dd-MON-yyyy'), 'SA_MAN', 13500, .3, 100, 80);INSERT INTO employees VALUES ( 147, 'Alberto', 'Errazuriz', 'AERRAZUR', '011.44.1344.429278', TO_DATE('10-MAR-1997', 'dd-MON-yyyy'), 'SA_MAN', 12000, .3, 100, 80);INSERT INTO employees VALUES ( 148, 'Gerald', 'Cambrault', 'GCAMBRAU', '011.44.1344.619268', TO_DATE('15-OCT-1999', 'dd-MON-yyyy'), 'SA_MAN', 11000, .3, 100, 80);INSERT INTO employees VALUES ( 149, 'Eleni', 'Zlotkey', 'EZLOTKEY', '011.44.1344.429018', TO_DATE('29-JAN-2000', 'dd-MON-yyyy'), 'SA_MAN', 10500, .2, 100, 80);INSERT INTO employees VALUES ( 150, 'Peter', 'Tucker', 'PTUCKER', '011.44.1344.129268', TO_DATE('30-JAN-1997', 'dd-MON-yyyy'), 'SA_REP', 10000, .3, 145, 80);INSERT INTO employees VALUES ( 151, 'David', 'Bernstein', 'DBERNSTE', '011.44.1344.345268', TO_DATE('24-MAR-1997', 'dd-MON-yyyy'), 'SA_REP', 9500, .25, 145, 80);INSERT INTO employees VALUES ( 152, 'Peter', 'Hall', 'PHALL', '011.44.1344.478968', TO_DATE('20-AUG-1997', 'dd-MON-yyyy'), 'SA_REP', 9000, .25, 145, 80);INSERT INTO employees VALUES ( 153, 'Christopher', 'Olsen', 'COLSEN', '011.44.1344.498718', TO_DATE('30-MAR-1998', 'dd-MON-yyyy'), 'SA_REP', 8000, .2, 145, 80);INSERT INTO employees VALUES ( 154, 'Nanette', 'Cambrault', 'NCAMBRAU', '011.44.1344.987668', TO_DATE('09-DEC-1998', 'dd-MON-yyyy'), 'SA_REP', 7500, .2, 145, 80);INSERT INTO employees VALUES ( 155, 'Oliver', 'Tuvault', 'OTUVAULT', '011.44.1344.486508', TO_DATE('23-NOV-1999', 'dd-MON-yyyy'), 'SA_REP', 7000, .15, 145, 80);INSERT INTO employees VALUES ( 156, 'Janette', 'King', 'JKING', '011.44.1345.429268', TO_DATE('30-JAN-1996', 'dd-MON-yyyy'), 'SA_REP', 10000, .35, 146, 80);INSERT INTO employees VALUES ( 157, 'Patrick', 'Sully', 'PSULLY', '011.44.1345.929268', TO_DATE('04-MAR-1996', 'dd-MON-yyyy'), 'SA_REP', 9500, .35, 146, 80);INSERT INTO employees VALUES ( 158, 'Allan', 'McEwen', 'AMCEWEN', '011.44.1345.829268', TO_DATE('01-AUG-1996', 'dd-MON-yyyy'), 'SA_REP', 9000, .35, 146, 80);INSERT INTO employees VALUES ( 159, 'Lindsey', 'Smith', 'LSMITH', '011.44.1345.729268', TO_DATE('10-MAR-1997', 'dd-MON-yyyy'), 'SA_REP', 8000, .3, 146, 80);INSERT INTO employees VALUES ( 160, 'Louise', 'Doran', 'LDORAN', '011.44.1345.629268', TO_DATE('15-DEC-1997', 'dd-MON-yyyy'), 'SA_REP', 7500, .3, 146, 80);INSERT INTO employees VALUES ( 161, 'Sarath', 'Sewall', 'SSEWALL', '011.44.1345.529268', TO_DATE('03-NOV-1998', 'dd-MON-yyyy'), 'SA_REP', 7000, .25, 146, 80);INSERT INTO employees VALUES ( 162, 'Clara', 'Vishney', 'CVISHNEY', '011.44.1346.129268', TO_DATE('11-NOV-1997', 'dd-MON-yyyy'), 'SA_REP', 10500, .25, 147, 80);INSERT INTO employees VALUES ( 163, 'Danielle', 'Greene', 'DGREENE', '011.44.1346.229268', TO_DATE('19-MAR-1999', 'dd-MON-yyyy'), 'SA_REP', 9500, .15, 147, 80);INSERT INTO employees VALUES ( 164, 'Mattea', 'Marvins', 'MMARVINS', '011.44.1346.329268', TO_DATE('24-JAN-2000', 'dd-MON-yyyy'), 'SA_REP', 7200, .10, 147, 80);INSERT INTO employees VALUES ( 165, 'David', 'Lee', 'DLEE', '011.44.1346.529268', TO_DATE('23-FEB-2000', 'dd-MON-yyyy'), 'SA_REP', 6800, .1, 147, 80);INSERT INTO employees VALUES ( 166, 'Sundar', 'Ande', 'SANDE', '011.44.1346.629268', TO_DATE('24-MAR-2000', 'dd-MON-yyyy'), 'SA_REP', 6400, .10, 147, 80);INSERT INTO employees VALUES ( 167, 'Amit', 'Banda', 'ABANDA', '011.44.1346.729268', TO_DATE('21-APR-2000', 'dd-MON-yyyy'), 'SA_REP', 6200, .10, 147, 80);INSERT INTO employees VALUES ( 168, 'Lisa', 'Ozer', 'LOZER', '011.44.1343.929268', TO_DATE('11-MAR-1997', 'dd-MON-yyyy'), 'SA_REP', 11500, .25, 148, 80);INSERT INTO employees VALUES ( 169 , 'Harrison', 'Bloom', 'HBLOOM', '011.44.1343.829268', TO_DATE('23-MAR-1998', 'dd-MON-yyyy'), 'SA_REP', 10000, .20, 148, 80);INSERT INTO employees VALUES ( 170, 'Tayler', 'Fox', 'TFOX', '011.44.1343.729268', TO_DATE('24-JAN-1998', 'dd-MON-yyyy'), 'SA_REP', 9600, .20, 148, 80);INSERT INTO employees VALUES ( 171, 'William', 'Smith', 'WSMITH', '011.44.1343.629268', TO_DATE('23-FEB-1999', 'dd-MON-yyyy'), 'SA_REP', 7400, .15, 148, 80);INSERT INTO employees VALUES ( 172, 'Elizabeth', 'Bates', 'EBATES', '011.44.1343.529268', TO_DATE('24-MAR-1999', 'dd-MON-yyyy'), 'SA_REP', 7300, .15, 148, 80);INSERT INTO employees VALUES ( 173, 'Sundita', 'Kumar', 'SKUMAR', '011.44.1343.329268', TO_DATE('21-APR-2000', 'dd-MON-yyyy'), 'SA_REP', 6100, .10, 148, 80);INSERT INTO employees VALUES ( 174, 'Ellen', 'Abel', 'EABEL', '011.44.1644.429267', TO_DATE('11-MAY-1996', 'dd-MON-yyyy'), 'SA_REP', 11000, .30, 149, 80);INSERT INTO employees VALUES ( 175, 'Alyssa', 'Hutton', 'AHUTTON', '011.44.1644.429266', TO_DATE('19-MAR-1997', 'dd-MON-yyyy'), 'SA_REP', 8800, .25, 149, 80);INSERT INTO employees VALUES ( 176, 'Jonathon', 'Taylor', 'JTAYLOR', '011.44.1644.429265', TO_DATE('24-MAR-1998', 'dd-MON-yyyy'), 'SA_REP', 8600, .20, 149, 80);INSERT INTO employees VALUES ( 177, 'Jack', 'Livingston', 'JLIVINGS', '011.44.1644.429264', TO_DATE('23-APR-1998', 'dd-MON-yyyy'), 'SA_REP', 8400, .20, 149, 80);INSERT INTO employees VALUES ( 178, 'Kimberely', 'Grant', 'KGRANT', '011.44.1644.429263', TO_DATE('24-MAY-1999', 'dd-MON-yyyy'), 'SA_REP', 7000, .15, 149, NULL);INSERT INTO employees VALUES ( 179, 'Charles', 'Johnson', 'CJOHNSON', '011.44.1644.429262', TO_DATE('04-JAN-2000', 'dd-MON-yyyy'), 'SA_REP', 6200, .10, 149, 80);INSERT INTO employees VALUES ( 180, 'Winston', 'Taylor', 'WTAYLOR', '650.507.9876', TO_DATE('24-JAN-1998', 'dd-MON-yyyy'), 'SH_CLERK', 3200, NULL, 120, 50);INSERT INTO employees VALUES ( 181, 'Jean', 'Fleaur', 'JFLEAUR', '650.507.9877', TO_DATE('23-FEB-1998', 'dd-MON-yyyy'), 'SH_CLERK', 3100, NULL, 120, 50);INSERT INTO employees VALUES ( 182, 'Martha', 'Sullivan', 'MSULLIVA', '650.507.9878', TO_DATE('21-JUN-1999', 'dd-MON-yyyy'), 'SH_CLERK', 2500, NULL, 120, 50);INSERT INTO employees VALUES ( 183, 'Girard', 'Geoni', 'GGEONI', '650.507.9879', TO_DATE('03-FEB-2000', 'dd-MON-yyyy'), 'SH_CLERK', 2800, NULL, 120, 50);INSERT INTO employees VALUES ( 184, 'Nandita', 'Sarchand', 'NSARCHAN', '650.509.1876', TO_DATE('27-JAN-1996', 'dd-MON-yyyy'), 'SH_CLERK', 4200, NULL, 121, 50);INSERT INTO employees VALUES ( 185, 'Alexis', 'Bull', 'ABULL', '650.509.2876', TO_DATE('20-FEB-1997', 'dd-MON-yyyy'), 'SH_CLERK', 4100, NULL, 121, 50);INSERT INTO employees VALUES ( 186, 'Julia', 'Dellinger', 'JDELLING', '650.509.3876', TO_DATE('24-JUN-1998', 'dd-MON-yyyy'), 'SH_CLERK', 3400, NULL, 121, 50);INSERT INTO employees VALUES ( 187, 'Anthony', 'Cabrio', 'ACABRIO', '650.509.4876', TO_DATE('07-FEB-1999', 'dd-MON-yyyy'), 'SH_CLERK', 3000, NULL, 121, 50);INSERT INTO employees VALUES ( 188, 'Kelly', 'Chung', 'KCHUNG', '650.505.1876', TO_DATE('14-JUN-1997', 'dd-MON-yyyy'), 'SH_CLERK', 3800, NULL, 122, 50);INSERT INTO employees VALUES ( 189, 'Jennifer', 'Dilly', 'JDILLY', '650.505.2876', TO_DATE('13-AUG-1997', 'dd-MON-yyyy'), 'SH_CLERK', 3600, NULL, 122, 50);INSERT INTO employees VALUES ( 190, 'Timothy', 'Gates', 'TGATES', '650.505.3876', TO_DATE('11-JUL-1998', 'dd-MON-yyyy'), 'SH_CLERK', 2900, NULL, 122, 50);INSERT INTO employees VALUES ( 191, 'Randall', 'Perkins', 'RPERKINS', '650.505.4876', TO_DATE('19-DEC-1999', 'dd-MON-yyyy'), 'SH_CLERK', 2500, NULL, 122, 50);INSERT INTO employees VALUES ( 192, 'Sarah', 'Bell', 'SBELL', '650.501.1876', TO_DATE('04-FEB-1996', 'dd-MON-yyyy'), 'SH_CLERK', 4000, NULL, 123, 50);INSERT INTO employees VALUES ( 193, 'Britney', 'Everett', 'BEVERETT', '650.501.2876', TO_DATE('03-MAR-1997', 'dd-MON-yyyy'), 'SH_CLERK', 3900, NULL, 123, 50);INSERT INTO employees VALUES ( 194, 'Samuel', 'McCain', 'SMCCAIN', '650.501.3876', TO_DATE('01-JUL-1998', 'dd-MON-yyyy'), 'SH_CLERK', 3200, NULL, 123, 50);INSERT INTO employees VALUES ( 195, 'Vance', 'Jones', 'VJONES', '650.501.4876', TO_DATE('17-MAR-1999', 'dd-MON-yyyy'), 'SH_CLERK', 2800, NULL, 123, 50);INSERT INTO employees VALUES ( 196, 'Alana', 'Walsh', 'AWALSH', '650.507.9811', TO_DATE('24-APR-1998', 'dd-MON-yyyy'), 'SH_CLERK', 3100, NULL, 124, 50);INSERT INTO employees VALUES ( 197, 'Kevin', 'Feeney', 'KFEENEY', '650.507.9822', TO_DATE('23-MAY-1998', 'dd-MON-yyyy'), 'SH_CLERK', 3000, NULL, 124, 50);INSERT INTO employees VALUES ( 198, 'Donald', 'OConnell', 'DOCONNEL', '650.507.9833', TO_DATE('21-JUN-1999', 'dd-MON-yyyy'), 'SH_CLERK', 2600, NULL, 124, 50);INSERT INTO employees VALUES ( 199, 'Douglas', 'Grant', 'DGRANT', '650.507.9844', TO_DATE('13-JAN-2000', 'dd-MON-yyyy'), 'SH_CLERK', 2600, NULL, 124, 50);INSERT INTO employees VALUES ( 200, 'Jennifer', 'Whalen', 'JWHALEN', '515.123.4444', TO_DATE('17-SEP-1987', 'dd-MON-yyyy'), 'AD_ASST', 4400, NULL, 101, 10);INSERT INTO employees VALUES ( 201, 'Michael', 'Hartstein', 'MHARTSTE', '515.123.5555', TO_DATE('17-FEB-1996', 'dd-MON-yyyy'), 'MK_MAN', 13000, NULL, 100, 20);INSERT INTO employees VALUES ( 202, 'Pat', 'Fay', 'PFAY', '603.123.6666', TO_DATE('17-AUG-1997', 'dd-MON-yyyy'), 'MK_REP', 6000, NULL, 201, 20);INSERT INTO employees VALUES ( 203, 'Susan', 'Mavris', 'SMAVRIS', '515.123.7777', TO_DATE('07-JUN-1994', 'dd-MON-yyyy'), 'HR_REP', 6500, NULL, 101, 40);INSERT INTO employees VALUES ( 204, 'Hermann', 'Baer', 'HBAER', '515.123.8888', TO_DATE('07-JUN-1994', 'dd-MON-yyyy'), 'PR_REP', 10000, NULL, 101, 70);INSERT INTO employees VALUES ( 205, 'Shelley', 'Higgins', 'SHIGGINS', '515.123.8080', TO_DATE('07-JUN-1994', 'dd-MON-yyyy'), 'AC_MGR', 12000, NULL, 101, 110);INSERT INTO employees VALUES ( 206, 'William', 'Gietz', 'WGIETZ', '515.123.8181', TO_DATE('07-JUN-1994', 'dd-MON-yyyy'), 'AC_ACCOUNT', 8300, NULL, 205, 110);REM ********* insert data into the JOB_HISTORY tablePrompt ****** Populating JOB_HISTORY table ....INSERT INTO job_history
VALUES (102, TO_DATE('13-JAN-1993', 'dd-MON-yyyy'), TO_DATE('24-JUL-1998', 'dd-MON-yyyy'), 'IT_PROG', 60);INSERT INTO job_history
VALUES (101, TO_DATE('21-SEP-1989', 'dd-MON-yyyy'), TO_DATE('27-OCT-1993', 'dd-MON-yyyy'), 'AC_ACCOUNT', 110);INSERT INTO job_history
VALUES (101, TO_DATE('28-OCT-1993', 'dd-MON-yyyy'), TO_DATE('15-MAR-1997', 'dd-MON-yyyy'), 'AC_MGR', 110);INSERT INTO job_history
VALUES (201, TO_DATE('17-FEB-1996', 'dd-MON-yyyy'), TO_DATE('19-DEC-1999', 'dd-MON-yyyy'), 'MK_REP', 20);INSERT INTO job_history
VALUES (114, TO_DATE('24-MAR-1998', 'dd-MON-yyyy'), TO_DATE('31-DEC-1999', 'dd-MON-yyyy'), 'ST_CLERK', 50);INSERT INTO job_history
VALUES (122, TO_DATE('01-JAN-1999', 'dd-MON-yyyy'), TO_DATE('31-DEC-1999', 'dd-MON-yyyy'), 'ST_CLERK', 50);INSERT INTO job_history
VALUES (200, TO_DATE('17-SEP-1987', 'dd-MON-yyyy'), TO_DATE('17-JUN-1993', 'dd-MON-yyyy'), 'AD_ASST', 90);INSERT INTO job_history
VALUES (176, TO_DATE('24-MAR-1998', 'dd-MON-yyyy'), TO_DATE('31-DEC-1998', 'dd-MON-yyyy'), 'SA_REP', 80);INSERT INTO job_history
VALUES (176, TO_DATE('01-JAN-1999', 'dd-MON-yyyy'), TO_DATE('31-DEC-1999', 'dd-MON-yyyy'), 'SA_MAN', 80);INSERT INTO job_history
VALUES (200, TO_DATE('01-JUL-1994', 'dd-MON-yyyy'), TO_DATE('31-DEC-1998', 'dd-MON-yyyy'), 'AC_ACCOUNT', 90);REM enable integrity constraint to DEPARTMENTSALTER TABLE departments ENABLE CONSTRAINT dept_mgr_fk;COMMIT;
這三個(gè)文件我們就執(zhí)行完了,這個(gè)導(dǎo)完以后,大家執(zhí)行這樣一個(gè)操作,我們講到第一節(jié)SQL語句的時(shí)候,我們有一個(gè)employees這張表,翻譯過來是員工的表,分號(hào)結(jié)束
一共是有107條記錄
如果你操作也是跟我一樣,顯示107條記錄的話,也表示你的也是沒有問題的,那我們之后學(xué)習(xí)SQL語句的話,就是在這里進(jìn)行學(xué)習(xí),如果你操作發(fā)現(xiàn)結(jié)果不是107條,看你是否按照我這個(gè)順序去先添加del_data.sql,再添加hr_cre.sql,再添加hr_popul.sql,按照這個(gè)順序來,這個(gè)數(shù)據(jù)最后不是107條,這個(gè)操作大家先完成一下,這個(gè)操作完成以后,我們接著做一個(gè)真正的ORACLE數(shù)據(jù)庫的一個(gè)管理,管理涉及到哪些內(nèi)容,我們先把他最小化,大家打開程序,client,第一項(xiàng)叫企業(yè)管理器,我們以管理員身份運(yùn)行,那企業(yè)管理器什么意思,就是一個(gè)平臺(tái),ORACLE給我們的一個(gè)平臺(tái),在這個(gè)平臺(tái)上,我們可以對所有的用戶,還可以添加數(shù)據(jù)庫的一個(gè)用戶,如果你是首次來打開企業(yè)管理器的話,會(huì)出現(xiàn)這樣一個(gè)窗口,讓你添加數(shù)據(jù)庫的一些信息,這里我們就不手動(dòng)添加數(shù)據(jù)庫了,不手動(dòng)添加,我們存在的這個(gè)orcl即可
大家看我的任務(wù)欄,這個(gè)明顯的是一個(gè)JAVA的標(biāo)識(shí),所以我們知道
ORACLE主要編程的語言,就是JAVA,它是通過JAVA來編寫的,然后我們打開數(shù)據(jù)庫,ORACL數(shù)據(jù)庫,然后點(diǎn)開,他需要我登陸,這里登陸的話,system來登陸,然后直接點(diǎn)確認(rèn)就可以,以DBA的身份進(jìn)行登陸,DBA的權(quán)限是比較大的,我們點(diǎn)確定,兩種方式都行
登陸好以后,他就會(huì)有這些選項(xiàng),例程,方案,安全性,存儲(chǔ),數(shù)據(jù)倉庫,工作區(qū),XML數(shù)據(jù)庫,這里我們主要帶著大家來了解這樣一個(gè)內(nèi)容,叫安全性,大家點(diǎn)開這個(gè)加號(hào)
提供了三項(xiàng),用戶,角色,概要文件,那我們先看一個(gè)用戶,這就意味著我們ORACLE數(shù)據(jù)庫,安裝完以后,默認(rèn)給我們提供的這樣一些用戶,比如我們剛才可以以system這個(gè)來登陸的用戶,也可以用SYS,默認(rèn)他們兩個(gè)是鎖定的,默認(rèn)顯示的是OPEN
那么SCOTT用戶我們在安裝的時(shí)候,給大家說了,我們給他解鎖,如果有人說我在口令的時(shí)候,沒有將SCOTT用戶給他開啟,那么你可以在這兒雙擊SCOTT用戶
你以system這個(gè)用戶進(jìn)來,然后你這里肯定是顯示鎖定的,如果你當(dāng)時(shí)在安裝的時(shí)候,沒有進(jìn)行口令管理的設(shè)置,那你是鎖定的,那你只要改成未鎖定,確認(rèn)就OK了,他就能顯示是OPEN狀態(tài),你就可以使用SCOTT用戶使用PL/SQL Dev來登陸ORACLE,然后我們可以把剛才那幾張表添加到SCOTT用戶下的,最好是不要添加到system用戶下,我們通過這個(gè)用戶來進(jìn)行SQL的一個(gè)學(xué)習(xí),這里看到的是已經(jīng)有的一些用戶,那么我們就想啊,我能夠再給數(shù)據(jù)庫添加一個(gè)用戶,能否給數(shù)據(jù)庫添加一些用戶,沒有問題,怎么添加,大家看,這是用戶,選中它,點(diǎn)擊右鍵,沒有添加,再點(diǎn)擊就有了,創(chuàng)建不是什么神奇的東西,這是ORACLE寫的時(shí)候一個(gè)bug,點(diǎn)創(chuàng)建
如果密碼忘了,可以讓系統(tǒng)用戶或者DBA,進(jìn)來給你重新再設(shè)置一個(gè),既然我這里創(chuàng)建了,我們就可以用剛才創(chuàng)建的用戶來登陸,比如我這里關(guān)閉了,以管理員身份運(yùn)行,我們以athome用戶,密碼athome,我們也是在ORCL數(shù)據(jù)庫下創(chuàng)建的,大家看到,我現(xiàn)在確實(shí)通過athome用戶連接到了ORCL,我們相應(yīng)的也可以打開Command Window,這樣一個(gè)操作界面,那剛才我們在scott用戶下,輸入過這樣一個(gè)命令select * from employees然后出來107條記錄,你現(xiàn)在看說表或視圖不存在
看一下我相應(yīng)創(chuàng)建的對象,Tables這里一個(gè)也沒有啊,這里是我們創(chuàng)建的一個(gè)表,一個(gè)也沒有,說明什么問題,說明我們剛才創(chuàng)建的三個(gè)文件里面,相應(yīng)的這些表,就是創(chuàng)建在scott用戶下的,屬于SCOTT用戶特有的幾個(gè)表
而現(xiàn)在我們通過athome用戶加進(jìn)來,根本沒有權(quán)限來訪問這張表,如果想通過athome這個(gè)用戶,訪問SCOTT用戶表信息的話,那我們回到剛才的你點(diǎn)開athome用戶,帶著大家說說什么叫角色,什么叫系統(tǒng),什么叫對象,給大家講一下這個(gè)概念,基本的使用,我們先來看對象,什么叫對象,對象你可以理解成JAVA當(dāng)中的類new出來的一個(gè)東西,就是屬于類的一個(gè)實(shí)體,一個(gè)實(shí)例,那么這里的對象,我們ORACLE中的各個(gè)用戶,那么各個(gè)用戶里邊,我先是在athome用戶下來操作的,他這個(gè)用戶有一個(gè)對象,里邊我們找到SCOTT用戶,再雙擊,SCOTT用戶下,有這樣一些信息,其中有一個(gè)就叫做表,把它打開
大家注意到這些表,很多,剛才我們看的只有幾個(gè),剩下多出來的那些就是我們剛才添加的剛才文件里面的表,其中有一個(gè)就是Employees表,就叫員工表,這個(gè)員工表,我是不是想在這里邊進(jìn)行一個(gè)select操作,查詢,叫查詢操作,我需要在企業(yè)管理器,Employees這個(gè)表下,將select功能給他添加進(jìn)來
相當(dāng)于我先做一應(yīng)用就可以怎么著,訪問通過athome用戶,訪問SCOTT用戶employees這個(gè)表的,select操作,我現(xiàn)在試一下select * from scott.employees;我們應(yīng)該這樣寫,scott用戶的.employees表,回車,大家看到,是不是我們這個(gè)時(shí)候,才能訪問scott用戶這個(gè)表,這里我們僅僅選了一個(gè)select查詢,如果你想對employees進(jìn)行修改的話,比如說增刪改,那這個(gè)操作你還得需要再將scott用戶表里邊的其他的功能給他添加進(jìn)來,比如能夠插入一條數(shù)據(jù),那你就得把insert給加進(jìn)來,如果你不想要了,就把它給退回去,employees表,那同樣的我們再舉一個(gè)例子,比如我們這里面還有一個(gè)表,departments,部門表,部門表里也有這樣的操作,那我們再來,比如我們select * from scott.departments;同樣提示我們說,表或視圖不存在,實(shí)際上不是不存在,是你根本沒有這個(gè)權(quán)限去訪問scott用戶的這個(gè)表,現(xiàn)在回來,我們剛才也講了,將他的select操作給添加進(jìn)來
然后應(yīng)用,再回來,這個(gè)時(shí)候回車,我就可以通過athome用戶,訪問scott用戶的departments這張表,對他進(jìn)行一個(gè)查詢的操作,這是我要給大家說清楚的對象,什么叫對象,這個(gè)說清楚以后,我們往前看,前面是不是有一個(gè)叫做系統(tǒng),有一個(gè)系統(tǒng),系統(tǒng)指的是什么,剛才我們看到可以做一個(gè)查詢的操作,查詢其他數(shù)據(jù)庫用戶的某些表啊,視圖的一個(gè)信息,那么我來想,我能不能自己創(chuàng)建一張表,我再說一下,我能不能自己創(chuàng)建一張表,相當(dāng)于athome這個(gè)用戶,要申請,申請什么,申請創(chuàng)建表的權(quán)限,咱們回來,假設(shè)現(xiàn)在還沒有進(jìn)行一個(gè)權(quán)限的賦予,我們看可不可以,大家這個(gè)時(shí)候點(diǎn)一下ed,然后點(diǎn)一下ctrl鍵,我們在這里進(jìn)行編輯
編輯什么,我現(xiàn)在想要?jiǎng)?chuàng)建一張表,那這個(gè)命名我們在講SQL語句的時(shí)候,這個(gè)命令先了解一下就可以了,叫create,創(chuàng)建一個(gè)table,table的名字,myemp,我們用一個(gè)小括號(hào)括起來,這個(gè)表名有了,id是個(gè)列名,number類型的,10個(gè)長度然后員工有名字,名字是varchar類型的,對應(yīng)我們JAVA里面的String類型的,或者叫StringBuffer型,準(zhǔn)確的應(yīng)該叫StringBuffer,可變的字符序列,20個(gè)字符,那么number相當(dāng)于我們Java里面的int,我創(chuàng)建這樣兩個(gè)列create table myemp(id number(10),name varchar2(20)
)
點(diǎn)一下斜線,一回車
大家看到,這里提示我們權(quán)限不足,意味著我們當(dāng)前athome用戶,沒有創(chuàng)建表的權(quán)限,那怎么添加這個(gè)權(quán)限,我們打開管理器,我們系統(tǒng)選項(xiàng),大家拉一下游標(biāo),我們是不是要?jiǎng)?chuàng)建表,叫CREATE ANY TABLE,創(chuàng)建表,拉下來
那此時(shí)我一應(yīng)用這個(gè)用戶,就有創(chuàng)建表的功能,大家看到后面有一個(gè)管理選項(xiàng),可以點(diǎn)叉可以點(diǎn)勾,這個(gè)什么意思,大家做一個(gè)了解,點(diǎn)叉他只能當(dāng)前這個(gè)用戶用,而你打個(gè)勾呢,是athome這個(gè)用戶create table這個(gè)權(quán)限,他可以賦給別人,就有點(diǎn)JAVA里面的繼承的意思,你要是點(diǎn)那個(gè)叉,他這個(gè)就不能夠被繼承了,相當(dāng)于final的一個(gè)功能,不能被繼承了,然后你要是打上勾就可以被繼承,他可以賦給別人這樣一個(gè)權(quán)限,這里我們默認(rèn)打個(gè)叉就可以,我們試圖在這兒,創(chuàng)建一張表
剛才提示的叫權(quán)限不足,現(xiàn)在我賦給這個(gè)用戶權(quán)限他卻提示說,又一個(gè)問題,說表空間users無權(quán)限,這是什么意思,大家你看,我在一般信息這,當(dāng)時(shí)我們這里都是默認(rèn)的,有一個(gè)選項(xiàng)叫users,那么他說的就是這個(gè)問題,表空間users,沒有權(quán)限,這是什么意思,我們大家看一下限額這一項(xiàng)
點(diǎn)開,限額這一項(xiàng)里邊,就列了我們的表空間,其中有一個(gè),叫USERS,限額的大小無,這是什么意思,我說一下,我們現(xiàn)在athome創(chuàng)建表,你要?jiǎng)?chuàng)建表的話,相當(dāng)于你要有磁盤空間,然后你把創(chuàng)建這個(gè)表,以及后邊你要給這個(gè)表賦予一個(gè)一個(gè)的信息,你得放在這個(gè)表里邊,你得有空間存儲(chǔ)他,就相當(dāng)于你有個(gè)電影,你電腦已經(jīng)沒有空間了,想存也存不了,所以這個(gè)時(shí)候,需要給athome這個(gè)用戶,相應(yīng)的賦一些表空間,你得讓他實(shí)體的開辟一些空間去存一些表,那么就是這個(gè)意思,默認(rèn)用的就是叫USERS,這個(gè)表空間,我們需要把無改成一個(gè)值,比如說多少兆,這里我們分配10兆讓他存儲(chǔ)表,等等一些信息
這里你賦予他以后啊,你再回來,相當(dāng)于我就有這個(gè)空間了,然后我們接著來這兒,我們再進(jìn)行剛才創(chuàng)建表的一個(gè)操作,這個(gè)時(shí)候我們才真正完成一個(gè)表的創(chuàng)建
叫table created,然后我們在MyObjects的Tables,這里是不是就有我們創(chuàng)建的一個(gè)表
只是我們現(xiàn)在這個(gè)表還沒有一條記錄呢,我可以這樣看一下select * from employees;
一條記錄也沒有,這個(gè)表也是我們要?jiǎng)?chuàng)建好的,就是這樣一個(gè)概念,我們還回到管理器這,剛才我們看到限額是什么意思了,還有這個(gè)對象,還有這個(gè)系統(tǒng),相應(yīng)的我們這里只是創(chuàng)建表的權(quán)限,然后我們講到創(chuàng)建視圖,創(chuàng)建索引,創(chuàng)建同義詞,包括創(chuàng)建存儲(chǔ)過程,你要想athome這個(gè)用戶,具有這樣的權(quán)限的話,那你就的在這里開辟這么一個(gè)權(quán)限,開啟這個(gè)權(quán)限,這是我們要講的系統(tǒng),接著我們這里還有一個(gè)角色,還有一個(gè)叫角色,角色我們來理解,比如你去公司的時(shí)候,你的角色就是一個(gè)軟件開發(fā)工程師,就是一個(gè)程序員,有的人工作幾年之后,我的角色就變了,變成一個(gè)項(xiàng)目經(jīng)理,或者CEO,那么剛才我說的軟件開發(fā)工程師,程序員,或者叫項(xiàng)目經(jīng)理,這都叫角色,角色干什么,你想想,一個(gè)人具有了某種角色,它具有了角色相應(yīng)的功能,比如這個(gè)職位會(huì)有很多的權(quán)限,包括很多的工作內(nèi)容,當(dāng)你作為一個(gè)小白進(jìn)來以后,就讓你當(dāng)CEO,你工作的職權(quán)范圍,你是不是都可以來操作了,那放在我們這兒怎么來解釋,我們前邊所講的對象,系統(tǒng)真正的一些權(quán)限,那角色就是對系統(tǒng)對象,相應(yīng)的權(quán)限的個(gè)封裝,給他封裝成一個(gè)叫角色的,比如這里有個(gè)叫DBA
DBA的話,我們可以在這里看,DBA都有哪些權(quán)限,點(diǎn)角色這,里面有個(gè)DBA,然后打開,DBA就相應(yīng)的封裝了一些權(quán)限,比如說系統(tǒng)這一塊,我們這些權(quán)限,下邊這么多
這么多權(quán)限D(zhuǎn)BA都有,同時(shí)對象的這些權(quán)限他都有啊,統(tǒng)一的集合到他這兒,現(xiàn)在叫DBA這樣的一個(gè)角色,如果我們把DBA這個(gè)角色賦給了我們剛剛創(chuàng)建的athome這個(gè)用戶,賦給了他
他現(xiàn)在就是一個(gè)DBA,沒錯(cuò),他現(xiàn)在就是DBA了,大家看到我們創(chuàng)建athome用戶的時(shí)候,默認(rèn)有一個(gè)connect這個(gè)一個(gè)角色,這個(gè)角色是干什么用的,這里有一個(gè)create session
這個(gè)什么意思,你創(chuàng)建這個(gè)用戶,他要想登陸我們這個(gè)數(shù)據(jù)庫,要能登陸到ORCL這個(gè)數(shù)據(jù)庫,他必須要有一個(gè)角色叫CONNECT,或者說必須要要有一個(gè)系統(tǒng)權(quán)限叫做CREATE SESSION,那我們剛才說到athome用戶這,他這里默認(rèn)有這個(gè)角色,我再加個(gè)角色,如果我把剛才CREATE TABLE這個(gè)權(quán)限給移除了,再應(yīng)用,我們再回到這個(gè)框里面,我們athome用戶再創(chuàng)建一個(gè)表的時(shí)候,大家應(yīng)該知道這個(gè)結(jié)局吧,是不是沒有這個(gè)權(quán)限了,現(xiàn)在給他賦予一個(gè)角色,我讓這個(gè)角色具有創(chuàng)建表的權(quán)限,那怎么創(chuàng)建角色,跟我們這里一樣,在角色這里點(diǎn)右鍵,創(chuàng)建,創(chuàng)建一個(gè)角色,比如說起個(gè)名字,我們就叫ACTOR
ACTOR這個(gè)角色具有系統(tǒng)的權(quán)限,叫CREATE ANY TABLE
然后你也可以再加其他的,創(chuàng)建view視圖,你也可以加,然后對象這,你也可以讓他訪問,比如SCOTT用戶的,可以訪問SCOTT用戶表的select
創(chuàng)建,我這個(gè)角色創(chuàng)建好了,再回到用戶這,athome這個(gè)用戶,剛才我們把他這個(gè)權(quán)限刪掉了,我把查詢employees表這個(gè)權(quán)限也給移除了,我已經(jīng)移除了,那你回過來再看,如果我再進(jìn)行剛才的操作select * from employees;
因?yàn)橐呀?jīng)沒有這個(gè)權(quán)限了,那我們現(xiàn)在做這樣一個(gè)事,我把剛才創(chuàng)建的ACTOR這么一個(gè)角色,賦給athome
ACTOR這個(gè)角色里,它集成了權(quán)限,這個(gè)操作需要我們重新連接,所以我重新登陸,然后我再進(jìn)行select操作,select * from employees;大家注意到我現(xiàn)在是可以查詢了,同時(shí)我再創(chuàng)建一個(gè)表,create tabel myemp2(id number(10))
大家注意到,這個(gè)時(shí)候我又開始創(chuàng)建表了,那么這個(gè)權(quán)限你是從哪里來的,就是從角色來的,就是從那個(gè)角色來的,你把這個(gè)角色賦給athome用戶,有角色有什么好處,大家肯定一目了然,比如說你工作的時(shí)候,突然來了一個(gè)人,那么這個(gè)人可能要賦給的權(quán)限,系統(tǒng)有10個(gè),你得有一個(gè)一個(gè)的加進(jìn)來,然后又來了一個(gè)人,一樣,又要加一遍,很麻煩,我是不是就給你定義一個(gè)角色,你是CEO,那我就認(rèn)為CEO就應(yīng)該有這樣的一些權(quán)限,那么你一來,我就把這個(gè)角色給你,是不是就省了一個(gè)一個(gè)給你添加了,很方便,同樣的你是一個(gè)軟件工程師,你是一個(gè)DBA,你有哪些權(quán)限,我給你做成角色,讓他把角色給你,這里告訴大家怎么創(chuàng)建一個(gè)角色,當(dāng)然你創(chuàng)建好以后,我也可以點(diǎn)右鍵移去,我移去這個(gè)角色了,相應(yīng)的我athome用戶,是不是就沒有這個(gè)角色了
默認(rèn)的就沒有,那我們再往前推,一般信息,這里還剩一個(gè)表空間,我們把這個(gè)表空間說一下,這個(gè)表空間我們默認(rèn)是USERS,默認(rèn)的這個(gè)叫USERS,然后有個(gè)臨時(shí)的叫TEMP,這個(gè)我們就這樣寫就可以,你最好不要把USERS改成SYSTEM,改成SYSTEM設(shè)置限額
這個(gè)SYSTEM,像我們的ORACLE數(shù)據(jù)庫,包括一些觸發(fā)器,存儲(chǔ)過程,他都是存在SYSTEM之下的,把你自己用戶創(chuàng)建的一些表,放在這個(gè)里邊,如果你這個(gè)量夠大的話,會(huì)影響ORACLE的一個(gè)執(zhí)行的速度,所以你最好不要放在這個(gè)之下,或者再舉個(gè)例子,就是我們大家有這樣一個(gè)感覺,是不是你安裝WINDOWS系統(tǒng)的時(shí)候,你不要你硬盤后來裝的東西,不要放在C盤里,你把C盤放的東西特別多,你開機(jī)的速度就變慢了,同樣的道理,C盤就相當(dāng)于我們這里的SYSTEM一樣,你放在這個(gè)USERS里面,那我們再來說上面,概要文件,默認(rèn)是DEFAULT,也有其他的,甚至你還可以自己創(chuàng)建,那概要文件指的是什么東西,概要文件想要做什么事,大家看到,這里有個(gè)一般信息,涉及到我們CPU,連接,等等一些的規(guī)則,這個(gè)你可以來設(shè)置
還有一個(gè)叫口令,我們看口令,什么時(shí)候口令失效,保留口令的歷史記錄有多少天,后面有一個(gè)登陸失敗后鎖定賬戶,如果你登陸連續(xù)10次失敗的話,我就給你鎖定,鎖定的天數(shù),就是無限期的給你鎖定
這個(gè)大家應(yīng)該很熟悉了,這個(gè)DEFAUL文件的功能,假設(shè)你這個(gè)銀行卡丟了,銀行卡丟了如果小偷拿到這個(gè)卡了,拿到這個(gè)卡以后去自動(dòng)取款機(jī)去取,一般如果我們輸入三次密碼還是不對的話,卡就會(huì)被鎖,那小偷就登陸不上去,相當(dāng)于對于用戶的一個(gè)保護(hù),同樣的如果你要登陸QQ,或者你登陸淘寶,天貓,如果你持續(xù)登陸3次5次,他就給你鎖定這個(gè)賬戶,那么你需要通過其他的方式來激活,相當(dāng)于對于這個(gè)用戶的一個(gè)保護(hù),這里默認(rèn)的是連接之后的鎖定,這是default設(shè)置的,那么我們這里相當(dāng)于athome用戶,默認(rèn)就是DEFAULT概要文件,如果我通過athome登錄10次都不對,他就會(huì)給我鎖定,我們演示一下這個(gè)事,怎么演示,我登陸10次,你要是想給他解鎖,概要文件這里是無限,他就是不會(huì)自動(dòng)給你解鎖,那就5天以后解鎖,那怎么辦啊,你只能在用戶這,現(xiàn)在再給他解開
這個(gè)時(shí)候你可以再試一下,我現(xiàn)在已經(jīng)解開了,這里是我們講的使用默認(rèn)的概要文件,這個(gè)athome用戶使用的DEFAULT概要文件,實(shí)際概要文件我們也可以自己來,點(diǎn)概要文件右鍵創(chuàng)建,起個(gè)名叫MY_PROFILE,口令,我們要輸入3次,鎖定無限期的
這個(gè)概要文件創(chuàng)建好以后,我們再來看athome這個(gè)用戶,我把他的概要文件改成我自己創(chuàng)建的
現(xiàn)在使用的就是自己的,我們在這里實(shí)驗(yàn)一下,輸入三次就被鎖了
因?yàn)檫@里的概要文件使用的是我自己的,自己創(chuàng)建的,這個(gè)時(shí)候你要給他未鎖定解鎖,這是我們講的概要文件,那這個(gè)概要文件你也可以給他刪了,也可以移除,移除以后就沒有剛才你用的那個(gè)了,就給你設(shè)置成默認(rèn)的
通過這樣幾個(gè)命令,有角色,系統(tǒng)啊,對象,限額,我們學(xué)習(xí)了基本的ORACLE的一個(gè)管理,當(dāng)然我們創(chuàng)建一個(gè)用戶,在公司待了兩年,這個(gè)人走了,這個(gè)用戶是不是也可以移除,那么這個(gè)人就不存在了,這個(gè)人不在了以后,再想通過這個(gè)人來操作,這個(gè)用戶就已經(jīng)沒有了
?
總結(jié)
以上是生活随笔為你收集整理的Oracle数据库管理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Oracle数据库的安装和配置
- 下一篇: 基本的SQL-SELECT语句