向資料庫中新增HR使用者和SCOTT使用者
一、HR使用者的新增
1、檢視$ORACLE_HOME/demo/schema/human_resources目錄下是否有以下幾個SQL執行檔案:
hr_analz.sql
hr_code.sql
hr_comnt.sql
hr_cre.sql
hr_dn_c.sql
hr_dn_d.sql
hr_drop.sql
hr_idx.sql
hr_main.sql
hr_popul.sql
- [oracle@TaylonMeng ~]$ cd /oracle/product/11.2.0/demo/schema/human_resources
- [oracle@TaylonMeng human_resources]$ ls
- hr_code.sql
我發現只有一個hr_code.sql檔案,然後在網上下載了human_resources,將解壓檔案放在/oracle/product/11.2.0/demo/schema/human_resources下。
2、執行主指令碼檔案hr_main.sql,該指令碼會呼叫其他指令碼。
-
[oracle@TaylonMeng ~]$ sqlplus / as sysdba
-
-
SQL*Plus: Release 11.2.0.4.0 Production on Sat Apr 2 20:38:56 2016
-
-
Copyright (c) 1982, 2013, Oracle. All rights reserved.
-
-
-
Connected to:
-
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
-
With the Partitioning, OLAP, Data Mining and Real Application Testing options
-
-
SQL> @/oracle/product/11.2.0/demo/schema/human_resources/hr_main.sql
-
-
specify password for HR as parameter 1:
-
Enter value for 1: hr
-
-
specify default tablespeace for HR as parameter 2:
-
Enter value for 2: users
-
-
specify temporary tablespace for HR as parameter 3:
-
Enter value for 3: temp
-
-
specify password for SYS as parameter 4:
-
Enter value for 4: password
-
-
specify log path as parameter 5:
- Enter value for 5: /oralog/hr/
3、檢查安裝情況
-
SQL> conn / as sysdba
- Connected.
-
SQL> select username from dba_users;
USERNAME
------------------------------
SYS
SYSTEM
SCOTT
HR
OUTLN
APPQOSSYS
DBSNMP
WMSYS
DIP
ORACLE_OCM
10 rows selected.
SQL> conn hr/hr
Connected.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
COUNTRIES
JOB_HISTORY
EMPLOYEES
JOBS
DEPARTMENTS
LOCATIONS
REGIONS
7 rows selected. -
-
SQL> select EMPLOYEE_ID,HIRE_DATE,SALARY from EMPLOYEES where EMPLOYEE_ID='124';
EMPLOYEE_ID HIRE_DATE SALARY
----------- ------------------ ----------
124 16-NOV-99 5800
1 row selected.
二、SCOTT使用者的新增
執行SQL檔案存放路徑:$ORACLE_HOME/rdbms/admin/utlsampl.sql
執行時需要使用system賬戶。
-
[oracle@TaylonMeng admin]$ cd $ORACLE_HOME/rdbms/admin
-
[oracle@TaylonMeng admin]$ ls utlsampl.sql
- utlsampl.sql
-
[oracle@TaylonMeng admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Apr 2 22:13:24 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> conn system/*****
Connected.
SQL> @$ORACLE_HOME/rdbms/admin/utlsampl.sql
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@TaylonMeng admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Apr 2 22:14:19 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select username from dba_users;
USERNAME
------------------------------
SYS
SYSTEM
SCOTT
HR
OUTLN
APPQOSSYS
DBSNMP
WMSYS
DIP
ORACLE_OCM
10 rows selected.
SQL> conn SCOTT/tiger
Connected.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
SALGRADE
BONUS
EMP
DEPT
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30776559/viewspace-2074356/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 新增scott使用者與其物件物件
- HR&SH&SCOTT使用者資料備份——供練習需要的兄弟下載
- Scott使用者及其物件和資料初始化指令碼物件指令碼
- Oracle資料庫scott使用者建立view檢視許可權Oracle資料庫View
- mysql8.0資料庫新增使用者和授權MySql資料庫
- Mysql 建立資料庫\新增使用者\使用者授權MySql資料庫
- 【Oracle】scott使用者下表結構、初始化資料和建表語句Oracle
- 建立scott使用者及物件物件
- MySQL新增使用者以及資料庫訪問授權MySql資料庫
- MySql中新增使用者,新建資料庫,使用者授權,刪除使用者,修改密碼MySql資料庫密碼
- MySQL新增新使用者、為使用者建立資料庫、為新使用者分配許可權MySql資料庫
- mybatis入門程式:向資料庫中新增使用者&&自增主鍵和非自增主鍵的返回MyBatis資料庫
- 使用者管理和資料庫安全(二)資料庫
- 使用者管理和資料庫安全(一)資料庫
- 向資料庫中插入一條新的資料,並返回新增資料的ID資料庫
- PerconaServer5.6(資料庫MySQL使用者配置和資料庫使用者許可權配置)Server資料庫MySql
- 新建資料庫使用者資料庫
- Oracle 12c 建立 SCOTT 使用者Oracle
- oracle手工建庫後建立scott使用者的emp表,conn scott/tiger報錯解決Oracle
- hr使用者示例建立指令碼指令碼
- 1.1.6. 資料庫使用者資料庫
- Oracle 12c如何建立scott使用者Oracle
- PHP中CakePHP新增資料庫PHP資料庫
- 查詢資料庫中的所有的普通使用者資料庫
- Oracle通過scott使用者中的emp練習單表操作Oracle
- 查詢Oracle資料庫使用者表中的多少資料量Oracle資料庫
- linux新增使用者和組Linux
- mongodb怎樣給本地資料庫新增使用者名稱密碼和修改賬號密碼?MongoDB資料庫密碼
- 以scott使用者執行set autotrace 出錯
- Oracle資料庫使用者刪除Oracle資料庫
- 如何刪除資料庫使用者?資料庫
- 資料庫及使用者的建立資料庫
- 【收藏】Linux新增/刪除使用者和使用者組Linux
- 兩個資料庫結構相同,但使用者、表空間名稱都不同,如何把一個資料庫中的使用者導到另一個使用者中(zt)資料庫
- [資料庫中介軟體]將使用者新增到DB2組授權資料庫DB2
- mongodb對資料庫建立使用者名稱和密碼MongoDB資料庫密碼
- 匯出和匯入資料庫使用者操作說明資料庫
- CAS配置資料庫,實現資料庫使用者認證資料庫