• (转)PLSQL Developer 12.0.7连接Oracle12c数据库


    版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sl1992/article/details/80489413

    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
    • 1
    • 2
    • 3

    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取消按钮 
    PL/SQL Developer 12.0.7登录界面

    ②点击菜单栏右上角按钮,或选择Configure-Preferences 
    点击或选择Configure-Preferences

    ③打开的Preferences窗口中,配置Oracle Home路径为Oracle Instant Client解压安装路径 
    下次启动PL/SQL生效 
    OCI library为Oracle Instant Client解压安装路径下的oci.dll文件 
    配置OracleHome 
    点击Apply-点击OK,使配置生效

    ④关闭PLSQL Developer,重新打开,多出了Connect as选项 
    配置了Oracle Instant Client后的显示

    4.配置Oracle Instant Client

    PLSQL Developer的登录界面没有数据库的初始化内容

    在Oracle Instant Client解压安装目录下NETWORKADMIN新建tnsnames.ora文件,instantclient_12_2下没有NETWORKADMIN目录,也要新建 
    配置tnsnames.ora

    tnsnames.ora内容如下:

    cdb1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = Oracle服务IP)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = cdb1)
        )
      )
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    Oracle服务IP替换为Oracle的IP地址,配置完成后,关闭PLSQL Developer,重新启动

    5.PL/SQL Developer登录Oracle

    启动PLSQL Developer后出现的登录界面如下 
    配置完成tnsnames.ora后显示

    这时如果不知道用哪个用户名登录,可以使用命令行语句查看oracle所有的用户,以及该用户的状态 
    select username,account_status from dba_users;

    [oracle@solang ~]$ 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
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184

    用户状态为OPEN的用户为SYSSYSTEM,其中SYS为超级管理员用户 
    用户SYSSYSTEM的密码为数据库创建时的密码

    忘记密码可进行修改

    [oracle@solang ~]$ 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;
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    alter user system identified by OraPasswd1;

    system用户输入用户名和密码,数据库为cdb1,Normal方式连接 
    system用户登录 
    sys用户输入用户名和密码,数据库为cdb1,SYSDBA或SYSOPER方式连接 
    sys用户登录

    6.PL/SQL Developer显示SQL行号

    点击菜单栏右上角按钮,或选择Configure-Preferences,左侧找到SQL Window,右侧找到Show gutter(line numbers)并勾选,Apply然后点击OK。 
    PLSQLDeveloper显示SQL行号

    7.PL/SQL Developer中文乱码处理

    PLSQL执行SQL中文乱码

    ①查看数据库字符集 
    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,删除不常使用到的用户 
    删除PLSQL登录历史记录

    本文参考: 
    PL/SQL Developer连接到Oracle 12c 
    PLSQL Developer 12.0.7 64位 注册码 
    plsql中文乱码问题(显示问号)

  • 相关阅读:
    Spring
    Spring
    Spring
    Spring
    JS 脱敏通用方法
    JS 实用技巧记录
    多快?好省!
    实战 | 如何使用微搭低代码实现按条件过滤数据
    2021腾讯数字生态大会落地武汉,微搭低代码专场等你来
    实战 | 如何使用微信云托管部署flask项目
  • 原文地址:https://www.cnblogs.com/liujiacai/p/9578495.html
Copyright © 2020-2023  润新知