發表文章

目前顯示的是 9月, 2025的文章

Oracle SQL Developer介紹與下載安裝_常用操作筆記

圖片
Oracle SQL Developer 是一款免費的圖形化使用者介面,能讓資料庫使用者與管理員以更少的點擊與按鍵完成資料庫工作。 作為提高生產力的工具,SQL Developer 的主要目標是幫助終端使用者節省時間,並最大化在 Oracle 資料庫技術堆疊上的投資報酬。 開發人員可使用 SQL Developer 來執行查詢、呼叫/撰寫儲存程序、進行測試,以及撰寫/產生文件與開發資料庫程式等。 資料庫管理員可用 SQL Developer 管理資料庫並執行各種管理作業等。 應用架構師與資料模型設計師可用 SQL Developer 進行資料建模、腳本撰寫、報表等。 網頁開發人員與管理員可用 SQL Developer 管理 Oracle REST Data Services (ORDS),以建立與修改 RESTful 服務。 SQL Developer 支援 Oracle Database 10g、11g、12c,並可在任何支援 Java 的作業系統上執行。 官方下載網址(需要先有Oracle帳號登入進去後才能下載) https://www.oracle.com/tw/database/sqldeveloper/technologies/download/ 下載含有JDK版本的 否 可以從側欄位開啟查詢sessino視窗 select * from tab; 用來查meta data table 在此我們可下載從網路上抓下來的Oracle Sample Schemas 做匯入 連結: https://github.com/oracle-samples/db-sample-schemas/releases/tag/v21.1 下載解壓存放的路徑要是放在Oracle安裝默認位置 C:\app\your_username\product\21c\dbhomeXE\demo\schema C:\app\chous\product\21c\dbhomeXE\demo\schema "C:\app\chous\product\21c\dbhomeXE\demo\schema\db-sample-schemas-21.1\human_resources\hr_main.sql" @ C:\app\chous\product\21c\dbhomeXE\demo...

PL-SQL筆記3_Oracle Listener與Listener.ora檔案,lsnrctl(Listener control)

圖片
  Oracle Net Listener : a separate process that runs on the database server computer. It receives incoming client connection requests and manages the traffic of these requests to the database server. Listener.ora檔案 : is the configuration file for a listener. It can include the protocol address it is accepting connection requests on a list of the database and other services it is listening for, and control paramaters used by the listener. 預設windows安裝好的位置 C:\app\你的User名\product\21c\homes\OraDB21Home1\network\admin 配置檔案內文 # listener.ora Network Configuration File: C:\app\chous\product\21c\homes\OraDB21Home1\NETWORK\ADMIN\listener.ora # Generated by Oracle configuration tools. DEFAULT_SERVICE_LISTENER = XE SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = C:\app\chous\product\21c\dbhomeXE) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:C:\app\chous\product\21c\dbhomeXE\bin\oraclr.dll") ) ) LISTENER = (DESCR...

PL-SQL筆記2_延伸XEPDB1登入_列出有哪些DB_連線登入到指定DB_建立新User並Grant權限

圖片
  在之前篇章已經知道如何去安裝Express免費用於學習或開發階段的Oracle DB PL-SQL筆記1_OracleOracle Database 21c Express Edition下載安裝筆記 https://coolmandiary.blogspot.com/2023/04/oracle-database-21c-express-edition.html 在這邊如果點選Oracle 執行處裡管理員跳出來的就是如下視窗 而點選SQL Plus則可以開啟終端 以DBA身分登入 / as sysdba 可以先撈取顯示幕前有哪些資料庫 select name from v$pdbs; 這邊可看到XEPDB1  這邊PDB這字眼代表的是 A pluggable database is a portable collection of schemas,schema objects, and nonschema objects in an oracle database. 登入指定的資料庫語法 connect sys/你一開始設置的SYS密碼@localhost:1521/資料庫名稱 as sysdba; 建立新User並Grant權限 (建立可登入、可建表的使用者,且表預設放在 USERS 表空間並有足夠空間。) create user demouser identified by demouser default tablespace users quota unlimited on users; 建立一個名為 demouser 的資料庫使用者,密碼也是 demouser(預設大小寫敏感) default tablespace users 將 USERS 設為這個使用者建立物件時的「預設永久表空間」。 quota unlimited on users 給予這個使用者在 USERS 表空間「不限額度」的配額,因此他可以在該表空間建立/擴張自己的物件(表、索引…)。若未設定配額或沒有 UNLIMITED,即使有建表權限也可能因為「沒有表空間配額」而建不起來。 grant create session, create table to demouser; create session:允許 demouser 登入資料庫(沒有此權限就不能連線)。 cr...