windows下$ORACLE_HOME/database 修改有關$ORACLE_SID的文件名
liunx
windows
在一個cmd運行oracle %ORACLE_ORCL%
在另一個cmd運行
set ORACLE_HOME=E:appcswggodproduct
set ORACLE_ORCL=orcl
orapwd file=%ORACLE_HOME%/ORACLE_HOME/dbs/orapw%ORACLE_SID% password=oracle entries=
startup
#
[oracle@h
SQL*Plus: Release
Copyright (c)
Connected to:
Oracle Database
With the Partitioning
SQL>
#
SQL> select * from v$thread;
SQL> select instance_name from v$instance;
INSTANCE_NAME
orcl
#
SQL> shutdown immediate;
Database closed
Database dismounted
ORACLE instance shut down
SQL>
#
[oracle@h
LSNRCTL for Linux: Version
Copyright (c)
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=
The command completed successfully
#
[oracle@h
Password:
[root@h
#
bitc:/app/oracle/product/
test:/app/oracle/product/
"/etc/oratab"
[root@h
#
[root@h
[oracle@h
/home/oracle
[oracle@h
#
# Get the aliases and functions
if [
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/
export ORACLE_SID=bitc
export PATH=$ORACLE_HOME/bin:
"
[oracle@h
[oracle@h
bitc
#
[oracle@h
[oracle@h
total
drwxr
drwxr
[oracle@h
[oracle@h
[oracle@h
[oracle@h
[oracle@h
[oracle@h
[oracle@h
hc_bitc
hc_DBUA
hc_test
#
[oracle@h
#
[oracle@h
bitc
[oracle@h
SQL*Plus: Release
Copyright (c)
Connected to an idle instance
SQL> startup
ORA
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted
Database opened
SQL> exit
[oracle@h
#
配置遠程namespace
驗證
#
SQL> show parameter listener;
NAME TYPE VALUE
listener_networks string
local_listener string BITC
remote_listener string
SQL> alter system set local_listener="BITC";
System altered
SQL> alter system register;
System altered
SQL> exit
Disconnected from Oracle Database
With the Partitioning
#
[oracle@h
LSNRCTL for Linux: Version
Copyright (c)
TNS
[oracle@h
LSNRCTL for Linux: Version
Copyright (c)
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=
STATUS of the LISTENER
Alias orcl
Version TNSLSNR for Linux: Version
Start Date
Uptime
Trace Level off #跟蹤級別
Security ON: Local OS Authentication#安全性
SNMP OFF
Listener Parameter File /app/oracle/product/
Listener Log File /app/oracle/diag/tnslsnr/h
Listening Endpoints Summary
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=
Services Summary
Service "bitc" has
Instance "bitc"
Service "orcl" has
Instance "bitc"
Service "orclXDB" has
Instance "bitc"
The command completed successfully
#
動態監聽默認
在netmgr中配置namespace
注在
#
select * from dba_db_links;
#
SQL> alter public database link conn_orcl connect to u
alter public database link conn_orcl connect to u
ORA
SQL> drop public database link conn_orcl;
Database link dropped
SQL> create public database link CONN_BITC connect to u
Database link created
#
SQL> conn system/manager
Connected to Oracle Database
Connected as system
SQL> grant dba to u
Grant succeeded
SQL> conn u
Connected to Oracle Database
Connected as u
SQL> create table t
Table created
SQL> create materialized view log on t
Materialized view log created
#
#
SQL> select * from U
ID NAME
#
SQL> create materialized view t
Materialized view created
SQL> select * from t
ID NAME
#
SQL> insert into t
SQL> commit;
Commit complete
#
SQL> select * from t
ID NAME
#
SQL> select * from t
ID NAME
#
#
SQL> show user
User is "u
SQL> create table stu (id int
Table created
#
SQL> create materialized view log on stu;
create materialized view log on stu
ORA
#
#
SQL> create materialized view stu_mv refresh force start with sysdate next
Materialized view created
#
SQL> insert into stu values(
SQL> commit;
Commit complete
#
SQL> select * from stu_mv;
ID NAME
#
#
#
SQL> show user
User is "u
SQL> create table test
Table created
SQL> create snapshot log on test
Materialized view log created
SQL> insert all into test
SQL> commit;
Commit complete
SQL>
#
SQL> create snapshot sn_test
Materialized view created
SQL> alter snapshot sn_test
Materialized view altered
#
SQL> select * from sn_test
ID NAME
SQL>
#
SQL> insert into test
SQL> commit;
Commit complete
#
SQL> select * from sn_test
ID NAME
SQL> /
ID NAME
SQL> /
ID NAME
#
#
SQL> create table test
Table created
SQL> insert into test
SQL> commit;
Commit complete
#
SQL> create snapshot sn_test
Materialized view created
#
SQL> select * from sn_test
ID NAME
#
熱備份
熱備份是在數據庫運行的情況下
(
(
(
(
(
(
(
熱備份的優點是
熱備份的不足是
#
方法一:select name from v$database;
方法二
方法三
#
實例名也被寫入參數文件中
在一般情況下
方法一
方法二
方法三
數據庫實例名與ORACLE_SID
雖然兩者都表是oracle實例
但ORACLE_SID必須與instance_name的值一致
數據庫實例名除了與操作系統交互外
#
數據庫域名在存在於參數文件中
方法一
方法二
方法三
#
從oracle
如果數據庫有域名
方法一
方法二
#
From:http://tw.wingwit.com/Article/program/Oracle/201311/19017.html