Subsections of Databases
Oracle
Subsections of Oracle
How to create DB
Modify following script with your user/password (database will be created with same name as username)
ALTER SESSION SET "_ORACLE_SCRIPT"=true;
CREATE USER username IDENTIFIED BY "password";
GRANT CONNECT TO username;
GRANT CONNECT, RESOURCE TO username;
GRANT CREATE SESSION TO username;
GRANT UNLIMITED TABLESPACE TO username;
GRANT SELECT ON SYS.DBA_RECYCLEBIN TO username;
QUIT
script can be run as:
sqlplus sys/sys_password@hostname:1521/ORCLCDB as SYSDBA @/oracle-init.sql;
How to drop DB
ALTER SESSION SET "_ORACLE_SCRIPT"=true;
DROP USER username CASCADE;
QUIT
script can be run as:
sqlplus sys/sys_password@hostname:1521/ORCLCDB as SYSDBA @/oracle-init.sql;
SQLServer
Subsections of SQLServer
How to create DB
Modify following script without your user/db/password
CREATE DATABASE database;
GO
USE database;
GO
CREATE LOGIN username WITH PASSWORD = 'password';
GO
CREATE USER username FOR LOGIN username;
GO
script can be run as:
/opt/mssql-tools/bin/sqlcmd -S "hostname,1433" -U SA -P SA_PASSWORD -i /sqlserver-init.sql;