蓝皮书的自留地

运筹帷幄,决胜千里

1、skip-grant-tables 我们常用的方法是使用skip-grant-tables选项,为了安全起见,通常加上skip-networking,mysqld 不侦听任何TCP/IP连接请求。

1)修改my.cnf配置文件,在mysqld选项中添加skip-grant-tablesskip-networking

2)再重启mysqld server

阅读全文 »

linux下kill掉某个用户的所有进程的简单快捷的方法,某日一用户最大连接数超限了,无法正常登录,只能用root kill掉其所有的进程,简单的命令如下:

1
2
3
1. pkill # pkill -u  username 

2. killall # killall -u username

然后轻松搞定,用root修改最大连接数。

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
#!/bin/sh
# chkconfig: 345 10 10
# description: Oracle dgstart / dbshut
#
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_UNQNAME=liupsdg
export ORACLE_SID=liups
export ORACLE_OWNER=oracle
LOGFILE=$ORACLE_BASE/dgstartup.log
echo "[$(date "+%F %T")]:########begin#######" >> ${LOGFILE}
echo "[$(date "+%F %T")]:/etc/init.d/oracle Begin 2 run:" >> ${LOGFILE}
if [ ! -f ${ORACLE_HOME}/bin/dgstart ] || [ ! -f ${ORACLE_HOME}/bin/dbshut ]; then
echo "Error: Missing the script file ${ORACLE_HOME}/bin/dbstart or ${ORACLE_HOME}/bin/dbshut!" >> ${LOGFILE}
echo "#################################" >> ${LOGFILE}
exit
fi
start(){
echo "[$(date "+%F %T")]:Startup Database..."
su - ${ORACLE_OWNER} -c "${ORACLE_HOME}/bin/dgstart ${ORACLE_HOME}"
touch /var/lock/subsys/oracle
echo "[$(date "+%F %T")]:Startup Database Done."
su - ${ORACLE_OWNER} -c "$ORACLE_HOME/bin/emctl start dbconsole"
}
stop(){
echo "[$(date "+%F %T")]:Shutdown Database..."
su - ${ORACLE_OWNER} -c "${ORACLE_HOME}/bin/dbshut ${ORACLE_HOME}"
echo "[$(date "+%F %T")]:Shutdown Database Done."
rm -f /var/lock/subsys/oracle
su - ${ORACLE_OWNER} -c "$ORACLE_HOME/bin/emctl stop dbconsole"
}
case "$1" in
'start')
start >> ${LOGFILE}
;;
'stop')
stop >> ${LOGFILE}
;;
'restart')
stop >> ${LOGFILE}
start >> ${LOGFILE}
;;
*)
echo "Usage: 'basename $0' start|stop|restart"
exit 1
esac
echo "[$(date "+%F %T")]:Finished." >> ${LOGFILE}
echo "[$(date "+%F %T")]:########end#######" >> ${LOGFILE}
exit 0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
USE [master]
GO
CREATE LOGIN [liups_loginame] WITH PASSWORD=N’liups88′, DEFAULT_DATABASE=[liups-dbname], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [liups-dbname]
GO
CREATE USER [liups_loginame] FOR LOGIN [liups_loginame]
GO
USE [liups-dbname]
GO
ALTER ROLE [db_owner] ADD MEMBER [liups_loginame]
GO

USE [liups-dbname]
GO

DROP USER [liups_loginame]
GO

USE [master]
GO

DROP LOGIN [liups_loginame]
GO

文章来源:https://docs.oracle.com/cd/E11882_01/server.112/e41134/whatsnew.htm#SBYDB5107

New 11.2 Features Common to Redo Apply and SQL Apply

  • As of Oracle Database 11g Release 2 (11.2.0.2), Oracle Data Guard is fully integrated with Oracle Real Application Clusters One Node (Oracle RAC One Node).
  • A Data Guard configuration can now consist of a primary database and up to 30 standby databases.
  • The FAL_CLIENT database initialization parameter is no longer required.
  • The default archive destination used by the Oracle Automatic Storage Management (Oracle ASM) feature and the fast recovery area feature has changed from LOG_ARCHIVE_DEST_10 to LOG_ARCHIVE_DEST_1.
  • Redo transport compression is no longer limited to compressing redo data only when a redo gap is being resolved. When compression is enabled for a destination, all redo data sent to that destination is compressed.
  • The new ALTER SYSTEM FLUSH REDO SQL statement can be used at failover time to flush unsent redo from a mounted primary database to a standby database, thereby allowing a zero data loss failover to be performed even if the primary database is not running in a zero data loss data protection mode. See Section 8.2.2 for more information.
0%