## set the database to logon
export ORACLE_SID=mydb
## conect sqlplus to the target database
sqlplus / as sysdba
## make sure connected to the correct database
SQL>show user;
user is "SYS"
SQL>select name from v$database;
name
--------
mydb
## start oracle goes through 3 stages: no mount, mount, open
1. startup; - this will go through all the stages and is the normal cmd
2. startup nomount; - only control files are loaded
alter database mount;
alter database open;
3. startup mount; - control file/data files are loaded but not open yet
alter database open;
## shutdown database
1. shutdown; - the normal cmd. Would hang if there're still users logged on, or active transactions not yet committed or rolled back.
2. shutdown immediate; - would shut down the database, logged in users kicked out, any active transactions would be rolled back.
3. shutdown transactional; - would hang if there're active transactions not yet committed or rolled back.
4. shutdown abort; - would shut down db immediately, without commit or rollback. On next startup, it would go through a recovery process and thus takes longer time.
------------------ a start example -----------------
[oracle@mob1db1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Nov 2 10:00:11 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> select name from v$database;
select name from v$database
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL>
startup;
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2144824 bytes
Variable Size 872416712 bytes
Database Buffers 721420288 bytes
Redo Buffers 7430144 bytes
Database mounted.
Database opened.
SQL> select name from v$database;
NAME
---------
AWCC
SQL> quit;
Disconnected from Oracle Database 11g Release 11.1.0.6.0 - 64bit Production
分享到:
相关推荐
- Windows: 使用`sc start ORACLE SID`命令,其中`ORACLE SID`为你的数据库实例名。 - Linux/Mac: 在SQL*Plus中输入`ALTER SYSTEM REGISTER;` 在提供的压缩包中,`Oracle服务开启.bat`脚本可能已经封装了这些命令...
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export ORACLE_SID=orcl export PATH=$PATH:$ORACLE_HOME/bin ORA_OWNR="oracle" # if the executables do not exist -- display error if [ ! -f $...
- 其中 `orcl` 是数据库实例名称,`/u01/oracle/product/OraHome` 是Oracle的安装路径,`Y` 表示该实例是可启动的。 - 这一步骤非常重要,因为它决定了系统是否能正确识别Oracle实例。 2. **设置环境变量** - ...
orcl:/ORACLE/app/product/10.2.0/db_1:Y ``` 通过以上三种方法之一,可以实现在 Linux 系统下 Oracle 10g 数据库服务的自动启动。每种方法都有其特点,可以根据实际需求选择合适的方式。无论是通过编写自定义...
这里 `xdjadb` 是实例名称,`/u01/app/oracle/product/12.2.0/dbhome_1` 是Oracle的安装目录,`Y` 表示该实例应该在启动时自动运行。 ##### 2. 创建 Oracle 服务启动脚本 接下来,我们需要创建一个启动脚本来管理...
- 将该行最后的`N`改为`Y`,表示此实例应该在系统启动时自动启动(例如:`orcl:/usr/oracle/app/product/11.2.0/dbhome_1:Y`)。 ##### 2. 修改`dbstart`和`dbshut`脚本 - **位置**:`/usr/local/oracle/product/...
set standby_logfile ('/u01/app/oracle/oradata/prodstd/redo01a.log', '/u01/app/oracle/oradata/prodstd/redo02a.log', '/u01/app/oracle/oradata/prodstd/redo03a.log') set db_unique_name to prodstd set ...
export ORACLE_HOME=/home/oracle/OraHome/9.2.0 export ORACLE_SID=orcl su - oracle -c "$ORACLE_HOME/bin/lsnrctl start" cat | su - oracle -c "$ORACLE_HOME/bin/sqlplus /nolog" conn / as sysdba shutdown ...
#/home/oracle/oraInventory/orainstRoot.sh #/home/oracle/10.2/root.sh ``` #### 四、安装后的检查与配置 完成安装后,需要进行一系列的检查与配置: 1. **检查数据库状态**: ```bash $ lsnrctl start $ ...
su - oracle -c "exp system/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp" 累计备份的SH文件:exp_cumu.sh rq=` date +"%m%d" ` su - oracle -c "exp system/manager full=y inctype=...
配置文件实例双击文件名,打开文件内容,修改文件内容中的:ORACLE_BASE 、ORACLE_HOME 、PATH 、ORACLE_SID(填写实际值)、ORACLE_USER(用户名一定要是 oracle)。可以直接将前一步中的 base、home、path 对应的...
- 查看日志文件 `/u01/app/oracle/product/10.2.0/db_1/log` 中是否有错误信息。 2. **如果服务没有自动启动**: - 检查 `/etc/rc.d/init.d/oradbstart` 脚本中的路径和变量是否正确。 - 确认服务是否已经通过 `...
/home/oracle/oraInventory/orainstRoot.sh ``` #### 三、配置监听器与数据库 **步骤1:** 配置监听器。 ```bash netca ``` 按照提示进行配置,大部分选项可以选择默认值。 **步骤2:** 创建数据库。 ```bash ...
- `SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = /data/oracle/product/10.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = orcl) (ORACLE_HOME = /data/...
export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 export ORACLE_SID=helowin export PATH=$ORACLE_HOME/bin:$PATH ``` 保存并退出,然后使配置生效: ``` source /etc/profile ``` 创建软...
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc1)(ORACLE_HOME = /u01/app/oracle/product/8.1.7)(PROGRAM = extproc)) (SID_DESC = (GLOBAL_DBNAME = cams)(ORACLE_HOME = /u01/app/oracle/...
- 示例:`hmpt:/oracle/product/10.2.0/db_1:Y`(其中`hmpt`为数据库实例名,`/oracle/product/10.2.0/db_1`为Oracle安装路径,`Y`表示允许系统自动启动该数据库)。 ### 2. **配置dbstart脚本** 接下来,需要配置...
其中 `XXXX` 是数据库的实例名,`/opt/app/ora10g/oracle/product/10.2.0/db_1` 是Oracle安装目录路径。 #### 三、修改dbstart、dbshut脚本 1. **定位脚本** - 找到 `dbstart` 和 `dbshut` 脚本文件。 2. **修改...
/u01/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole & /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart /u01/app/oracle/product/11.2.0/dbhome_1 /u01/app/oracle/product/11.2.0/dbhome_1/...