2_Oracle_手工建库

news2025/1/10 16:59:04

一、手工建库的目的
1、方便理解Oracle的体系结构
2、更快更好的创建数据库
3、方便了解建库的每步细节
4、手工建库的实用性
在这里插入图片描述二、dbca生成的脚本
/app/oracle/admin/orcl/scripts/

orcl.sh

#!/bin/sh
OLD_UMASK=`umask`
umask 0027
mkdir -p /app/oracle/admin/orcl/adump
mkdir -p /app/oracle/admin/orcl/dpdump
mkdir -p /app/oracle/admin/orcl/pfile
mkdir -p /app/oracle/cfgtoollogs/dbca/orcl
mkdir -p /app/oracle/oradata/orcl
mkdir -p /app/oracle/product/11.2.0/db_1/dbs
umask ${OLD_UMASK}
ORACLE_SID=orcl; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
echo You should Add this entry in the /etc/oratab: orcl:/app/oracle/product/11.2.0/db_1:Y
/app/oracle/product/11.2.0/db_1/bin/sqlplus /nolog @/app/oracle/admin/orcl/scripts/orcl.sql

orcl.sql

set verify off
ACCEPT sysPassword CHAR PROMPT 'Enter new password for SYS: ' HIDE
ACCEPT systemPassword CHAR PROMPT 'Enter new password for SYSTEM: ' HIDE
ACCEPT sysmanPassword CHAR PROMPT 'Enter new password for SYSMAN: ' HIDE
ACCEPT dbsnmpPassword CHAR PROMPT 'Enter new password for DBSNMP: ' HIDE
host /app/oracle/product/11.2.0/db_1/bin/orapwd file=/app/oracle/product/11.2.0/db_1/dbs/orapworcl force=y
@/app/oracle/admin/orcl/scripts/CreateDB.sql
@/app/oracle/admin/orcl/scripts/CreateDBFiles.sql
@/app/oracle/admin/orcl/scripts/CreateDBCatalog.sql
@/app/oracle/admin/orcl/scripts/lockAccount.sql
@/app/oracle/admin/orcl/scripts/postDBCreation.sql  

CreateDB.sql

SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /app/oracle/admin/orcl/scripts/CreateDB.log append
startup nomount pfile="/app/oracle/admin/orcl/scripts/init.ora";
CREATE DATABASE "orcl"
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/app/oracle/oradata/orcl/system01.dbf' SIZE 700M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 600M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/app/oracle/oradata/orcl/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED
SMALLFILE UNDO TABLESPACE "UNDOTBS1" DATAFILE '/app/oracle/oradata/orcl/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT  5120K MAXSIZE UNLIMITED
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('/app/oracle/oradata/orcl/redo01.log') SIZE 51200K,
GROUP 2 ('/app/oracle/oradata/orcl/redo02.log') SIZE 51200K,
GROUP 3 ('/app/oracle/oradata/orcl/redo03.log') SIZE 51200K
USER SYS IDENTIFIED BY "&&sysPassword" USER SYSTEM IDENTIFIED BY "&&systemPassword";
spool off

CreateDBFiles.sql

SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /app/oracle/admin/orcl/scripts/CreateDBFiles.log append
CREATE SMALLFILE TABLESPACE "USERS" LOGGING DATAFILE '/app/oracle/oradata/orcl/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT  AUTO;
ALTER DATABASE DEFAULT TABLESPACE "USERS";
spool off

CreateDBCatalog.sql

SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /app/oracle/admin/orcl/scripts/CreateDBCatalog.log append
@/app/oracle/product/11.2.0/db_1/rdbms/admin/catalog.sql;
@/app/oracle/product/11.2.0/db_1/rdbms/admin/catblock.sql;
@/app/oracle/product/11.2.0/db_1/rdbms/admin/catproc.sql;
@/app/oracle/product/11.2.0/db_1/rdbms/admin/catoctk.sql;
@/app/oracle/product/11.2.0/db_1/rdbms/admin/owminst.plb;
connect "SYSTEM"/"&&systemPassword"
@/app/oracle/product/11.2.0/db_1/sqlplus/admin/pupbld.sql;
connect "SYSTEM"/"&&systemPassword"
set echo on
spool /app/oracle/admin/orcl/scripts/sqlPlusHelp.log append
@/app/oracle/product/11.2.0/db_1/sqlplus/admin/help/hlpbld.sql helpus.sql;
spool off
spool off

lockAccount.sql

SET VERIFY OFF
set echo on
spool /app/oracle/admin/orcl/scripts/lockAccount.log append
BEGIN
 FOR item IN ( SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS IN ('OPEN', 'LOCKED', 'EXPIRED') AND USERNAME NOT IN (
'SYS','SYSTEM') )
 LOOP
  dbms_output.put_line('Locking and Expiring: ' || item.USERNAME);
  execute immediate 'alter user ' ||
         sys.dbms_assert.enquote_name(
         sys.dbms_assert.schema_name(
         item.USERNAME),false) || ' password expire account lock' ;
 END LOOP;
END;
/
spool off

postDBCreation.sql

SET VERIFY OFF
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
spool /app/oracle/admin/orcl/scripts/postDBCreation.log append
select 'utl_recomp_begin: ' || to_char(sysdate, 'HH:MI:SS') from dual;
execute utl_recomp.recomp_serial();
select 'utl_recomp_end: ' || to_char(sysdate, 'HH:MI:SS') from dual;
connect "SYS"/"&&sysPassword" as SYSDBA
set echo on
create spfile='/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora' FROM pfile='/app/oracle/admin/orcl/scripts/init.ora';
shutdown immediate;
connect "SYS"/"&&sysPassword" as SYSDBA
startup ;
spool off

三、手工建库步骤
Step 1: Specify an Instance Identifier (SID) 指定SID
Step 2: Ensure That the Required Environment Variables Are Set 设置环境变量
Step 3: Choose a Database Administrator Authentication Method 配置密码文件
Step 4: Create the Initialization Parameter File 编辑创建参数文件
Step 5: (Windows Only) Create an Instance 若操作系统是windows就要执行,创建实例
Step 6: Connect to the Instance 连接实例
Step 7: Create a Server Parameter File 创建spfile文件
Step 8: Start the Instance 启动实例
Step 9: Issue the CREATE DATABASE Statement 创建数据库
Step 10: Create Additional Tablespaces 创建表空间
Step 11: Run Scripts to Build Data Dictionary Views 运行数据字典脚本

Step 1:指定SID
Decide on a unique Oracle system identifier (SID) for your instance, open a command window,
and setthe ORACLE_SID environment variable
为实例确定一个唯一的Oracle系统标识符(SID),打开一个命令窗口,并设置ORACLE_SID环境变量
在这里插入图片描述Step 2:设置环境变量

]$ vi .bash_profile
#.bash_profile
#Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
#User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export ORACLE_BASE=/app/oracle
export ORACLE_HOME=/$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ORCL
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH

Step 3:配置密码文件
密码文件的位置:$ORACLE_HOME/dbs
密码文件的名称:orapw<ORACLE_SID>
V$PWFILE_USERS
orapwd file=orapworcl password=oracle;

Step 4:编辑创建参数文件
When an Oracle instance starts, it reads initialization parameters from an initialization parameter file.
This file must at a minimum specify the DB_NAME parameter. All other parameters have default values.
当Oracle实例启动时,它从初始化参数文件中读取初始化参数。此文件至少必须指定DB\u NAME参数。所有其他参数都有默认值。

compatible ='11.2.0'
control_files = (/app/oracle/oradata/orcl/control01.ctl, /app/oracle/oradata/orcl/control02.ctl)
db_name='orcl'
memory_target=800M
sga_target=500M
processes = 150
audit_file_dest='/app/oracle/admin/orcl/adump'
db_block_size=8192
open_cursors=300
undo_tablespace='UNDOTBS1

Step 5:若操作系统为windows则这一步就要执行
On the Windows platform, before you can connect to an instance,you must manually create it if it does not already exist.
The ORADIM command creates an Oracle instance by creating a new Windowsservice.
To create an instance:
Enter the following command at a Windows command prompt:
oradim -NEW -SID sid -STARTMODE MANUAL -PFILE pfile
where sid is the desired SID (for example mynewdb) and pfile is the full path to the text initialization parameter file.
This command creates the instance but does not start it.
在Windows平台上,在连接到实例之前,如果它不存在,则必须手动创建它。
ORADIM命令通过创建新窗口来创建Oracle实例服务。
要创建实例:
在Windows命令提示符下输入以下命令:

oradim -NEW -SID SID -STARTMODE MANUAL -PFILE pfile

其中sid是所需的sid(例如mynewdb),pfile是文本初始化参数文件。
此命令创建实例,但不启动它。

Step 6:连接实例
在这里插入图片描述
Step 7:创建spfile文件
The server parameter file enables you to change initialization parameters with the ALTER SYSTEM
command and persist the changes across a database shutdown and startup.

You create the server parameter file from your edited text initialization file.
The following SQL*Plus command reads the text initialization parameter file (PFILE)
with the default name from the default location, creates a server parameter file (SPFILE)
from the text initialization parameter file, and writes the SPFILE to the default location with the default SPFILE name.

CREATE SPFILE FROM PFILE;

You can also supply the file name and path for both the PFILE and SPFILEif you are not using default names and locations.

服务器参数文件允许您使用关闭数据库并更改整个系统启动。

从编辑的文本初始化文件创建服务器参数文件。下面的SQL*Plus命令读取文本初始化参数文件(PFILE)
使用默认位置中的默认名称,创建一个服务器参数文件(SPFILE)
并将SPFILE写入默认位置使用默认的SPFILE名称。

CREATE SPFILE FROM PFILE;

您还可以提供PFILE和SPFILE的文件名和路径如果不使用默认名称和位置。

Step 8:启动实例
Start an instance without mounting a database. Typically, you do this only during database creation or while performing maintenance on the database.
Use the STARTUP command with the NOMOUNT clause.
In this example, because the initialization parameter file or server parameter file is stored inthe default location,
you are not required to specify the PFILE clause:

STARTUP NOMOUNT

At this point, the instance memory is allocated and its processes are started. The database itself does not yet exist.

在不装载数据库的情况下启动实例。通常,只在数据库期间执行此操作创建或在对数据库执行维护时。
在NOMOUNT子句中使用STARTUP命令。
在本例中,因为初始化参数文件或服务器参数文件存储在默认位置,
您不需要指定PFILE子句:

STARTUP NOMOUNT

此时,将分配实例内存并启动其进程。数据库它本身还不存在。

Step 9:创建数据库

CREATE DATABASE orcl
USER SYS IDENTIFIED BY Password1
USER SYSTEM IDENTIFIED BY Password1
LOGFILE GROUP 1 ('/app/oracle/oradata/orcl/redo01a.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/app/oracle/oradata/orcl/redo02a.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/app/oracle/oradata/orcl/redo03a.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/app/oracle/oradata/orcl/system01.dbf' SIZE 500M REUSE
SYSAUX DATAFILE '/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 500M REUSE
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/app/oracle/oradata/orcl/temp01.dbf'
SIZE 200M REUSE
UNDO TABLESPACE undotbs1
DATAFILE '/app/oracle/oradata/orcl/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

Step 10:创建表空间
To make the database functional, you must create additional tablespaces for your application data. The
following sample script creates some additional tablespaces:
要使数据库正常工作,必须为应用程序数据创建额外的表空间。
这个以下示例脚本将创建一些附加表空间:

CREATE TABLESPACE apps_tbs LOGGING
DATAFILE '/app/oracle/oradata/orcl/apps01.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;
-- create a tablespace for indexes, separate from user tablespace (optional)
CREATE TABLESPACE indx_tbs LOGGING
DATAFILE '/app/oracle/oradata/orcl/indx01.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;

Step 11:运行数据字典脚本
Run the scripts necessary to build data dictionary views, synonyms, and PL/SQL packages,
and to support proper functioning of SQL*Plus:

运行构建数据字典视图、同义词和PL/SQL包所需的脚本,为了支持SQL*Plus的正常运行:

@?/rdbms/admin/catalog.sql	sys用户执行
@?/rdbms/admin/catproc.sql	sys用户执行
@?/sqlplus/admin/pupbld.sql  system用户执行
EXIT

practice(练习):
删除之前创建的数据库
方法一:
用dbca图形界面操作:
]$ dbca
在这里插入图片描述
在这里插入图片描述在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述在这里插入图片描述方法二、命令行删除之前的创建的库
]$ rm -rf /app/oracle/oradata/orcl —数据库
]$ rm -rf /app/oracle/admin/orcl 审计文件
]$ rm -rf $ORACLE_HOME/dbs/* — 密码文件

1、指定SID(之前已设置)
2、设置变量(之前已设置)
3、配置密码文件

]$ cd $ORACLE_HOME/dbs
]$ orapwd file=orapworcl password=Password1
]$ ll
total 4
-rw-r----- 1 oracle oinstall 1536 Dec 14 16:10 orapworcl

4、编辑创建参数文件

]$ pwd
/app/oracle/product/11.2.0/db_1/dbs
]$ vi initORCL.ora
compatible ='11.2.0'
control_files = (/app/oracle/oradata/orcl/control01.ctl, /app/oracle/oradata/orcl/control02.ctl)
db_name='orcl'
memory_target=800M
sga_target=500M
processes = 150
audit_file_dest='/app/oracle/admin/orcl/adump'
db_block_size=8192
open_cursors=300
undo_tablespace='UNDOTBS1'

5、连接实例

]$ echo $ORACLE_SID
ORCL
]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Dec 14 16:15:14 2020

Copyright (c) 1982, 2009, Oracle.  All rights reserved.
SQL> startup

没有反应,查看oracle告警日志

]$ cd /app/oracle/diag/rdbms/orcl/ORCL/trace/
]$ tail -f alert_ORCL.log 
Retry Iteration No: 5   OS Error: 2
OS Audit file could not be created; failing after 5 retries
Could not open audit file: /app/oracle/admin/orcl/adump/orcl_ora_31046_1.aud
Retry Iteration No: 1   OS Error: 2
Retry Iteration No: 2   OS Error: 2
Retry Iteration No: 3   OS Error: 2
Retry Iteration No: 4   OS Error: 2
Retry Iteration No: 5   OS Error: 2

找不到目录,直接创建

]$ cd /app/oracle/admin/
]$ mkdir -p orcl/adump
]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Dec 14 16:54:21 2020

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size		    2217952 bytes
Variable Size		  473958432 bytes
Database Buffers	  352321536 bytes
Redo Buffers		    6606848 bytes
ORA-00205: error in identifying control file, check alert log for more info

此时实例已经起来了,但是还没创建控制文件,先把实例停了

SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;		//只启动实例,不参加控制文件启动
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size		    2217952 bytes
Variable Size		  473958432 bytes
Database Buffers	  352321536 bytes
Redo Buffers		    6606848 bytes

SQL> show parameter spfile

NAME				     TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile				     string

spfile文件还未创建
6、创建pfile文件

SQL> create spfile from pfile;
File created

创建后会在/app/oracle/product/11.2.0/db_1/dbs目录下生成spfile文件

]$ ll
......
-rw-r--r-- 1 oracle oinstall  294 Dec 14 16:54 initORCL.ora		---pfile文件
-rw-r----- 1 oracle oinstall 1536 Dec 14 17:01 spfileORCL.ora	---spfile文件

如果spfile没有的话,实例启动的时候是读取pfile文件,反之亦然。
可观察告警日志
没有创建spfile第一次启动的时候

Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
Using parameter settings in server-side **pfile /app/oracle/product/11.2.0/db_1/dbs/initORCL.ora**
System parameters with non-default values:
  processes                = 150
  sga_target               = 500M
  memory_target            = 800M
  control_files            = "/app/oracle/oradata/orcl/control01.ctl"
  control_files            = "/app/oracle/oradata/orcl/control02.ctl"
  db_block_size            = 8192
  compatible               = "11.2.0"
  undo_tablespace          = "UNDOTBS1"
  audit_file_dest          = "/app/oracle/admin/orcl/adump"
  db_name                  = "orcl"
  open_cursors             = 300
Mon Dec 14 16:56:44 2020

重新启动实例

SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size		    2217952 bytes
Variable Size		  473958432 bytes
Database Buffers	  352321536 bytes
Redo Buffers		    6606848 bytes

]$ cd /app/oracle/diag/rdbms/orcl/ORCL/trace
]$ tail -f alert_ORCL.log 
Starting up:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
Using parameter settings in server-side **spfile /app/oracle/product/11.2.0/db_1/dbs/spfileORCL.ora**
System parameters with non-default values:
  processes                = 150
  sga_target               = 500M
  memory_target            = 800M
  control_files            = "/app/oracle/oradata/orcl/control01.ctl"
  control_files            = "/app/oracle/oradata/orcl/control02.ctl"
  db_block_size            = 8192
  compatible               = "11.2.0"
  undo_tablespace          = "UNDOTBS1"
  audit_file_dest          = "/app/oracle/admin/orcl/adump"
  db_name                  = "orcl"
  open_cursors             = 300
Mon Dec 14 17:11:00 2020

SQL> show parameter pfile;

NAME				     TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile				     string
/app/oracle/product/11.2.0/db_
1/dbs/spfileORCL.ora

7、启动实例

SQL> startup nomount

8、创建数据库

SQL>CREATE DATABASE orcl
USER SYS IDENTIFIED BY Password1
USER SYSTEM IDENTIFIED BY Password1
LOGFILE GROUP 1 ('/app/oracle/oradata/orcl/redo01a.log') SIZE 100M BLOCKSIZE 512,
GROUP 2 ('/app/oracle/oradata/orcl/redo02a.log') SIZE 100M BLOCKSIZE 512,
GROUP 3 ('/app/oracle/oradata/orcl/redo03a.log') SIZE 100M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/app/oracle/oradata/orcl/system01.dbf' SIZE 500M REUSE
SYSAUX DATAFILE '/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 500M REUSE
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/app/oracle/oradata/orcl/temp01.dbf'
SIZE 200M REUSE
UNDO TABLESPACE undotbs1
DATAFILE '/app/oracle/oradata/orcl/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

*
ERROR at line 1:
ORA-01501: CREATE DATABASE failed
ORA-00200: control file could not be created
ORA-00202: control file: '/app/oracle/oradata/orcl/control01.ctl'
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory

执行后会报错,因为之前删除了这个/app/oracle/oradata/orcl目录,使得找不到此目录
创建即可

]$ mkdir -p /app/oracle/oradata/orcl/

再次执行创建数据库语句

......
TEMPFILE '/app/oracle/oradata/orcl/temp01.dbf'
SIZE 200M REUSE
UNDO TABLESPACE undotbs1
DATAFILE '/app/oracle/oradata/orcl/undotbs01.dbf'
 21  SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

Database created.

创建成功

9、创建表空间

SQL> CREATE TABLESPACE apps_tbs LOGGING
DATAFILE '/app/oracle/oradata/orcl/apps01.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;

Tablespace created.

SQL> CREATE TABLESPACE indx_tbs LOGGING
DATAFILE '/app/oracle/oradata/orcl/indx01.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL;

Tablespace created.

SQL> show user;
USER is "SYS"
SQL> select * from dba_data_files;
select * from dba_data_files
              *
ERROR at line 1:
ORA-00942: table or view does not exist

此时查看用本身的信息报错,是因为还未执行数据字典脚本。
10、运行数据字典脚本
@?/rdbms/admin/catalog.sql sys用户执行
@?/rdbms/admin/catproc.sql sys用户执行
@?/sqlplus/admin/pupbld.sql system用户执行

SQL> @?/rdbms/admin/catalog.sql
......
PL/SQL procedure successfully completed.

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATALOG	  2020-12-14 17:52:08

SQL> @?/rdbms/admin/catproc.sql	
PL/SQL procedure successfully completed.

SQL> SELECT dbms_registry_sys.time_stamp('CATPROC') AS timestamp FROM DUAL;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATPROC    2020-12-14 17:56:55

SQL> conn system/Password1
Connected.
SQL> @?/sqlplus/admin/pupbld.sql
Synonym created.

SQL> create user fan identified by Password1;

User created.

SQL> grant dba to fan;

Grant succeeded.

SQL> conn fan/Password1
Connected.

@这里表示运行
?这里表示家目录 $ORACLE_HOME

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/95002.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

2022年度调味品十大热门品牌排行

调味品行业总量大&#xff0c;种类繁多&#xff0c;需求量大&#xff0c;且调味品作为生活必需品&#xff0c;与饮食文化紧密联系&#xff0c;也与人们的生活息息相关&#xff0c;如近日各省陆续全面放开后&#xff0c;也出现了北方抢黄头罐头南方抢醋的风潮。总体来说&#xf…

C++11后的常用容器和迭代器

文章目录一、string容器二、vector容器三、list容器1.构造函数2.特性操作3.元素操作4.赋值操作5.交换、反转、排序、归并6.比较操作7.插入和删除五、pair键值对四、map容器1.红黑树&#xff08;平衡二叉排序树&#xff09;2.构造函数3.特性操作4.元素操作5.赋值操作6.交换操作7…

Docker学习笔记5(狂神)

Docker网络&#xff1a; 我们学习docker的网络首先要删除我们所有的镜像&#xff1a; 我们发现我们有这么多的镜像。 我们现在来安装一下tomcat&#xff1a; linux能够ping通docker容器内部 再次测试ip addr 我们再启动一个容器测试&#xff1a; 发现又多了一对网卡。 3.我们来…

条件执行指令 CMP

CMP可以比较两个数的关系&#xff0c;其本质就是一条减法指令&#xff0c;只是不会将运算结果保存到寄存器&#xff0c;因为对于CPU而言&#xff0c;比较两个数时只关心结果是false还是true 指令格式&#xff1a;CMP <第一操作寄存器> <第二操作数> 第一操作寄…

【渐进式:深度光谱变换】

P2Sharpen: A progressive pansharpening network with deep spectral transformation &#xff08;P2Sharpen&#xff1a;一种具有深度光谱变换的渐进式全色锐化网络&#xff09; 大多数现有的基于深度学习方法pansharpening的监督任务仅仅依靠伪ground-truth多光谱图像,展示…

【猿如意】猿如意初用之感及editplus工具解绍

​​​​​​【猿如意】猿如意初用之感及editplus工具解绍 目录 一、猿如意初用之感 二、editplus工具下载安装渠道 三、工具介绍 四、功能介绍首先&#xff0c;EditPlus是一套功能强大的文本编辑器。 五、软件截图 六、软件安装过程 6.1在猿如意中的下载步骤 七、使用…

升级JSONB列式存储,Hologres助力淘宝搜索2022双11降本增效!

作者&#xff1a;陆晨炜&#xff08;花名遣云&#xff09;阿里巴巴智能引擎事业部数据开发 前言&#xff1a; 2022年的双11&#xff0c;阿里淘宝搜推集群承载上千万每秒的的流量峰值&#xff0c;消费者的每一次浏览、点击都通过搜推集群进行流转&#xff0c;与往年双11不同的…

[附源码]Python计算机毕业设计高校学生心理健康信息咨询系统Django(程序+LW)

该项目含有源码、文档、程序、数据库、配套开发软件、软件安装教程 项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等…

万字长文——MySQL基础一篇打通

准备工作 直接使用MySQL提供的数据&#xff0c;下载MySQL示例数据库 MySQL示例数据库模式由以下表组成&#xff1a; Customers&#xff1a;存储客户的数据。Products&#xff1a;存储比例模型车列表。ProductLines&#xff1a;存储产品系列类别列表。Orders&#xff1a;存储…

Web(九)JavaScript概述-JavaSript知识训练-入门基础

1、JavaScript是运行在( B)的脚本语言。 A、 服务器端 B、 客户端 C、 在服务器运行后&#xff0c;把结果返回到客户端 D、 在客户端运行后&#xff0c;把结果返回到服务端 2、JavaScript代码通常是用&#xff08; D&#xff09;标签嵌入到html文档的。 A、 JavaScript B、 La…

微服务框架 SpringCloud微服务架构 多级缓存 48 多级缓存 48.5 查询Tomcat【实现查询】

微服务框架 【SpringCloudRabbitMQDockerRedis搜索分布式&#xff0c;系统详解springcloud微服务技术栈课程|黑马程序员Java微服务】 多级缓存 文章目录微服务框架多级缓存48 多级缓存48.5 查询Tomcat【实现查询】48.5.1 使用Http函数查询数据48 多级缓存 48.5 查询Tomcat【…

docker容器监控

docker容器监控 一、docker介绍 Docker的中文意思就是码头工人&#xff0c;进入到Docker的官方网站后&#xff0c;也可以看到Docker的图标&#xff0c;如下图所示。 这个Docker图标上就是一条鲸鱼&#xff0c;上面有很多集装箱&#xff0c;集装箱就相当于虚拟环境&#xff0c…

股票信息网站

开发工具(eclipse/idea/vscode等)&#xff1a; 数据库(sqlite/mysql/sqlserver等)&#xff1a; 功能模块(请用文字描述&#xff0c;至少200字)&#xff1a;

基于java+springmvc+mybatis+vue+mysql的志愿者招募网站

项目介绍 网络的广泛应用给生活带来了十分的便利。所以把志愿者招募管理与现在网络相结合&#xff0c;利用java技术建设志愿者招募网站&#xff0c;后端使用ssm框架&#xff0c;前端使用vue技术&#xff0c;实现志愿者招募的信息化。对于进一步提高志愿者招募管理发展&#xf…

【Java寒假打卡】Java基础-面向对象

【Java寒假打卡】Java基础-面向对象一、面向对象和面相过程二、类的定义三、对象的使用四、手机类的创建和使用五、单个对象的内存图六、两个引用指向同一内存图七、成员变量和局部变量八、priavte九、this关键字十、封装十一、构造方法十二、标准类一、面向对象和面相过程 对象…

童年辣条神话卫龙,首日破发“辣条第一股”,跌超10亿

“辣条第一股”的神话破了&#xff1f; 今日&#xff08;12月15日&#xff09;“辣条大王”卫龙美味全球控股有限公司&#xff08;下称“卫龙”&#xff0c;09985.HK&#xff09;正式挂牌港交所&#xff0c;但上市首日即遭破发。 作为千禧一代撑起的童年“神话”&#xff0c;…

GNN Algorithms (1): DeepWalk

DeepWalk Concept 图表示Graph Embedding based on Random Walk -> Graph GNN based neighbor aggregation. Graph Embedding使用低维稠密向量的形式表示图中的节点&#xff0c;使得在原始图中相似的节点在低维表达空间中也相似。 DeepWalk关键基础是Random Walk和word…

Hubbell EDI 855 采购订单确认报文详解

Hubbell于纽约证券交易所上市&#xff0c;全球员工近12000名&#xff0c;在欧美地区以其高品质获得人们的青睐&#xff0c;成为家喻户晓的品牌&#xff0c;同类产品占有份额达95%以上。 在数字化的今天&#xff0c;HUBBELL延续了在一个多世纪前建立的增长和创新传统&#xff0…

Sql Server 生成 Word 文档 表结构

打开数据库编辑器&#xff0c;输入以下代码并执行&#xff08;F5&#xff09; SELECT 表名 case when a.colorder1 then d.name else end, 表说明 case when a.colorder1 then isnull(f.value,) else end, 序号 a.colorder, 列名 a.name, …

QT6+CloudCompare显示3D点云

CloudCompare是一个三维点云&#xff08;网格&#xff09;编辑和处理软件。最初&#xff0c;它被设计用来对稠密的三维点云进行直接比较。它依赖于一种特定的八叉树结构&#xff0c;在进行点云对比这类任务时具有出色的性能。此外&#xff0c;由于大多数点云都是由地面激光扫描…