PLSQL Developer 12.0.7連線Oracle12c資料庫
- 1.下載安裝PL/SQL Developer
- 2.下載Oracle Instant Client
- 3.配置PL/SQL Developer首選項
- 4.配置Oracle Instant Client
- 5.PL/SQL Developer登入Oracle
- 6.PL/SQL Developer顯示SQL行號
- 7.PL/SQL Developer中文亂碼處理
- 8.PL/SQL Developer刪除登入記錄
Windows下使用PL/SQL Developer 12.0.7連線Oracle12c資料庫
1.下載安裝PL/SQL Developer
下載PL/SQL Developer - Registered Download,這裡選擇當前最新版12.0.7x64位plsqldev1207x64.msi
雙擊plsqldev1207x64.msi進行安裝,註冊碼參見PLSQL Developer 12.0.7 64位 註冊碼,設定如下:
product code: 4vkjwhfeh3ufnqnmpr9brvcuyujrx3n3le
serial Number:226959
password: xs374ca
2.下載Oracle Instant Client
PL/SQL Developer使用配合Oracle Instant Client
下載Oracle Instant Client,這裡選擇Instant Client for Microsoft Windows (x64),版本Version 12.2.0.1.0
,選擇instantclient-basic-windows.x64-12.2.0.1.0.zip
Version 12.2.0.1.0
的Oracle資料庫安裝可參見Linux命令列安裝Oracle12c
將下載的instantclient-basic-windows.x64-12.2.0.1.0.zip解壓到和PL/SQL Developer安裝的同級目錄下(也可以是別的目錄,看個人需要)
3.配置PL/SQL Developer首選項
①開啟PLSQL Developer,登入介面如下,點選Cancel取消按鈕
②點選選單欄右上角按鈕,或選擇Configure-Preferences
③開啟的Preferences視窗中,配置Oracle Home路徑為Oracle Instant Client解壓安裝路徑
OCI library為Oracle Instant Client解壓安裝路徑下的oci.dll檔案
點選Apply
-點選OK
,使配置生效
④關閉PLSQL Developer,重新開啟,多出了Connect as選項
4.配置Oracle Instant Client
PLSQL Developer的登入介面沒有資料庫的初始化內容
在Oracle Instant Client解壓安裝目錄下\NETWORK\ADMIN
新建tnsnames.ora
檔案,instantclient_12_2下沒有NETWORK\ADMIN
目錄,也要新建
tnsnames.ora
內容如下:
cdb1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle服務IP)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = cdb1)
)
)
Oracle服務IP
替換為Oracle的IP地址,配置完成後,關閉PLSQL Developer,重新啟動
5.PL/SQL Developer登入Oracle
啟動PLSQL Developer後出現的登入介面如下
這時如果不知道用哪個使用者名稱登入,可以使用命令列語句檢視oracle所有的使用者,以及該使用者的狀態
select username,account_status from dba_users;
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon May 28 15:28:45 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select username,account_status from dba_users;
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
SYS
OPEN
SYSTEM
OPEN
XS$NULL
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
OJVMSYS
EXPIRED & LOCKED
LBACSYS
EXPIRED & LOCKED
OUTLN
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
SYS$UMF
EXPIRED & LOCKED
DBSNMP
EXPIRED & LOCKED
APPQOSSYS
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
DBSFWUSER
EXPIRED & LOCKED
GGSYS
EXPIRED & LOCKED
ANONYMOUS
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
CTXSYS
EXPIRED & LOCKED
SI_INFORMTN_SCHEMA
EXPIRED & LOCKED
DVSYS
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
DVF
EXPIRED & LOCKED
GSMADMIN_INTERNAL
EXPIRED & LOCKED
ORDPLUGINS
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
MDSYS
EXPIRED & LOCKED
OLAPSYS
EXPIRED & LOCKED
ORDDATA
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
XDB
EXPIRED & LOCKED
WMSYS
EXPIRED & LOCKED
ORDSYS
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
GSMCATUSER
EXPIRED & LOCKED
MDDATA
EXPIRED & LOCKED
SYSBACKUP
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
REMOTE_SCHEDULER_AGENT
EXPIRED & LOCKED
GSMUSER
EXPIRED & LOCKED
SYSRAC
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
AUDSYS
EXPIRED & LOCKED
DIP
EXPIRED & LOCKED
SYSKM
EXPIRED & LOCKED
USERNAME
--------------------------------------------------------------------------------
ACCOUNT_STATUS
--------------------------------
ORACLE_OCM
EXPIRED & LOCKED
SYSDG
EXPIRED & LOCKED
SPATIAL_CSW_ADMIN_USR
EXPIRED & LOCKED
36 rows selected.
SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
使用者狀態為OPEN的使用者為SYS
和SYSTEM
,其中SYS
為超級管理員使用者
使用者SYS
和SYSTEM
的密碼為資料庫建立時的密碼
忘記密碼可進行修改
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon May 28 15:28:45 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> alter user you_username identified by you_password;
例alter user system identified by OraPasswd1;
system使用者輸入使用者名稱和密碼,資料庫為cdb1,Normal方式連線
sys使用者輸入使用者名稱和密碼,資料庫為cdb1,SYSDBA或SYSOPER方式連線
6.PL/SQL Developer顯示SQL行號
點選選單欄右上角按鈕,或選擇Configure-Preferences,左側找到SQL Window
,右側找到Show gutter(line numbers)
並勾選,Apply
然後點選OK
。
7.PL/SQL Developer中文亂碼處理
①檢視資料庫字符集
select userenv('language') from dual;
字符集為AMERICAN_AMERICA.AL32UTF8
②檢視本地字符集
select * from V$NLS_PARAMETERS;
發現第一行和第九行是相對應的,AMERICAN_AMERICA.AL32UTF8
③新建系統環境變數NLS_LANG
變數值和資料庫的字符集相同,若已存在系統變數NLS_LANG
,則更新變數值
不新建到系統變數裡,新建到上面的使用者變數裡也能正常使用。
④重新開啟PL/SQL Developer
8.PL/SQL Developer刪除登入記錄
最近登入過的使用者記錄會在開啟PL/SQL Developer中顯示
開啟Preferences視窗,選擇Logon History
,刪除不常使用到的使用者
本文參考:
PL/SQL Developer連線到Oracle 12c
PLSQL Developer 12.0.7 64位 註冊碼
plsql中文亂碼問題(顯示問號)